SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.05352 · 2020

MoCo-CXR: MoCo Pretraining Improves Representation and Transferability of Chest X-ray Models

arXiv · PDF · Open in the Atlas

Code that ran

2 of 7 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 2 have no contract verdict; 0 failures of our instrument; 5 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/2010.05352.json · badge: /api/ran/2010.05352.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
stanfordmlgroup/MoCo-CXR canonical (classifier label)
classifier basis: census
0 ran · 1 no recorded run
stanfordmlgroup/MedSelect community (classifier label)
classifier basis not recorded on the link
2 ran · 4 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran on a synthesized input
stanfordmlgroup/MedSelect/src/utils.py
code served (permissive licence) · get_code("b3908d9d2a605c86")
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 dict. 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

torch.manual_seed(0)

# Create sample tasks
# Each task is a dictionary with keys: 'cond', 'pool', 'pool_labels', 'query', 'query_labels'
batch_size = 2
pool_size = 5
query_size = 3
embedding_size = 4

task1 = {
    'cond': 'condition_1',
    'pool': torch.randn(pool_size, embedding_size),
    'pool_labels': torch.randint(0, 2, (pool_size,)),
    'query': torch.randn(query_size, embedding_size),
    'query_labels': torch.randint(0, 2, (query_size,))
}

task2 = {
    'cond': 'condition_2',
    'pool': torch.randn(pool_size, embedding_size),
    'pool_labels': torch.randint(0, 2, (pool_size,)),
    'query': torch.randn(query_size, embedding_size),
    'query_labels': torch.randint(0, 2, (query_size,))
}

task_list = [task1, task2]

ARGS = {
    'task_list': task_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 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
sample_once Ran
ran on a synthesized input
stanfordmlgroup/MedSelect/src/utils.py
code served (permissive licence) · get_code("3cac019b51caa971")
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 torch
import numpy as np

torch.manual_seed(0)

# weights: a tensor of shape (batch_size, pool_size) containing logits
# batch_size = 2, pool_size = 4
weights = torch.randn(2, 4)

# k: number of samples to draw from the pool
k = 3

ARGS = {
    "weights": weights,
    "k": k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
accuracy Not yet run
unverified (harvested, no recorded run)
stanfordmlgroup/MoCo-CXR/moco_pretraining/moco/main_moco.py
pointer only (licence: NONE); the stored copy get_code serves, from zbh2047/clipping-algorithms, is pointer only (licence: NONE) · get_code("9b8289076669fe4f")
How it ran

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

concat_all_gather Not yet run
unverified (harvested, no recorded run)
stanfordmlgroup/MedSelect/src/moco/builder.py
code served (permissive licence) · get_code("73cecca9f3575f09")
How it ran

no invocation recorded.

get_eval_loaders Not yet run
unverified (harvested, no recorded run)
stanfordmlgroup/MedSelect/src/moco/get_loader.py
code served (permissive licence) · get_code("677f1011358dc17b")
How it ran

no invocation recorded.

get_loader Not yet run
unverified (harvested, no recorded run)
stanfordmlgroup/MedSelect/src/moco/get_loader.py
code served (permissive licence) · get_code("55935351950f720b")
How it ran

no invocation recorded.

random_baseline Not yet run
unverified (harvested, no recorded run)
stanfordmlgroup/MedSelect/src/utils.py
code served (permissive licence) · get_code("a0f87cdea6b60076")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 2 later) and 5 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
concat_all_gather 138 other papers
8 dated earlier, 130 later · 33 only as an assembly brick
1710.09412 (2017-10)
mixup: BEYOND EMPIRICAL RISK MINIMIZATION
1905.04899 (2019-05)
CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 135 more not named here
accuracy 80 other papers
46 dated earlier, 3 the same month, 31 later
1307.0414 (2013-07)
Challenges in Representation Learning: A report on three machine learning contests
1412.6553 (2014-12)
Speeding-up Convolutional Neural Networks Using Fine-tuned CP-Decomposition
1503.02531 (2015-03)
Distilling the Knowledge in a Neural Network
and 77 more not named here

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

Contrastive learning is a form of self-supervision that can leverage unlabeled data to produce pretrained models. While contrastive learning has demonstrated promising results on natural image classification tasks, its application to medical imaging tasks like chest X-ray interpretation has been limited. In this work, we propose MoCo-CXR, which is an adaptation of the contrastive learning method Momentum Contrast (MoCo), to produce models with better representations and initializations for the detection of pathologies in chest X-rays. In detecting pleural effusion, we find that linear models trained on MoCo-CXR-pretrained representations outperform those without MoCo-CXR-pretrained representations, indicating that MoCo-CXR-pretrained representations are of higher-quality. End-to-end fine-tuning experiments reveal that a model initialized via MoCo-CXR-pretraining outperforms its non-MoCo-CXR-pretrained counterpart. We find that MoCo-CXR-pretraining provides the most benefit with limited labeled training data. Finally, we demonstrate similar results on a target Tuberculosis dataset unseen during pretraining, indicating that MoCo-CXR-pretraining endows models with representations and transferability that can be applied across chest X-ray datasets and tasks.

For agents

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

get_harvested_code_for_paper("2010.05352")
get_code_for_paper("2010.05352")
have("2010.05352")

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

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

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

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

Connect an agent — have() is free.