Papers › In Defense of the Triplet Loss for Person Re-Identification

In Defense of the Triplet Loss for Person Re-Identification

22 Mar 2017arXiv:1703.07737archive 2025-07-28

Alexander Hermans, Lucas Beyer, Bastian Leibe

In the past few years, the field of computer vision has gone through a revolution fueled mainly by the advent of large datasets and the adoption of deep convolutional neural networks for end-to-end learning. The person re-identification subfield is no exception to this. Unfortunately, a prevailing belief in the community seems to be that the triplet loss is inferior to using surrogate losses (classification, verification) followed by a separate metric learning step. We show that, for models trained from scratch as well as pretrained ones, using a variant of the triplet loss to perform end-to-end deep metric learning outperforms most other published methods by a large margin.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1703.07737")

Code

Syntology Ran 6 of 46 code samples harvested from 8 repositories linked to this paper; 40 have no recorded run. Of those that ran: 3 ran · honoured contract; 2 ran · our draft was wrong; 1 ran with no contract checked.

By repository: community (archive-listed): 46 samples from 8 repositories, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

31 repositories listed; official and paper-mentioned ones first.

AdrianUng/keras-triplet-loss-mnist mentioned on GitHubtfMIT report
AsuradaYuci/tripletreid-zhushi mentioned on GitHubtfMIT report
BonaventureR/person-reid mentioned on GitHubpytorch report
abhishirk/Aligned_ReId mentioned on GitHubpytorch report
adambielski/siamese-triplet mentioned on GitHubpytorch report
agongt408/vbranch mentioned on GitHubtf report
bastiennNB/Pair_ReID mentioned on GitHubpytorch report
cftang0827/human_recognition mentioned on GitHubtf report
h4veFunCodin9/Aligned_ReID mentioned on GitHubpytorch report
huynhtuan17ti/FaceNet-OneShotLearning mentioned on GitHubpytorch report
immuno121/audio_source_classification mentioned on GitHubpytorch report
jjmachan/DeepHash mentioned on GitHubpytorchBSD-3-Clause report
keetsky/Net_ghostVLAD-pytorch mentioned on GitHubpytorchMIT report
khrlimam/facenet mentioned on GitHubpytorch report
kilsenp/triplet-reid-pytorch mentioned on GitHubpytorchMIT report
layumi/Person_reID_baseline_pytorch mentioned on GitHubpytorch report
lyakaap/NetVLAD-pytorch mentioned on GitHubpytorchMIT report
shubhamtyagii/Aligned_Reid mentioned on GitHubpytorch report
tbmoon/facenet mentioned on GitHubpytorchMIT report
thomas-liao/diva_tracking_reid mentioned on GitHubtfMIT report
zhengziqiang/ReshapeGAN mentioned on GitHubtf report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

46 samples harvested; 6 ran; 3 honoured the contract we drafted; 40 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
2ran · our draft was wrong
1ran
40unverified

Licence: 0 of the 46 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 8 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

average_precision_score_market VisualComputingInstitute/triplet-reid/evaluate.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 82445be81c67abf4 · report
calculate_accuracy tbmoon/facenet/eval_metrics.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · f975336b5d5f1a80 · report
pdist jjmachan/DeepHash/utils.py community (archive-listed) ran · honoured contract fingerprinted BSD-3-Clause (permissive) · 21868b96f7d7b0a3 · report
test_epoch adambielski/siamese-triplet/trainer.py community (archive-listed) ran · our draft was wrong BSD-3-Clause (permissive) · 3d7ea6c7a90b443f · report
train_epoch adambielski/siamese-triplet/trainer.py community (archive-listed) ran · our draft was wrong BSD-3-Clause (permissive) · 8e1349744be50b82 · report
wrapped_partial AsuradaYuci/tripletreid-zhushi/nets/mobilenet_v1.py community (archive-listed) ran MIT (permissive) · b6e06004f7efe660 · report
all_diffs thomas-liao/diva_tracking_reid/loss.py community (archive-listed) unverified MIT (permissive) · 8427c7e156becb53 · report
all_diffs AsuradaYuci/tripletreid-zhushi/loss.py community (archive-listed) unverified MIT (permissive) · cab57693e7555782 · report
calculate_roc tbmoon/facenet/eval_metrics.py community (archive-listed) unverified MIT (permissive) · ecb40e2478acb33f · report
cdist thomas-liao/diva_tracking_reid/loss.py community (archive-listed) unverified MIT (permissive) · 3dbcae6ca6415ede · report
cdist AsuradaYuci/tripletreid-zhushi/loss.py community (archive-listed) unverified MIT (permissive) · ffe848e860beaf70 · report
check_directory AsuradaYuci/tripletreid-zhushi/common.py community (archive-listed) unverified MIT (permissive) · 119574482993a7b8 · report
check_directory thomas-liao/diva_tracking_reid/common.py community (archive-listed) unverified MIT (permissive) · 44a92853a18a9115 · report
create_dat AsuradaYuci/tripletreid-zhushi/lbtoolbox.py community (archive-listed) unverified MIT (permissive) · c081c93cd90e636b · report
dcg_score BarbaAlGhul/recommender-system-thesis/metrics.py community (archive-listed) unverified MIT (permissive) · 87856274c73e4919 · report
evaluate tbmoon/facenet/eval_metrics.py community (archive-listed) unverified MIT (permissive) · a6bdfe104037e7f5 · report
find_dcg BarbaAlGhul/recommender-system-thesis/metrics.py community (archive-listed) unverified MIT (permissive) · 3ebeec2cc2de528b · report
five_crops AsuradaYuci/tripletreid-zhushi/embed.py community (archive-listed) unverified MIT (permissive) · b1c214482b18d02c · report
flip_augment AsuradaYuci/tripletreid-zhushi/embed.py community (archive-listed) unverified MIT (permissive) · cb19488564617e1e · report
get_at_indices thomas-liao/diva_tracking_reid/loss.py community (archive-listed) unverified MIT (permissive) · f6fa452e61831f1d · report
get_at_indices AsuradaYuci/tripletreid-zhushi/loss.py community (archive-listed) unverified MIT (permissive) · 4acfece13ca5c19a · report
get_dataloader tbmoon/facenet/data_loader.py community (archive-listed) unverified MIT (permissive) · 70087c59822847c9 · report
get_dir_and_file tbmoon/facenet/mtcnn.py community (archive-listed) unverified MIT (permissive) · 127d42102f3bcc02 · report
hardest_negative jjmachan/DeepHash/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · 28431bd8429ef046 · report
identity_loss BarbaAlGhul/recommender-system-thesis/losses.py community (archive-listed) unverified MIT (permissive) · cc6714cb88899d93 · report
load BarbaAlGhul/recommender-system-thesis/load_movies.py community (archive-listed) unverified MIT (permissive) · 240b69380724f6e4 · report
load BarbaAlGhul/recommender-system-thesis/load_ratings.py community (archive-listed) unverified MIT (permissive) · de12e26f4dd9eee4 · report
load_dat AsuradaYuci/tripletreid-zhushi/lbtoolbox.py community (archive-listed) unverified MIT (permissive) · ec4f4037a31db0cb · report
load_dataset IcewineChen/mxnet-batch_hard_triplet_loss/dataset.py community (archive-listed) unverified MIT (permissive) · f0cb72e43bf6a71e · report
load_state tbmoon/facenet/models.py community (archive-listed) unverified MIT (permissive) · e07f80108977f267 · report
margin_comparator_loss BarbaAlGhul/recommender-system-thesis/losses.py community (archive-listed) unverified MIT (permissive) · 0721ce972ca2f5d4 · report
mean AsuradaYuci/tripletreid-zhushi/aggregators.py community (archive-listed) unverified MIT (permissive) · 3d7c7885af720b02 · report
mean_average_precision BarbaAlGhul/recommender-system-thesis/evaluate.py community (archive-listed) unverified MIT (permissive) · a3a9be21cfa9c135 · report
model_920 tbmoon/facenet/models.py community (archive-listed) unverified MIT (permissive) · 25d9a8847999551c · report
model_921 tbmoon/facenet/models.py community (archive-listed) unverified MIT (permissive) · e67e3d8709640b1d · report
ndcg_score BarbaAlGhul/recommender-system-thesis/metrics.py community (archive-listed) unverified MIT (permissive) · 97c2bad5618d999e · report
normalized_mean AsuradaYuci/tripletreid-zhushi/aggregators.py community (archive-listed) unverified MIT (permissive) · ab2f98823f035603 · report
random_hard_negative jjmachan/DeepHash/utils.py community (archive-listed) unverified BSD-3-Clause (permissive) · ac72a4aca5c29a4a · report
readable_directory AsuradaYuci/tripletreid-zhushi/common.py community (archive-listed) unverified MIT (permissive) · 6b0abcd1d16fa141 · report
readable_directory thomas-liao/diva_tracking_reid/common.py community (archive-listed) unverified MIT (permissive) · 3fed355ce4cc7002 · report
roc_auc BarbaAlGhul/recommender-system-thesis/evaluate.py community (archive-listed) unverified MIT (permissive) · 0ec981d9205019e5 · report
sample_triplets BarbaAlGhul/recommender-system-thesis/sample_triplets.py community (archive-listed) unverified MIT (permissive) · d4dd6ed08bb883ee · report
tuplize AsuradaYuci/tripletreid-zhushi/lbtoolbox.py community (archive-listed) unverified MIT (permissive) · ec3794294a86cc5a · report
valid_ext tbmoon/facenet/mtcnn.py community (archive-listed) unverified MIT (permissive) · bf2651694c0c427e · report
writeable_directory AsuradaYuci/tripletreid-zhushi/common.py community (archive-listed) unverified MIT (permissive) · ea0ec55f5f51c7e1 · report
writeable_directory thomas-liao/diva_tracking_reid/common.py community (archive-listed) unverified MIT (permissive) · 1ce4139aa71c6a1d · report

Tasks

General ClassificationMetric LearningPerson Re-Identification

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Person Re-Identification CUHK03 TriNet Rank-1 89.63 #18 of 19 Archive leaderboard report
Person Re-Identification CUHK03 TriNet Rank-5 99.01 #18 of 19 Archive leaderboard report
Person Re-Identification DukeMTMC-reID TriNet Rank-1 72.44 #78 of 94 Archive leaderboard report
Person Re-Identification DukeMTMC-reID TriNet mAP 53.50 #78 of 94 Archive leaderboard report
Person Re-Identification MARS TriNet (RK) Rank-1 81.21 #14 of 21 Archive leaderboard report
Person Re-Identification MARS TriNet (RK) Rank-5 90.76 #14 of 21 Archive leaderboard report
Person Re-Identification MARS TriNet (RK) mAP 77.43 #14 of 21 Archive leaderboard report
Person Re-Identification MARS LuNet (RK) Rank-1 78.48 #15 of 21 Archive leaderboard report
Person Re-Identification MARS LuNet (RK) Rank-5 88.74 #15 of 21 Archive leaderboard report
Person Re-Identification MARS LuNet (RK) mAP 73.68 #15 of 21 Archive leaderboard report
Person Re-Identification MARS TriNet Rank-1 79.80 #18 of 21 Archive leaderboard report
Person Re-Identification MARS TriNet Rank-5 91.36 #18 of 21 Archive leaderboard report
Person Re-Identification MARS TriNet mAP 67.70 #18 of 21 Archive leaderboard report
Person Re-Identification MARS LuNet Rank-1 75.56 #19 of 21 Archive leaderboard report
Person Re-Identification MARS LuNet Rank-5 89.70 #19 of 21 Archive leaderboard report
Person Re-Identification MARS LuNet mAP 60.48 #19 of 21 Archive leaderboard report
Person Re-Identification Market-1501 TriNet (RK) Rank-1 86.67 #101 of 135 Archive leaderboard report
Person Re-Identification Market-1501 TriNet (RK) Rank-5 93.38 #101 of 135 Archive leaderboard report
Person Re-Identification Market-1501 TriNet (RK) mAP 81.07 #101 of 135 Archive leaderboard report
Person Re-Identification Market-1501 TriNet Rank-1 84.92 #105 of 135 Archive leaderboard report
Person Re-Identification Market-1501 TriNet Rank-5 94.21 #105 of 135 Archive leaderboard report
Person Re-Identification Market-1501 TriNet mAP 69.14 #105 of 135 Archive leaderboard report
Person Re-Identification Market-1501 LuNet (RK) Rank-1 84.59 #106 of 135 Archive leaderboard report
Person Re-Identification Market-1501 LuNet (RK) Rank-5 91.89 #106 of 135 Archive leaderboard report
Person Re-Identification Market-1501 LuNet (RK) mAP 75.62 #106 of 135 Archive leaderboard report
Person Re-Identification Market-1501 LuNet Rank-1 81.38 #111 of 135 Archive leaderboard report
Person Re-Identification Market-1501 LuNet Rank-5 92.34 #111 of 135 Archive leaderboard report
Person Re-Identification Market-1501 LuNet mAP 60.71 #111 of 135 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections