{"id":13472091,"url":"https://github.com/abhrac/relational-proxies","last_synced_at":"2025-03-26T15:31:20.115Z","repository":{"id":59747309,"uuid":"538913547","full_name":"abhrac/relational-proxies","owner":"abhrac","description":"Official implementation of \"Relational Proxies: Emergent Relationships as Fine-Grained Discriminators\", NeurIPS 2022.","archived":false,"fork":false,"pushed_at":"2025-02-01T19:34:39.000Z","size":554,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T20:27:34.131Z","etag":null,"topics":["fine-grained-visual-categorization","neurips","neurips-2022","proxy-based-learning","relational-learning"],"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/abhrac.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":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-20T09:43:53.000Z","updated_at":"2025-02-01T19:34:42.000Z","dependencies_parsed_at":"2024-06-01T17:29:29.870Z","dependency_job_id":"592a6f43-b56d-4a5e-af89-0c635124564f","html_url":"https://github.com/abhrac/relational-proxies","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/abhrac%2Frelational-proxies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhrac%2Frelational-proxies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhrac%2Frelational-proxies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhrac%2Frelational-proxies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhrac","download_url":"https://codeload.github.com/abhrac/relational-proxies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245681289,"owners_count":20655165,"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":["fine-grained-visual-categorization","neurips","neurips-2022","proxy-based-learning","relational-learning"],"created_at":"2024-07-31T16:00:51.843Z","updated_at":"2025-03-26T15:31:20.096Z","avatar_url":"https://github.com/abhrac.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Relational Proxies: Emergent Relationships as Fine-Grained Discriminators\n\nOfficial implementation of \"[Relational Proxies: Emergent Relationships as Fine-Grained Discriminators](https://proceedings.neurips.cc/paper_files/paper/2022/hash/c9f95e9ec39fa5ad3d0a562b993b92aa-Abstract-Conference.html)\",\nNeurIPS 2022 (Spotlight).\\\nAdditional links: [Spotlight Presentation](https://nips.cc/virtual/2022/spotlight/65257) | [arXiv](https://arxiv.org/abs/2210.02149) | [Video \u0026 Poster](https://nips.cc/virtual/2022/poster/54901)\n\nOur framework helps learn a cross-view representation by modelling local-to-global emergent relationships\nfor Fine-Grained Visual Categorization (FGVC).\n\n![Model Diagram](./assests/relational_proxies_diagram.png)\n\n## Environment Setup\n\nThis project is implemented using PyTorch. A conda environment with all related dependencies can be created as follows:\n1. Clone the project repository:\n```shell\ngit clone https://github.com/abhrac/relational-proxies.git\ncd relational-proxies\n```\n2. Create and activate conda environment:\n```shell\nconda env create -f environment.yml\nconda activate relational-proxies\n```\n3. Download the .pth file from\n[here](https://drive.google.com/file/d/1P556ct4WTxWgZSLsKj4k9PZ52g6StGFA/view?usp=sharing)\nand place it in the `./view_extractor/` folder under the project root.\n\n## Training\nTo train the model from scratch, run the following:\n```shell\npython3 src/main.py --data_root='RootDirOfAllDatasets' --dataset='DatasetName'\n```\nThe `run_expt.sh` file contains sample training commands.\n\n## Evaluation\nTo evaluate on a dataset using pretrained weights, first download the model for the corresponding dataset from\n[here](https://drive.google.com/drive/folders/1WR9qqFmhArHJqg78wsffhQtAbiW3V77R?usp=sharing)\nand place it under the folder `./checkpoint/$DataSetName/`,\nwhere `./checkpoint` is under the project root, but could optionally be elsewhere too\n(see `src/options.py`). Then, run the following command:\n```shell\npython3 src/main.py --data_root='RootDirForAllDatasets' --dataset='DatasetName' --pretrained --eval_only\n```\n\n## Results\n| |FGVC Aircraft | Stanford Cars |CUB | NABirds | iNaturalist | Cotton Cultivar | Soy Cultivar |\n|:-|:-:|:-:|:-:|:-:|:-:|:-:|:-:|\n|MaxEnt, NeurIPS'18 | 89.76 | 93.85 | 86.54 | - | - | - | - |\n|DBTNet, NeurIPS'19 | 91.60 | 94.50 | 88.10 | - | - | - | - |\n|StochNorm, NeurIPS'20 | 81.79 | 87.57 | 79.71 | 74.94 | 60.75 | 45.41 | 38.50 |\n|MMAL, MMM'21 | 94.70 | 95.00 | 89.60 | 87.10 | 69.85 | 65.00 | 47.00 |\n|FFVT, BMVC'21 | 79.80 | 91.25 | 91.65 | 89.42 | 70.30 | 57.92 | 44.17 |\n|CAP, AAAI'21 | 94.90 | 95.70 | 91.80 | 91.00 | - | - | - |\n|TransFG, AAAI'22 | 80.59 | 94.80 | 91.70 | 90.80 | 71.70 | 45.84 | 38.67 |\n|**Ours (Relational Proxies)** | **95.25** $\\pm$ 0.02| **96.30** $\\pm$ 0.04 | **92.00** $\\pm$ 0.01 | **91.20** $\\pm$ 0.02 |**72.15** $\\pm$ 0.03 | **69.81** $\\pm$ 0.04 | **51.20** $\\pm$ 0.02|\n\n## Disclaimer\nThe pretrained weights provided can be used to reproduce the results in the paper. However, since the training of the models were done using pretrained weights from prior works ([48] in the main paper), and it consisted of several phases with slightly different hyperparameters for each phase, not all of which were always kept track of, running the training scripts from scratch with the default hyperparameters provided here is unlikely to produce expected results. The purpose of the training scripts provided here is to illustrate how the end-to-end pipelines were implemented. The purpose of the pretrained weights provided here is to reproduce the actual results.\n\n## Citation\n```\n@inproceedings{Chaudhuri2022RelationalProxies,\n author = {Abhra Chaudhuri and Massimiliano Mancini and Zeynep Akata and Anjan Dutta},\n booktitle = {Proceedings of Advances in Neural Information Processing Systems (NeurIPS)},\n title = {Relational Proxies: Emergent Relationships as Fine-Grained Discriminators},\n year = {2022}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhrac%2Frelational-proxies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhrac%2Frelational-proxies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhrac%2Frelational-proxies/lists"}