Semi-Supervised Learning and Image Classification

franky
3 min readJun 10, 2020

--

Figure 1. Supervised Learning, Semi-Supervised Learning, and Unsupervised Learning. [credit]

Semi-supervised learning is an approach to machine learning that considers both labeled data and unlabeled data in a problem solving process. Semi-supervised learning falls between supervised learning (dealing with labeled data) and unsupervised learning (dealing with unlabeled data). [wiki]

Let’s take image classification under supervised learning and semi-supervised learning as an example.

  • Image classification under supervised learning trains a machine learning model or a deep learning model using labeled images and then verifies the performance of the model by predicting a test dataset against its target.
  • Image classification under semi-supervised learning trains a machine learning model or a deep learning model using both labeled images and unlabeled images, then verifies the performance of the model by predicting a test dataset against its target.

Considering these two approaches together is meaningful and interesting if putting it on common ground. For example, if there are a small amount of labeled data and a large amount of unlabeled data in a given task, supervised learning with limited labeled data might not be able to achieve a good performance. As a result, how to learn the representation of both labeled data and unlabeled data, then create a better classifier become an important issue. Figure 2 illustrates the overall problem solving process of supervised learning and semi-supervised learning. The black boxes show the process of supervised learning, while the red boxes show the caviar of semi-supervised learning which indicates what we would like to do (adding unlabeled data) and what we would like to achieve (improving accuracy). Also note that, given a specific arrangement of training data and testing data, supervised learning could become a baseline for evaluating the performance of semi-supervised learning.

Figure 2. Semi-Supervised Learning [modified from the figure under scikit-learn]

Two deep learning approaches to semi-supervised learning on image classification are illustrated in Figure 3:

Figure 3-a a generated adversarial network approach and Figure 3-b FixMatch approach.

Figure 3-a shows the idea of using a generated adversarial network as the core of semi-supervised learning, which has multi-inputs and multi-outputs for training. Considering MNIST as an example:

  • 3 inputs: (x, y) as the labeled data, x as the unlabeled data, and x* as the fake data.
  • 11 outputs: the class index and the real/fake value.

Ref: GANs in Action, Ch7 [Manning] [Github]

Figure 3-b shows the idea of FixMatch which uses data augmentation and pseudo labeling as the core of semi-supervised learning, which also has multi-inputs and multi-outputs for training. Considering a dog/cat dataset as an example:

  • 3 inputs: labeled data, unlabeled data under weakly augmentation, and unlabeled data under strong augmentation.
  • 3 outputs: the real label and the consistency of predicted labels.

Ref: FixMatch [paperswithcode] and [illustrated]

This blog has presented the problems and the approaches of semi-supervised learning for image classification in brief. If you have any questions, please feel free to drop a note.

--

--

franky
franky

No responses yet