Skip to content

LAMDA-NeSy/Bi-CoG

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bi-CoG: Bi-Consistency-Guided Self-Training for Vision-Language Models

arXiv Venue License: MIT

This repository contains the official code for the paper: Bi-CoG: Bi-Consistency-Guided Self-Training for Vision-Language Models, accepted at the 35th International Joint Conference on Artificial Intelligence (IJCAI 2026).

pipeline

📢 News

  • 2026/05 — Bi-CoG is accepted at IJCAI 2026 (Main Track) 🎉.

🔧 Installation

This code is built on top of PromptSRC and the Dassl.pytorch toolbox. Please use the Dassl.pytorch/ folder included in this repository (we have made modifications to support Bi-CoG).

Step 1: Setup Dassl environment

cd Dassl.pytorch/

# Create a conda environment
conda create -y -n dassl python=3.8
conda activate dassl

# Install PyTorch (>= 1.8.1) and torchvision
# Refer to https://pytorch.org/ for your CUDA version
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

# Install dependencies
pip install -r requirements.txt

# Install Dassl (no need to rebuild if source code is modified)
python setup.py develop

cd ..

Step 2: Install additional dependencies

pip install scikit-learn numpy matplotlib seaborn
pip install setuptools==59.5.0

📂 Dataset Preparation

Please follow PromptSRC's DATASETS.md for detailed download links and instructions.

🚀 How to Run

Before running, update the DATA variable in the scripts to point to your dataset root directory.

Base-to-Novel Generalization

# Training
bash scripts/bicog/base2novel_train.sh <DATASET> <CLASSIFIER> <SHOTS> <SEED> <GPU_ID>

# Testing on all classes
bash scripts/bicog/base2novel_test_all.sh <DATASET> <CLASSIFIER> <SHOTS> <SEED> <GPU_ID>

# Testing on base classes
bash scripts/bicog/base2novel_test_base.sh <DATASET> <CLASSIFIER> <SHOTS> <SEED> <GPU_ID>

# Testing on novel classes
bash scripts/bicog/base2novel_test_new.sh <DATASET> <CLASSIFIER> <SHOTS> <SEED> <GPU_ID>

Example: Train and evaluate Bi-CoG with CoOp on Caltech101 using 16 shots:

# Train
bash scripts/bicog/base2novel_train.sh caltech101 CoOp 16 1 0

# Test on novel classes
bash scripts/bicog/base2novel_test_new.sh caltech101 CoOp 16 1 0

Arguments

Argument Description
DATASET Config name of the dataset (e.g., caltech101, oxford_pets)
CLASSIFIER Base method to use: CoOp, MaPLe, PromptSRC
SHOTS Number of labeled shots per class
SEED Random seed
GPU_ID GPU device ID

🙏 Acknowledgements

This codebase is built upon PromptSRC and Dassl.pytorch. We thank the authors for releasing their code.

📖 Citation

If you find this work useful, please cite our paper:

@inproceedings{zhu2026bicog,
    title     = {Bi-CoG: Bi-Consistency-Guided Self-Training for Vision-Language Models},
    author    = {Rui Zhu and Song-Lin Lv and Zi-Kang Wang and Lan-Zhe Guo},
    booktitle = {Proceedings of the 35th International Joint Conference on Artificial Intelligence},
    year      = {2026}
}

About

[IJCAI 2026] Bi-CoG: Bi-Consistency-Guided Self-Training for Vision-Language Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 96.9%
  • Shell 3.1%