Taha Mustapha Nehdi,
Nairouz Mrabah,
Atif Belal,
Marco Pedersoli,
Eric Granger ,
École de technologie supérieure (ÉTS)
📧 Primary Contact: taha-mustapha.nehdi.1@ens.etsmtl.ca
TL; DR. We propose SAGE-reID, a source-free multi-source domain adaptation framework for person re-identification based on gated LoRA experts. It first learns lightweight source-specific LoRA adapters without accessing source data during adaptation, then uses a small gating network to dynamically merge these experts while keeping the backbone fixed, achieving state-of-the-art accuracy with <2% extra parameters on Market-1501, DukeMTMC-reID, and MSMT17.
-
2025.10.06: Our paper is accepted by WACV 2026 🎉 🎉. The revised paper and a more efficient codebase will be released in December. Almost there 🤓 ~
-
2025.08.09: The first version of our paper is released at arXiv:2508.06831v1 📌.
Our codebase is built upon Python 3.12, PyTorch 2.5.0 (recommended).
conda create -n SAGE-reID python=3.12 # suggest to use virtual envs
conda activate SAGE-reID
# PyTorch:
# CUDA 12.4
pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu124
# Other dependencies:
pip install -t requirments.txt🔗 For all the datasets we used in our experiments, you can access them from the following public link:
./data
├── dukemtmc
│ └── DukeMTMC-reID
├── market1501
│ └── Market-1501-v15.09.15
├── msmt17
| └── MSMT17_V2
├── cuhk03
| └── images_detected
| └── images_labeled
| └── cuhk03_new_protocol_config_detected.mat
| └── cuhk03_new_protocol_config_labeled.mat
...
In this documentation, we will primarily focus on pre-training, adaptation, and Low-Rank Merging on msmt17 benchmarks as example feel free to try other benchmarks. All the configurations corresponding to our experiments are stored in the scripts folder. You can also customize the configuration files according to your own requirements.
💾 Similar to many methods in the literature, we use the ViT-B/16 (vit_base_patch16_224) model initialized with ImageNet-1k pre-trained weights. Various ViT model variants are also available in vit.py.
we will first pre-train ViT-B/16 on the corresponding dataset (source dataset) to serve as the initialization for subsequent domain adaptation step.
For example, you can pre-train a ViT-B/16 model on market1501 as follows:
sh scripts/pre_train/pre_market1501.shIn this step, we perform source-to-target domain adaptation using deep clustering in a source-free setting, relying only on initializing our model with source pre-trained weights.
For example, you can adapt from market1501 to msmt17 as follows:
sh scripts/adaptation/adapt_market1501_to_msmt17.shOnce the low-rank experts from Market1501, DukeMTMC-reID, and CUHK03 have been adapted to MSMT17 and the adapted experts have been saved, we proceed in this step to merge them.
sh scripts/merging/adapt_market1501_cuhk03_dukemtmc_to_msmt17.shUsing this script, you can achieve 44.1 mAP & 69.8 R1 on msmt17 test set. There is a relatively high instability (~ 0.8)
This project is built upon UDAStrongBaseline, LoRA .
If you think this project is helpful, please feel free to leave a ⭐ and cite our paper:
@article{nehdi2025low,
title={Low-Rank Expert Merging for Multi-Source Domain Adaptation in Person Re-Identification},
author={Nehdi, Taha Mustapha and Mrabah, Nairouz and Belal, Atif and Pedersoli, Marco and Granger, Eric},
journal={arXiv preprint arXiv:2508.06831},
year={2025}
}