Learning Instance segmentation

username: PytorchLearning
cooked: <p>Hi,</p>
<p>I am learning deep learning with Pytorch and I have understood how to train a classification. Now I would like to learn the instance segmentation from scratch by training my own models (a simple model for understand the basics) to learn and understand all the steps.<br>
I tried to find a tutorial that shows how to train step by step from scratch but I could not find it.<br>
Can someone please show me how to train step by step an instance segmentation with custom datasets, or if you know a website that shows how to train step by step an instance segmentation.</p>
<p>Thanks for your help.</p>

username: KFrank
cooked: <p>Hi Learning!</p>
<aside class="quote no-group" data-username="PytorchLearning" data-post="1" data-topic="119988" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/p/d2c977/48.png" class="avatar"> PytorchLearning:</div>
<blockquote>
<p>I would like to learn the instance segmentation from scratch by training my own models (a simple model for understand the basics)</p>
</blockquote>
</aside>
<p>The challenge is that instance segmentation is a rather difficult<br>
problem.  Instance segmentation has a number of logical steps to<br>
it, and instance-segmentation models (at least as practiced) are<br>
built out of a number of submodules – so such a model might not<br>
meet your definition of “simple.”</p>
<p>The best I can recommend – and it’s definitely not completely from<br>
scratch with all the steps – is this pytorch tutorial:</p>
<p><a href="https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html" rel="noopener nofollow ugc">TorchVision Object Detection Finetuning Tutorial</a></p>
<p>It uses pytorch’s prebuilt <a href="https://pytorch.org/vision/0.8/models.html#mask-r-cnn" rel="noopener nofollow ugc">Mask R-CNN</a> model.  (There are other<br>
instance-segmentation models but they all share similar complexity.)</p>
<p>Here is the original <a href="https://arxiv.org/abs/1703.06870" rel="noopener nofollow ugc">Mask R-CNN</a> article.  It will give you a sense of the<br>
complexity and submodules involved.</p>
<p>You could certainly build an instance-segmentation model totally from<br>
scratch, but it would be a lot of work.  If you want to, I would suggest<br>
that you work through the original Mask R-CNN paper <em>and references<br>
therein</em> (or similar paper about some other model), building the<br>
submodules one by one (from scratch) and then put them together.</p>
<p>But, even if you decide to do this from scratch, I would recommend<br>
first working through the not-from-scratch pytorch tutorial to get an<br>
overview of hos things work and how some of the pieces fit together.</p>
<p>Good luck.</p>
<p>K. Frank</p>

username: PytorchLearning
cooked: <p>Hi <a class="mention" href="/u/kfrank">@KFrank</a> ,</p>
<p>First of all thanks a lot for your answer. I will try to see Mask R-CNN model.</p>
<p>However if I want to use Mask R-CNN model, can you please show me how to train the model because I could not understand how to train a model for instance segmentation in pytorch.</p>
<p>Thanks for your help.</p>

username: KFrank
cooked: <p>Hi Learning!</p>
<aside class="quote no-group" data-username="PytorchLearning" data-post="3" data-topic="119988" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/p/d2c977/48.png" class="avatar"> PytorchLearning:</div>
<blockquote>
<p>I want to use Mask R-CNN model, can you please show me how to train the model</p>
</blockquote>
</aside>
<p>The tutorial I linked to shows how to train Mask R-CNN starting,<br>
more-or-less, with this section:</p>
<p><a href="https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html#an-instance-segmentation-model-for-pennfudan-dataset" rel="noopener nofollow ugc">An Instance segmentation model for PennFudan Datase</a></p>
<p>The tutorial can be rather terse in places, and I think that some of the<br>
code might be a bit out of date with respect to the current pytorch.  If<br>
you decide to work through it, please feel free to post specific questions<br>
about steps you’re having trouble with.</p>
<p>Best.</p>
<p>K. Frank</p>

username: PytorchLearning
cooked: <p>Hi <a class="mention" href="/u/kfrank">@KFrank</a></p>
<p>Thanks a lot for your answer. I will try to understand how to train the model.</p>

username: PytorchLearning
cooked: <p>Hi <a class="mention" href="/u/kfrank">@KFrank</a></p>
<p>I read a lot about Mask R-CNN model and I’m starting to understand but I also did a little research on other models and the one that I can understand the most is:</p>
<p>PolarMask: Single Shot Instance Segmentation with Polar Representation</p>
<p>This model I have understood very well.</p>
<p>I have a question, can you please show me how to train this model with a simple program, because now I would like to understand how to train an instance segmentation. I know how to train a model for a classification or GAN but I don’t know how to train an instance segmentation.</p>
<p>Thanks for your help.</p>

username: tom
cooked: <p>Depending on the task, the conceptually simpler U-Nets might also work very well. Our book, which used to be available for download from the PyTorch website, uses it to find nodules in CT scans.<br>
The disadvantage is that U-Nets don’t deal with overlap etc. and you need a connected component finding step to get the sites.</p>
<p>Best regards</p>
<p>Thomas</p>