Source-linked AI summary
FastReID: A Pytorch Toolbox for General Instance Re-identification
Lingxiao He, Xingyu Liao, Wu Liu, Xinchen Liu, Peng Cheng, Tao Mei
TL;DR
General instance re-identification needs reproducible, extensible software that can bridge research and production. FastReID provides a modular toolkit, deployment-oriented components, and pretrained systems across multiple re-identification tasks. It reports strong results for person, cross-domain, and partial person re-identification on benchmark datasets.
Problem
Limited extensibility and reusable modification hinder reproducibility, while the research–production gap makes re-identification techniques difficult to transfer into production.
Method
FastReID is a unified, modular re-identification library with configurable components, knowledge distillation, deployment conversion tools, and pretrained models across multiple tasks.
Results
FastReID achieves 96.3% rank-1 and 90.3% mAP on Market1501, 92.4% rank-1 and 83.2% mAP on DukeMTMC, and 85.1% rank-1 and 65.4% mAP on MSMT17.
Takeaways & Limitations
FastReID provides a reusable platform with strong baselines and reported effectiveness across person, cross-domain, and partial person re-identification tasks.
Abstract
from arXiv · showhide
General Instance Re-identification is a very important task in the computer vision, which can be widely used in many practical applications, such as person/vehicle re-identification, face recognition, wildlife protection, commodity tracing, and snapshop, etc.. To meet the increasing application demand for general instance re-identification, we present FastReID as a widely used software system in JD AI Research. In FastReID, highly modular and extensible design makes it easy for the researcher to achieve new research ideas. Friendly manageable system configuration and engineering deployment functions allow practitioners to quickly deploy models into productions. We have implemented some state-of-the-art projects, including person re-id, partial re-id, cross-domain re-id and vehicle re-id, and plan to release these pre-trained models on multiple benchmark datasets. FastReID is by far the most general and high-performance toolbox that supports single and multiple GPU servers, you can reproduce our project results very easily and are very welcome to use it, the code and models are available at https://github.com/JDAI-CV/fast-reid.
1. Introduction
General instance re-identification supports applications involving people, vehicles, faces, and objects, but limited extensibility and the research–production gap hinder reproducibility and deployment. FastReID addresses these needs with a unified, modular library and pretrained models across multiple re-identification tasks.
- General instance re-identification finds people, vehicles, faces, or other objects of interest across large video collections.The paper connects this capability to applications including video search, missing-child searches, surveillance, e-commerce, commodity tracing, and wildlife protection.
- Limited extensibility and reusable modification in open-source code make reproducing research results difficult.
- The gap between academic research and practical applications makes transferring techniques into production difficult.
- FastReID provides a unified, modular, extensible library that lets users plug in custom modules without repeatedly rewriting the codebase.Its manageable configuration also supports extension to general image retrieval and face recognition.
- FastReID provides pretrained models for person, cross-domain person, partial person, and vehicle re-identification, with additional models planned.
2. Highlight of FastReID
FastReID combines a complete re-identification workflow with modular extensibility, richer evaluation, deployment support, and pretrained models spanning several tasks.
- FastReID provides a complete toolkit for training, evaluation, finetuning, and model deployment.
- Modular and extensible design: Its modular design lets users plug custom-designed modules into almost any part of the re-identification system.
- Richer evaluation system: FastReID provides ROC and mINP alongside CMC to better reflect model performance for practical deployment scenarios.
- Engineering deployment: Knowledge distillation targets more precise and efficient lightweight models for edge hardware and AI chips.The paper identifies time-consuming inference and unrealizable layers as deployment challenges for overly deep models.
- State-of-the-art pre-trained models: FastReID provides state-of-the-art inference models for person, partial-person, cross-domain, and vehicle re-identification.The library is described as extensible to general object retrieval and face recognition, with pretrained models planned for release.
3. Architecture of FastReID
FastReID organizes its architecture as preprocessing, backbone, aggregation, and head modules. These components transform images into feature representations and classification outputs while supporting multiple design choices.
- The FastReID pipeline consists of image preprocessing, backbone, aggregation, and head modules.
- Image pre-processing: Preprocessing resizes images, batches them, and applies augmentations such as flipping, random erasing, random patch, Cutout, and auto-augmentation.These methods diversify training images and are described as reducing overfitting risk and improving robustness to occlusion.
- Backbone: FastReID supports ResNet, ResNeXt, and ResNeSt backbones, with non-local and IBN modules for more robust feature learning.
- Aggregation: Aggregation converts backbone feature maps into a global feature using max, average, GeM, or attention pooling.The pooling layer maps X ∈ R^W×H×C to f ∈ R^1×1×C; attention pooling uses a control coefficient and softmax attention weights.
- Head: FastReID implements linear, batch-normalization, and reduction heads to process aggregated global vectors and produce classification outputs.The reduction head includes convolution, batch normalization, ReLU, dropout, dimensionality reduction, and a decision layer.
4. Training
FastReID implements several losses and training strategies for learning discriminative re-identification embeddings. Its training uses normalized classification objectives, metric-learning losses, learning-rate scheduling, and initial backbone freezing.
- Loss Functions: FastReID implements cross-entropy, label smoothing, ArcFace, circle loss, and triplet loss for re-identification training.These objectives address classification confidence, angular separation, and distances between positive and negative examples.
- Loss Functions: ArcFace applies l2 normalization and an additive angular margin to improve intra-class compactness and inter-class discrepancy.The normalized logits use an angular formulation with margin m.
- Loss Functions: Triplet loss enforces a margin so each anchor is closer to same-person images than to images of other persons.The distance function compares anchor-positive and anchor-negative pairs with margin m.
- Training Strategy: Training begins with a small learning rate of 3.5×10^-5, increases during the first 2k iterations, remains at 3.5−4 through 9k, then decays to 7.7 × 10^-7 by 18k.The schedule also includes warm-up and freezing strategies.
- Training Strategy: Backbone freezing initially trains only the randomly initialized classifier while keeping the pretrained network parameters fixed.This is used when fine-tuning an ImageNet-pretrained classification network for re-identification.
5. Testing
FastReID supports global and local distance computation, retrieval re-ranking, and expanded evaluation metrics. Its testing tools include Euclidean and cosine measures, deep spatial reconstruction, query expansion, and result rank lists.
- Distance Metric: FastReID implements Euclidean and cosine distances alongside deep spatial reconstruction for local feature matching.Deep spatial reconstruction compares spatial features from query and gallery images and aggregates their matching scores.
- Distance Metric: Deep spatial reconstruction constructs spatial feature matrices for query and gallery images and matches each query location to its most similar gallery feature.The query and gallery matrices contain features from wx × hx and wy × hy spatial locations, respectively.
- Post-processing: FastReID provides K-reciprocal coding and Query Expansion as re-ranking methods.Query Expansion averages a query feature with verified similar gallery features before retrieval.
- Evaluation: Testing uses CMC and mAP, supplemented by ROC curves and mINP for performance evaluation.The additional metrics are intended for broader assessment than a single retrieval index.
- Evaluation: FastReID includes a rank-list tool for inspecting retrieval results and identifying unresolved algorithmic problems.
6. Deployment
FastReID addresses deployment constraints by distilling deeper teacher models into lightweight student models and providing model-conversion tools. The paper also reports benchmark comparisons for its re-identification system.
- Deployment Motivation: Knowledge distillation targets a high-precision, high-efficiency lightweight model because deeper models are harder to deploy on edge hardware and AI chips.The stated deployment issues are time-consuming inference and layers that are difficult to implement on AI chips.
- Knowledge Distillation: The distillation module trains a shallow student against a deeper teacher using logits, feature-space transfer, and re-identification loss.The teacher backbone is frozen, while the student produces logits and features for optimization.
- Evaluation: Table 1 compares performance on the Market1501, DukeMTMC, and MSMT17 datasets.
- Knowledge Distillation: After distillation, the student feature fs is used for inference.
- Engineering Deployment: FastReID provides conversion tools from PyTorch to Caffe and TensorRT for model deployment.
7. Projects
FastReID is evaluated across person, cross-domain, partial-person, and vehicle re-identification projects, with strong reported results on multiple benchmark datasets.
- Person Re-identification: FastReID achieves 96.3% rank-1 and 90.3% mAP on Market1501, 92.4% and 83.2% on DukeMTMC, and 85.1% and 65.4% on MSMT17.These results use an IBN-ResNet101 backbone with a Non-local module, gem pooling, bnneck, circle loss, and triplet loss.
- Cross-domain Person Re-identification: FastReID-MLT uses mixture label transport and multi-granularity pseudo-labeling for unsupervised cross-domain person re-identification.It trains on a labeled source domain and fine-tunes on pseudo labels from the target domain.
- Cross-domain Person Re-identification: 92.7% rank-1 and 80.5% mAP under D→M, and 82.7% and 69.2% under M→D, are reported for FastReID-MLT.The reported results are described as close to supervised learning results.
- Partial Person Re-identification: FastReID-DSR addresses partial person re-identification, where only several partial observations of people are available for matching.The framework is evaluated on PartialREID, OccludedREID, and PartialiLIDS.
- Partial Person Re-identification: 82.7%/76.8%, 81.6%/70.9%, and 73.1%/79.8% rank-1/mAP results are reported on PartialREID, OccludedREID, and PartialiLIDS, respectively.The values are reported as rank-1/mAP metrics for FastReID-DSR.
- Vehicle Re-identification: FastReID achieves the best performance on the VeRi, VehicleID, and VERI-Wild vehicle re-identification datasets.The comparisons use state-of-the-art algorithms published during 2015–2019.
8. Conclusion
The paper introduces FastReID as an open-source library for general instance re-identification. Experiments demonstrate versatility and effectiveness across person and vehicle re-identification tasks, with the release intended to accelerate community progress.
- FastReID is introduced as an open-source library for general instance re-identification.
- Experimental results demonstrate FastReID’s versatility and effectiveness on multiple tasks, including person and vehicle re-identification.
- FastReID is shared because open-source research platforms are described as critical to rapid advances in AI by researchers and practitioners.
- The conclusion expresses an intention for FastReID’s release to continue accelerating progress in general instance re-identification.