Two studies, one question

How far can structure and unlabelled data stretch a few annotations?

Brain tumour segmentation on multi-contrast MRI and autism classification from resting-state fMRI, each with a model built around a property of the data that the usual baseline ignores: the left-right symmetry of the brain, and the estimation noise of a connectome measured from a few minutes of signal.

oedema non-enhancing core enhancing
held-out test scan
Structural MRI

Bilateral U-Net

MSD Task01 (BraTS): 750 scans, four contrasts each. Every encoder level can read the features of its mirror image across the midline, and the network is pretrained without labels by reconstructing hidden tissue from its contralateral twin.

3D U-Netmasked image modellingDice · HD9596 test scans
Resting-state fMRI

Noise-aware connectome classifier

ABIDE I: 871 scans from 20 sites. Each scan's connectome is re-estimated on six sub-windows, and the classifier is trained on that spread rather than on one point per subject, which penalises connections that are not reproducible within a scan.

SPD geometryvicinal risk5 atlases5 × 10-fold + leave-site-out
Structural MRI · test scans

Tumour viewer

Four co-registered contrasts with the reference annotation and the predictions of both models trained on 10% of the labels. Drag to rotate in 3D, scroll to move through slices.

Scan

loading
View
loading drag · scroll · right-drag for contrast
oedema non-enhancing core enhancing tumour

This scan

Dice (higher is better) and HD95 in mm (lower is better)

select a scan

Structural MRI · 96 held-out scans

Label efficiency

The same U-Net backbone, data pipeline and training budget at every point; only the bilateral blocks and the pretraining differ. Bars are 95% bootstrap intervals over test scans.

Dice against the number of annotated scans

Scan by scan

Each dot is a test scan; above the diagonal, ours is better.

What each part contributes

10% of labels, mean Dice

Boundary error

HD95 in mm, mean over test scans

Resting-state fMRI · deployed model

Connectome

The connections the classifier weighs most, drawn between region centres in MNI space. Warm-coloured edges push the prediction towards autism, blue ones towards typical development. Weights are those of the model fitted on all 871 subjects, in units of standardised features.

Direction
Camera

These are weights of a linear classifier on standardised features, not group differences, and a single weight should not be read as an effect size.

loading drag to rotate · scroll to zoom

Strongest connections

largest absolute weights

Resting-state fMRI · 871 subjects, 20 sites

Classifiers

All models are scored on the same 50 train/test splits (5 repeats of 10-fold cross-validation, stratified by site and diagnosis), and again with each of the 20 sites held out in turn.

Every atlas

ours against the strongest baseline on each atlas

All models, repeated cross-validation

mean over repeats with 95% bootstrap interval

Split by split

difference to the strongest baseline on each split

Leave one site out

accuracy on each held-out site, all five atlases

Calibration

predicted probability against observed frequency, all five atlases

Trust · tumour segmentation · 96 held-out scans

Audit: segmentation

Before relying on a prediction: does the network know when it is wrong, do its probabilities mean what they say, can its volumes be followed over time, where does it fail, and what happens when the images get worse. Each line of the scorecard has a written rule; the evidence is below it.

loading

Does it know when it is wrong?

each dot is a test scan; further right means more uncertain

Declining the most uncertain scans

mean error of the scans that remain

Do voxel probabilities mean what they say?

within five voxels of the predicted or true region

Can volumes be followed?

predicted against reference volume, log scale

Where it fails

Dice by tertile of whole-tumour volume

Worse images

mean Dice on the same scans under the same perturbations

Which contrasts it relies on

Dice lost when one contrast is removed, ours

Same test, U-Net from scratch

for comparison

Where the gradient points

share of gradient × input inside the segmented tumour, by contrast

The bilateral blocks

how much the exchange changes the features, and whether left-right asymmetry alone finds the tumour

Uncertainty and gradient maps of the showcase scans are in the tumour viewer, under Overlay. Rules and limits: the plan page.

Trust · connectome classifier · 871 subjects, 20 sites

Audit: connectome

An AUC alone does not say whether the probabilities can be believed, whether the classifier is reading the site or the head motion instead of the brain, whether it holds in every group, or what it looks at. The scorecard answers with rules written down in advance; the evidence follows.

loading

Calibration

predicted probability of autism against the observed fraction

All models

raw and recalibrated; the recalibration is fitted on other folds only

Declining hard cases

accuracy when only the most confident subjects are scored

Is the AUC a shortcut?

classifiers that see only nuisance variables, on the same folds

Every group

AUC of the noise-aware model inside each group

What it looks at

strongest regions of the shipped classifier

Features are entries of the matrix logarithm of the connectivity matrix, so a single entry is not one edge. Regions and lobe blocks are the safer reading.

Lobe by lobe (AAL)

weight per feature in each block of regions

Stable under refitting?

30 bootstrap refits of the classifier

Is the explanation faithful?

AUC after deleting the features an explanation names

Nothing leaves your browser

Run the models

The connectome classifier runs here in plain JavaScript: shrinkage covariance, matrix logarithm by Jacobi rotations, standardisation and the linear score, on scans of subjects that model never saw during training. The segmentation network runs through ONNX Runtime Web.

fMRI

Classify a resting-state scan

held-out subjects of one cross-validation fold

MRI

Segment a scan

the bilateral U-Net, 10.8M parameters, fetched from Hugging Face

Downloads about 43 MB once, then runs four windows in a background thread: a few minutes on the CPU, faster with WebGPU. The page stays usable meanwhile.
The ideas, interactively

How it works

Three pictures that carry most of the method. The documentation has the derivations.

Bilateral exchange

Every position reads its mirror image across the midline. Move the probe.

Contralateral masking

Each hidden cube has a visible twin on the other side. Compare with ordinary random masking.

Training on a scan's own noise

Each subject is a cloud of window connectomes rather than one point.

From raw download to this page

Reproduce

One Nextflow pipeline runs both studies, locally, in Docker or on a cluster; a test profile runs every stage on synthetic data in a few minutes.

Pipeline

Everything, one command

nextflow run mahdisabetkish/brainssl -profile docker,gpu

Or step by step

pip install -e .
brainssl download abide && brainssl download msd
brainssl prepare abide && brainssl prepare msd
python scripts/run_smri.py
python scripts/run_fmri.py
brainssl report

Inference without Python

brainssl-infer segment --model exports/segmentation \
  --input scan.nii.gz --output seg.nii.gz

Hardware behind the numbers