SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.04279 · 2022

Detecting Shortcuts in Medical Images -- A Case Study in Chest X-rays

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 2 failures of our instrument; 1 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/2211.04279.json · badge: /api/ran/2211.04279.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
ameliajimenez/shortcuts-chest-xray canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
volesen/slicing-through-bias community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
bootstrapped_brier_score Ran
ran on a synthesized input
volesen/slicing-through-bias/comorbidity_plot.py
code served (permissive licence) · get_code("2379cfb76a515561")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd
import sklearn.mixture
import sklearn.metrics

# Create small sample data with pandas DataFrames
# y_true should be binary (0/1) labels
# y_prob should be probability predictions (0-1 range)
np.random.seed(0)

n_samples = 20
y_true = pd.DataFrame(np.random.randint(0, 2, size=n_samples))
y_prob = pd.DataFrame(np.random.rand(n_samples))

ARGS = {
    "y_true": y_true,
    "y_prob": y_prob,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_embeddings Ran
ran on a synthesized input
volesen/slicing-through-bias/embed.py
code served (permissive licence) · get_code("855d1152f9bc31db")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np
import pandas as pd

torch.manual_seed(0)

class SimpleEmbeddingModel(nn.Module):
    def __init__(self, input_dim, embedding_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, embedding_dim)
    
    def forward(self, X):
        return self.linear(X)

# Create a simple model
model = SimpleEmbeddingModel(input_dim=4, embedding_dim=3)

# Create a simple dataloader as a list of (X, y) tuples
dataloader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([1, 0])),
]

ARGS = {
    "model": model,
    "dataloader": dataloader,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pred Ran
ran; our contract draft was wrong, not the code
ameliajimenez/shortcuts-chest-xray/bin/test_model.py
pointer only (licence: NONE) · get_code("a925c89a990e4ad6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ameliajimenez/shortcuts-chest-xray 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.

load_chexpert Ran
ran on a synthesized input
volesen/slicing-through-bias/load_chexpert.py
code served (permissive licence) · get_code("6199dc6c884f8339")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import pandas as pd
import numpy as np

# Create a temporary directory to serve as root_dir
temp_dir = tempfile.mkdtemp()

# Create sample CSV files that the function expects
CHEXPERT_DISEASE_COLUMNS = ['No Finding', 'Enlarged Cardiomediastinum', 'Cardiomegaly', 'Lung Opacity', 'Lung Lesion', 'Edema', 'Consolidation', 'Pneumonia', 'Atelectasis', 'Pneumothorax', 'Pleural Effusion', 'Pleural Other', 'Fracture', 'Support Devices']

# Create labels CSV file
labels_data = {
    'Unnamed: 0': [0, 1],
    'Unnamed: 0.1': [0, 1],
    'index': [0, 1],
    'path_preproc': ['path1', 'path2'],
    'path_preproc_new': ['img1.jpg', 'img2.jpg'],
    'sex': ['M', 'F'],
    'sex_label': [1, 0],
    'age': [45, 60],
    'ethnicity': ['White', 'Asian'],
    'race': ['White', 'Asian'],
    'patient_id': [100, 101],
    'Frontal/Lateral': ['Frontal', 'Lateral'],
    'AP/PA': ['AP', 'PA'],
}

# Add disease columns with some NaN and numeric values
for col in CHEXPERT_DISEASE_COLUMNS:
    labels_data[col] = [np.nan, 1.0]

labels_df = pd.DataFrame(labels_data)
labels_df.to_csv(os.path.join(temp_dir, 'test.version_0.csv'), index=False)

# Create predictions CSV file
predictions_data = {
    'Index': [0, 1],
    'Prediction_No Finding': [0.1, 0.9],
    'Prediction_Cardiomegaly': [0.8, 0.2],
}
predictions_df = pd.DataFrame(predictions_data)
predictions_df.to_csv(os.path.join(temp_dir, 'predictions.test.version_0.csv'), index=False)

# Create embeddings CSV file
embeddings_data = {
    'emb_0': [0.1, 0.2],
    'emb_1': [0.3, 0.4],
    'emb_2': [0.5, 0.6],
    'emb_3': [0.7, 0.8],
}
embeddings_df = pd.DataFrame(embeddings_data)
embeddings_df.to_csv(os.path.join(temp_dir, 'embeddings.test.version_0.csv'), index=False)

# Also create embeddings with specific size for testing embedding_size parameter
embeddings_size_data = {
    'emb_0': [0.1, 0.2],
    'emb_1': [0.3, 0.4],
}
embeddings_size_df = pd.DataFrame(embeddings_size_data)
embeddings_size_df.to_csv(os.path.join(temp_dir, 'embeddings_test_2.csv'), index=False)

ARGS = {
    'root_dir': temp_dir,
    'split': 'test',
    'version': 0,
    'embedding_size': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
predict Ran
ran on a synthesized input
volesen/slicing-through-bias/embed.py
code served (permissive licence) · get_code("98beba4417329e63")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Define a minimal model that can be called with input X
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = SimpleModel()

# Create a simple dataloader as a list of (X, y) tuples
# Each batch has 2 samples, with 4 features each
dataloader = [
    (torch.randn(2, 4), torch.randn(2, 1)),
    (torch.randn(2, 4), torch.randn(2, 1)),
]

ARGS = {
    'model': model,
    'dataloader': dataloader,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
summarize_clusters Ran
ran on a synthesized input
volesen/slicing-through-bias/comorbidity_plot.py
code served (permissive licence) · get_code("050da65d797a0b7f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd
import sklearn.metrics

# Create a small sample dataframe with the required columns
np.random.seed(0)
n_samples = 20

label_df = pd.DataFrame({
    'target_0': np.random.randint(0, 2, n_samples),
    'class_0': np.random.uniform(0, 1, n_samples),
    'Sex_Female': np.random.randint(0, 2, n_samples),
    'Age': np.random.uniform(20, 80, n_samples),
    'cluster': np.random.randint(0, 3, n_samples),
    'extra_col_1': np.random.uniform(0, 1, n_samples),
    'extra_col_2': np.random.uniform(0, 1, n_samples),
})

ARGS = {
    'label_df': label_df,
    'cluster': 'cluster',
    'include_columns': ['extra_col_1', 'extra_col_2'],
    'threshold': 0.5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
test_epoch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ameliajimenez/shortcuts-chest-xray/bin/test_model.py
pointer only (licence: NONE) · get_code("266eb9acd1e4c6e4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ameliajimenez/shortcuts-chest-xray 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.

load_nih Not yet run
unverified (harvested, no recorded run)
volesen/slicing-through-bias/load_nih.py
code served (permissive licence) · get_code("7b2ebaa0e2b58283")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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 availability of large public datasets and the increased amount of computing power have shifted the interest of the medical community to high-performance algorithms. However, little attention is paid to the quality of the data and their annotations. High performance on benchmark datasets may be reported without considering possible shortcuts or artifacts in the data, besides, models are not tested on subpopulation groups. With this work, we aim to raise awareness about shortcuts problems. We validate previous findings, and present a case study on chest X-rays using two publicly available datasets. We share annotations for a subset of pneumothorax images with drains. We conclude with general recommendations for medical image classification.

For agents

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

get_harvested_code_for_paper("2211.04279")
get_code_for_paper("2211.04279")
have("2211.04279")

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

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

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

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

Connect an agent — have() is free.