MCPcopy Index your code
hub / github.com/DawnLIU35/FSCIL-ASP

github.com/DawnLIU35/FSCIL-ASP @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
142 symbols 364 edges 13 files 4 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FSCIL-ASP Official Implementation

This codebase contains the official Python implementation of Few-shot Class Incremental Learning with Attention-Aware Self-Adaptive Prompt (ECCV2024)

Introduction

ASP is a novel few-shot class incremental learning (FSCIL) algorithm which utilizes prompt tuning with a Vision Transformer backbone. ASP encourages task-invariant prompts to capture shared knowledge by reducing specific information from the attention aspect. Additionally, self-adaptive task-specific prompts in ASP provide specific information and transfer knowledge from old classes to new classes with an Information Bottleneck learning objective.

Performance

ASP consistently outperforms traditional FSCIL works using ResNet, multi-modal FSCIL works using CLIP, and prompt-based CIL works using ViT.

Instructions on running ASP

Environment setup

Clone this GitHub repository and run:

pip install -r requirements.txt

Dataset preparation

Download the dataset and put them in folder ./data * CIFAR100: will be automatically downloaded by the code. * CUB200: Google Drive: link * ImageNet-R: Google Drive: link

Run experiment

Experiment on CIFAR100 dataset:

python main.py --config=./exps/cifar.json

Experiment on CUB200 dataset:

python main.py --config=./exps/cub.json

Experiment on ImageNet-R dataset:

python main.py --config=./exps/inr.json

Citation

@article{liu2024few,
  title={Few-Shot Class Incremental Learning with Attention-Aware Self-Adaptive Prompt},
  author={Liu, Chenxi and Wang, Zhenyi and Xiong, Tianyi and Chen, Ruibo and Wu, Yihan and Guo, Junfeng and Huang, Heng},
  journal={arXiv preprint arXiv:2403.09857},
  year={2024}
}

Core symbols most depended-on inside this repo

split_images_labels
called by 16
utils/toolkit.py
build_transform
called by 14
utils/data.py
get_dataset
called by 11
utils/data_manager.py
_extract_vectors
called by 8
models/base.py
reduce_proxies
called by 4
backbone/linears.py
build_transform_coda_prompt
called by 4
utils/data.py
tensor2numpy
called by 4
utils/toolkit.py
_select
called by 3
utils/data_manager.py

Shape

Method 90
Function 28
Class 24

Languages

Python100%

Modules by API surface

utils/data.py27 symbols
backbone/asp_backbone.py24 symbols
models/base.py21 symbols
utils/data_manager.py20 symbols
models/asp.py12 symbols
backbone/linears.py12 symbols
utils/inc_net.py10 symbols
utils/toolkit.py6 symbols
trainer.py6 symbols
main.py3 symbols
utils/factory.py1 symbols

For agents

$ claude mcp add FSCIL-ASP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact