LAMDA-PILOT

LAMDA-CLMIT更新放缓

基于预训练模型的持续学习工具箱,集成多种增量学习与终身学习算法,方便在视觉和视觉语言模型上做可复现的持续学习实验。

🎉 PILOT: A Pre-trained Model-Based Continual Learning Toolbox

暂无版本613star69fork同步于 2026-11-07 07:31 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/sun-hailong/LAMDA-PILOT
cd LAMDA-PILOT
python main.py --config=./exps/[MODEL NAME].json
硬件要求按 README 说明

README 未说明显存、CPU 或 GPU 型号等硬件要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于预训练模型的类增量学习工具箱,复现 L2P、DualPrompt、CODA-Prompt 等前沿方法

基于预训练模型的持续学习工具箱,集成多种增量学习与终身学习算法,方便在视觉和视觉语言模型上做可复现的持续学习实验。

核心能力

  • 复现 L2P、DualPrompt、CODA-Prompt 等基于提示的增量学习方法
  • 将 FOSTER、MEMO 等典型类增量算法适配到预训练模型场景
  • 通过 JSON 配置文件统一设置全局参数与算法超参数
  • 支持从 Timm 库选择 ViT-B/16 等多种预训练骨干网络
  • 提供 CIFAR-100 与 ImageNet-R 上的复现结果对比

容易踩的坑

依赖版本较严格,需 torch 2.0.1、torchvision 0.15.2、timm 0.6.12;运行前需先编辑对应的 [MODEL NAME].json 配置文件;骨干网络为 Timm 预训练模型,首次运行需下载权重

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    🎉 Introduction

    Welcome to PILOT, a pre-trained model-based continual learning toolbox [Paper]. On the one hand, PILOT implements some state-of-the-art class-incremental learning algorithms based on pre-trained models, such as L2P, DualPrompt, and CODA-Prompt. On the other hand, PILOT also fits typical class-incremental learning algorithms (e.g., FOSTER, and MEMO) within the context of pre-trained models to evaluate their effectiveness.

    If you use any content of this repo for your work, please cite the following bib entries:

    @article{sun2025pilot,
        title={PILOT: A Pre-Trained Model-Based Continual Learning Toolbox},
        author={Sun, Hai-Long and Zhou, Da-Wei and Zhan, De-Chuan and Ye, Han-Jia},
        journal={SCIENCE CHINA Information Sciences},
        year={2025},
        volume = {68},
        number = {4},
        pages = {147101},
        doi = {https://doi.org/10.1007/s11432-024-4276-4}
    }
    
    @inproceedings{zhou2024continual,
        title={Continual learning with pre-trained models: A survey},
        author={Zhou, Da-Wei and Sun, Hai-Long and Ning, Jingyi and Ye, Han-Jia and Zhan, De-Chuan},
        booktitle={IJCAI},
        pages={8363-8371},
        year={2024}
    }
    
    @article{zhou2024class,
        author = {Zhou, Da-Wei and Wang, Qi-Wei and Qi, Zhi-Hong and Ye, Han-Jia and Zhan, De-Chuan and Liu, Ziwei},
        title = {Class-Incremental Learning: A Survey},
        journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
        volume={46},
        number={12},
        pages={9851--9873},
        year = {2024}
    }
    

    📰 What's New

    • [2026-01]🌟 We have released C3Box, a CLIP-based Class-Incremental Learning Toolbox. Have a try!
    • [2025-08]🌟 Add TUNA. State-of-the-art method of 2025!
    • [2025-07]🌟 Check out our latest work on class-incremental learning with CLIP (ICCV 2025)!
    • [2025-07]🌟 Check out our latest work on pre-trained model-based class-incremental learning (ICCV 2025)!
    • [2025-07]🌟 Check out our latest work on domain-incremental learning with PTM (ICML 2025)!
    • [2025-03]🌟 Add DUCT. State-of-the-art method of 2025!
    • [2025-03]🌟 Check out our latest work on class-incremental learning (CVPR 2025)!
    • [2025-02]🌟 Check out our latest work on pre-trained model-based domain-incremental learning (CVPR 2025)!
    • [2025-02]🌟 Check out our latest work on class-incremental learning with vision-language models (TPAMI 2025)!
    • [2025-01]🌟 PILOT is accepted to SCIS!
    • [2024-12]🌟 Add MOS. State-of-the-art method of 2025!
    • [2024-12]🌟 Check out our latest work on pre-trained model-based class-incremental learning (AAAI 2025)!
    • [2024-08]🌟 Check out our latest work on pre-trained model-based class-incremental learning (IJCV 2024)!
    • [2024-07]🌟 Check out our rigorous and unified survey about class-incremental learning, which introduces some memory-agnostic measures with holistic evaluations from multiple aspects (TPAMI 2024)!
    • [2024-07]🌟 Check out our work about all-layer margin in class-incremental learning (ICML 2024)!
    • [2024-04]🌟 Check out our latest survey on pre-trained model-based continual learning (IJCAI 2024)!
    • [2024-03]🌟 Add EASE. State-of-the-art method of 2024!
    • [2024-03]🌟 Check out our latest work on pre-trained model-based class-incremental learning (CVPR 2024)!
    • [2023-12]🌟 Add RanPAC.
    • [2023-09]🌟 Initial version of PILOT is released.
    • [2023-01]🌟 As team members are committed to other projects and in light of the intense demands of code reviews, we will prioritize reviewing algorithms that have explicitly cited and implemented methods from our toolbox paper in their publications. Please read the PR policy before submitting your code.

    🌟 Methods Reproduced

    • FineTune: Baseline method which simply updates parameters on new tasks.
    • iCaRL: iCaRL: Incremental Classifier and Representation Learning. CVPR 2017 [paper]
    • Coil: Co-Transport for Class-Incremental Learning. ACMMM 2021 [paper]
    • DER: DER: Dynamically Expandable Representation for Class Incremental Learning. CVPR 2021 [paper]
    • FOSTER: Feature Boosting and Compression for Class-incremental Learning. ECCV 2022 [paper]
    • MEMO: A Model or 603 Exemplars: Towards Memory-Efficient Class-Incremental Learning. ICLR 2023 Spotlight [paper]
    • L2P: Learning to Prompt for Continual Learning. CVPR 2022 [paper]
    • DualPrompt: DualPrompt: Complementary Prompting for Rehearsal-free Continual Learning. ECCV 2022 [paper]
    • CODA-Prompt: CODA-Prompt: COntinual Decomposed Attention-based Prompting for Rehearsal-Free Continual Learning. CVPR 2023 [paper]
    • RanPAC: RanPAC: Random Projections and Pre-trained Models for Continual Learning. NeurIPS 2023 [paper]
    • LAE: A Unified Continual Learning Framework with General Parameter-Efficient Tuning. ICCV 2023 [paper]
    • SLCA: SLCA: Slow Learner with Classifier Alignment for Continual Learning on a Pre-trained Model. ICCV 2023 [paper]
    • FeCAM: FeCAM:Exploiting the Heterogeneity of Class Distributions in Exemplar-Free Continual Learning. NeurIPS 2023 [paper]
    • DGR: Gradient Reweighting: Towards Imbalanced Class-Incremental Learning. CVPR 2024 [paper]
    • Ease: Expandable Subspace Ensemble for Pre-Trained Model-Based Class-Incremental Learning. CVPR 2024 [paper]
    • CoFiMA: Weighted Ensemble Models Are Strong Continual Learners. ECCV 2024 [paper]
    • SimpleCIL: Revisiting Class-Incremental Learning with Pre-Trained Models: Generalizability and Adaptivity are All You Need. IJCV 2024 [paper]
    • Aper: Revisiting Class-Incremental Learning with Pre-Trained Models: Generalizability and Adaptivity are All You Need. IJCV 2024 [paper]
    • MOS: Model Surgery for Pre-Trained Model-Based Class-Incremental Learning. AAAI 2025 [paper]
    • DUCT: Dual Consolidation for Pre-Trained Model-Based Domain-Incremental Learning. CVPR 2025 [paper]
    • TUNA: Integrating Task-Specific and Universal Adapters for Pre-Trained Model-based Class-Incremental Learning. ICCV 2025 [paper]

    📝 Reproduced Results

    CIFAR-100
    ImageNet-R

    For exemplar parameters, Coil, DER, iCaRL, MEMO, and FOSTER set the fixed_memory option to false and retain the memory_size of 2000 for CIFAR100, while setting fixed_memory option to true and retaining the memory_per_class of 20 for ImageNet-R. On the contrary, other models are exemplar-free.

    ☄️ how to use

    🕹️ Clone

    Clone this GitHub repository:

    git clone https://github.com/sun-hailong/LAMDA-PILOT
    cd LAMDA-PILOT
    

    🗂️ Dependencies

    1. torch 2.0.1
    2. torchvision 0.15.2
    3. timm 0.6.12
    4. tqdm
    5. numpy
    6. scipy
    7. easydict

    🔑 Run experiment

    1. Edit the [MODEL NAME].json file for global settings and hyperparameters.

    2. Run:

      python main.py --config=./exps/[MODEL NAME].json
      
    3. hyper-parameters

      When using PILOT, you can edit the global parameters and algorithm-specific hyper-parameter in the corresponding json file.

      These parameters include:

      • model_name: The model's name should be selected from the 11 methods listed above, i.e., finetune, icarl, coil, der, foster, memo, simplecil, l2p, dualprompt, coda-prompt and adam.
      • init_cls: The number of classes in the initial incremental stage. As the configuration of CIL includes different settings with varying class numbers at the outset, our framework accommodates diverse options for defining the initial stage.
      • increment: The number of classes in each incremental stage $i$, $i$ > 1. By default, the number of classes is equal across all incremental stages.
      • backbone_type: The backbone network of the incremental model. It can be selected from a variety of pre-trained models available in the Timm library, such as ViT-B/16-IN1K and ViT-B/16-IN21K. Both are pre-trained on ImageNet21K, while the former is additionally fine-tuned on ImageNet1K.
      • seed: The random seed is utilized for shuffling the class order. It is set to 1993 by default, following the benchmark setting iCaRL.
      • fixed_memory: a Boolean parameter. When set to true, the model will maintain a fixed amount of memory per class. Alternatively, when set to false, the model will preserve dynamic memory allocation per class.
      • memory_size: The total number of exemplars in the incremental learning process. If fixed_memory is set to false, assuming there are $K$ classes at the current stage, the model will preserve $\left[\frac{{memory-size}}{K}\right]$ exemplars for each class. L2P, DualPrompt, SimpleCIL, ADAM, and CODA-Prompt do not require exemplars. Therefore, parameters related to the exemplar are not utilized.
      • memory_per_class: If fixed memory is set to true, the model will preserve a fixed number of memory_per_class exemplars for each class.

    🔎 Datasets

    We have implemented the pre-processing 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
    • ImageNet-A: Google Drive: link or Onedrive: link
    • OmniBenchmark: Google Drive: link or Onedrive: link
    • VTAB: Google Drive: link or Onedrive: link
    • ObjectNet: Onedrive: link You can also refer to the filelist if the file is too large to download.

    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.

    When training not on CIFAR100, you should specify the folder of your dataset in utils/data.py.

        def download_data(self):
            assert 0,"You should specify the folder of your dataset"
            train_dir = '[DATA-PATH]/train/'
            test_dir = '[DATA-PATH]/val/'
    

    👨‍🏫 Acknowledgments

    We thank the following repos providing helpful components/functions in our work.

    🤗 Contact

    If there are any questions, please feel free to propose new features by opening an issue or contact with the author: Hai-Long Sun([email protected]) and Da-Wei Zhou([email protected]). Enjoy the code.

    🚀 Star History

    Star History Chart