Task Adaptive Feature Transformation for One-Shot Learning

Imtiaz Masud Ziko, Freddy Lécué, Ismail Ben AyedarXiv 2023 · DOI

Abstract

One-shot learning remains a significant challenge in deep learning due to the extreme risk of overfitting when models are fine-tuned on very small support sets. This paper introduces FT-TIM (Fine-Tuning with Transductive Information Maximization), which employs a novel non-linear, norm-induced feature transformation layer. By re-parameterizing the feature space through squared Euclidean distances to learnable anchors, the model learns to focus on task-relevant dimensions. When combined with a transductive entropy loss, this approach effectively disentangles classes even with a single labeled example. Experimental results across four benchmarks show that FT-TIM consistently achieves state-of-the-art accuracy.

Introduction

Deep learning models typically require vast amounts of data to generalize. In contrast, one-shot learning tasks require models to recognize new categories from just a single example. The standard approach—fine-tuning a pre-trained model on the new "support set"—often leads to overfitting, where the model captures noise rather than generalizable features. Linear transformations often lack the capacity to adapt to new tasks, while overly flexible non-linear models can collapse into trivial solutions.

Proposed Method: FT-TIM

The authors propose a method called FT-TIM, which introduces a norm-induced feature transformation layer to address these challenges.

Norm-Induced Transformation

Instead of a standard linear layer ($Wx + b$), the proposed transformation $g(x_i, W)$ calculates the squared Euclidean distance between input features $x_i$ and a set of learnable "anchor" weights $w_d$: $$g(x_i, W) = -\frac{1}{2} [\|x_i - w_1\|^2, \dots, \|x_i - w_d\|^2]^T$$ This geometric re-parametrization allows the model to "stretch" or "shrink" feature dimensions based on their relevance to the specific task, facilitating better class separation.

Transductive Information Maximization (TIM)

The transformation is fine-tuned during inference using a transductive loss that considers all unlabeled "query" images simultaneously. The TIM loss function integrates:

  1. Cross-entropy on the labeled support sample.
  2. Conditional Entropy Minimization to increase prediction confidence on unlabeled data.
  3. Marginal Entropy Maximization to prevent the model from collapsing into a single-class prediction (the "trivial solution").

Experimental Results

The method was evaluated on four benchmarks: miniImageNet, tieredImageNet, CUB (fine-grained birds), and Aircraft (fine-grained airplane models).

Performance and Visualization

FT-TIM consistently outperformed previous state-of-the-art methods. On miniImageNet, it achieved 75.00% accuracy using a ResNet-18 backbone. On the Aircraft dataset, it reached 84.47%.

Visualizing feature disentanglement across mini-ImageNet and Aircraft datasets using t-SNE.

As shown in the t-SNE visualizations above, standard pretrained features and linear transformations often result in overlapping clusters for one-shot tasks. In contrast, the proposed FT-TIM transformation clearly separates query samples into distinct, tight clusters that correspond to their true classes.

Discussion and Conclusion

One of the key theoretical insights is the connection between entropy minimization and K-means clustering; minimizing conditional entropy is mathematically similar to performing a "soft" K-means clustering on the transformed features. This provides a clear geometric intuition for the success of the method.

While highly effective, FT-TIM is a transductive method, requiring access to the entire query set at once, which may limit its use in real-time "online" scenarios. Additionally, the requirement for gradient updates at test time increases computational overhead compared to purely inductive methods. Future research could focus on adapting this transformation for online settings or improving inference efficiency.

Summary updated

BibTeX
@misc{ziko2023task,
  author = {Imtiaz Masud Ziko and Freddy Lécué and Ismail Ben Ayed},
  title = {{Task Adaptive Feature Transformation for One-Shot Learning}},
  year = {2023},
  eprint = {2304.06832},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.06832},
}
Figure