{"id":13737984,"url":"https://github.com/clovaai/embedding-expansion","last_synced_at":"2026-02-24T03:07:53.012Z","repository":{"id":49336643,"uuid":"245979744","full_name":"clovaai/embedding-expansion","owner":"clovaai","description":"Official MXNet implementation of \"Embedding Expansion: Augmentation in Embedding Space for Deep Metric Learning\" (CVPR 2020)","archived":false,"fork":false,"pushed_at":"2022-12-10T12:48:56.000Z","size":16428,"stargazers_count":79,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-06T16:39:28.383Z","etag":null,"topics":["cars196","cub200-2011","cvpr2020","deep-learning","image-clustering","image-retrieval","metric-learning","mxnet","stanford-online-products","synthesis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clovaai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-09T08:21:53.000Z","updated_at":"2025-05-22T02:58:55.000Z","dependencies_parsed_at":"2023-01-26T07:30:39.600Z","dependency_job_id":null,"html_url":"https://github.com/clovaai/embedding-expansion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clovaai/embedding-expansion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Fembedding-expansion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Fembedding-expansion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Fembedding-expansion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Fembedding-expansion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clovaai","download_url":"https://codeload.github.com/clovaai/embedding-expansion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Fembedding-expansion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29770359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T01:40:24.820Z","status":"online","status_checked_at":"2026-02-24T02:00:07.497Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cars196","cub200-2011","cvpr2020","deep-learning","image-clustering","image-retrieval","metric-learning","mxnet","stanford-online-products","synthesis"],"created_at":"2024-08-03T03:02:08.131Z","updated_at":"2026-02-24T03:07:52.967Z","avatar_url":"https://github.com/clovaai.png","language":"Python","funding_links":[],"categories":["Python","Beyond Vision"],"sub_categories":["**Other**"],"readme":"# Embedding Expansion: Augmentation in Embedding Space for Deep Metric Learning\n\nOfficial MXNet implementation of Embedding Expansion: Augmentation in Embedding Space for Deep Metric Learning (CVPR 2020)\n\n**Byungsoo Ko\\*, Geonmo Gu\\*** (* Authors contributed equally.)\n\n@NAVER/LINE Vision\n\n- [Paper](https://arxiv.org/abs/2003.02546) | [Supplementary Video](https://www.youtube.com/watch?v=5msMSXyQZ5U) | [PPT](https://www.slideshare.net/ByungSooKo1/cvpr2020-embedding-expansion-augmentation-in-embedding-space-for-deep-metric-learning-ppt) | [Poster](https://www.slideshare.net/ByungSooKo1/cvpr2020-embedding-expansion-augmentation-in-embedding-space-for-deep-metric-learning-poster)\n\n\n## Overview\n### Embedding Expansion\n*Embedding Expansion (EE)* is a novel augmentation method in embedding space which is compatible with existing pair-based metric learning losses.\n\n\u003cimg src=\"figures/teaser.png\"\u003e\n\n### How it Works\nBy generating synthetic points with linear interpolation, they can contribute to training a network with augmented information.\n\n\u003cimg src=\"figures/Supplementary_video.gif\"\u003e\n\n### Experimental Results\nClustering and retrieval performance (%) on three benchmarks in comparison with other methods. † denotes the HPHN triplet loss, and bold numbers indicate the best score within the same loss.\n\n\u003cimg src=\"figures/results.png\"\u003e\n\n## Getting Started\n\n### Requirements\n\n```\n$ pip3 install -r requirements.txt\n```\n\n### Prepare Data\n\n+ Download [CARS196](https://ai.stanford.edu/~jkrause/cars/car_dataset.html) dataset.\n\n```\n$ mkdir -p data/CARS_196\n$ wget http://ai.stanford.edu/~jkrause/car196/car_ims.tgz\n$ tar -xvzf car_ims.tgz -C data/CARS_196\n```\n\n### Train Models\n\n- **Available losses**: HPHN-triplet, EE + HPHN-triplet\n  - Best recall@1 of EE + HPHN-triplet: 0.745 (0.716 in paper)\n- Note: The meaning of *epoch* in the paper and implementation is 'number of classes * number of instance per class'. So, the total epochs can be seen unusually high but it does not indicate slow convergence.\n\n```\n# EE + HPHN-triplet (n_inner_points=2)\n$ python3 main.py --gpu_idx=0 --data_name=cars196 \\\n--backbone=googlenet --embed_dim=512 \\\n--loss=hphn_triplet --n_inner_pts=2 --ee_l2norm=True \\\n--seed=0 --batch_size=128 --image_size=227 \\\n--optim=adam --lr=0.0001 --lr_decay_factor=0.5 --lr_decay_epochs=400,800,1200,1600 \\\n--epochs=4000 --eval_epoch_term=5 --save_dir=results/inner-2\n\n# HPHN-triplet (n_inner_points=0)\n$ python3 main.py --gpu_idx=0 --data_name=cars196 \\\n--backbone=googlenet --embed_dim=512 \\\n--loss=hphn_triplet --n_inner_pts=0 --ee_l2norm=True \\\n--seed=0 --batch_size=128 --image_size=227 \\\n--optim=adam --lr=0.0001 --lr_decay_factor=0.5 --lr_decay_epochs=400,800,1200,1600 \\\n--epochs=4000 --eval_epoch_term=5 --save_dir=results/inner-0\n```\n\n\n### Check Test Results\n```\n$ tensorboard --logdir=results --port=10000\n```\n\n\u003cimg src=\"figures/recall1_results.png\" width=\"700\"\u003e\n\n- dark blue: EE + HPHN-triplet (n_inner_points=2)\n- sky blue: HPHN-triplet (n_inner_points=0)\n\n \n## Citation\nIf you find *Embedding Expansion* useful in your research, please consider to cite the following paper.\n\n```\n@inproceedings{ko2020embedding,\n    title={Embedding Expansion: Augmentation in Embedding Space for Deep Metric Learning},\n    author={Ko, Byungsoo and Gu, Geonmo},\n    booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n    year={2020}\n}\n```\n\n## Acknowledgement\nThis repository is refactored based on the implementation of *Combination of Multiple Global Descriptors for Image Retrieval (CGD)*.\n(Special thanks to the authors :D)\n\nIf you are interested in extended implementation of deep metric learning, please check the *CGD*'s repository and consider to cite the following paper.\n\n- [Arxiv](https://arxiv.org/abs/1903.10663) | [Github](https://github.com/naver/cgd)\n\n```\n@article{jun2019combination,\n  title={Combination of Multiple Global Descriptors for Image Retrieval},\n  author={Jun, HeeJae and Ko, ByungSoo and Kim, Youngjoon and Kim, Insik and Kim, Jongtack},\n  journal={arXiv preprint arXiv:1903.10663},\n  year={2019}\n}\n```\n\n## License\n\n```\nCopyright (c) 2020-present NAVER Corp.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclovaai%2Fembedding-expansion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclovaai%2Fembedding-expansion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclovaai%2Fembedding-expansion/lists"}