Home

Awesome

Weakly supervised discriminative feature learning with state information for person identification

<img src="img/intro.png" width="400"/>

This repo contains the source code for our CVPR'20 work Weakly supervised discriminative feature learning with state information for person identification (paper. Our implementation is based on Pytorch. In the following is an instruction to use the code to train and evaluate our model.

Prerequisites

  1. Pytorch 1.0.0
  2. Python 3.6+
  3. Python packages: numpy, scipy, pyyaml/yaml, h5py

Data and pretrained weights

Please download the Market/Duke/Multi-PIE/CFP dataset as well as the pretrained ResNet50 weights from BaiduPan with password "tih8". Put all of them (datasets and pretrained weights) into /data/ (please create a folder /data in the root directory).

Run the code

Please enter the main folder, and run

python src/main.py --gpu 0,1,2,3 --save_path runs/market

on Market dataset, where "0,1,2,3" specifies your gpu IDs. If you are using gpus with 12G memory, you need 4 gpus to run in the default setting (batchsize=384). Note that small batch size is NOT recommended as it increases the variance in estimating in-batch feature distributions. If you have to set a small batch size, please lower the learning rate as the gradient would be stronger for a smaller batch size. Please also note that since I load the whole datasets into cpu memory and parallelize computation, you need at least 12G RAM memory for Market. Hence I recommend you run it on a server.

For Duke dataset, run

python src/main.py --gpu 0,1,2,3 --save_path runs/duke

For Multi-PIE:

python src/main_mpie.py --gpu 0,1,2,3 --save_path runs/mpie

For CFP:

python src/main_cfp.py --gpu 0,1,2,3 --save_path runs/cfp

Main results

We find our method can achieve performances that are comparable to standard supervised fine-tuning performances on Duke, MultiPIE and CFP datasets.

Duke

MethodRank-1Rank-5MAP
Supervised fine-tune75.085.057.2
Pretrained43.159.228.8
Ours72.183.553.8

Market

MethodRank-1Rank-5MAP
Supervised fine-tune85.995.266.8
Pretrained46.264.424.6
Ours74.087.447.9

Multi-PIE

Methodavg15°30°45°60°
Supervised fine-tune98.299.799.498.898.195.7
Pretrained88.798.597.593.789.771.2
Ours97.199.198.998.396.893.1

CFP

MethodAccuracyEER (lower better)AUC
Supervised fine-tune95.54.798.8
Pretrained92.97.497.8
Ours95.54.798.8

Trained models

Trained models can be found here. Note that I just trained these models so they are slightly different (maybe higher/lower within 1% than reported numbers) from the models used to report results in the paper. If you used the code and found the obtained numbers a bit different from the paper, it is expected because the performance of unsupervised deep learning can fluctuate sometimes.

To evaluate the trained models, simply modify the pretrain_path in runs/dataset/args.yaml, as well as setting epoch to 0.

Reference

If you find our work helpful in your research, please kindly cite our paper:

Hong-Xing Yu and Wei-Shi Zheng, "Weakly supervised discriminative feature learning with state information for person identification", In CVPR, 2020.

bib:

@inproceedings{yu2020weakly,
  title={Weakly supervised discriminative feature learning with state information for person identification},
  author={Yu, Hong-Xing and Zheng, Wei-Shi},
  year={2020},
  booktitle={IEEE International Conference on Computer Vision and Pattern Recognition (CVPR)},
}

Contact

If you find any problem or question please kindly let me know by opening an issue or emailing me at xKoven@gmail.com