Task2Vec: Task Embedding for Meta-Learning.

Alessandro Achille, Michael Lam, Rahul Tewari, Avinash Ravichandran, Subhransu Maji, Charless C. Fowlkes, Stefano Soatto, Pietro PeronaICCV 2019 · DOI

TL;DR

This paper introduces TASK2VEC, a novel method to represent visual classification tasks as fixed-dimensional vectors. These "task embeddings" capture task complexity and semantic similarity, enabling efficient meta-learning, particularly for selecting the best pre-trained feature extractor for a new task.

What Problem Does This Paper Address?

The success of deep learning relies heavily on transferring knowledge between tasks. However, there's a lack of a general framework to understand and quantify the relationships between different visual tasks. This makes it challenging to effectively leverage existing models or select the most suitable pre-trained feature extractor for a new, unseen task, especially when data is scarce. Without such a framework, finding the optimal pre-trained model often requires an expensive, brute-force search.

Methods

The core of TASK2VEC is to represent a task using an embedding derived from the Fisher Information Matrix (FIM). Here's the breakdown:

  • Probe Network: A pre-trained convolutional neural network (CNN) is used as a "probe network." Its weights are fixed, except for the final classification layer, which is retrained for the specific task.
  • Fisher Information Matrix (FIM): The FIM quantifies how much information each parameter (weight) in the probe network contains about the task. It's essentially the expected covariance of the gradients of the log-likelihood.
  • Task Embedding: Instead of using the full FIM (which can be massive), the authors use a diagonal approximation and average filter-wise. This results in a fixed-dimensional vector embedding for each task.
  • Robust Fisher Computation: To make the FIM estimation more robust to noisy loss landscapes and limited data, they employ a method inspired by variational inference, which provides a more stable estimator.
  • Similarity Measures:
    • Symmetric TASK2VEC distance: Cosine distance between normalized task embeddings, designed to capture semantic similarity.
  • Asymmetric TASK2VEC distance: A modified distance that accounts for task complexity (related to the norm of the embedding), aiming to capture transferability.
  • MODEL2VEC: For more sophisticated model selection, they propose learning a joint embedding for tasks and models, allowing them to predict which model will perform best on a given task.

Datasets

The paper uses a large collection of tasks and models for evaluation:

  • iNaturalist: Tasks are generated by classifying species within different taxonomic orders.
  • CUB-200: Similar to iNaturalist, tasks are based on bird species classification within orders, but with fewer samples per task.
  • iMaterialist & DeepFashion: Tasks are derived from attribute classification (e.g., color, material, style) of clothing items. These tasks share the same domain but differ in labels.

They create a benchmark of 1460 tasks in total, simulating real-world scenarios with varying dataset sizes and class imbalances.

Key Insights and Ideas

  • FIM as a Task Fingerprint: The FIM, when computed on a fixed probe network, acts as a powerful, fixed-dimensional "fingerprint" for a visual classification task, capturing its intrinsic difficulty and structure.
  • Task Embeddings Reflect Intuition: The embeddings naturally group semantically similar tasks (e.g., species classification tasks from the same taxonomic order cluster together), aligning with human intuition.
  • Complexity and Performance Correlation: The norm of the task embedding correlates with the task's difficulty and the expected test error, suggesting that harder tasks have larger embeddings.
  • Beyond Domain Similarity: TASK2VEC embeddings capture task-specific information that domain embeddings (which only consider input data statistics) miss, especially when tasks share a domain but have different labels.
  • Efficient Model Selection: TASK2VEC enables efficient selection of pre-trained feature extractors, significantly outperforming random selection or using a generic ImageNet model, and approaching the performance of exhaustive search.

Key Results

  • Semantic Similarity: TASK2VEC distance shows strong correlation with taxonomic distance for species classification tasks.
  • Model Selection Performance: In meta-learning experiments (iNat+CUB and Mixed), the Asymmetric TASK2VEC approach achieved performance close to the ground-truth optimal model selection, significantly improving over chance and generic ImageNet experts. For instance, on the iNat+CUB meta-task, it achieved a mean relative error increase of +9.97% over the ground-truth optimum, compared to +30.18% for a generic ImageNet expert.
  • Efficiency: The TASK2VEC approach has O(1) complexity for model selection, compared to O(N) for brute-force search over N experts.
  • Robustness to Data Size: The effectiveness of TASK2VEC for model selection is maintained even with very few training samples for the target task.

Limitations and Future Work

  • Probe Network Choice: The performance of TASK2VEC embeddings can depend on the choice of the probe network. While ResNet-34 and DenseNet-121 performed well, VGG was less effective.
  • Model Interaction Ignored (TASK2VEC): The basic TASK2VEC embedding only considers the task, not the specific model architecture or training procedure. This is addressed by the proposed MODEL2VEC.
  • Future Work: The authors suggest extending their work to larger and more diverse task collections to further test the robustness and limitations of their embedding method and explore its application in other meta-learning scenarios. They also highlight the potential for reconstructing a topology on the task space.

Summary updated

BibTeX
@inproceedings{achille2019task,
  author = {Alessandro Achille and Michael Lam and Rahul Tewari and Avinash Ravichandran and Subhransu Maji and Charless C. Fowlkes and Stefano Soatto and Pietro Perona},
  title = {{Task2Vec: Task Embedding for Meta-Learning.}},
  booktitle = {ICCV},
  year = {2019},
  doi = {10.1109/iccv.2019.00653},
}
Figure