{"id":37640030,"url":"https://github.com/imageomics/finer-cam","last_synced_at":"2026-01-16T11:15:54.693Z","repository":{"id":273655707,"uuid":"919760751","full_name":"Imageomics/Finer-CAM","owner":"Imageomics","description":"This is an official implementation for Finer-CAM: Spotting the Difference Reveals Finer Details for Visual Explanation. [CVPR'25]","archived":false,"fork":false,"pushed_at":"2025-11-10T03:53:32.000Z","size":5796,"stargazers_count":43,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-10T05:33:14.224Z","etag":null,"topics":["class-activation-maps","computer-vision","explainable-ai","fine-grained-classification","saliency-maps","vision-transformers","visualizations","xai"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Imageomics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-21T00:48:10.000Z","updated_at":"2025-11-10T03:53:36.000Z","dependencies_parsed_at":"2025-04-12T19:12:31.367Z","dependency_job_id":"878334da-a229-431c-8069-92d73e2d52d0","html_url":"https://github.com/Imageomics/Finer-CAM","commit_stats":null,"previous_names":["imageomics/finer-cam"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Imageomics/Finer-CAM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2FFiner-CAM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2FFiner-CAM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2FFiner-CAM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2FFiner-CAM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Imageomics","download_url":"https://codeload.github.com/Imageomics/Finer-CAM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2FFiner-CAM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["class-activation-maps","computer-vision","explainable-ai","fine-grained-classification","saliency-maps","vision-transformers","visualizations","xai"],"created_at":"2026-01-16T11:15:54.183Z","updated_at":"2026-01-16T11:15:54.670Z","avatar_url":"https://github.com/Imageomics.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Finer-CAM : Spotting the Difference Reveals Finer Details for Visual Explanation [CVPR 2025]\nOfficial implementation of \"Finer-CAM [[arxiv]](https://arxiv.org/pdf/2501.11309)\".\n\nCAM methods highlight image regions influencing predictions but often struggle in fine-grained tasks due to shared feature activation across similar classes. We propose **Finer-CAM**, which explicitly compares the target class with similar ones, suppressing shared features and emphasizing unique, discriminative details.\n\nFiner-CAM retains CAM’s efficiency, offers precise localization, and adapts to multi-modal zero-shot models, accurately activating object parts or attributes. It enhances explainability in fine-grained tasks without increasing complexity.\n\n![images](imgs/pipeline.jpg)\n## Update\n\n**`2025.3.13`**: Merged into [jacobgil/pytorch-grad-cam](https://github.com/jacobgil/pytorch-grad-cam), a wonderful library that supports multiple CAM-based methods.\n\n\n\n## Demo \nExperience the power of Finer-CAM with our interactive demos! Witness **accurate localization** of discriminative features.\n\n- \tTry the **multi-modal** demo and see how Finer-CAM activates detailed and relevant regions for diverse concepts: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1plLrL7vszVD5r71RGX3YOEXEBmITkT90?usp=sharing)\n- Test the **classifier** demo to explore class-specific activation maps with enhanced explainability: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SAjRTmGy31G-GjtAc9pVH6isPjm1hWsj?usp=sharing)\n\n## Reqirements\n\n```\npip install grad-cam\n```\n\n\n\n\n## Preparing Datasets\n### Stanford Cars\n1. **Download the dataset** using the following command:\n\n   ```bash\n   curl -L -o datasets/stanford_cars.zip \\\n   https://www.kaggle.com/api/v1/datasets/download/cyizhuo/stanford-cars-by-classes-folder\n\n\n2. **Unzip the downloaded file** \n   ```bash\n   unzip datasets/stanford_cars.zip -d datasets/\n\n3. The structure of `datasets/`should be organized as follows:\n\n```\ndatasets/\n├── train/\n│   ├── Acura Integra Type R 2001/\n│   │   ├── 000405.jpg\n│   │   ├── 000406.jpg\n│   │   └── ...\n│   ├── Acura RL Sedan 2012/\n│   │   ├── 000090.jpg\n│   │   ├── 000091.jpg\n│   │   └── ...\n│   └── ...\n└── test/\n    ├── Acura Integra Type R 2001/\n    │   ├── 000450.jpg\n    │   ├── 000451.jpg\n    │   └── ...\n    ├── Acura RL Sedan 2012/\n    │   ├── 000122.jpg\n```\n\n\n\n## Usage\n\n### Step 1. Generate CAMs for Validation Set\n\n **Run the Script:**\n\n   - Execute the `generate_cams.py` script with the appropriate arguments using the following command:\n     ```bash\n      python generate_cams.py \\\n          --classifier_path \u003cpath_to_classifier_weight\u003e \\\n          --dataset_path \u003cpath_to_dataset_or_image_list\u003e \\\n          --save_path \u003cpath_to_save_results\u003e\n     ```\n\n\n\n\n### Step 2. Visualize Results\n\n **Run the Script:**\n\n   - Execute the `visualize.py` script with the appropriate arguments using the following command:\n     ```bash\n     python visualize.py --dataset_path \u003cpath_to_dataset_directory\u003e \\\n                         --cams_path \u003cpath_to_cams_directory\u003e \\\n                         --save_path \u003cpath_to_save_visualizations\u003e\n     ```\n\n\n\n\n\n## Acknowledgement\n\nWe utilized code from:\n\n- [pytorch_grad_cam](https://github.com/jacobgil/pytorch-grad-cam/tree/61e9babae8600351b02b6e90864e4807f44f2d4a)  \n- [clip-es](https://github.com/linyq2117/CLIP-ES)  \n\nThanks for their wonderful works.\n\n\n# Citation [![Paper](https://img.shields.io/badge/Paper-10.48550%2FarXiv.2501.11309-blue)](https://arxiv.org/abs/2501.11309)\nIf you find this repository useful, please consider citing our work :pencil: and giving a star :star2: :\n```\n@InProceedings{zhang2025finer,\n    author    = {Zhang, Ziheng and Gu, Jianyang and Chowdhury, Arpita and Mai, Zheda and Carlyn, David and Berger-Wolf, Tanya and Su, Yu and Chao, Wei-Lun},\n    title     = {Finer-CAM: Spotting the Difference Reveals Finer Details for Visual Explanation},\n    booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)},\n    month     = {June},\n    year      = {2025},\n    pages     = {9611-9620}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimageomics%2Ffiner-cam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimageomics%2Ffiner-cam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimageomics%2Ffiner-cam/lists"}