{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/sampling-matters-in-deep-embedding-learning","title":"Sampling Matters in Deep Embedding Learning","arxiv_id":"1706.07567","date":"2017-06-23","proceeding":"ICCV 2017 10","authors":["Chao-yuan Wu","R. Manmatha","Alexander J. Smola","Philipp Krähenbühl"],"abstract":"Deep embeddings answer one simple question: How similar are two images?\nLearning these embeddings is the bedrock of verification, zero-shot learning,\nand visual search. The most prominent approaches optimize a deep convolutional\nnetwork with a suitable loss function, such as contrastive loss or triplet\nloss. While a rich line of work focuses solely on the loss functions, we show\nin this paper that selecting training examples plays an equally important role.\nWe propose distance weighted sampling, which selects more informative and\nstable examples than traditional approaches. In addition, we show that a simple\nmargin based loss is sufficient to outperform all other loss functions. We\nevaluate our approach on the Stanford Online Products, CAR196, and the\nCUB200-2011 datasets for image retrieval and clustering, and on the LFW dataset\nfor face verification. Our method achieves state-of-the-art performance on all\nof them.","url_abs":"http://arxiv.org/abs/1706.07567v2","url_pdf":"http://arxiv.org/pdf/1706.07567v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"sampling-matters-in-deep-embedding-learning","repo_url":"https://github.com/ArturPrzybysz/MNIST-siamese","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"sampling-matters-in-deep-embedding-learning","repo_url":"https://github.com/immuno121/audio_source_classification","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"sampling-matters-in-deep-embedding-learning","repo_url":"https://github.com/minzwon/tag-based-music-retrieval","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"sampling-matters-in-deep-embedding-learning","repo_url":"https://github.com/CompVis/metric-learning-divide-and-conquer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"sampling-matters-in-deep-embedding-learning","repo_url":"https://github.com/Recognito-Vision/Android-FaceRecognition-FaceLivenessDetection","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"sampling-matters-in-deep-embedding-learning","repo_url":"https://github.com/suruoxi/DistanceWeightedSampling","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"face-verification","task_name":"Face Verification"},{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":null,"task_name":"Triplet"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"bottleneck-residual-block","method_name":"Bottleneck Residual Block"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"kaiming-initialization","method_name":"Kaiming Initialization"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-block","method_name":"Residual Block"},{"method_slug":"residual-connection","method_name":"Residual Connection"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-retrieval-on-cars196","task":"Image Retrieval","dataset":"CARS196","model":"Margin","rank_in_archive_order":5,"of":8,"metrics":{"R@1":"86.9"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"ResNet-50 + Margin","rank_in_archive_order":33,"of":36,"metrics":{"R@1":"79.6"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-cub-200-2011","task":"Metric Learning","dataset":"CUB-200-2011","model":"ResNet-50 + Margin","rank_in_archive_order":24,"of":30,"metrics":{"R@1":"63.6"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1706.07567","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1706.07567"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ArturPrzybysz/MNIST-siamese","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/minzwon/tag-based-music-retrieval","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/immuno121/audio_source_classification","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/CompVis/metric-learning-divide-and-conquer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/suruoxi/DistanceWeightedSampling","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Recognito-Vision/Android-FaceRecognition-FaceLivenessDetection","reach":{"status":"ok"}}],"summary":{"ran_honours":2},"by_repo_kind":{"listed":{"samples":2,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"88dc4f262c9b561a","entry":"get_distance","repo":"suruoxi/DistanceWeightedSampling","repo_kind":"listed","path":"model.py","file_url":"https://github.com/suruoxi/DistanceWeightedSampling/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"88dc4f262c9b561a"}},{"code_sha256_prefix":"b3008cda91f30a22","entry":"l2_norm","repo":"suruoxi/DistanceWeightedSampling","repo_kind":"listed","path":"model.py","file_url":"https://github.com/suruoxi/DistanceWeightedSampling/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3008cda91f30a22"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}