{"id":13738296,"url":"https://github.com/elias-ramzi/ROADMAP","last_synced_at":"2025-05-08T16:33:10.731Z","repository":{"id":41262196,"uuid":"358665679","full_name":"elias-ramzi/ROADMAP","owner":"elias-ramzi","description":"This repository contains the official implementation of the NeurIPS'21 paper, ROADMAP: Robust and Decomposable Average Precision for Image Retrieval.","archived":false,"fork":false,"pushed_at":"2023-04-06T11:14:04.000Z","size":594,"stargazers_count":72,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-15T07:34:06.217Z","etag":null,"topics":["average-precision","image-retrieval","metric-learning","neurips-2021"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2110.01445","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/elias-ramzi.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,"governance":null,"roadmap":"roadmap/__init__.py","authors":null}},"created_at":"2021-04-16T16:56:42.000Z","updated_at":"2024-10-17T14:05:00.000Z","dependencies_parsed_at":"2024-01-07T17:11:07.262Z","dependency_job_id":"3d4e7cbc-39e6-4acf-85b5-764c2f61b84b","html_url":"https://github.com/elias-ramzi/ROADMAP","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ramzi%2FROADMAP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ramzi%2FROADMAP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ramzi%2FROADMAP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ramzi%2FROADMAP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elias-ramzi","download_url":"https://codeload.github.com/elias-ramzi/ROADMAP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253105423,"owners_count":21855023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["average-precision","image-retrieval","metric-learning","neurips-2021"],"created_at":"2024-08-03T03:02:17.506Z","updated_at":"2025-05-08T16:33:10.370Z","avatar_url":"https://github.com/elias-ramzi.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Robust And Decomposable Average Precision for Image Retrieval (NeurIPS 2021)\n\nThis repository contains the source code for our [ROADMAP paper (NeurIPS 2021)](https://arxiv.org/abs/2110.01445).\n\n![outline](https://github.com/elias-ramzi/ROADMAP/blob/main/picture/outline.png)\n\n## Use ROADMAP\n\n```\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -e .\n```\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/robust-and-decomposable-average-precision-for/image-retrieval-on-inaturalist)](https://paperswithcode.com/sota/image-retrieval-on-inaturalist?p=robust-and-decomposable-average-precision-for)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/robust-and-decomposable-average-precision-for/image-retrieval-on-sop)](https://paperswithcode.com/sota/image-retrieval-on-sop?p=robust-and-decomposable-average-precision-for)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/robust-and-decomposable-average-precision-for/image-retrieval-on-cub-200-2011)](https://paperswithcode.com/sota/image-retrieval-on-cub-200-2011?p=robust-and-decomposable-average-precision-for)\n\n## Datasets\n\nWe use the following datasets for our submission\n\n- CUB-200-2011 (download link available on this website : http://www.vision.caltech.edu/visipedia/CUB-200.html)\n- Stanford Online Products (you can download it here : https://cvgl.stanford.edu/projects/lifted_struct/)\n- INaturalist-2018 (obtained from here https://github.com/visipedia/inat_comp/tree/master/2018#Data)\n\n\n## Run the code\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eSOP\u003c/b\u003e\u003c/summary\u003e\u003cbr/\u003e\n\n  The following command reproduce our results for Table 4.\n\n  ```\nCUDA_VISIBLE_DEVICES=0 python roadmap/single_experiment_runner.py \\\n'experience.experiment_name=sop_ROADMAP_${dataset.sampler.kwargs.batch_size}_sota' \\\nexperience.seed=333 \\\nexperience.max_iter=100 \\\n'experience.log_dir=${env:HOME}experiments/ROADMAP' \\\noptimizer=sop \\\nmodel=resnet \\\ntransform=sop_big \\\ndataset=sop \\\ndataset.sampler.kwargs.batch_size=128 \\\ndataset.sampler.kwargs.batches_per_super_pair=10 \\\nloss=roadmap\n  ```\n\n  With the transformer backbone :\n\n  ```\n  CUDA_VISIBLE_DEVICES=0 python roadmap/single_experiment_runner.py \\\n  'experience.experiment_name=sop_ROADMAP_${dataset.sampler.kwargs.batch_size}_DeiT' \\\n  experience.seed=333 \\\n  experience.max_iter=75 \\\n  'experience.log_dir=${env:HOME}/experiments/ROADMAP' \\\n  optimizer=sop_deit \\\n  model=deit \\\n  transform=sop \\\n  dataset=sop \\\n  dataset.sampler.kwargs.batch_size=128 \\\n  dataset.sampler.kwargs.batches_per_super_pair=10 \\\n  loss=roadmap\n  ```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eINaturalist\u003c/b\u003e\u003c/summary\u003e\u003cbr/\u003e\n\n  For ROADMAP sota results:\n\n  ```\nCUDA_VISIBLE_DEVICES='0,1,2' python roadmap/single_experiment_runner.py \\\n'experience.experiment_name=inat_ROADMAP_${dataset.sampler.kwargs.batch_size}_sota' \\\nexperience.seed=333 \\\nexperience.max_iter=90 \\\n'experience.log_dir=experiments/ROADMAP' \\\noptimizer=inaturalist \\\nmodel=resnet \\\ntransform=inaturalist \\\ndataset=inaturalist \\\ndataset.sampler.kwargs.batch_size=384 \\\nloss=roadmap_inat\n  ```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eCUB-200-2011\u003c/b\u003e\u003c/summary\u003e\u003cbr/\u003e\n\n  For ROADMAP sota results:\n\n  ```\n  CUDA_VISIBLE_DEVICES=0 python roadmap/single_experiment_runner.py \\\n  'experience.experiment_name=cub_ROADMAP_${dataset.sampler.kwargs.batch_size}_sota' \\\n  experience.seed=333 \\\n  experience.max_iter=200 \\\n  'experience.log_dir=${env:HOME}/experiments/ROADMAP' \\\n  optimizer=cub \\\n  model=resnet_max_ln \\\n  transform=cub_big \\\n  dataset=cub \\\n  dataset.sampler.kwargs.batch_size=128 \\\n  loss=roadmap\n  ```\n\n  ```\n  CUDA_VISIBLE_DEVICES=0 python roadmap/single_experiment_runner.py \\\n  'experience.experiment_name=cub_ROADMAP_${dataset.sampler.kwargs.batch_size}_sota_DeiT' \\\n  experience.seed=333 \\\n  experience.max_iter=150 \\\n  'experience.log_dir=${env:HOME}/experiments/ROADMAP' \\\n  optimizer=cub_deit \\\n  model=deit \\\n  transform=cub \\\n  dataset=cub \\\n  dataset.sampler.kwargs.batch_size=128 \\\n  loss=roadmap\n  ```\n\n\u003c/details\u003e\n\n\nThe results are not exactly the same as my code changed a bit (for instance the random seed are not the same).\n\n\n## Contacts\n\nIf you have any questions don't hesitate to create an issue on this repository. Or send me an email at elias.ramzi@lecnam.net.\n\nDon't hesitate to cite our work:\n```\n@inproceedings{\nramzi2021robust,\ntitle={Robust and Decomposable Average Precision for Image Retrieval},\nauthor={Elias Ramzi and Nicolas THOME and Cl{\\'e}ment Rambour and Nicolas Audebert and Xavier Bitot},\nbooktitle={Thirty-Fifth Conference on Neural Information Processing Systems},\nyear={2021},\nurl={https://openreview.net/forum?id=VjQw3v3FpJx}\n}\n```\n\n\n## Resources\n- Pytorch Metric Learning (PML): https://github.com/KevinMusgrave/pytorch-metric-learning\n- SmoothAP: https://github.com/Andrew-Brown1/Smooth_AP\n- Blackbox: https://github.com/martius-lab/blackbox-backprop\n- FastAP: https://github.com/kunhe/FastAP-metric-learning\n- SoftBinAP: https://github.com/naver/deep-image-retrieval\n- timm: https://github.com/rwightman/pytorch-image-models\n- PyTorch: https://github.com/pytorch/pytorch\n- Hydra: https://github.com/facebookresearch/hydra\n- Faiss: https://github.com/facebookresearch/faiss\n- Ray: https://github.com/ray-project/ray\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias-ramzi%2FROADMAP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felias-ramzi%2FROADMAP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias-ramzi%2FROADMAP/lists"}