{"id":13737992,"url":"https://github.com/DarrenZhang01/ExCon","last_synced_at":"2025-05-08T15:32:11.152Z","repository":{"id":97134915,"uuid":"430412415","full_name":"DarrenZhang01/ExCon","owner":"DarrenZhang01","description":"ExCon: Explanation-driven Supervised Contrastive Learning","archived":false,"fork":false,"pushed_at":"2021-12-30T21:38:58.000Z","size":1492,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T00:41:20.800Z","etag":null,"topics":["artificial-intelligence","deep-learning","machine-learning-algorithms","python","representation-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarrenZhang01.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}},"created_at":"2021-11-21T15:59:50.000Z","updated_at":"2023-02-11T16:56:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"e58c9ddb-34be-467e-9819-100de44ce2d9","html_url":"https://github.com/DarrenZhang01/ExCon","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/DarrenZhang01%2FExCon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarrenZhang01%2FExCon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarrenZhang01%2FExCon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarrenZhang01%2FExCon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarrenZhang01","download_url":"https://codeload.github.com/DarrenZhang01/ExCon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253096304,"owners_count":21853573,"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":["artificial-intelligence","deep-learning","machine-learning-algorithms","python","representation-learning"],"created_at":"2024-08-03T03:02:08.425Z","updated_at":"2025-05-08T15:32:09.868Z","avatar_url":"https://github.com/DarrenZhang01.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ExCon: Explanation-driven Supervised Contrastive Learning\n\n### Link to the paper: https://arxiv.org/pdf/2111.14271.pdf\n\n### Contributors of this repo:\n- Zhibo Zhang (zhibozhang@cs.toronto.edu)\n- Jongseong Jang (j.jang@lgresearch.ai)\n- Ruiwen Li (ruiwen.li@mail.utoronto.ca)\n\nCopyright (c) 2021 **LG AI Research** and **University of Toronto**, all rights reserved.\n\nIf you use our code, please cite our paper:\n```\n@misc{zhang2021excon,\n      title={ExCon: Explanation-driven Supervised Contrastive Learning for Image Classification},\n      author={Zhibo Zhang and Jongseong Jang and Chiheb Trabelsi and Ruiwen Li and Scott Sanner and Yeonjeong Jeong and Dongsub Shim},\n      year={2021},\n      eprint={2111.14271},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```\n\nPrepare the Tiny ImageNet dataset (in the path where you want to save the dataset):\n```\nwget -nc https://image-net.org/data/tiny-imagenet-200.zip\nunzip tiny-imagenet-200.zip\npython3 ExCon/utils/val_format.py\n```\n\n### Run ExCon:\nCIFAR-100 dataset\n```python\npython3 ExCon/main_supcon.py --epochs=200 --explainer=\"GradCAM\" --dataset=\"cifar100\" --batch_size=256 --method=\"Ex_SupCon\" --learning_rate=0.5 --temp=0.1 --cosine --negative_pair=1 --validation=0 --background_anchor=0 --exp_epochs=50\n```\nTiny ImageNet dataset\n```python\npython3 ExCon/main_supcon.py --epochs=200 --explainer=\"GradCAM\" --dataset=\"ImageNet\" --batch_size=128 --method=\"Ex_SupCon\" --learning_rate=0.5 --temp=0.1 --cosine --negative_pair=1 --validation=0 --background_anchor=0 --exp_epochs=0 --data_folder=$PATH_TO_DATASET\n```\n\n\n## Reference Repos:\n\n[1] https://github.com/HobbitLong/SupContrast\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDarrenZhang01%2FExCon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDarrenZhang01%2FExCon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDarrenZhang01%2FExCon/lists"}