Skip to content

Jywsuperman/LGSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

[ICCV2025]LGSP-Prompt: Revisiting Pool-based Prompt Learning for Few-shot Class-incremental Learning

ICCV 2025 arXiv GitHub Stars License

Authors: Yongwei Jiang, Yixiong Zou*, Yuhua Li, Ruixuan Li
Affiliation: School of Computer Science and Technology, Huazhong University of Science and Technology


πŸ”₯ News

  • 2025.09.28 πŸ“ Code and implementation released
  • 2025.06.26 πŸŽ‰ Our paper is accepted at ICCV 2025!

πŸ’‘ Highlights

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.

πŸ“¦ Installation

Prerequisites

  • Python >= 3.8
  • PyTorch >= 1.12.0
  • timm >= 0.6.7
  • Vision Transformer backbone

Quick Setup

# 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 Preparation

Datasets Overview

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

Directory Structure

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]

πŸš€ Quick Start

Training LGSP-Prompt

Run the training script with pre-configured parameters:

cd run_script
python vit_run_pretrain.py

Configuration

Modify 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 path

Manual Training (Alternative)

You 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/data

Note: For different datasets, simply change the dataset variable in the configuration file.

πŸ“œ Citation

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}
}

🀝 Acknowledgments

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“§ Contact


🌟 Star this repo if you find it helpful! 🌟

"From token saturation to spatial innovation - rethinking prompt learning for FSCIL"

About

ICCV2025

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages