Cross-Domain Few-Shot Learning by Representation Fusion

Thomas Adler, Johannes Brandstetter, Michael Widrich, Andreas Mayr, David P. Kreil, Michael Kopp, Günter Klambauer, Sepp Hochreiter

Abstract

In order to quickly adapt to new data, few-shot learning aims at learning from few examples, often by using already acquired knowledge. The new data often differs from the previously seen data due to a domain shift, that is, a change of the input-target distribution. While several methods perform well on small domain shifts like new target classes with similar inputs, larger domain shifts are still challenging. Large domain shifts may result in high-level concepts that are not shared between the original and the new domain, whereas low-level concepts like edges in images might still be shared and useful. For cross-domain few-shot learning, we suggest representation fusion to unify different abstraction levels of a deep neural network into one representation. We propose Cross-domain Hebbian Ensemble Few-shot learning (CHEF), which achieves representation fusion by an ensemble of Hebbian learners acting on different layers of a deep neural network. Ablation studies show that representation fusion is a decisive factor to boost cross-domain few-shot learning. On the few-shot datasets miniImagenet and tieredImagenet with small domain shifts, CHEF is competitive with state-of-the-art methods. On cross-domain few-shot benchmark challenges with larger domain shifts, CHEF establishes novel state-of-the-art results in all categories. We further apply CHEF on a real-world cross-domain application in drug discovery. We consider a domain shift from bioactive molecules to environmental chemicals and drugs with twelve associated toxicity prediction tasks. On these tasks, that are highly relevant for computational drug discovery, CHEF significantly outperforms all its competitors.

Introduction

Deep learning models are notoriously data-hungry, often requiring thousands of labeled examples to generalize effectively. Few-Shot Learning (FSL) attempts to mitigate this by training models to learn new concepts from just a handful of examples. However, most FSL methods struggle with Domain Shift, where the target data comes from a distribution significantly different from the training data (e.g., a model trained on natural images attempting to classify medical X-rays).

When the domain shift is large, high-level semantic features (like specific object parts) often lose their relevance. Conversely, low-level features—such as edges, textures, or basic shapes—tend to be shared across diverse domains. The challenge lies in determining which level of abstraction is most useful for a specific new task without sufficient data to retrain the entire network.

Methodology: The CHEF Framework

To address this, the researchers propose CHEF (Cross-domain Hebbian Ensemble Few-shot learning), a method that leverages Representation Fusion and Hebbian Ensembles.

The CHEF architecture utilizes representation fusion across multiple network layers combined with Hebbian learning for rapid adaptation.

Representation Fusion

Instead of relying solely on the final output layer of a pre-trained "backbone" network (like a ResNet), CHEF extracts features from multiple intermediate layers. This allows the model to access a hierarchy of abstractions, ensuring that both low-level and high-level information are available for the new task.

Hebbian Ensembles

CHEF attaches a simple "Hebbian learner" to each selected layer. Inspired by the biological principle "neurons that fire together, wire together," these learners use a mathematically simple update rule that does not require expensive backpropagation. During a few-shot task, each learner quickly adapts to the new samples. The final classification is a weighted sum of predictions from all layers. This ensemble approach allows the model to automatically prioritize the most discriminative layers for a given domain.

Experimental Results

CHEF was evaluated across standard FSL benchmarks and the Cross-Domain Few-Shot (CD-FSL) Challenge, which includes specialized datasets like CropDisease (plant pathology), EuroSAT (satellite imagery), ISIC (skin lesions), and ChestX (X-rays).

Performance comparison of the CHEF ensemble (ens) against individual layers across various CD-FSL datasets for 5-shot and 50-shot scenarios.

Key Insights

  • State-of-the-Art Performance: CHEF established new state-of-the-art results in all 12 categories of the CD-FSL benchmark. In difficult medical tasks like ChestX and ISIC, it outperformed previous methods by significant margins (often a 2-5% accuracy boost).
  • The "Distance-to-Layer" Relationship: A striking finding is that as domain shift increases, lower-level features become more critical. For tasks with small shifts (e.g., CropDisease), the final layers were superior. For large shifts (e.g., ChestX), middle layers often outperformed the output layer. The ensemble (marked as 'ens' in the figures) consistently leverages the best available signals.
  • Drug Discovery Application: In toxicity prediction (Tox21), CHEF achieved an ROC-AUC of 0.76, significantly outperforming industry standards like Support Vector Machines (0.66) and Random Forests (0.64).

Conclusion

CHEF demonstrates that representation fusion is a decisive factor in boosting cross-domain few-shot learning. By replacing gradient-based fine-tuning with efficient Hebbian updates, the model can adapt to new tasks in a fraction of a second. Future research may explore more sophisticated associative memory structures, such as Modern Hopfield Networks, to further refine how models store and retrieve information from limited examples.

Summary updated

Abstract

In order to quickly adapt to new data, few-shot learning aims at learning from few examples, often by using already acquired knowledge. The new data often differs from the previously seen data due to a domain shift, that is, a change of the input-target distribution. While several methods perform well on small domain shifts like new target classes with similar inputs, larger domain shifts are still challenging. Large domain shifts may result in high-level concepts that are not shared between the original and the new domain, whereas low-level concepts like edges in images might still be shared and useful. For cross-domain few-shot learning, we suggest representation fusion to unify different abstraction levels of a deep neural network into one representation. We propose Cross-domain Hebbian Ensemble Few-shot learning (CHEF), which achieves representation fusion by an ensemble of Hebbian learners acting on different layers of a deep neural network. Ablation studies show that representation fusion is a decisive factor to boost cross-domain few-shot learning. On the few-shot datasets miniImagenet and tieredImagenet with small domain shifts, CHEF is competitive with state-of-the-art methods. On cross-domain few-shot benchmark challenges with larger domain shifts, CHEF establishes novel state-of-the-art results in all categories. We further apply CHEF on a real-world cross-domain application in drug discovery. We consider a domain shift from bioactive molecules to environmental chemicals and drugs with twelve associated toxicity prediction tasks. On these tasks, that are highly relevant for computational drug discovery, CHEF significantly outperforms all its competitors. Github: https://github.com/ml-jku/chef
BibTeX
@misc{adler2020cross,
  author = {Thomas Adler and Johannes Brandstetter and Michael Widrich and Andreas Mayr and David P. Kreil and Michael Kopp and Günter Klambauer and Sepp Hochreiter},
  title = {{Cross-Domain Few-Shot Learning by Representation Fusion}},
  year = {2020},
  eprint = {2010.06498},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.06498},
}
Figure