Advanced feature extraction methods have significantly contributed to enhancing the task of person re-identification (Re-ID). In addition, modifications to objective functions have been developed to further improve performance. Nonetheless, selecting better class representatives is an underexplored area of research that can also lead to advancements in Re-ID performance.
This repository provides source code for our paper titled "Person Re-Identification via Generalized Class Prototypes." To address the Re-ID problem, we propose a generalized selection method that involves choosing representations that are not limited to class centroids. Our approach strikes a balance between accuracy and mean average precision, leading to improvements beyond the state of the art. For example, the actual number of representations per class can be adjusted to meet specific application requirements. We apply our methodology on top of multiple Re-ID embeddings, and in all cases it substantially improves upon contemporary results.
If you find this project useful, then please consider citing our paper.
@article{muzaddid2025person,
title={Person Re-Identification via Generalized Class Prototypes},
author={Muzaddid, Md Ahmed Al and Beksi, William J},
journal={arXiv preprint arXiv:2510.17043},
year={2025}
}
First, begin by cloning the project
$ git clone https://github.com/robotic-vision-lab/Person-Re-Identification-Via-Generalized-Class-Prototypes.git
$ cd Person-Re-Identification-Via-Generalized-Class-Prototypes
Next, install PyTorch
$ pip install torch torchvision torchaudio
Proceed by downloading the feature-extraction model from https://github.com/damo-cv/TransReID and exporting the image features by following the author's instructions. You will need two sets of extracted features: one for the gallery images (gal_feature), and the other for the gallery and query images (query_gal_feature).
To train a model, execute
$ python src/main.py train {feature_base_directory} {gal_feature file name} {query_gal_feature file name}
The trained model can be tested by running
$ python src/main.py test {feature_base_directory} {query_gal_feature file name} {trained_model path}

