Abstract
RelationNet2 introduces "Deep Comparison Columns" to few-shot learning (FSL), moving beyond simple vector comparisons to a multi-level hierarchy of non-linear similarity checks. By representing images as probability distributions rather than fixed points, the model effectively regularizes deep architectures, achieving state-of-the-art performance on major benchmarks like miniImageNet and tieredImageNet.
Introduction
Deep learning models are notoriously data-hungry, often requiring thousands of labeled examples to recognize a new category. Few-Shot Learning (FSL) aims to bridge this gap, enabling models to learn from just one or five examples (1-shot or 5-shot).
Current approaches usually fall into "metric learning," where a network learns to embed images into a space where similar items are close together. However, these methods often rely on simple linear comparisons (like Euclidean distance) or only look at the final, most abstract layer of features. This ignores the rich information available at intermediate levels—such as textures or shapes—and often leads to overfitting when using powerful, deep backbones like ResNet.
Methodology: The Deep Comparison Network
The authors propose the Deep Comparison Network (DCN), which features two primary innovations designed to leverage multi-level feature hierarchies and improve regularization.
1. Relation Columns (Multi-Level Comparison)
Instead of one comparison at the end of the pipeline, DCN uses a "column" of Relation Modules (RMs) paired with Embedding Modules (EMs) at multiple stages of the network. Each RM learns a non-linear similarity metric for its specific level of abstraction. Crucially, each RM also receives the similarity map from the previous level, building a hierarchical understanding of "sameness."
2. Distributional Embeddings
To prevent overfitting with deep backbones, the EMs do not just output a fixed feature vector; they output a Gaussian distribution (mean and variance). Using the "reparameterization trick," the model samples from this distribution during training. This acts as a form of "semantic data augmentation," forcing the model to be robust to noise in the feature space and preventing it from memorizing specific training samples.
3. Deep Supervision & Attention
Every Relation Module in the column is trained with its own loss function (deep supervision). At test time, the model uses a learnable attention mechanism to weight the similarity scores from different levels, automatically deciding whether a "texture match" or a "part match" is more important for the current task.
Experimental Evaluation
The model was evaluated on the two standard "gold standards" for few-shot recognition:
- miniImageNet: A subset of ImageNet with 100 classes and 600 images per class.
- tieredImageNet: A larger and more challenging dataset (608 classes) where the split between training and testing is done at a higher level of the ImageNet hierarchy to ensure a significant "semantic gap" between seen and unseen classes.
Key Results
- State-of-the-Art Accuracy: On miniImageNet (1-shot), DCN using an SENet backbone achieved 63.19% accuracy, significantly outperforming the original RelationNet (~50%) and other popular methods like MAML (~48%).
- Tiered Performance: On the more difficult tieredImageNet, it reached 68.83% (1-shot), showing strong generalization capabilities.
- Flexibility: The model proved robust in "cross-way" scenarios—for example, a model trained to distinguish between 5 classes performed exceptionally well when suddenly asked to distinguish between 20 classes at test time.
Discussion and Insights
A key finding of this work is that similarity is not one-dimensional. Two birds might be similar because of their wing shape (high-level) or their feather texture (low-level). By comparing at every level, DCN captures both.
As shown in the visualization of similarity scores across the column, different levels focus on different aspects of the data. Lower levels might be better at distinguishing fine-grained categories like different dog breeds, while higher levels handle broader category differences. This diversity of predictions allows the attention mechanism to select the most relevant features for a given query.
Conclusion
RelationNet2 demonstrates that hierarchical, non-linear comparisons combined with distributional embeddings provide a powerful framework for few-shot learning. While the architecture adds some computational overhead due to multiple Relation Modules, the gains in accuracy and robustness to deep backbones are significant. Future work may explore end-to-end single-stage training and scaling to even deeper architectures.
Summary updated