Multi-Pretext Attention Network For Few-Shot Learning With Self-Supervision

Hainan Li, Renshuai Tao, Jun Li, Haotong Qin, Yifu Ding, Shuo Wang, Xianglong Liu

Abstract

Few-shot learning (FSL) aims to recognize novel concepts from extremely limited labeled data. While self-supervised learning (SSL) has emerged as a powerful auxiliary tool for FSL, current approaches often fail to exploit sample correlations or optimally fuse multiple pretext tasks. This paper presents the Multi-Pretext Attention Network (MAN), which introduces a differentiable Graph-driven Clustering (GC) branch to capture endogenous sample relationships and an adaptive attention mechanism to dynamically weight auxiliary losses. Experimental results on miniImageNet and tieredImageNet demonstrate that MAN achieves state-of-the-art performance across various backbone architectures.

Introduction

Neural networks typically require vast amounts of labeled data to generalize, whereas humans can learn from a single example. Few-shot learning (FSL) attempts to bridge this gap by learning robust feature representations that can be adapted to new tasks with minimal supervision. A common strategy is to incorporate Self-Supervised Learning (SSL) to learn from unlabeled data by solving "pretext tasks," such as predicting image rotation or patch locations.

However, the authors identify two primary challenges in existing FSL+SSL methods:

  1. Neglect of Endogenous Information: Most SSL tasks are "augmentation-relied," focusing on individual images and ignoring the inherent correlations between different samples in a batch.
  2. Suboptimal Task Fusion: Combining multiple SSL tasks usually involves fixed, manually-tuned weights, which fails to capture the varying importance of different pretext tasks during the learning process.

Methodology

The proposed Multi-Pretext Attention Network (MAN) addresses these issues through a dual-branch architecture and an adaptive fusion module.

Overview of the Multi-pretext Attention Network (MAN) architecture.

Graph-driven Clustering (GC)

To capture sample correlations without relying solely on data augmentation, MAN introduces an "augmentation-free" branch based on Graph-driven Clustering. Unlike traditional K-means, which is non-differentiable and difficult to integrate into deep learning pipelines, GC utilizes a Graph Convolutional Network (GCN):

  • Graph Construction: Nodes represent image features, and edges are defined by cosine similarity between samples.
  • Pseudo-label Generation: The GCN performs nonlinear transformations to produce pseudo-labels for clustering.
  • Differentiability: Because the clustering process is formulated via a GCN, it allows for gradient backpropagation. This enables the feature extractor to learn representations that are specifically optimized for capturing the underlying structure of the data.

Multi-pretext Attention Mechanism

MAN integrates four distinct pretext tasks: Rotation, Patch Location, Jigsaw, and the proposed GC. Instead of a simple summation of losses, it employs a learnable attention module to adaptively assign weights to each task based on their contribution to the final classification objective.

A key innovation is the "Plus One" Trick. Standard sigmoid-based weights (ranging from 0 to 1) can lead to vanishing self-supervision signals if the attention weights become too small. By adding 1 to the sigmoid output, the authors scale the weights to the [1, 2] range, ensuring that auxiliary losses remain impactful throughout the training process.

Experiments and Results

The model was evaluated on the miniImageNet and tieredImageNet benchmarks using various backbones, including Conv-4-64, ResNet-12, and WRN-28-10.

Key Results

MAN consistently outperforms existing state-of-the-art (SOTA) methods across all tested backbones. On the miniImageNet dataset using a WRN-28-10 backbone, MAN achieved 64.51% for 1-shot and 80.93% for 5-shot classification, marking a significant improvement over previous SSL-integrated methods.

Performance comparison on the miniImageNet dataset across different backbones.

Ablation studies highlight the importance of the individual components:

  • GC vs. K-means: Replacing standard K-means with the proposed differentiable GC improved 1-shot accuracy by 1.75% on its own.
  • Attention Fusion: The adaptive attention mechanism provided a 0.7% boost over a simple summation of losses, confirming that dynamic task weighting is superior to fixed fusion.

Conclusion

The Multi-Pretext Attention Network (MAN) demonstrates that the intelligent combination of multiple self-supervised tasks significantly enhances few-shot learning. By making clustering differentiable via GCNs and adaptively weighting pretext losses, MAN effectively captures both individual and relational data features. This framework provides a robust path forward for developing FSL systems that rely less on manual labeling and more on the inherent structure of unlabeled data.

Summary updated

Abstract

Few-shot learning is an interesting and challenging study, which enables machines to learn from few samples like humans. Existing studies rarely exploit auxiliary information from large amount of unlabeled data. Self-supervised learning is emerged as an efficient method to utilize unlabeled data. Existing self-supervised learning methods always rely on the combination of geometric transformations for the single sample by augmentation, while seriously neglect the endogenous correlation information among different samples that is the same important for the task. In this work, we propose a Graph-driven Clustering (GC), a novel augmentation-free method for self-supervised learning, which does not rely on any auxiliary sample and utilizes the endogenous correlation information among input samples. Besides, we propose Multi-pretext Attention Network (MAN), which exploits a specific attention mechanism to combine the traditional augmentation-relied methods and our GC, adaptively learning their optimized weights to improve the performance and enabling the feature extractor to obtain more universal representations. We evaluate our MAN extensively on miniImageNet and tieredImageNet datasets and the results demonstrate that the proposed method outperforms the state-of-the-art (SOTA) relevant methods. <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">1</sup>
BibTeX
@inproceedings{li2021multi,
  author = {Hainan Li and Renshuai Tao and Jun Li and Haotong Qin and Yifu Ding and Shuo Wang and Xianglong Liu},
  title = {{Multi-Pretext Attention Network For Few-Shot Learning With Self-Supervision}},
  booktitle = {ICME},
  year = {2021},
  url = {https://openreview.net/forum?id=QlhQGdpL1gf},
}
Figure