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).
- 2026/05 — Bi-CoG is accepted at IJCAI 2026 (Main Track) 🎉.
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.0Please follow PromptSRC's DATASETS.md for detailed download links and instructions.
Before running, update the DATA variable in the scripts to point to your dataset root directory.
# 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| 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 |
This codebase is built upon PromptSRC and Dassl.pytorch. We thank the authors for releasing their code.
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}
}