{"id":13738404,"url":"https://github.com/Confusezius/ICCV2019_MIC","last_synced_at":"2025-05-08T16:33:43.268Z","repository":{"id":93947056,"uuid":"199616080","full_name":"Confusezius/ICCV2019_MIC","owner":"Confusezius","description":"(ICCV 2019) This repo contains code for \"MIC: Mining Interclass Characteristics for Improved Metric Learning\", which proposes an auxiliary training task to explain away intra-class variations.","archived":false,"fork":false,"pushed_at":"2020-06-12T20:42:46.000Z","size":15761,"stargazers_count":61,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-15T07:34:22.129Z","etag":null,"topics":["cars196","computer-vi","cub200","deep-lear","deep-metric-learning","metric-","pku-vehicle","pytorch","shop-clothes-retrieval"],"latest_commit_sha":null,"homepage":"https://confusezius.github.io/metric-learning-mining-interclass-characteristics/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Confusezius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-30T09:07:11.000Z","updated_at":"2024-08-30T05:25:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"45247ce4-e164-4e17-8ce5-1ecf92bdabd1","html_url":"https://github.com/Confusezius/ICCV2019_MIC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Confusezius%2FICCV2019_MIC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Confusezius%2FICCV2019_MIC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Confusezius%2FICCV2019_MIC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Confusezius%2FICCV2019_MIC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Confusezius","download_url":"https://codeload.github.com/Confusezius/ICCV2019_MIC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253105531,"owners_count":21855048,"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":["cars196","computer-vi","cub200","deep-lear","deep-metric-learning","metric-","pku-vehicle","pytorch","shop-clothes-retrieval"],"created_at":"2024-08-03T03:02:21.385Z","updated_at":"2025-05-08T16:33:42.898Z","avatar_url":"https://github.com/Confusezius.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# MIC: Mining Interclass Characteristics for Improved Deep Metric Learning\n---\n#### ___Authors___:\n* Karsten Roth (karsten.rh1@gmail.com)\n* Biagio Brattoli (biagio.brattoli@gmail.com)\n* Björn Ommer\n\n___Primary Contact___: Karsten Roth\n\nFor baseline implementations, check out https://github.com/Confusezius/Revisiting_Deep_Metric_Learning_PyTorch and the accompanying paper!\n\n---\nThis repository contains the code to run the pipeline proposed in our ICCV 2019 paper _Mining Interclass Characteristics for Improved Deep Metric Learning_ (https://arxiv.org/abs/1909.11574). The results using this pipeline for ProxyNCA and Triplet with Semihard Sampling are better than noted in the paper due to an improved implementation of the baseline methods.\n\n**Note:** Baseline implementations can be found at https://github.com/Confusezius/Deep-Metric-Learning-Baselines.\n\n---\n### Requirements\nOur method was tested around\n* Python Version 3.6.6+\n* PyTorch Version 1.0.1+ and Cuda 8.0\n* Faiss(-gpu) 1.5.1 (GPU support optional) for Cuda 8.0\n* Scikit Image 0.14.2\n* Scikit Learn 0.20.3\n* Scipy 1.2.1\n\nTo run with standard batch sizes, at least 11 GB of VRAM is required (e.g. 1080Ti, Titan X).\n\n---\n\n### How To Use\nFor a quick start for standard Deep Metric Learning datasets:\n\n* [CUB200-2011](http://www.vision.caltech.edu/visipedia/CUB-200.html)\n* [CARS196](https://ai.stanford.edu/~jkrause/cars/car_dataset.html)\n* [Stanford Online Products](http://cvgl.stanford.edu/projects/lifted_struct/)\n* [In-Shop Clothes](http://mmlab.ie.cuhk.edu.hk/projects/DeepFashion/InShopRetrieval.html)\n* [PKU Vehicle-ID](https://www.pkuml.org/resources/pku-vds.html)\n\n\nsimply run the sample setups given in `Result_Runs.sh`. These give similar values (*assuming the underlying setup to be the same*) as those reported in the paper. Minor differences are due to choice of seeds and underlying setups.  \n\n---\n\n### Specifics\nThe main script is `main.py`. Running it with default flags will provide a Metric Learning Run with Interclass Mining on CUB200-2011 using Resnet50, Marginloss and Distance-weighted Sampling. For all tweakable parameters and their purpose, please refer to the help-strings in the `main.py`-ArgumentParser. Most should be fairly self-explanatory. Again, good default setups can be found in `Result_Runs.sh`.   \n\n__NOTE__ regarding ProxyNCA for __Online Products__, __PKU Vehicle ID__ and __In-Shop Clothes__: Due to the high number of classes, the number of proxies required is too high for useful training (\u003e10000 proxies).\n\n\n---\n\n### Repo Structure\n```\nRepository\n│   README.md\n|\n|   ### Main Scripts\n|   main.py     (main training script)\n|   losses.py   (collection of loss and sampling impl.)\n│   datasets.py (dataloaders for all datasets)\n│   \n│   ### Utility scripts\n|   auxiliaries.py  (set of utilities)\n|   evaluate.py     (set of evaluation functions)\n│   \n│   ### Network Scripts\n|   netlib.py       (contains impl. for ResNet50 and network utils)\n|   googlenet.py    (contains impl. for GoogLeNet)\n│   \n└───Training Results (generated during Training)\n|    │   e.g. cub200/Training_Run_Name\n|    │   e.g. cars196/Training_Run_Name\n│   \n└───Datasets (should be added, if one does not want to set paths)\n|    │   cub200, cars196 ...\n```\n\n---\n\n\n### Required Dataset Structures\n__CUB200-2011__\n```\ncub200\n└───images\n|    └───001.Black_footed_Albatross\n|           │   Black_Footed_Albatross_0001_796111\n|           │   ...\n|    ...\n```\n\n__CARS196__\n```\ncars196\n└───images\n|    └───Acura Integra Type R 2001\n|           │   00128.jpg\n|           │   ...\n|    ...\n```\n\n__Online Products__\n```\nonline_products\n└───images\n|    └───bicycle_final\n|           │   111085122871_0.jpg\n|    ...\n└───Info_Files\n|    │   bicycle.txt\n|    │   ...\n```\n\n__In-Shop Clothes__\n```\nin-shop\n└───img\n|    └───MEN\n|         └───Denim\n|               └───id_00000080\n|                       │   01_1_front.jpg\n|                       │   ...\n|    ...\n└───Eval\n|    │   list_eval_partition.txt\n```\n\n\n__PKU Vehicle ID__\n```\nvehicle_id\n└───image\n|     │   \u003cimg\u003e.jpg\n|     |   ...\n└───train_test_split\n|     |   test_list_800.txt\n|     |   ...\n```\n\n---\n\n### Stored Data:\nBy default, the following files are saved:\n```\nName_of_Training_Run\n| checkpoint.pth.tar     -\u003e Contains network state-dict.\n| hypa.pkl               -\u003e Contains all network parameters as pickle.\n|                           Can be used directly to recreate the network.\n| log_train_Class.csv    -\u003e Logged training data as CSV.                      \n| log_val_Class.csv      -\u003e Logged test metrics as CSV.                    \n| Parameter_Info.txt     -\u003e All Parameters stored as readable text-file.\n| InfoPlot_Class.svg     -\u003e Graphical summary of training/testing metrics progression.\n| Curr_Summary_Class.txt -\u003e Summary of training (best metrics...).                      \n| sample_recoveries.png  -\u003e Sample recoveries for best validation weights.\n|                           Acts as a sanity test.\n```\n\n---\n\n## Citing Our Paper\nIf you use this repository or wish to cite our results, please use (https://arxiv.org/abs/1909.11574)\n```\n@conference{roth2019mic,\n  title={MIC: Mining Interclass Characteristics for Improved Metric Learning},\n  author={Roth, Karsten, and Brattoli, Biagio, and Ommer, Bj\\\"orn},\n  booktitle={Proceedings of the International Conference on Computer Vision (ICCV)},\n  year={2019}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConfusezius%2FICCV2019_MIC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FConfusezius%2FICCV2019_MIC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConfusezius%2FICCV2019_MIC/lists"}