In this project, we try to boost the performance of person re-identification (person ReID) task using all kinds of existing techniques. In Bag of Tricks and A Strong Baseline for Deep Person Re-identification, Luo et al. apply several training tricks on ID Embedding (IDE) network which is a well-known basic baseline in person ReID task including Random Erasing, Warmup Learning Rate, Last Stride, BNNeck. Similar to what has been done by Luo, we want to explore the effect of these tricks on Multiple Granularities Network (MGN), a state-of-the-art network that leverages discriminative information with multiple granularities.
In addition to training tricks, we also explore the possibilities of using generative model to augment training data that can aid the training of person ReID model. We use DG-Net, a joint learning framework which learns generative and discriminative model end-to-end. The author, Zheng el at., claims that the generative model in DG-Net is superior than other alternatives such as PN-GAN, FD-GAN and so on.
We can observe that applying data augmentation using generative model will lower the performance, which might be the cause of noise in the generated sample. MGN divides input image to various granularities to help discover finer discriminative features. When using the image generated by DG-Net, the noise might influence the network more.
Using Label Smoothing, Center Loss, Random Erasing can help the model learn better. Random Erasing mimic the object occlusion in real-world scenario. Center Loss makes up the draw back of triplet loss by learning a center and penalizing the distances between features of each class. Label Smoothing can help fight against over-fitting the training identifications. This is especially important in the person ReID task because training identification may not appear in the testing identification.
The best result is when we apply all three training tricks but without data augmentation and with re-ranking. We achieve a small improvement over the original MGN model and DG-Net model.
- Python 3.6
- GPU memory >= 10G (fp16/fp32)
- NumPy
- PyTorch 1.0+
- Prepare dataset
python prepare-market.py - Download teacher model from DG-Net
- Train
python train.py --config configs/latest.yml
Please view the instruction Here
Codes are taken from GNAYUOHZ / ReID-MGN and NVlabs / DG-Net with some modification. Tricks' code including Random Erasing, Label Smoothing and Center Loss are referencing michuanhaohao / reid-strong-baseline. KaiyangZhou / deep-person-reid is also one of the reference we use.
