SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.06287 · 2024

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

arXiv · PDF · Open in the Atlas

Code that ran

12 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 10 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.06287.json · badge: /api/ran/2404.06287.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xiemk/mlc-pat canonical (classifier label)
classifier basis: census
12 ran · 3 no recorded run
FunctionStatusWhere it lives
average_precision Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xiemk/mlc-pat/src_files/helper_functions/helper_functions.py
pointer only (licence: NONE); the stored copy get_code serves, from kjmillerCURIS/SPARC, is pointer only (licence: NONE) · get_code("f52b226226096fdd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

calculate_metric Ran
ran, violated the contract we drafted
xiemk/mlc-pat/run_PAT-I.py
pointer only (licence: NONE) · get_code("c1a4354520c04ab6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

conv1x1 Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/models/resnet.py
pointer only (licence: NONE) · get_code("d9def42110729a85")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

conv3x3 Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/models/resnet.py
pointer only (licence: NONE) · get_code("160bb14bd76201b4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_model_path Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/models/factory.py
pointer only (licence: NONE) · get_code("c324d082f762772c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_raw_dict Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/helper_functions/helper_functions.py
pointer only (licence: NONE) · get_code("96e62b62824b856f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

kill_process Ran
ran, honoured the contract we drafted
xiemk/mlc-pat/run_PAT-T.py
pointer only (licence: NONE) · get_code("6840401a1f3d4796")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

linear_head Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/models/factory.py
pointer only (licence: NONE) · get_code("bc7c582ef8068c42")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_args Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/helper_functions/helper_functions.py
pointer only (licence: NONE) · get_code("044fe3f67aac5e39")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

resnet Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/utils/model.py
pointer only (licence: NONE) · get_code("ec3bc56d56e88c4b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

thresholding Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/run_PAT-I.py
pointer only (licence: NONE) · get_code("5f1d5c1452000082")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

to_ddp Ran
ran; our contract draft was wrong, not the code
xiemk/mlc-pat/src_files/helper_functions/distributed.py
pointer only (licence: NONE) · get_code("fa1eb87122247e2f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

create_model Not yet run
unverified (harvested, no recorded run)
xiemk/mlc-pat/src_files/utils/model.py
pointer only (licence: NONE) · get_code("dffe6300676b187f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

q2l_head Not yet run
unverified (harvested, no recorded run)
xiemk/mlc-pat/src_files/models/factory.py
pointer only (licence: NONE) · get_code("e68752297a7b78de")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

reduce_tensor Not yet run
unverified (harvested, no recorded run)
xiemk/mlc-pat/src_files/helper_functions/distributed.py
pointer only (licence: NONE) · get_code("14265d790751cfed")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiemk/mlc-pat when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 2 the same month, 3 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
conv1x1 431 other papers
344 dated earlier, 6 the same month, 70 later, 10 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
conv3x3 312 other papers
238 dated earlier, 7 the same month, 56 later, 10 same year, order not determinable, 1 undated · 31 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
and 309 more not named here
average_precision 7 other papers
6 dated earlier, 1 later
2009.14119 (2020-09)
Asymmetric Loss For Multi-Label Classification
2111.12933 (2021-11)
ML-Decoder: Scalable and Versatile Classification Head
2112.07368 (2021-12)
Simple and Robust Loss Design for Multi-Label Learning with Missing Labels
and 4 more not named here
parse_args 2 other papers
2 dated earlier
2009.14119 (2020-09)
Asymmetric Loss For Multi-Label Classification
2112.07368 (2021-12)
Simple and Robust Loss Design for Multi-Label Learning with Missing Labels
kill_process 1 other paper
1 dated earlier
2107.10834 (2021-07)
Query2Label: A Simple Transformer Way to Multi-Label Classification
reduce_tensor 1 other paper
1 dated earlier
2104.10972 (2021-04)
ImageNet-21K Pretraining for the Masses
to_ddp 1 other paper
1 dated earlier
2104.10972 (2021-04)
ImageNet-21K Pretraining for the Masses

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.06287")
get_code_for_paper("2404.06287")
have("2404.06287")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.06287.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.06287.svg)](https://syntology.ai/paper/2404.06287)

Connect an agent — have() is free.