[ICCV2025]LGSP-Prompt: Revisiting Pool-based Prompt Learning for Few-shot Class-incremental Learning
Authors: Yongwei Jiang, Yixiong Zou*, Yuhua Li, Ruixuan Li
Affiliation: School of Computer Science and Technology, Huazhong University of Science and Technology
2025.09.28π Code and implementation released2025.06.26π Our paper is accepted at ICCV 2025!
TLDR: We present the first study of pool-based prompt learning in FSCIL settings, revealing token-dimension saturation issues when applying L2P to few-shot scenarios, and propose LGSP-Prompt that innovatively shifts from token dimension to spatial dimension for superior performance.
- Python >= 3.8
- PyTorch >= 1.12.0
- timm >= 0.6.7
- Vision Transformer backbone
# Clone the repository
git clone https://github.com/Jywsuperman/LGSP.git
cd LGSP
# Create conda environment
conda create -n lgsp python=3.9 -y
conda activate lgsp
# Install PyTorch (match your CUDA version)
pip install torch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 --index-url https://download.pytorch.org/whl/cu116
# Install all dependencies
pip install -r requirements.txt| Dataset | Domain | Images | Base Classes | Novel Classes | Download |
|---|---|---|---|---|---|
| CUB-200 | Birds | 11,788 | 100 | 100 (10 sessions, 10 classes each) | GDrive / Baidu Pan |
| iNF200 | Fungi | 10,000 | 100 | 100 (10 sessions, 10 classes each) | GDrive / Baidu Pan |
| FGVC-Aircraft | Aircraft | 10,000 | 50 | 50 (10 sessions, 5 classes each) | GDrive / Baidu Pan |
Note: Novel classes are divided into sessions for incremental few-shot learning
your_workspace/
βββ π΅ LGSP/ # This repository (contains session splits)
β βββ data/
β β βββ index_list/ # Session split files
β βββ models/
β βββ utils_data/
β βββ train.py
β
βββ π data/ # Dataset folder (same level as LGSP)
β
βββ π’ CUB_200_2011/ # Bird species dataset
β βββ attributes/
β βββ images/
β βββ classes.txt
β βββ ...
β
βββ π‘ fgvc-aircraft-2013b/ # Aircraft dataset
β βββ data/
β β βββ images/
β β βββ variants.txt
β βββ ...
β
βββ π£ iNF200/ # Natural image dataset
βββ train_mini/
β βββ [class folders]
βββ val/
βββ [class folders]Run the training script with pre-configured parameters:
cd run_script
python vit_run_pretrain.pyModify parameters in run_script/vit_run_pretrain.py:
# Dataset selection (uncomment one)
dataset = 'cub200'
# dataset = 'FGVCAircraft'
# dataset = 'iNF200'
# Training parameters
epochs_bases = [80] # Base session epochs
epochs_new = 5 # Novel session epochs
gpu_num = 1 # GPU ID
# Learning rates
lr_base = 0.01 # Base classifier LR
lr_new = 0.06 # Novel classifier LR
lr_PromptTokens_base = 0.02 # Base prompt tokens LR
lr_PromptTokens_novel = 0.003 # Novel prompt tokens LR
# Data directory
data_dir = '/path/to/your_workspace/data' # Update this pathYou can also run training directly:
# FGVCAircraft FSCIL
python train.py \
-project base \
-dataset FGVCAircraft \
-base_mode ft_dot \
-new_mode avg_cos \
-lr_base 0.01 \
-lr_new 0.06 \
-epochs_base 80 \
-epochs_new 5 \
-gpu 0 \
-vit \
-dataroot /path/to/your_workspace/dataNote: For different datasets, simply change the dataset variable in the configuration file.
If you find our work useful for your research, please cite:
@inproceedings{jiang2025revisiting,
title={Revisiting pool-based prompt learning for few-shot class-incremental learning},
author={Jiang, Yongwei and Zou, Yixiong and Li, Yuhua and Li, Ruixuan},
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
pages={1303--1313},
year={2025}
}We thank the authors of the following works that inspired our research:
- L2P for pioneering prompt pool learning
- VPT for visual prompt tuning foundation
- PriViLege for FSCIL baselines
This project is licensed under the MIT License - see the LICENSE file for details.
- Yongwei Jiang: jiangyongwei@hust.edu.cn
- GitHub Issues: Create an issue
π Star this repo if you find it helpful! π
"From token saturation to spatial innovation - rethinking prompt learning for FSCIL"