Learning by Association - A Versatile Semi-Supervised Training Method for Neural Networks

Philip Häusser, Alexander Mordvintsev, Daniel Cremers

Abstract

In many real-world scenarios, labeled data for a specific machine learning task is costly to obtain. Semi-supervised training methods make use of abundantly available unlabeled data and a smaller number of labeled examples. We propose a new framework for semi-supervised training of deep neural networks inspired by learning in humans. Associations are made from embeddings of labeled samples to those of unlabeled ones and back. The optimization schedule encourages correct association cycles that end up at the same class from which the association was started and penalizes wrong associations ending at a different class. The implementation is easy to use and can be added to any existing end-to-end training setup. We demonstrate the capabilities of learning by association on several data sets and show that it can improve performance on classification tasks tremendously by making use of additionally available unlabeled data. In particular, for cases with few labeled data, our training scheme outperforms the current state of the art on SVHN.

Introduction

Deep learning models typically require vast amounts of labeled data to achieve high performance. However, in many domains, acquiring labels is a bottleneck due to the time and expertise required. Semi-supervised learning (SSL) aims to mitigate this by leveraging large quantities of unlabeled data alongside a small labeled set. While previous SSL approaches often relied on complex auxiliary models like Generative Adversarial Networks (GANs) or Variational Autoencoders, this work introduces a simpler, more intuitive framework based on associative cycles.

The Associative Learning Framework

The core of the proposed method is the "Association Cycle," which utilizes a stochastic walker to navigate the embedding space between labeled and unlabeled data batches.

Overview of the Association Cycle: A CNN produces embeddings for labeled and unlabeled samples. A walker moves from labeled to unlabeled and back, aiming for class consistency.

The Association Cycle

The process involves three primary steps:

  1. Forward Step ($A \to B$): Given a batch of labeled samples $A$ and unlabeled samples $B$, the network generates embeddings for both. Transition probabilities are calculated based on the similarity (dot product) between these embeddings. A walker moves from a labeled sample in $A$ to a sample in $B$.
  2. Backward Step ($B \to A$): The walker then moves back from the unlabeled set $B$ to the labeled set $A$, again guided by embedding similarity.
  3. Consistency Check: A cycle is considered successful if the walker returns to a sample in $A$ that shares the same class label as the starting sample.

Loss Functions

To optimize this cycle, the authors define a multi-component loss function:

  • Walker Loss ($L_{walker}$): Maximizes the probability of correct round-trips (returning to the same class).
  • Visit Loss ($L_{visit}$): Ensures the walker explores the entire unlabeled batch. This prevents the model from collapsing to a subset of "easy" unlabeled examples and forces it to learn a more comprehensive representation of the data distribution.
  • Classification Loss ($L_{classification}$): The standard cross-entropy loss applied to the labeled samples to ensure discriminative power.

Experimental Results

The method was evaluated on standard benchmarks including MNIST, SVHN, and STL-10.

Performance on SVHN

The Street View House Numbers (SVHN) dataset presents a significant challenge due to its high variability. The associative learning approach demonstrated a remarkable breakthrough here. With only 500 labeled samples, the inclusion of unlabeled data through associative cycles reduced the error rate from 17.75% to 6.25%, representing a 64% relative improvement.

Visualization of associations between labeled (A) and unlabeled (B) samples. The bottom panel shows how training clarifies these associations into distinct class clusters.

Domain Adaptation

A notable strength of this method is its inherent capability for domain adaptation. By treating a source domain (e.g., SVHN) as labeled and a target domain (e.g., MNIST) as unlabeled, the network learns to bridge the distribution gap. In experiments, a model trained on SVHN and tested on MNIST achieved an error of 18.56% without adaptation. With associative adaptation, the error dropped to 0.51%, nearly matching the performance of a model trained directly on MNIST labels.

Conclusion and Future Work

Learning by Association provides an elegant and effective "plug-and-play" loss function for semi-supervised learning. By enforcing cycle consistency in the embedding space, the model learns robust features from unlabeled data. Future research will explore the scalability of this method to datasets with thousands of classes and its applicability to tasks beyond classification, such as semantic segmentation.

Summary updated

BibTeX
@inproceedings{hausser2017learning,
  author = {Philip Häusser and Alexander Mordvintsev and Daniel Cremers},
  title = {{Learning by Association - A Versatile Semi-Supervised Training Method for Neural Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  url = {https://openreview.net/forum?id=SkWShCZOZB},
}
Figure