Skip to content

The official PyTorch implementation of CVPR2025 paper "Language Guided Concept Bottleneck Models for Interpretable Continual Learning"

Notifications You must be signed in to change notification settings

FisherCats/CLG-CBM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language Guided Concept Bottleneck Models for Interpretable Continual Learning

arXiv

This repo is the official PyTorch implementation of CVPR2025 paper "Language Guided Concept Bottleneck Models for Interpretable Continual Learning".

We follow the framework of Pilot to implement this project.

framework

Environment Setup

conda create -n <env name> python=3.8.10 -y
conda activate <env name>
conda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.7 -c pytorch -c nvidia --no-deps
# other dependencies
pip install -r requirements.txt
pip install git+https://github.com/openai/CLIP.git

Dataset preparation

We evaluated our approch on 3 coarse-grained datasets: CIFAR-100, TinyImageNet, ImageNet100; and 4 fine-grained datasets: CUB-200, Flower102, Food101, Stanford-cars.

You should specify your data folder 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/'

or

def download_data(self):
    assert 0,"You should specify the folder of your dataset"
    root="/[DATA_PATH]/"
    ....

Concept preparation

We provide the concepts that are utilized in our experiments in data folder.

Model training

The configuration of hyper-parameters of our method is provided in exps folder. You can run an experiment follows:

python main.py --config=<config json path>

You can modify the configuration file directly to specialize the training process.

About

The official PyTorch implementation of CVPR2025 paper "Language Guided Concept Bottleneck Models for Interpretable Continual Learning"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages