AttriCLIP: A Non-Incremental Learner for Incremental Knowledge Learning

Runqi Wang, Xiaoyue Duan, Guoliang Kang, Jianzhuang Liu, Shaohui Lin, Songcen Xu, Jinhu Lv, Baochang Zhang

Abstract

Continual Learning (CL) aims to enable models to learn new tasks sequentially without forgetting previously acquired knowledge. Traditional methods often rely on expanding model architectures or maintaining memory-intensive replay buffers, which pose challenges for scalability and privacy. We present AttriCLIP, a novel framework that leverages the pre-trained CLIP model and a learnable "Attribute Word Bank" to achieve non-incremental learning. By focusing on shared visual attributes rather than rigid class labels, AttriCLIP eliminates the need for a replay buffer and prevents catastrophic forgetting. Our evaluation on CIFAR100, ImageNet100, and a new Cross-Datasets Continual Learning (CDCL) benchmark demonstrates that AttriCLIP significantly outperforms existing CLIP-based methods, even achieving positive backward transfer in domain-shift scenarios.

1. Introduction

In the field of Continual Learning (CL), the primary challenge is catastrophic forgetting—the tendency of neural networks to overwrite parameters essential for old tasks when fine-tuned on new data. To mitigate this, state-of-the-art methods typically employ two strategies: architectural expansion (adding new weights for new classes) or experience replay (storing a subset of old images to periodically retrain the model). However, architectural expansion leads to increasing memory overhead, and replay buffers raise significant privacy concerns and storage requirements.

AttriCLIP addresses these issues by functioning as a "non-incremental learner." It utilizes the frozen, high-quality representations of the Contrastive Language-Image Pre-training (CLIP) model. Instead of learning class-specific weights, AttriCLIP learns a fixed set of universal visual attributes. This approach allows the model to recognize new classes by identifying their constituent attributes, ensuring that the model size remains constant and no historical data needs to be stored.

2. Methodology

AttriCLIP is built upon the frozen image and text encoders of CLIP. The core innovation is the Attribute Word Bank, which consists of $N$ pairs of learnable components: Keys and Prompts.

2.1 The Attribute Word Bank

  • Keys ($k_i$): These are learnable vectors in the visual feature space that represent specific local visual characteristics or "attributes" (e.g., the texture of fur or the presence of a beak).
  • Prompts ($P_i$): These are learnable textual embeddings that correspond to the visual attributes. They serve as descriptive modifiers for the class labels.

2.2 Inference Mechanism

During inference, an input image is processed through the frozen CLIP image encoder. The resulting feature vector is compared against all keys in the Attribute Word Bank using similarity metrics. The model selects the top-$C$ most relevant attributes based on this similarity.

These selected attributes' corresponding prompts are then concatenated with the target class name (e.g., "a photo of a [Attribute 1] [Attribute 2] dog"). This augmented text is passed through the frozen CLIP text encoder to generate a classifier weight. Classification is achieved by finding the highest similarity between the image feature and these attribute-enhanced textual features. This mechanism allows the model to generalize to new classes zero-shot, provided the new classes share attributes with previously learned ones.

2.3 Optimization

The model is optimized using three distinct loss functions:

  1. Classification Loss: Standard cross-entropy loss to ensure correct label prediction.
  2. Matching Loss: Ensures that the learnable keys in the bank align closely with the actual visual features extracted from the images.
  3. Orthogonality Loss: Encourages the prompts in the bank to remain diverse, preventing the model from collapsing into a state where all attributes represent the same redundant information.

3. Experimental Evaluation

3.1 Benchmarks

The authors evaluated AttriCLIP on standard benchmarks including CIFAR100 and ImageNet100, both split into 10 sequential tasks. Additionally, they introduced the Cross-Datasets Continual Learning (CDCL) benchmark. CDCL simulates realistic domain shifts by training the model on one dataset (e.g., ImageNet100) and then continuing training on a completely different dataset (e.g., CIFAR100).

3.2 Results

AttriCLIP demonstrated superior performance across all metrics without the use of a replay buffer:

  • Accuracy: On CIFAR100, AttriCLIP achieved an average accuracy of 79.7%, significantly outperforming other CLIP-based prompt tuning methods such as CoOp (67.6%) and Continual-CLIP (66.7%).
  • Backward Transfer: In the CDCL setup, AttriCLIP was the only method to exhibit positive Backward Transfer (+7.0%). While other methods saw performance drops of 4% to 25% on the first dataset after learning the second, AttriCLIP's performance on the original task actually improved. This suggests that learning attributes in a new domain can refine the model's understanding of those same attributes in the original domain.
  • Efficiency: By maintaining a fixed-size Attribute Word Bank and using frozen encoders, AttriCLIP avoids the parameter growth and memory overhead typical of incremental learners.

4. Discussion and Limitations

The success of AttriCLIP stems from the insight that while class labels are specific, attributes are universal. A "dog" and a "cat" are distinct, but they may share attributes like "furry" or "on the grass." By decoupling knowledge from a rigid class-based architecture, AttriCLIP facilitates both forward and backward knowledge transfer.

However, some limitations remain. For extremely diverse or long-sequence tasks, the fixed size of the Attribute Word Bank ($N$) may eventually become a bottleneck, requiring a strategy for bank expansion. Additionally, the use of multiple concatenated prompts increases the sequence length for the text encoder, which may lead to a slight increase in inference latency compared to simple class-name prompting.

5. Conclusion

AttriCLIP represents a significant step toward efficient and privacy-preserving continual learning. By leveraging the zero-shot capabilities of CLIP and focusing on a learnable bank of shared attributes, it achieves state-of-the-art results without the need for data replay or increasing model complexity. Future work will explore automated methods for optimizing bank size and reducing computational overhead during inference.

Summary updated

BibTeX
@inproceedings{wang2023attriclip,
  author = {Runqi Wang and Xiaoyue Duan and Guoliang Kang and Jianzhuang Liu and Shaohui Lin and Songcen Xu and Jinhu Lv and Baochang Zhang},
  title = {{AttriCLIP: A Non-Incremental Learner for Incremental Knowledge Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure