Relational Embedding for Few-Shot Classification

Dahyun Kang, Heeseung Kwon, Juhong Min, Minsu Cho

Abstract

We propose to address the problem of few-shot classification by meta-learning "what to observe" and "where to attend" from a relational perspective. Our method leverages relational patterns within and between images via self-correlational representation (SCR) and cross-correlational attention (CCA). Within each image, the SCR module transforms a base feature map into a self-correlation tensor to extract structural patterns. Between images, the CCA module computes cross-correlation to produce co-attention. Our Relational Embedding Network (RENet) combines these modules to learn relational embeddings in an end-to-end manner. Experimental evaluation shows consistent improvements over state-of-the-art methods on miniImageNet, tieredImageNet, CUB-200-2011, and CIFAR-FS.

Introduction

Few-shot classification remains a significant challenge in computer vision, often described as a "cold start" problem where models must recognize new categories from as few as one or five examples. The primary obstacle is overfitting; standard deep learning models are "feature hungry" and often latch onto spurious details—such as specific backgrounds or lighting—rather than the actual object. These models fail to generalize because their learned embeddings are too tightly coupled with the specific appearance of training data.

We argue that while appearance changes, the relational structure of objects (how parts relate to each other) is a more robust, transferable signal. RENet shifts the focus from raw image features to these meta-patterns.

Methodology: The Relational Embedding Network (RENet)

RENet introduces two novel modules designed to capture structural signals rather than just raw pixel intensities. The overall architecture, shown below, integrates these modules into a unified pipeline.

The RENet architecture overview, illustrating the flow from base representation to relational embedding via SCR and CCA modules.

Self-Correlational Representation (SCR)

Instead of relying solely on standard feature maps, SCR examines the local neighborhood of every pixel. It computes a channel-wise Hadamard product between a feature vector and its neighbors, creating a "self-correlation tensor." This tensor captures local structural patterns, such as how a wing texture relates to a bird's body. Unlike standard self-attention mechanisms that often collapse information into scalars, SCR preserves rich semantic channels.

Cross-Correlational Attention (CCA)

This module identifies the "common ground" between a query image and a support image. It computes a 4D correlation tensor representing all possible matches between the two images.

A key innovation here is the application of 4D convolutions to this tensor. This process, termed "convolutional matching," enforces geometric consistency. It filters out noisy matches (e.g., matching a patch of blue sky in one image to a blue car in another) by seeking a consensus among neighboring matches. The final embeddings are produced via attentive pooling, where CCA maps guide the model to the most relevant SCR-enhanced features.

Key Insights and Qualitative Results

A central thesis of this work is that relational patterns are more "meta" and thus more transferable across classes than raw appearance. By treating image matching as a geometric problem, the CCA module ensures that if two points match, their neighbors should likely match in a similar spatial configuration.

Qualitative comparison of attention maps between CCA (ours) and CAN. CCA demonstrates superior focus on the object of interest (the missile) while deactivating irrelevant background features.

As seen in the qualitative results, the SCR and CCA modules naturally "deactivate" irrelevant background features. Because background areas lack the consistent structural correlations found in objects of interest, the model learns to ignore them, focusing instead on the shared relational structure between the query and support images.

Experimental Results

RENet was evaluated on four gold-standard benchmarks, achieving state-of-the-art (SOTA) performance:

  • miniImageNet: Reached 67.60% (1-shot) and 82.58% (5-shot), outperforming previous leaders like FEAT and DeepEMD.
  • CUB-200-2011: Showed a significant jump to 79.49% (1-shot), proving its efficacy in fine-grained scenarios where structural details are paramount.
  • Efficiency: Beyond accuracy, RENet offers a major speed advantage. On tieredImageNet, it is roughly 320x faster to evaluate than DeepEMD (1.5 minutes vs. 8 hours for 2,000 episodes) because it utilizes a feed-forward architecture rather than complex optimization at inference time.

Conclusion

By focusing on "what to observe" and "where to attend" through a relational lens, RENet provides a robust framework for few-shot learning. While the self-correlation tensor increases memory usage—a limitation mitigated by using local windows—the gains in generalization and inference speed represent a significant step forward. Future work may extend this relational perspective to few-shot object detection and segmentation.

Summary updated

BibTeX
@inproceedings{kang2021relational,
  author = {Dahyun Kang and Heeseung Kwon and Juhong Min and Minsu Cho},
  title = {{Relational Embedding for Few-Shot Classification}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  url = {https://openreview.net/forum?id=Rc1T74cQ75},
}
Figure