Skip to content

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Hierarchical Semantic Tree Anchoring for CLIP-Based Class-Incremental Learning

Tao Hu Lan Li Zhen-Hao Xie Da-Wei Zhou
School of Artificial Intelligence, Nanjing University
State Key Laboratory for Novel Software Technology, Nanjing University

The PyTorch code repository for Hierarchical Semantic Tree Anchoring for CLIP-Based Class-Incremental Learning. If you use this code in your research, please cite:

@inproceedings{hu2026hierarchical,
  title={Hierarchical Semantic Tree Anchoring for CLIP-Based Class-Incremental Learning},
  author={Tao Hu and Lan Li and Zhen-Hao Xie and Da-Wei Zhou},
  booktitle = {NeurIPS},
  year      = {2026}
}

📝 Introduction

Class-Incremental Learning (CIL) enables models to learn new classes continually while preserving past knowledge. Recently, vision-language models like CLIP offer transferable features via multimodal pre-training, making them well-suited for CIL. However, real-world visual and linguistic concepts are inherently hierarchical: a textual concept like "dog" subsumes fine-grained categories such as "Labrador" and "Golden Retriever," and each category is associated with corresponding images. Nevertheless, existing CLIP-based CIL methods fail to explicitly capture this inherent hierarchy, leading to feature drift of fine-grained classes during incremental updates and ultimately to catastrophic forgetting. To address this challenge, we propose HASTEN (Hierarchical Semantic Tree Anchoring), a hierarchy-aware framework that uses semantic structure to stabilize CLIP-based CIL. Rather than treating classes as isolated labels, HASTEN leverages external hierarchical knowledge as structured supervision to organize visual and textual features in hyperbolic space, helping maintain parent--child relations as new tasks arrive and mitigating feature drift. Since the shared hyperbolic mapper is updated across tasks, we further stabilize it by constraining its updates to a null space induced by prior-task features, reducing interference with previous mappings while retaining adaptability to new classes. Extensive experiments on nine benchmarks show that HASTEN consistently outperforms existing methods while reducing feature drift and catastrophic forgetting.

🔧 Requirements

Environment

1 torch 1.13.0

2 torchvision 0.15.0

3 open-clip 2.30.0

Dataset

We provide the processed datasets as follows:

  • CIFAR100: will be automatically downloaded by the code.
  • CUB200: Google Drive: link or OneDrive link
  • ImageNet-R: Google Drive: link or Onedrive: link
  • ObjectNet: Onedrive: link You can also refer to the filelist and processing code if the file is too large to download.
  • Cars: Google Drive: link or OneDrive: link
  • UCF: Google Drive: link or OneDrive: link
  • Aircraft: Google Drive: link or OneDrive: link
  • Food: Google Drive: link or OneDrive: link
  • SUN: OneDrive: link

These subsets are sampled from the original datasets. Please note that I do not have the right to distribute these datasets. If the distribution violates the license, I shall provide the filenames instead.

Set DATA_ROOT_PATH in utils/data.py to your dataset directory; its default is data/ relative to the repository root. The prepared layout is:

data/
├── cifar100/
│   └── cifar-100-python/
│       ├── train
│       ├── test
│       └── meta
├── aircraft/{train,test}/
├── cars/{train,test}/
├── cub/{train,test}/
├── food101/{train,test}/
├── imagenet-r/{train,test}/
├── objectnet/{train,test}/
├── sun/{train,test}/
└── ucf/{train,test}/

💡 Running scripts

To prepare your JSON files, refer to the settings in the exps folder and run the following command. All main experiments from the paper are already provided in the exps folder, you can simply execute them to reproduce the results found in the logs folder.

python main.py --config ./exps/hasten/[configname].json

🌳 Incremental semantic trees

We provide task-wise semantic trees for the main experiments in knowledge/. A generation script is also available at utils/create_hier.py to construct incremental semantic trees for different seeds or task splits.

🎈 Acknowledgements

This implementation builds on CIL_Survey, PyCIL, C3Box, and OpenCLIP.

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages