Answers.Body: <p>I don't think your interpretation is correct. Take images as example.</p>
  
  <ul>
  <li><p>Supervised Learning</p>
  
  <p>e.g. classification (maybe use CNN with a L2 loss function)</p>
  
  <p>Assume you have many images with different labels. You wish to find a function to approximate the function <span class="math-container">$y=f(x)$</span> given a lot of <span class="math-container">$(\hat x, \hat y)$</span> sample pairs. </p></li>
  <li><p>Unsupervised Learning</p>
  
  <p>e.g. clustering (maybe use k-means) </p>
  
  <p>Assume you have many images, but we don't have the labels or we just want to see if there's a way to categorize them into different categories. So we cluster the images by some  characteristic that isn't pre-defined.</p></li>
  <li><p>Self-Supervised Learning</p>
  
  <p>e.g. super resolution (maybe use CNN with a L2 loss function)</p>
  
  <p>You have many high resolution images without labels, but, your target is to train a model to up sample a low resolution image. So you can have the high resolution images as target, and down size the image to be the input, and try to train the image pairs. So the target is not some manually tagged labels, but generated directly from the data.</p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-20T02:48:33.600Z
Answers.Text: The contents of this answer seem to be correct, but maybe you should address the part of the OP "For example, to detect cats in unseen images, my self-supervised network would still have to be composed exclusively of cats...". The OP already seemed to know what SSL is. They wanted to understand  **why** it really works and the relationship between the downstream task and the pre-text task (and data), if I understood correctly. Your answer doesn't address this.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-24T11:00:13.940Z
Answers.LastActivityDate: 2019-12-24T11:00:13.940Z
Answers.UserDisplayName: J3soon
Answers.Body: <p>Andrew Zisserman, who is a pioneer in the field of self-supervised learning, described self-supervised learning in a talk at ICML as:</p>
  
  <blockquote>
    <p>Self-supervised Learning is a form of unsupervised learning where the data provides the supervision. In general, we withhold some part of the data and task the network with predicting it. The network is forced to learn what we really care about e.g. a semantic representation, in order to solve it.</p>
  </blockquote>
  
  <p>Thus, self-supervised is a subset of unsupervised learning, where you generate the labels from the given data itself. There are a few patterns of research being done for self-supervised learning:  </p>
  
  <p><strong>1. Reconstruction:</strong><br>
  In this, researchers have set up pretext tasks as predicting the color image from gray-scale image (Image Colorization), predicting the high-resolution image from the low-resolution version (Image Super-resolution) and removing some part of the image and trying to predict it (Image Inpainting).</p>
  
  <p><strong>2. Common Sense Reasoning</strong>:<br>
  You could take patches of 3x3 images and shuffle the patches and ask the network to predict the correct order (<a href="https://amitness.com/2020/02/illustrated-self-supervised-learning/#1-image-jigsaw-puzzle" rel="nofollow noreferrer">Jigsaw puzzle</a>).  </p>
  
  <p>Similarly, you could take the center patch and some random patch and train model to predict where the random patch is located in relation to the center patch (<a href="https://amitness.com/2020/02/illustrated-self-supervised-learning/#2-context-prediction" rel="nofollow noreferrer">context prediction</a>). </p>
  
  <p>There is another approach where you randomly rotate image into {0, 90, 180, 270} degrees and ask the model to predict the rotation angle applied (<a href="https://amitness.com/2020/02/illustrated-self-supervised-learning/#3-geometric-transformation-recognition" rel="nofollow noreferrer">Geometric Transformation Recognition</a>).</p>
  
  <p><strong>3. Clustering</strong>:  </p>
  
  <p>You could cluster the images into K categories and treat those clusters as labels. Then, a model can be trained on those clusters and you get representations. You can again repeat clustering and model training for few epochs. Papers for these include: <a href="https://amitness.com/2020/04/deepcluster/" rel="nofollow noreferrer">DeepCluster</a> and <a href="https://amitness.com/2020/04/illustrated-self-labelling/" rel="nofollow noreferrer">Self-Labelling</a>.</p>
  
  <p><strong>4. Contrastive Learning</strong>:  </p>
  
  <p>In this paradigm, augmentations of the image is taken and the task is to bring two augmentations of the same images near while making the distance between this image and some other random image far. Papers for these include: <a href="https://amitness.com/2020/03/illustrated-simclr/" rel="nofollow noreferrer">SimCLR</a> and <a href="https://amitness.com/2020/03/illustrated-pirl/" rel="nofollow noreferrer">PIRL</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-20T02:48:29.697Z
Answers.Text: The contents of this answer seem to be correct, but maybe you should address the part of the OP "For example, to detect cats in unseen images, my self-supervised network would still have to be composed exclusively of cats...". The OP already seemed to know what SSL is. They wanted to understand  **why** it really works and the relationship between the downstream task and the pre-text task (and data), if I understood correctly. Your answer doesn't address this.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-19T11:00:45.050Z
Answers.LastActivityDate: 2020-04-19T11:00:45.050Z
Answers.UserDisplayName: Amit Chaudhary
Body: <p>I am new to self-supervised learning and it all seems a little magical at the moment.</p>
  <p>The only way I can get an intuitive understanding is to assume that, for real-world problems, features are still embedded at a per-object level.</p>
  <p>For example, to detect cats in unseen images, my self-supervised network would still have to be composed exclusively of cats.</p>
  <p>So, if I had 100 images of cats and 100 images of dogs, then I thought self-supervised approaches would learn the features of the images. For example, if an image is rotated 90 degrees, it learns what was in the image that was rotated 90 degrees. However, if I wanted to classify just cats using this representation, then I wouldn't be able to do so without separating out what makes a cat a cat and a dog a dog.</p>
  <p>Is my assumption correct?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-20T02:44:03.793Z
Comments.Text: This question is very related to [this one](https://ai.stackexchange.com/q/10623/2444), but you're specifically asking 1. "_Why SSL really works?_" and 2. "_What is the relationship between the downstream task and the data used to learn representations?_", if I understand correctly. Can you confirm that? If those are your questions, none of the current answers below seem to really address them. They only state what SSL is, which you already know, apparently.
Comments.UserDisplayName: nbro
Tags: <self-supervised-learning><representation-learning>
Title: How to understand the concept of self-supervised learning in AI?
UserDisplayName: user3546025
ThreadText: # How to understand the concept of self-supervised learning in AI?
  
  (Asked by: username_0 on 2019-12-24)
  
  I am new to self-supervised learning and it all seems a little magical at the moment.
  
  The only way I can get an intuitive understanding is to assume that, for real-world problems, features are still embedded at a per-object level.
  
  For example, to detect cats in unseen images, my self-supervised network would still have to be composed exclusively of cats.
  
  So, if I had 100 images of cats and 100 images of dogs, then I thought self-supervised approaches would learn the features of the images. For example, if an image is rotated 90 degrees, it learns what was in the image that was rotated 90 degrees. However, if I wanted to classify just cats using this representation, then I wouldn't be able to do so without separating out what makes a cat a cat and a dog a dog.
  
  Is my assumption correct?
  
  **Tags:** self-supervised-learning, representation-learning
  > **Comments:**
  > **username_1**: This question is very related to [this one](https://ai.stackexchange.com/q/10623/2444), but you're specifically asking 1. "_Why SSL really works?_" and 2. "_What is the relationship between the downstream task and the data used to learn representations?_", if I understand correctly. Can you confirm that? If those are your questions, none of the current answers below seem to really address them. They only state what SSL is, which you already know, apparently.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-12-24. Score: 4
  
  I don't think your interpretation is correct. Take images as example.
  
  * Supervised Learning
  
    e.g. classification (maybe use CNN with a L2 loss function)
  
    Assume you have many images with different labels. You wish to find a function to approximate the function $y=f(x)$ given a lot of $(\hat x, \hat y)$ sample pairs.
  * Unsupervised Learning
  
    e.g. clustering (maybe use k-means)
  
    Assume you have many images, but we don't have the labels or we just want to see if there's a way to categorize them into different categories. So we cluster the images by some characteristic that isn't pre-defined.
  * Self-Supervised Learning
  
    e.g. super resolution (maybe use CNN with a L2 loss function)
  
    You have many high resolution images without labels, but, your target is to train a model to up sample a low resolution image. So you can have the high resolution images as target, and down size the image to be the input, and try to train the image pairs. So the target is not some manually tagged labels, but generated directly from the data.
  
  > **Comments:**
  > **username_1**: The contents of this answer seem to be correct, but maybe you should address the part of the OP "For example, to detect cats in unseen images, my self-supervised network would still have to be composed exclusively of cats...". The OP already seemed to know what SSL is. They wanted to understand  **why** it really works and the relationship between the downstream task and the pre-text task (and data), if I understood correctly. Your answer doesn't address this.  
  
  ---
  
  ### Answer by username_3 on 2020-04-19. Score: 2
  
  Andrew Zisserman, who is a pioneer in the field of self-supervised learning, described self-supervised learning in a talk at ICML as:
  
  > Self-supervised Learning is a form of unsupervised learning where the data provides the supervision. In general, we withhold some part of the data and task the network with predicting it. The network is forced to learn what we really care about e.g. a semantic representation, in order to solve it.
  
  Thus, self-supervised is a subset of unsupervised learning, where you generate the labels from the given data itself. There are a few patterns of research being done for self-supervised learning:
  
  **1. Reconstruction:**  
  In this, researchers have set up pretext tasks as predicting the color image from gray-scale image (Image Colorization), predicting the high-resolution image from the low-resolution version (Image Super-resolution) and removing some part of the image and trying to predict it (Image Inpainting).
  
  **2. Common Sense Reasoning**:  
  You could take patches of 3x3 images and shuffle the patches and ask the network to predict the correct order ([Jigsaw puzzle](https://amitness.com/2020/02/illustrated-self-supervised-learning/#1-image-jigsaw-puzzle)).
  
  Similarly, you could take the center patch and some random patch and train model to predict where the random patch is located in relation to the center patch ([context prediction](https://amitness.com/2020/02/illustrated-self-supervised-learning/#2-context-prediction)).
  
  There is another approach where you randomly rotate image into {0, 90, 180, 270} degrees and ask the model to predict the rotation angle applied ([Geometric Transformation Recognition](https://amitness.com/2020/02/illustrated-self-supervised-learning/#3-geometric-transformation-recognition)).
  
  **3. Clustering**:
  
  You could cluster the images into K categories and treat those clusters as labels. Then, a model can be trained on those clusters and you get representations. You can again repeat clustering and model training for few epochs. Papers for these include: [DeepCluster](https://amitness.com/2020/04/deepcluster/) and [Self-Labelling](https://amitness.com/2020/04/illustrated-self-labelling/).
  
  **4. Contrastive Learning**:
  
  In this paradigm, augmentations of the image is taken and the task is to bring two augmentations of the same images near while making the distance between this image and some other random image far. Papers for these include: [SimCLR](https://amitness.com/2020/03/illustrated-simclr/) and [PIRL](https://amitness.com/2020/03/illustrated-pirl/).
  
  > **Comments:**
  > **username_1**: The contents of this answer seem to be correct, but maybe you should address the part of the OP "For example, to detect cats in unseen images, my self-supervised network would still have to be composed exclusively of cats...". The OP already seemed to know what SSL is. They wanted to understand  **why** it really works and the relationship between the downstream task and the pre-text task (and data), if I understood correctly. Your answer doesn't address this.  
  
  ---
  
  