Papers › SoftTriple Loss: Deep Metric Learning Without Triplet Sampling

SoftTriple Loss: Deep Metric Learning Without Triplet Sampling

11 Sep 2019ICCV 2019 10arXiv:1909.05235archive 2025-07-28

Qi Qian, Lei Shang, Baigui Sun, Juhua Hu, Hao Li, Rong Jin

Distance metric learning (DML) is to learn the embeddings where examples from the same class are closer than examples from different classes. It can be cast as an optimization problem with triplet constraints. Due to the vast number of triplet constraints, a sampling strategy is essential for DML. With the tremendous success of deep learning in classifications, it has been applied for DML. When learning embeddings with deep neural networks (DNNs), only a mini-batch of data is available at each iteration. The set of triplet constraints has to be sampled within the mini-batch. Since a mini-batch cannot capture the neighbors in the original set well, it makes the learned embeddings sub-optimal. On the contrary, optimizing SoftMax loss, which is a classification loss, with DNN shows a superior performance in certain DML tasks. It inspires us to investigate the formulation of SoftMax. Our analysis shows that SoftMax loss is equivalent to a smoothed triplet loss where each class has a single center. In real-world data, one class can contain several local clusters rather than a single one, e.g., birds of different poses. Therefore, we propose the SoftTriple loss to extend the SoftMax loss with multiple centers for each class. Compared with conventional deep metric learning algorithms, optimizing SoftTriple loss can learn the embeddings without the sampling phase by mildly increasing the size of the last fully connected layer. Experiments on the benchmark fine-grained data sets demonstrate the effectiveness of the proposed loss function. Code is available at https://github.com/idstcv/SoftTriple

PaperPDFConference PDFCodeCode 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="1909.05235")

Code

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

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

idstcv/SoftTriple officialmentioned in paperpytorchApache-2.0 report
navervision/MemVir mentioned on GitHubpytorch report
navervision/proxy-synthesis mentioned on GitHubpytorch 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

4 samples harvested; 2 ran; 1 honoured the contract we drafted; 2 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.

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

Licence: 2 of the 4 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 2 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.

bninception idstcv/SoftTriple/net/bninception.py official repository unverified Apache-2.0 (permissive) · 8040266c75525c17 · report
evaluation idstcv/SoftTriple/evaluation.py official repository unverified Apache-2.0 (permissive) · d120bf5b3dee8b75 · report
get_embedding QuocThangNguyen/deep-metric-learning-tsinghua-dogs/src/infer.py community (archive-listed) ran · honoured contract no licence file found · pointer only · 5480fa55602d0208 · report
get_embeddings_from_dataloader QuocThangNguyen/deep-metric-learning-tsinghua-dogs/src/infer.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 613cf8184c0ccefe · report

Tasks

Image RetrievalMetric Learning

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Metric Learning CARS196 BN-Inception + SoftTriple R@1 84.5 #28 of 36 Archive leaderboard report
Metric Learning CUB-200-2011 BN-Inception + SoftTriple R@1 65.4 #21 of 30 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.

Methods

SoftmaxTriplet Loss

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