SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.08326 · 2022

Contrastive learning for regression in multi-site brain age prediction

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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 4 have no contract verdict; 2 failures of our instrument; 0 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.08326.json · badge: /api/ran/2211.08326.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
EIDOSLAB/contrastive-brain-age-prediction community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
EIDOSLAB/contrastive-brain-age-prediction/src/util.py
code served (permissive licence) · get_code("3651da484e7d73c0")
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 list, 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 torch

torch.manual_seed(0)

# output: logits tensor of shape (batch_size, num_classes)
# For batch_size=2, num_classes=4
output = torch.randn(2, 4)

# target: class indices of shape (batch_size,)
# Values should be in range [0, num_classes)
target = torch.tensor([0, 2])

# topk: tuple of k values to compute accuracy for
topk = (1,)

ARGS = {
    'output': output,
    'target': target,
    'topk': topk,
}
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 list, ndim 1, dtype family float — a list 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
arg2bool Ran
ran on a synthesized input
EIDOSLAB/contrastive-brain-age-prediction/src/util.py
code served (permissive licence) · get_code("3235f2a60f631be5")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# arg2bool takes one parameter: val
# It can be:
# - a bool
# - a string ('true' or 'false')
# - an int-convertible value (0 or 1)

ARGS = {
    'val': True
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
conv1x1 Ran
ran; our contract draft was wrong, not the code
EIDOSLAB/contrastive-brain-age-prediction/ramp-submission/estimator.py
pointer only (licence: MIT); the stored copy get_code serves, from Duplums/bhb10k-dl-benchmark, is pointer only (licence: NONE) · get_code("262e5c2a0bf12f36")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Duplums/bhb10k-dl-benchmark, and GitHub detected no licence in that repository 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
EIDOSLAB/contrastive-brain-age-prediction/ramp-submission/estimator.py
pointer only (licence: MIT); the stored copy get_code serves, from Duplums/bhb10k-dl-benchmark, is pointer only (licence: NONE) · get_code("68212b2060dc618d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Duplums/bhb10k-dl-benchmark, and GitHub detected no licence in that repository 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.

gather_age_feats Ran
ran on a synthesized input
EIDOSLAB/contrastive-brain-age-prediction/src/util.py
code served (permissive licence) · get_code("47283968d0e8959f")
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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal model with a .features() method
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 8)
    
    def features(self, x):
        return self.fc(x)

model = MinimalModel()

# Create a minimal dataloader (list of tuples with images, labels, and a third element)
dataloader = [
    (torch.randn(2, 4), torch.randn(2, 5), None),
    (torch.randn(2, 4), torch.randn(2, 5), None),
]

# Create a minimal opts object with a device attribute
class Options:
    def __init__(self):
        self.device = 'cpu'

opts = Options()

ARGS = {
    'model': model,
    'dataloader': dataloader,
    'opts': opts,
}
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 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
load_optimizer Ran
ran on a synthesized input
EIDOSLAB/contrastive-brain-age-prediction/src/main_infonce.py
code served (permissive licence) · get_code("5a63166d06eda6f9")
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 Adam. 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 torch.optim

torch.manual_seed(0)

# Create a minimal model with parameters
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = MinimalModel()

# Create a minimal options object with required attributes
class OptsConfig:
    def __init__(self, optimizer='adam', lr=0.001, momentum=0.9, weight_decay=1e-4):
        self.optimizer = optimizer
        self.lr = lr
        self.momentum = momentum
        self.weight_decay = weight_decay

opts = OptsConfig(optimizer='adam', lr=0.001, momentum=0.9, weight_decay=1e-4)

ARGS = {
    'model': model,
    'opts': opts
}
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 Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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 3 other papers
3 dated earlier · 1 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1611.05431 (2016-11)
Aggregated Residual Transformations for Deep Neural Networks
1904.08921 (2019-04)
Deep Parametric Shape Predictions using Distance Fields
conv3x3 3 other papers
3 dated earlier · 1 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1611.05431 (2016-11)
Aggregated Residual Transformations for Deep Neural Networks
1904.08921 (2019-04)
Deep Parametric Shape Predictions using Distance Fields

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

Building accurate Deep Learning (DL) models for brain age prediction is a very relevant topic in neuroimaging, as it could help better understand neurodegenerative disorders and find new biomarkers. To estimate accurate and generalizable models, large datasets have been collected, which are often multi-site and multi-scanner. This large heterogeneity negatively affects the generalization performance of DL models since they are prone to overfit site-related noise. Recently, contrastive learning approaches have been shown to be more robust against noise in data or labels. For this reason, we propose a novel contrastive learning regression loss for robust brain age prediction using MRI scans. Our method achieves state-of-the-art performance on the OpenBHB challenge, yielding the best generalization capability and robustness to site-related noise.

For agents

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

get_harvested_code_for_paper("2211.08326")
get_code_for_paper("2211.08326")
have("2211.08326")

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

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

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

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

Connect an agent — have() is free.