Continually Learn to Map Visual Concepts to Large Language Models in Resource-constrained Environments

Clea Rebillard, Julio Hurtado, Andrii Krutsylo, Lucia Passaro, Vincenzo LomonacoarXiv 2024 · DOI

TL;DR

Continual Visual Mapping (CVM) enables efficient continual learning on resource-constrained edge devices by training a small visual model to project images into a fixed semantic space anchored by a frozen Large Language Model (LLM). This approach eliminates classifier-level interference, significantly mitigates catastrophic forgetting, and outperforms state-of-the-art methods while requiring only a fraction of the computational footprint.

What Problem Does This Paper Address?

In continual learning (CL), deep learning models must learn from a continuous stream of non-i.i.d. data without forgetting previously acquired knowledge. While large pre-trained vision-language models (like CLIP or Vision Transformers) mitigate this "catastrophic forgetting" remarkably well, their massive size makes fine-tuning or deploying them on resource-constrained edge devices completely impractical. Conversely, training smaller models from scratch on edge devices typically leads to severe overfitting and representation bias.

The authors address a compelling question: Can we leverage the rich, structured knowledge of large pre-trained models without actually running them during the continual learning and inference process?

Methods

CVM solves this by decoupling the heavy language model from the active training loop.

First, the method uses a frozen LLM (such as SentenceBERT) to generate fixed "anchor vectors" for each class label using a simple prompt template: "This is an image of [class name]". This establishes a stable, knowledgeable semantic hyperspace.

Instead of using a traditional linear classification layer—which is a primary source of forgetting due to constantly shifting weights—the authors train a small visual model ($f_\theta$) to map image representations directly into this fixed LLM latent space. Training relies on a combination of two loss functions:

  1. Triplet Loss ($L_m$): Minimizes the distance between an image representation and its correct class anchor vector, while maximizing its distance from negative class anchors.
  2. Semantic Distance Loss ($L_d$): A novel retention loss that minimizes the discrepancy between the current model's distance mappings and those of the model from the previous time step. This prevents the model from distorting the established semantic relationships of past tasks.

At inference time, predicting a class is as simple as finding the nearest anchor vector in the latent space using a standard distance function (like cosine distance).

Figure 1: Conceptual image of our Continual Visual Mapping (CVM) method. A small and efficient parametric model fθ is continually learned to map visual concepts into semantically richer embeddings seldomly extracted from frozen and pre-trained Large Language Models (LLMs).
Figure 2: Diagram of how CVM works at Training and Inference. During training (a), when adding new classes (plane and boat), two losses are involved: the triplet loss with a margin α (Equation 4) and the Semantic distance loss restrained by coefficient β (Equation 5). At inference (b), the prediction ˆY is obtained by selecting the minimum distance between the image embedding and the seen classes in the latent space.

Datasets

The authors evaluated CVM across five distinct benchmarks:

  • CIFAR100 & Tiny-ImageNet: Evaluated under a challenging Class-Incremental Learning (Class-IL) setup split into 10 sequential experiences.
  • CORe50: A realistic dataset designed for object recognition on embedded devices, evaluated under a Domain-Incremental Learning (Domain-IL) setup.
  • GTSRB (German Traffic Sign Detection Benchmark) & Aircraft: Fine-grained datasets used specifically to expose the limitations of large general-purpose pre-trained models.

Key Insights and Ideas

  • Ditching the Classifier Halts Forgetting: Replacing the volatile linear classifier with a stable set of anchor vectors eliminates the interference typically generated in the final layer of a network, which is a recognized contributor to forgetting.
  • LLM Spaces Foster Zero-Shot Generalization: Because the visual model learns to align its features with a semantic space structured by an LLM's broad understanding of the world, it naturally gains forward-transfer capabilities. CVM can actually classify unseen classes zero-shot simply by adding a new text anchor vector, a feat impossible for standard classifier-based CL models.
  • Smaller Models Win on Granular Tasks: Large vision models pre-trained on general internet data often struggle with highly specific, fine-grained tasks due to data scarcity or lack of specialized features. Smaller models guided by a robust semantic space can adapt more effectively to these niche domains.

Key Results

CVM consistently outperformed classic regularization and memory-based continual learning methods (such as Experience Replay, DER++, and iCarl) across standard benchmarks:

  • On CIFAR100, CVM achieved an average accuracy of 32.9%, outperforming the next best baseline by nearly 4%.
  • On Tiny-ImageNet and CORe50, it achieved state-of-the-art accuracies of 27.0% and 37.6% respectively.
Table 1: Accuracy and forgetting for CIFAR100, Tiny-ImageNet, and CORe50. CVM outperforms all methods regarding average accuracy due to the combination of Lm and the semantic loss. It is worth noting that we cannot measure the forgetting metric in CORe50 since it is designed with a unique and fixed test set.

Crucially, on fine-grained datasets like GTSRB, CVM achieved 84.8% accuracy, vastly outperforming large prompt-based models like L2P (which scored just 32.4%). Furthermore, CVM's inference time was over 13x faster than L2P, proving its viability for real-time edge applications.

Limitations and Future Work

Currently, CVM relies on a static, simple prompt template to generate its anchor vectors. The authors note that using a single class label phrase might not capture the full visual nuance of an image. They suggest that future work should explore using more detailed textual descriptions or automatically extracting richer contextual concepts from images to build an even more descriptive and effective latent space.

Summary updated

BibTeX
@misc{rebillard2024continually,
  author = {Clea Rebillard and Julio Hurtado and Andrii Krutsylo and Lucia Passaro and Vincenzo Lomonaco},
  title = {{Continually Learn to Map Visual Concepts to Large Language Models in Resource-constrained Environments}},
  year = {2024},
  eprint = {2407.08279},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.08279},
}
Figure