GithubHelp home page GithubHelp logo

aliang-cn / ptl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zjulearning/ptl

0.0 0.0 0.0 18 KB

Progressive Transfer Learning for Person Re-identification published on IJCAI-2019

License: MIT License

Python 100.00%

ptl's Introduction

PTL: Progressive Transfer Learning for Person Re-identification

Introduction

PTL is a model fine-tuning method for deep neural networks. It provides an efficient solution for the model fine-tuning task, and can improve the performance of the pre-trained model on the target dataset significantly.

This project is the implementation of the Batch-related Convolutional Cell (BConv-Cell) and the MGN_PTL network of our IJCAI-2019 paper - Progressive Transfer Learning for Person Re-identification.

PTL method has been used by the CityBrain Group (Damo Academy, Alibaba Group) to help improve the model performance when using the pre-trained ReID models in a newly emerged scenario.

BConv-Cell

  • The key component of the MGN_PTL network is the BConv-Cell in bconv_cell.py
  • The BConv-Cell can integrate with most deep neural networks to improve the model performance when using mini-batch training.
  • This project only provides an example of its usage, feel free to explore.

Performance

Datasets

  • Market-1501

    Download using:

    wget http://188.138.127.15:81/Datasets/Market-1501-v15.09.15.zip <path/to/where/you/want>
    unzip <path/to/>/Market-1501-v15.09.15.zip
    
  • CUHK03

    1. Download cuhk03 dataset from here
    2. Unzip the file and you will get the cuhk03_release dir which include cuhk-03.mat
    3. Download "cuhk03_new_protocol_config_detected.mat" from here and put it with cuhk-03.mat. We need this new protocol to split the dataset.
    python utils/transform_cuhk03.py --src <path/to/cuhk03_release> --dst <path/to/save>
    

    NOTICE: You need to change num_classes in network depend on how many people in your train dataset! e.g. 751 in Market1501.

The data structure should look like:

data/
    bounding_box_train/
    bounding_box_test/
    query/

Compared person ReID methods

  • DML: Deep Mutual Learning
  • HA-CNN: Harmonious Attention Network for Person Re-identification
  • PCB: Beyond Part Models: Person Retrieval with Refined Part Pooling (and a Strong Convolutional Baseline)
  • PCB+RPP: Beyond Part Models: Person Retrieval with Refined Part Pooling (and a Strong Convolutional Baseline)
  • MGN: Learning Discriminative Features with Multiple Granularities for Person Re-Identification

Results

Method Market-1501 DukeMTMC-reID CUHK03(Detected) CUHK03(Labelled)
mAP CMC-1 mAP CMC-1 mAP CMC-1 mAP CMC-1
DML 70.51 89.34 - - - - - -
HA-CNN 75.70 91.20 63.80 80.50 38.60 41.70 41.00 44.40
PCB 77.30 92.40 65.30 81.90 54.20 61.30 - -
PCB+RPP 81.60 93.80 69.20 83.30 57.50 63.70 - -
MGN 86.90 95.70 78.40 88.70 66.00 66.80 67.40 68.00
MGN(reproduced) 85.80 94.60 77.07 87.70 69.41 71.64 72.96 74.07
MGN_PTL 87.34 94.83 79.16 89.36 74.22 76.14 77.31 79.79

NOTICE: The MGN(reproduced) is the reproduction of MGN. To our best knowledge, the official implementation of MGN has not released yet. Hence, the MGN_PTL network used the MGN(reproduced) as backbone network. The code for MGN(reproduced) is in mgn.py

RUN

Prerequisites

  • cudnn 7
  • CUDA 9
  • Pytorch v0.4.1
  • Python 2.7
  • torchvision
  • scipy
  • numpy
  • scikit_learn

GPU usage

We used one Tesla P100 GPU in our experiments

  • To run the MGN with batchid=4 and batchimage=4 cost 7819 MiB
  • To run the MGN_PTL with batchid=4 and batchimage=4 cost 8819 MiB

Weights

Pretrained weight download from TODO (Currently unavailable, the weight file will be released later)

Train

You can specify more parameters in opt.py

  • Train MGN_PTL
    CUDA_VISIBLE_DEVICES=0 python train_eval.py --arch mgn_ptl --mode train --usegpu --project_name 'temp_project' --data_path <path/to/Market-1501-v15.09.15> --lr 2e-4 --batchid 4 --epoch 450
    
  • Train MGN
    CUDA_VISIBLE_DEVICES=0 python train_eval.py --arch mgn --mode train --usegpu --project_name 'temp_project' --data_path <path/to/Market-1501-v15.09.15> --lr 2e-4 --batchid 4 --epoch 450
    

Evaluate

Use pretrained weight or your trained weight

  • Evaluate MGN_PTL
    CUDA_VISIBLE_DEVICES=0 python train_eval.py --arch mgn_ptl --mode evaluate --usegpu --weight <path/to/weight/weight_name.pt> --data_path <path/to/Market-1501-v15.09.15>
    
  • Evaluate MGN
    CUDA_VISIBLE_DEVICES=0 python train_eval.py --arch mgn --mode evaluate --usegpu --weight <path/to/weight/weight_name.pt> --data_path <path/to/Market-1501-v15.09.15>
    

Reference

Reference to cite when you use PTL in a research paper:

@inproceedings{ijcai2019-586,
  title     = {Progressive Transfer Learning for Person Re-identification},
  author    = {Yu, Zhengxu and Jin, Zhongming and Wei, Long and Guo, Jishun and Huang, Jianqiang and Cai, Deng and He, Xiaofei and Hua, Xian-Sheng},
  booktitle = {Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, {IJCAI-19}},
  publisher = {International Joint Conferences on Artificial Intelligence Organization},             
  pages     = {4220--4226},
  year      = {2019},
  month     = {7},
  doi       = {10.24963/ijcai.2019/586},
  url       = {https://doi.org/10.24963/ijcai.2019/586},
  }

License

PTL is MIT-licensed.

ptl's People

Contributors

zhengxuyu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.