We provide the PyTorch implementation for Task Progressive Curriculum Learning: Approach for Robust Visual Question Answering (BMVC 2025).
- Python version: 3.12.0
- PyTorch version: 2.1.1
- dependencies in requirements.txt
- We train and evaluate all of the models based on one Nvidia H100 GPU using 48Gb of memory.
-
Clone this repository:
git clone cd TPCL -
Install PyTorch and other dependencies:
pip install -r requirements.txt
cd data
bash download.sh
python preprocess_features.py --input_tsv_folder xxx.tsv --output_h5 xxx.h5
python feature_preprocess.py --input_h5 xxx.h5 --output_path trainval
python create_dictionary.py --dataroot vqacp2/
python preprocess_text.py --dataroot vqacp2/ --version v2
cd ..
- Train LXMERT with Dynamic TPCL
CUDA_VISIBLE_DEVICES=0 python src/main_tpcl_dyn.py --mode lxmert --cl linguistic --dataset cpv2 --output 'output/' --img_root /vqacp2/coco/ --dataroot /vqacp2/
- Train LXMERT with Fixed TPCL
CUDA_VISIBLE_DEVICES=0 python src/main_tpcl_fixed.py --mode lxmert --cl linguistic --dataset cpv2 --output 'output/' --img_root /vqacp2/coco/ --dataroot /vqacp2/
- Train the LXMERT with TPCL with 30% of the original training set
CUDA_VISIBLE_DEVICES=0 python src/main_tpcl_dyn.py --ratio 0.3 --mode lxmert --cl linguistic --dataset cpv2 --output 'output/' --img_root /vqacp2/coco/ --dataroot /vqacp2/ --ratio 0.3
- A json file of results from the test set can be produced with:
CUDA_VISIBLE_DEVICES=0 python test.py --dataroot data/vqacp2/ --img_root data/coco/ --checkpoint_path saved_models_cp2/best_model.pth --output saved_models_cp2/result/
- Running: refer to
Download and preprocess the data,TrainingandEvaluationsteps inGetting Started.
If you found this code is useful, please cite our paper:
@inproceedings{Akl_2025_BMVC,
author = {Ahmed Akl and Abdelwahed Khamis and Zhe Wang and Ali Cheraghian and Sara Khalifa and Kewen Wang},
title = {Task Progressive Curriculum Learning for Robust Visual Question Answering},
booktitle = {36th British Machine Vision Conference 2025, {BMVC} 2025, Sheffield, UK, November 24-27, 2025},
publisher = {BMVA},
year = {2025},
url = {https://bmva-archive.org.uk/bmvc/2025/assets/papers/Paper_294/paper.pdf}
}
This repository contains code modified from D-VQA, thank you very much!
