Task Attribute Distance for Few-Shot Learning: Theoretical Analysis and Applications

Minyang Hu, Hong Chang, Zong Guo, Bingpeng Ma, Shiguan Shan, Xilin ChenarXiv 2024 · DOI

Abstract

This paper introduces Task Attribute Distance (TAD), a model-agnostic metric that quantifies the relatedness between training experience and novel few-shot learning tasks. By leveraging a shared language of attributes, the authors provide a theoretical bridge between task similarity and adaptation difficulty. They prove that tasks with higher TAD are fundamentally harder for models to master, and demonstrate that this metric can be used to improve model performance through data augmentation and targeted interventions.

Introduction: The Challenge of Task Relatedness

Few-shot learning (FSL) relies on the ability of a model to generalize from a set of training tasks to novel tasks with very few examples. A central assumption in FSL is that the model can "leverage experience" from related tasks. However, defining and measuring this "relatedness" has remained an open challenge. Existing metrics often suffer from model bias or high computational costs.

Overview of task relatedness and the transition from standard few-shot learning to cross-domain tasks.

This research addresses two fundamental questions: how can we objectively measure the distance between tasks, and how does this distance correlate with a model's ability to adapt? The proposed TAD metric seeks a universal, efficient, and theoretically grounded way to measure the "gap" between what a model knows and what it is being asked to learn.

Methodology: Task Attribute Distance (TAD)

The authors propose Task Attribute Distance (TAD) based on the attribute compositionality hypothesis. This hypothesis suggests that while specific categories (e.g., a particular bird species) may be unique, they are composed of reusable, shared attributes (e.g., bill shape, feather pattern).

The TAD Metric

TAD calculates the Total Variation (TV) distance between the attribute conditional distributions of categories. To compare entire tasks, the framework employs a minimum-weight matching in a bipartite graph, identifying the most efficient mapping from training categories to novel ones. To ensure scalability, the authors also introduced an approximate TAD that replaces individual category differences with average differences, reducing complexity from $O(C^3)$ to $O(1)$ relative to the number of categories.

Theoretical Foundation

A key contribution of this work is a derived generalization error bound. The authors formally prove that the error on a novel task is partially bounded by its average TAD to the training set, establishing a theoretical link between task similarity and performance.

Experimental Setup and Datasets

The effectiveness of TAD was evaluated across three distinct benchmarks representing different levels of domain shift:

Examples from the three benchmark datasets used to evaluate TAD: miniImageNet, CUB, and SUN.
  • CUB-200-2011 (CUB): A fine-grained dataset for bird classification featuring 312 human-annotated attributes.
  • SUN with Attribute (SUN): A scene classification dataset with 102 attributes.
  • miniImageNet: A standard FSL benchmark. To handle the lack of manual attributes, the authors used a pretrained CLIP model to auto-annotate categories with 14 predefined attributes (e.g., pattern, texture), proving TAD's utility even in the absence of expert labels.

Key Insights and Results

The research yielded several significant findings regarding the behavior of FSL models:

  • Linear Performance Decay: A striking linear relationship exists between TAD and model accuracy. As the attribute distance increases, the performance of popular models like MAML and ProtoNet drops predictably.
  • Model Agnosticism: TAD predicts performance even for models that do not explicitly use attributes, suggesting that these models implicitly learn attribute-like features during training.
  • Predictive Power: TAD outperformed traditional metrics such as Frechet Inception Distance (FID) and Earth Mover’s Distance (EMD) in identifying difficult tasks.

Practical Applications

The authors demonstrated two practical uses for TAD:

  1. Data Augmentation: By using TAD to identify the most related training categories to "calibrate" novel class prototypes, they improved ProtoNet's 1-shot accuracy on CUB by 7.8% (from 57.0% to 64.8%).
  2. Test-Time Intervention: By identifying "hard" tasks (those with high TAD) before evaluation, researchers can allocate more labeled samples to those specific tasks, significantly improving worst-case performance.

Conclusion and Future Directions

TAD provides a robust, theoretically grounded framework for understanding task difficulty in few-shot learning. While the current model assumes attribute independence, future work aims to incorporate attribute correlations and explore the discovery of "latent" attributes automatically. This metric opens new doors for more efficient and predictable meta-learning systems.

Summary updated

BibTeX
@misc{hu2024task,
  author = {Minyang Hu and Hong Chang and Zong Guo and Bingpeng Ma and Shiguan Shan and Xilin Chen},
  title = {{Task Attribute Distance for Few-Shot Learning: Theoretical Analysis and Applications}},
  year = {2024},
  eprint = {2403.03535},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.03535},
}
Figure