Self-Supervised Relational Reasoning for Representation Learning

Massimiliano Patacchiola, Amos J. Storkey

Abstract

Self-supervised learning (SSL) has emerged as a powerful paradigm for representation learning, enabling models to extract meaningful features from unlabeled data. This paper introduces a novel SSL framework that leverages relational reasoning as a pretext task. By training a neural network to determine if two different views belong to the same object (intra-reasoning) or different objects (inter-reasoning), the authors achieve state-of-the-art representation quality. The proposed method consistently outperforms competitors like SimCLR by significant margins while being more computationally efficient, scaling linearly with batch size.

Introduction

In deep learning, representation learning is the fundamental process of teaching a model to extract useful features from raw data, such as pixels, to facilitate downstream tasks like classification. Traditionally, this has required massive amounts of human-labeled data. Self-supervised learning (SSL) seeks to eliminate this dependency by creating "pretext tasks" where the data itself provides the supervision signal.

A dominant approach in recent years has been contrastive learning, which aims to pull representations of the same image together and push different images apart. However, these methods often necessitate massive batch sizes or complex memory banks to provide a sufficient number of "negative" examples for effective learning. This paper argues for a more biologically inspired approach: relational reasoning. By focusing on how entities compare and connect, the model can learn deeper, more discriminative features.

Methodology

The proposed framework, Self-Supervised Relational Reasoning, follows a structured pipeline designed for efficiency and performance:

  1. Augmentation: A mini-batch of images is processed by applying $K$ different random transformations (e.g., cropping, color jittering) to each image.
  2. Backbone Encoding: These augmented views are passed through a standard neural network (the "backbone," $f_\theta$) to generate feature representations.
  3. Relational Pair Aggregation:
    • Intra-reasoning (Positive Pairs): Pairs are formed from two different augmentations of the same original image.
  4. Inter-reasoning (Negative Pairs): Pairs are formed from augmentations of different images within the mini-batch.
  5. Relation Module: Unlike contrastive methods that often use a simple dot product for comparison, this framework feeds the paired vectors into a small Multi-Layer Perceptron (MLP) called the Relation Module ($r_\phi$). This allows the model to learn a complex, non-linear similarity metric.
  6. Loss Function: The system is trained using standard Binary Cross-Entropy (BCE) loss, often enhanced with a focal loss factor, to classify pairs as "same" or "different."
Overview of the Self-Supervised Relational Reasoning pipeline, illustrating the flow from mini-batch augmentations to the relation module and final cross-entropy loss.

A key advantage of this architecture is its scalability. While many contrastive methods scale quadratically with batch size and the number of augmentations, this relational approach scales linearly, making it accessible for researchers with standard hardware.

Experimental Setup

The authors evaluated the effectiveness of relational reasoning across several standard computer vision benchmarks:

  • CIFAR-10 & CIFAR-100: Standard datasets for small-scale image classification.
  • STL-10: A dataset specifically designed for unsupervised learning, featuring 100,000 unlabeled images.
  • tiny-ImageNet: A subset of the large-scale ImageNet dataset, containing 200 classes at lower resolution.
  • SlimageNet: A challenging dataset consisting of 1,000 classes with only 160 low-resolution images per class, testing the model's performance in data-constrained environments.

Results and Discussion

The proposed method demonstrates superior performance across all tested benchmarks. As shown in the table below, it consistently achieves higher accuracy in linear evaluation and domain transfer tasks compared to established methods like DeepCluster, RotationNet, and SimCLR.

Performance comparison of Relational Reasoning against other SSL methods across various benchmarks including linear evaluation, domain transfer, and fine-tuning.

Key Insights

  • The Importance of the Relation Head: Ablation studies revealed that the Relation Module is critical. Replacing the MLP with a simple dot product resulted in a performance drop of up to 23%. The non-linear nature of the MLP is essential for learning sophisticated similarity metrics.
  • Scaling with Augmentations: Performance is positively correlated with the number of augmentations ($K$). This suggests that more diverse comparisons lead to more robust feature representations.
  • Theoretical Grounding: The use of BCE loss can be viewed as a proxy for maximizing mutual information between representations and targets, providing a solid theoretical foundation for the pretext task.
  • Feature Disentanglement: Relational reasoning encourages the model to move beyond superficial features (like color) and focus on structural properties to distinguish between similar objects, such as an orange versus a basketball.

Conclusion and Future Work

Self-supervised relational reasoning offers a powerful and efficient alternative to traditional contrastive learning. By framing representation learning as a comparison task mediated by a non-linear relation module, the method achieves state-of-the-art results on multiple benchmarks.

However, the method's performance is heavily dependent on the quality and variety of data augmentations. Future work could explore more adaptive augmentation strategies or investigate the model's potential in "online" and "few-shot" learning scenarios. Additionally, further hyperparameter tuning specific to individual tasks could likely yield even greater performance gains.

Summary updated

BibTeX
@inproceedings{patacchiola2020self,
  author = {Massimiliano Patacchiola and Amos J. Storkey},
  title = {{Self-Supervised Relational Reasoning for Representation Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=_UMhOhznZEe},
}
Figure