Papers › Counterfactual Attention Learning for Fine-Grained Visual Categorization and Re-identification

Counterfactual Attention Learning for Fine-Grained Visual Categorization and Re-identification

19 Aug 2021ICCV 2021 10arXiv:2108.08728archive 2025-07-28

Yongming Rao, Guangyi Chen, Jiwen Lu, Jie zhou

Attention mechanism has demonstrated great potential in fine-grained visual recognition tasks. In this paper, we present a counterfactual attention learning method to learn more effective attention based on causal inference. Unlike most existing methods that learn visual attention based on conventional likelihood, we propose to learn the attention with counterfactual causality, which provides a tool to measure the attention quality and a powerful supervisory signal to guide the learning process. Specifically, we analyze the effect of the learned visual attention on network prediction through counterfactual intervention and maximize the effect to encourage the network to learn more useful attention for fine-grained image recognition. Empirically, we evaluate our method on a wide range of fine-grained recognition tasks where attention plays a crucial role, including fine-grained image categorization, person re-identification, and vehicle re-identification. The consistent improvement on all benchmarks demonstrates the effectiveness of our method. Code is available at https://github.com/raoyongming/CAL

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2108.08728")

Code

Syntology Ran 8 of 11 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 8 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

raoyongming/CAL officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 8 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

8ran
3unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from raoyongming/CAL. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BAP raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · 003486e56cfd2870 · report
BasicConv2d raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · ee5a84cd4d4e6a4f · report
InceptionA raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · 32e7d9b157d87237 · report
InceptionAux raoyongming/CAL/fgvc/models/cal.py official repository ran MIT (permissive) · 9e5dae472f33d1cb · report
InceptionB raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · 1ed069706334c6a4 · report
InceptionC raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · be3a20ab4edbbfff · report
InceptionD raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · ca178667076da355 · report
InceptionE raoyongming/CAL/fgvc/models/cal.py official repository ran fingerprinted MIT (permissive) · 6d1c24d8babf109b · report
Inception3 raoyongming/CAL/fgvc/models/cal.py official repository unverified MIT (permissive) · bf7a0b9b99f8c230 · report
WSDAN_CAL raoyongming/CAL/fgvc/models/cal.py official repository unverified MIT (permissive) · 00e4a6e5da3d2d97 · report
inception_v3 raoyongming/CAL/fgvc/models/cal.py official repository unverified MIT (permissive) · 5113305f69f8a813 · report

Tasks

Causal InferenceFew-Shot LearningFine-Grained Image ClassificationFine-Grained Image RecognitionFine-Grained Visual CategorizationFine-Grained Visual RecognitionImage CategorizationMitigating Contextual BiasPerson Re-IdentificationVehicle Re-Identification

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Few-Shot Learning DTD CAL 12-shot Accuracy 54.6 #3 of 4 Archive leaderboard report
Few-Shot Learning DTD CAL 16-shot Accuracy 57.4 #3 of 4 Archive leaderboard report
Few-Shot Learning DTD CAL 4-shot Accuracy 40.9 #3 of 4 Archive leaderboard report
Few-Shot Learning DTD CAL 8-shot Accuracy 50.4 #3 of 4 Archive leaderboard report
Few-Shot Learning FGVC Aircraft CAL 12-shot Accuracy 67.6 #2 of 4 Archive leaderboard report
Few-Shot Learning FGVC Aircraft CAL 16-shot Accuracy 74.3 #2 of 4 Archive leaderboard report
Few-Shot Learning FGVC Aircraft CAL 4-shot Accuracy 35.2 #2 of 4 Archive leaderboard report
Few-Shot Learning FGVC Aircraft CAL 8-shot Accuracy 55.4 #2 of 4 Archive leaderboard report
Few-Shot Learning FGVC Aircraft CAL Harmonic mean 35.2 #2 of 4 Archive leaderboard report
Few-Shot Learning Stanford Cars CAL 12-shot Accuracy 82.9 #3 of 3 Archive leaderboard report
Few-Shot Learning Stanford Cars CAL 16-shot Accuracy 88.9 #3 of 3 Archive leaderboard report
Few-Shot Learning Stanford Cars CAL 4-shot Accuracy 42.2 #3 of 3 Archive leaderboard report
Few-Shot Learning Stanford Cars CAL 8-shot Accuracy 71.8 #3 of 3 Archive leaderboard report
Fine-Grained Image Classification CUB-200-2011 CAL Accuracy 90.6 #12 of 30 Archive leaderboard report
Fine-Grained Image Classification FGVC Aircraft CAL Accuracy 94.2 #11 of 57 Archive leaderboard report
Fine-Grained Image Classification Stanford Cars CAL Accuracy 95.5% #13 of 83 Archive leaderboard report
Mitigating Contextual Bias FGVC Aircraft CAL + ALIA OOD Accuracy (%) 25.1 #2 of 4 Archive leaderboard report
Mitigating Contextual Bias FGVC Aircraft CAL + ALIA Top-1 Accuracy (%) 71.8 #2 of 4 Archive leaderboard report
Mitigating Contextual Bias FGVC Aircraft CAL OOD Accuracy (%) 10.2 #4 of 4 Archive leaderboard report
Mitigating Contextual Bias FGVC Aircraft CAL Top-1 Accuracy (%) 71.0 #4 of 4 Archive leaderboard report
Person Re-Identification DukeMTMC-reID CAL Rank-1 90 #41 of 94 Archive leaderboard report
Person Re-Identification DukeMTMC-reID CAL mAP 80.5 #41 of 94 Archive leaderboard report
Person Re-Identification MSMT17 CAL(ResNet50) Rank-1 84.2 #24 of 43 Archive leaderboard report
Person Re-Identification MSMT17 CAL(ResNet50) mAP 64 #24 of 43 Archive leaderboard report
Person Re-Identification Market-1501 CAL Rank-1 95.5 #55 of 135 Archive leaderboard report
Person Re-Identification Market-1501 CAL mAP 89.5 #55 of 135 Archive leaderboard report
Vehicle Re-Identification VeRi-776 CAL Rank-1 95.4 #15 of 17 Archive leaderboard report
Vehicle Re-Identification VeRi-776 CAL Rank5 97.9 #15 of 17 Archive leaderboard report
Vehicle Re-Identification VeRi-776 CAL mAP 74.3 #15 of 17 Archive leaderboard report
Vehicle Re-Identification VehicleID Large CAL Rank-1 75.1 #9 of 10 Archive leaderboard report
Vehicle Re-Identification VehicleID Large CAL mAP 80.9 #9 of 10 Archive leaderboard report
Vehicle Re-Identification VehicleID Medium CAL Rank-1 78.2 #8 of 9 Archive leaderboard report
Vehicle Re-Identification VehicleID Medium CAL mAP 83.8 #8 of 9 Archive leaderboard report
Vehicle Re-Identification VehicleID Small CAL Rank-1 82.5 #10 of 13 Archive leaderboard report
Vehicle Re-Identification VehicleID Small CAL mAP 87.8 #10 of 13 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections