Federated Re-ID
Federated Learning on Person Re-Identification
Abstract
This project covers my research experiments about Federated Learning on Person Re-Identification. Our primary goal is jointly optimizing performance on seen and unseen domains. One feature of this project is reproducing experimental results presented in Decentralised Person Re-Identification with Selective Knowledge Aggregation [1].
News
- Dec 6th, 2022. IBN-Net [2] is now available. The source code of IBN-Net for ReID is referenced from reid-strong-baseline.
Source Code
Usage
- Clone the source code by
git clone https://github.com/dogsc729/Federated-Learning-on-Re-ID.git
- Create two directories, checkpoint and datasets, under the cloned repositories by
mkdir checkpoint
and
mkdir datasets
-
You should have four datasets already, including
Market1501
,MSMT17
,DukeMTMC-reID
andCUHK03-np-detected
.Unzip the four datasets and place them in
datasets
, the structure should be:datasets |- /Market | |- /bounding_box_test | |- /bounding_box_train | |- /gt_bbox | |- /gt_query |- /MSMT17 | |- /bounding_box_test | |- /bounding_box_train |- /DukeMTMC-reID | |- /bounding_box_test | |- /bounding_box_train |- /cuhk03-np-detected |- /bounding_box_test |- /bounding_box_train
Note that the structure above including the naming should be exactly the same.
- Pre-process the datasets by running
python3 ./src/big_data_preprocess.py
- Start the training by
python3 ./src/federated_train.py
. In addition, you can change the settings by adding the arguments below.-
-s, --scenario
: You can change the training scenario by selectingska
for Selective Knowledge Aggregation orfed
for classic Federated Learning, The default value isska
. -
-l, --location
: You can change the location of the directory under/checkpoint/
. The log file, models, and record of training progress in .png file will be stored here. The default value is the time you start the training. -
-m, --model
: You can change the type of model by selectingattentive
for Attentive normalization ResNet50,vanilla
for vanilla ResNet50 oribn
for IBN-Net. The default value isattentive
. -
--global_iter
: The number of iteration of the global training stage. The default value is100
. -
--local_epoch
: The number of epoch trained on each client model. The default value is1
. -
lr_feature
: The learning rate of the feature extraction layers of the model. The default value is0.01
. -
lr_classifier
: The learning rate of the classifier layers of the model. The default value is0.1
.
For example, You can run
python3 ./src/federated_train.py -s fed -l federated_test -m vanilla --local_epoch 5
to set your experiment on classic Federated Learning scenario, checkpoint location at/checkpoint/federated_test
, using vanilla ResNet50 as your model and set the number of local epoch trained for each global round as5
. -
Reference
- [1] Shitong Sun, Guile Wu, Shaogang Gong. Decentralised Person Re-Identification with Selective Knowledge Aggregation. In BMVC, 2021.
- [2] Xingang Pan, Ping Luo, Jianping Shi, Xiaoou Tang. Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net, In ECCV, 2018.