Papers › Counterfactual Reasoning for Multi-Label Image Classification via Patching-Based Training

Counterfactual Reasoning for Multi-Label Image Classification via Patching-Based Training

9 Apr 2024arXiv:2404.06287archive 2025-07-28

Ming-Kun Xie, Jia-Hao Xiao, Pei Peng, Gang Niu, Masashi Sugiyama, Sheng-Jun Huang

The key to multi-label image classification (MLC) is to improve model performance by leveraging label correlations. Unfortunately, it has been shown that overemphasizing co-occurrence relationships can cause the overfitting issue of the model, ultimately leading to performance degradation. In this paper, we provide a causal inference framework to show that the correlative features caused by the target object and its co-occurring objects can be regarded as a mediator, which has both positive and negative impacts on model predictions. On the positive side, the mediator enhances the recognition performance of the model by capturing co-occurrence relationships; on the negative side, it has the harmful causal effect that causes the model to make an incorrect prediction for the target object, even when only co-occurring objects are present in an image. To address this problem, we propose a counterfactual reasoning method to measure the total direct effect, achieved by enhancing the direct effect caused only by the target object. Due to the unknown location of the target object, we propose patching-based training and inference to accomplish this goal, which divides an image into multiple patches and identifies the pivot patch that contains the target object. Experimental results on multiple benchmark datasets with diverse configurations validate that the proposed method can achieve state-of-the-art performance.

PaperPDFCodeCode 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="2404.06287")

Code

Syntology Ran 12 of 15 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · our draft was wrong; 1 ran · fixture could not drive it; 8 ran with no contract checked.

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

xiemk/mlc-pat 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

15 samples harvested; 12 ran; 1 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.

1ran · honoured contract
2ran · our draft was wrong
1ran · fixture could not drive it
8ran
3unverified

Licence: 15 of the 15 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 xiemk/mlc-pat. “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.

average_precision xiemk/mlc-pat/src_files/helper_functions/helper_functions.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · f52b226226096fdd · report
calculate_metric xiemk/mlc-pat/run_PAT-I.py official repository ran no licence file found · pointer only · c1a4354520c04ab6 · report
conv1x1 xiemk/mlc-pat/src_files/models/resnet.py official repository ran · our draft was wrong no licence file found · pointer only · d9def42110729a85 · report
conv3x3 xiemk/mlc-pat/src_files/models/resnet.py official repository ran · our draft was wrong no licence file found · pointer only · 160bb14bd76201b4 · report
get_model_path xiemk/mlc-pat/src_files/models/factory.py official repository ran no licence file found · pointer only · c324d082f762772c · report
get_raw_dict xiemk/mlc-pat/src_files/helper_functions/helper_functions.py official repository ran no licence file found · pointer only · 96e62b62824b856f · report
kill_process xiemk/mlc-pat/run_PAT-T.py official repository ran · honoured contract no licence file found · pointer only · 6840401a1f3d4796 · report
linear_head xiemk/mlc-pat/src_files/models/factory.py official repository ran no licence file found · pointer only · bc7c582ef8068c42 · report
parse_args xiemk/mlc-pat/src_files/helper_functions/helper_functions.py official repository ran no licence file found · pointer only · 044fe3f67aac5e39 · report
resnet xiemk/mlc-pat/src_files/utils/model.py official repository ran no licence file found · pointer only · ec3bc56d56e88c4b · report
thresholding xiemk/mlc-pat/run_PAT-I.py official repository ran no licence file found · pointer only · 5f1d5c1452000082 · report
to_ddp xiemk/mlc-pat/src_files/helper_functions/distributed.py official repository ran no licence file found · pointer only · fa1eb87122247e2f · report
create_model xiemk/mlc-pat/src_files/utils/model.py official repository unverified no licence file found · pointer only · dffe6300676b187f · report
q2l_head xiemk/mlc-pat/src_files/models/factory.py official repository unverified no licence file found · pointer only · e68752297a7b78de · report
reduce_tensor xiemk/mlc-pat/src_files/helper_functions/distributed.py official repository unverified no licence file found · pointer only · 14265d790751cfed · report

Tasks

Causal InferenceCounterfactual ReasoningImage ClassificationMulti-Label Image ClassificationObjectimage-classification

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Causal inference

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