<p>For this you can extract <a href="https://arxiv.org/abs/1610.02391" rel="nofollow noreferrer">Grad-CAM</a> features. <code>Kears</code> already has published an official documentation for <code>Grad-CAM extraction</code> you can find it <a href="https://keras.io/examples/vision/grad_cam/" rel="nofollow noreferrer">here</a>.
So for your task steps need to followed are</p>
<ol>
<li><code>Extract Grad-CAM from the images</code></li>
<li><code>Based on Grad-CAM create a  segmentation mask using simple image processing technique</code></li>
</ol>
<p>In this method <code>you can easily create segmentation mask for images</code> but masks <code>may not be so accurate </code>. Beacuse, see this picture,</p>
<p><a href="https://i.stack.imgur.com/zXTzx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zXTzx.png" alt="enter image description here" /></a></p>
<p>it is for <code>Xception model (ImageNet).</code></p>
<p>Hope you will understand and you will be helpful.</p>
Having a trained classifier like VGG16 how to automate image segmentation?
<p>I Have a trained classifier: VGG16 on say Image Net (or my own images DB and classes). I want to segment my images automatically knowing there are classes on images my classifier knows. How to automate image segmentation?</p>