Papers › DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning

DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning

15 Mar 2020arXiv:2003.06777archive 2025-07-28

Chi Zhang, Yujun Cai, Guosheng Lin, Chunhua Shen

In this work, we develop methods for few-shot image classification from a new perspective of optimal matching between image regions. We employ the Earth Mover's Distance (EMD) as a metric to compute a structural distance between dense image representations to determine image relevance. The EMD generates the optimal matching flows between structural elements that have the minimum matching cost, which is used to calculate the image distance for classification. To generate the important weights of elements in the EMD formulation, we design a cross-reference mechanism, which can effectively alleviate the adverse impact caused by the cluttered background and large intra-class appearance variations. To implement k-shot classification, we propose to learn a structured fully connected layer that can directly classify dense image representations with the EMD. Based on the implicit function theorem, the EMD can be inserted as a layer into the network for end-to-end training. Our extensive experiments validate the effectiveness of our algorithm which outperforms state-of-the-art methods by a significant margin on five widely used few-shot classification benchmarks, namely, miniImageNet, tieredImageNet, Fewshot-CIFAR100 (FC100), Caltech-UCSD Birds-200-2011 (CUB), and CIFAR-FewShot (CIFAR-FS). We also demonstrate the effectiveness of our method on the image retrieval task in our experiments.

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="2003.06777")

Code

Syntology Ran 2 of 7 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran with no contract checked.

By repository: community (archive-listed): 7 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.

Tsingularity/FRN mentioned on GitHubpytorch report
anguyen8/deepface-emd mentioned on GitHubpytorch report
anguyen8/face-vit mentioned on GitHubpytorch report
icoz69/DeepEMD mentioned on GitHubpytorchMIT report
whut-yirong/espt 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

7 samples harvested; 2 ran; 0 honoured the contract we drafted; 5 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 · our draft was wrong
1ran
5unverified

Licence: 0 of the 7 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 icoz69/DeepEMD. “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.

conv3x3 icoz69/DeepEMD/Models/models/resnet.py community (archive-listed) ran · our draft was wrong MIT (permissive) · fac5364e2f53c6db · report
set_gpu icoz69/DeepEMD/Models/utils.py community (archive-listed) ran MIT (permissive) · 8327880f0b76f9db · report
compute_confidence_interval icoz69/DeepEMD/Models/utils.py community (archive-listed) unverified MIT (permissive) · 81ea193467a90dc6 · report
count_acc icoz69/DeepEMD/Models/utils.py community (archive-listed) unverified MIT (permissive) · 684d8ecbca8220ab · report
emd_inference_opencv icoz69/DeepEMD/Models/models/emd_utils.py community (archive-listed) unverified MIT (permissive) · 829d4aa345489492 · report
emd_inference_opencv_test icoz69/DeepEMD/Models/models/emd_utils.py community (archive-listed) unverified MIT (permissive) · 4d2e05bc40a813cc · report
set_up_datasets icoz69/DeepEMD/Models/dataloader/data_utils.py community (archive-listed) unverified MIT (permissive) · 3a753faa7bc9cb2b · report

Tasks

ClassificationFew-Shot Image ClassificationFew-Shot LearningGeneral ClassificationImage ClassificationImage RetrievalRetrievalimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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