Answers.Body: <blockquote>
  <p>Is it possible to use SSL to pre-train e.g. a faster R-CNN on a pretext task (for example, rotation), then use this pre-trained model for instance segmentation with the aim to get better accuracy?</p>
  </blockquote>
  <p>Yes, it's possible and this has already been done. I don't know the details (because I have not yet read those papers), but I will provide you with some links to some potentially useful papers (based on their titles and abstracts) and associated code.</p>
  <ul>
  <li><a href="https://people.eecs.berkeley.edu/%7Epathak/papers/cvprw18.pdf" rel="nofollow noreferrer">Learning Instance Segmentation by Interaction</a> (<a href="https://github.com/pathak22/seg-by-interaction" rel="nofollow noreferrer">code</a>, 2018)</li>
  <li><a href="https://arxiv.org/pdf/2005.09484.pdf" rel="nofollow noreferrer">Self-supervised Transfer Learning for Instance Segmentation through Physical Interaction</a> (<a href="https://github.com/aeitel/self_deepmask" rel="nofollow noreferrer">code</a>, 2019)</li>
  <li><a href="https://link.springer.com/chapter/10.1007%2F978-3-030-59728-3_27" rel="nofollow noreferrer">White Matter Tract Segmentation with Self-supervised Learning</a> (<a href="https://github.com/MIC-DKFZ/TractSeg" rel="nofollow noreferrer">code</a>, 2020)</li>
  <li><a href="https://link.springer.com/chapter/10.1007%2F978-3-030-59710-8_58" rel="nofollow noreferrer">Self-supervised Depth Estimation to Regularise Semantic Segmentation in Knee Arthroscopy</a> (<a href="https://github.com/ThomasLiu1021/geo-sem" rel="nofollow noreferrer">code</a>, 2020)</li>
  <li><a href="https://link.springer.com/chapter/10.1007%2F978-3-030-59716-0_12" rel="nofollow noreferrer">Simulation of Brain Resection for Cavity Segmentation Using Self-supervised and Semi-supervised Learning</a> (<a href="https://github.com/fepegar/resector" rel="nofollow noreferrer">code</a>, 2020)</li>
  </ul>
  <p>You can probably find more relevant papers <a href="https://github.com/JunMa11/MICCAI-OpenSourcePapers" rel="nofollow noreferrer">here</a>, where I also found some of the just cited papers.</p>
  <p>The pre-text tasks designed in these papers could be useful in your case, but it may also turn out that you need to develop other pre-text tasks or combine multiple of them.</p>
  <p>Maybe you can start from some pre-trained faster R-CNN or some appropriate model for instance segmentation (that you can find on the web, for example, <a href="https://github.com/matterport/Mask_RCNN" rel="nofollow noreferrer">here</a>), which has been pre-trained on some imagery data similar to yours (either with SSL or by other means), then try to fine-tune this model with your labeled dataset for instance segmentation, and see if you get better results than just training a faster R-CNN from scratch. Eventually, if this pre-trained model does not lead to higher performance, you could pre-train it yourself with some SSL technique that you can come up with or one that is described in the literature. Of course, you should probably use a pre-trained model that has been pre-trained with data that is relevant for your <em>downstream task</em> (i.e. the instance segmentation task). You didn't describe the details of your unlabelled and labeled data, so I cannot be more specific (and I wouldn't currently be able to, in any case, because I didn't fully read those papers, and my experience with SSL techniques is mostly theoretical).</p>
  <p>For more info about SSL, take a look at <a href="https://ai.stackexchange.com/a/10624/2444">this</a> and <a href="https://ai.stackexchange.com/a/22860/2444">this</a> answers.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-20T16:32:01.917Z
Answers.LastActivityDate: 2020-11-20T16:56:45.937Z
Answers.LastEditDate: 2020-11-20T16:56:45.937Z
Answers.UserDisplayName: nbro
Body: <p>I would like to use self-supervised learning (SSL) to learn features from images (the dataset consists of similar images with small differences), then use the resulting trained model to bootstrap an instance segmentation task.</p>
  <p>I am thinking about using Faster R-CNN, Mask R-CNN, or ResNet for the instance segmentation task, which is pre-trained in an SSL way by solving a pretext task, with the aim that this will lead to higher accuracy and also teach the CNNs with fewer examples during the downstream task.</p>
  <p>Is it possible to use SSL to pre-train e.g. a faster R-CNN on a pretext task (for example, rotation), then use this pre-trained model for instance segmentation with the aim to get better accuracy?</p>
  
Tags: <transfer-learning><r-cnn><self-supervised-learning><instance-segmentation><pretext-tasks>
Title: Is it possible to pre-train a CNN in a self-supervised way so that it can later be used to solve an instance segmentation task?
UserDisplayName: Timco Vanco
ThreadText: # Is it possible to pre-train a CNN in a self-supervised way so that it can later be used to solve an instance segmentation task?
  
  (Asked by: username_0 on 2020-11-20)
  
  I would like to use self-supervised learning (SSL) to learn features from images (the dataset consists of similar images with small differences), then use the resulting trained model to bootstrap an instance segmentation task.
  
  I am thinking about using Faster R-CNN, Mask R-CNN, or ResNet for the instance segmentation task, which is pre-trained in an SSL way by solving a pretext task, with the aim that this will lead to higher accuracy and also teach the CNNs with fewer examples during the downstream task.
  
  Is it possible to use SSL to pre-train e.g. a faster R-CNN on a pretext task (for example, rotation), then use this pre-trained model for instance segmentation with the aim to get better accuracy?
  
  **Tags:** transfer-learning, r-cnn, self-supervised-learning, instance-segmentation, pretext-tasks
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-20. Score: 2
  
  > Is it possible to use SSL to pre-train e.g. a faster R-CNN on a pretext task (for example, rotation), then use this pre-trained model for instance segmentation with the aim to get better accuracy?
  
  Yes, it's possible and this has already been done. I don't know the details (because I have not yet read those papers), but I will provide you with some links to some potentially useful papers (based on their titles and abstracts) and associated code.
  
  * [Learning Instance Segmentation by Interaction](https://people.eecs.berkeley.edu/%7Epathak/papers/cvprw18.pdf) ([code](https://github.com/pathak22/seg-by-interaction), 2018)
  * [Self-supervised Transfer Learning for Instance Segmentation through Physical Interaction](https://arxiv.org/pdf/2005.09484.pdf) ([code](https://github.com/aeitel/self_deepmask), 2019)
  * [White Matter Tract Segmentation with Self-supervised Learning](https://link.springer.com/chapter/10.1007%2F978-3-030-59728-3_27) ([code](https://github.com/MIC-DKFZ/TractSeg), 2020)
  * [Self-supervised Depth Estimation to Regularise Semantic Segmentation in Knee Arthroscopy](https://link.springer.com/chapter/10.1007%2F978-3-030-59710-8_58) ([code](https://github.com/ThomasLiu1021/geo-sem), 2020)
  * [Simulation of Brain Resection for Cavity Segmentation Using Self-supervised and Semi-supervised Learning](https://link.springer.com/chapter/10.1007%2F978-3-030-59716-0_12) ([code](https://github.com/fepegar/resector), 2020)
  
  You can probably find more relevant papers [here](https://github.com/JunMa11/MICCAI-OpenSourcePapers), where I also found some of the just cited papers.
  
  The pre-text tasks designed in these papers could be useful in your case, but it may also turn out that you need to develop other pre-text tasks or combine multiple of them.
  
  Maybe you can start from some pre-trained faster R-CNN or some appropriate model for instance segmentation (that you can find on the web, for example, [here](https://github.com/matterport/Mask_RCNN)), which has been pre-trained on some imagery data similar to yours (either with SSL or by other means), then try to fine-tune this model with your labeled dataset for instance segmentation, and see if you get better results than just training a faster R-CNN from scratch. Eventually, if this pre-trained model does not lead to higher performance, you could pre-train it yourself with some SSL technique that you can come up with or one that is described in the literature. Of course, you should probably use a pre-trained model that has been pre-trained with data that is relevant for your *downstream task* (i.e. the instance segmentation task). You didn't describe the details of your unlabelled and labeled data, so I cannot be more specific (and I wouldn't currently be able to, in any case, because I didn't fully read those papers, and my experience with SSL techniques is mostly theoretical).
  
  For more info about SSL, take a look at [this](https://ai.stackexchange.com/a/10624/2444) and [this](https://ai.stackexchange.com/a/22860/2444) answers.
  
  
  ---
  
  