Skip to content
Transductive Zero-Shot Learning with Visual Structure Constraint, in NeurIPS 2019
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea 10.25 Oct 25, 2019
Tools 10.25 Oct 25, 2019
LOG 10.26 Oct 26, 2019

Transductive Zero-Shot Learning with Visual Structure Constraint

This is the offical implementation of our paper [Transductive Zero-Shot Learning with Visual Structure Constraint (NeurIPS 2019)] using PyTorch.


Python 3.6.3
Pytorch 0.4.1
CUDA 8.0.61
Scipy 1.2.1
Scikit-learn 0.20.3

All experiments are conducted on single TITAN XP.


  1. (Optional) Finetune the pretrained model on the training dataset. This is useful for fine-grained dataset such as CUB since ImageNet is a general dataset:

    python Tools/ --data_dir [root of dataset] --train_class_list [file of seen class name] --gpu_id [Your device information]
  2. Extract the features of each image

    python Tools/ --data_dir [root of dataset] --pretrain_model [ignore if you use ImageNet pretrain directly] --mode [SS|PS] --gpu_id [Your device information]
  3. Extract Visual Center

    python Tools/ --train_class_list [file of seen class name] --test_class_list [file of unseen class name] --data_dir [root of dataset] --feature_name [name of json file] --dataset_name [AwA|...] --mode [SS|PS]
  4. Cluster in target feature space

    python Cluster/ --test_class_list [file of unseen class name] --mode[SS|PS] --data_dir [root of dataset] --feature_name [name of json file] --cluster_method [Kmeans|Spectral] --center_num [unseen class num] --dataset_name [AwA|...]
  5. Train the model

    python --lamda [The coefficient of VSC term] --data_path [root of dataset] --method [VCL|CDVSc|BMVSc|WDVSc] --GPU [Your device information] --dataset [AwA1|AwA2|CUB|SUN|SUN10] --split_mode [standard_split|proposed_split] --train_center [VC of seen classes] --cluster_center [Approximated VC of unseen classes] --save_dir [save place]
  6. Test the results

    python --GPU [Your device information] --dataset [AwA|...] --split_mode [standard_split|proposed_split] --checkpoint_fn [The saving dir]


For CDVSc and BMVSc, please cross-validate the parameter according to the paper. For WDVSc, you could set lamda to 0.001 directly. There may exist some variance while performing cluster. To achieve similar results with original paper, we suggest to use our cluster results directly.


If you find our work is helpful for your research, please cite the following paper.

title={Transductive Zero-Shot Learning with Visual Structure Constraint},
author={Wan, Ziyu and Chen, Dongdong and Li, Yan and Yan, Xingguang and Zhang, Junge and Yu, Yizhou and Liao, Jing},
booktitle={Thirty-third Conference on Neural Information Processing Systems (NeurIPS)},


Some parts of the code are borrowed from DGP.


Feel free to contact me if there are any questions:

You can’t perform that action at this time.