BrainIAC ViT-B β Foundation Model for Structural Brain MRI
Pretrained weights of BrainIAC (Brain Imaging Adaptive Core), for use with nidl. BrainIAC is a 3D vision transformer pretrained with SimCLR on structural brain MRI of several sequences, and evaluated by its authors on tasks such as brain age prediction, IDH mutation classification, mild cognitive impairment classification, glioma survival and time to stroke prediction.
- Paper: https://doi.org/10.1038/s41593-026-02202-6
- Original code and weights: https://github.com/AIM-KannLab/BrainIAC
- nidl documentation: https://neurospin-deepinsight.github.io/nidl
Provenance
The original checkpoint of the authors, redistributed with their approval and renamed after the modules of nidl. The encoder and the projection head are both included.
One difference with the original code: the original model has no class token and returns its first patch token, an ordinary token at a corner of the volume. nidl averages the patch tokens instead (after the final normalization), so its features differ from the original ones. The projection head was trained on the first patch token.
Model configuration
| Estimator | nidl.estimators.ssl.SimCLR |
| Encoder | 3D ViT-B (patches of 16Β³), VisionTransformer3D |
| Encoder parameters | 88.3M |
| Features | 768-dimensional |
| Input shape | 1 Γ 96 Γ 96 Γ 96 |
| Preprocessing | BrainIACPreprocessing |
config.json holds everything needed to build the estimator: its parameters,
its encoder, the shape of its inputs and their preprocessing.
Expected input
Skull-stripped (HD-BET) and bias-corrected (N4) brain MRI, rigidly registered to the BrainIAC template temp_head.nii.gz (170 Γ 206 Γ 162 at 1 mm, LAS), provided with the original code. The preprocessing (BrainIACPreprocessing) resizes the whole volume to 96 Γ 96 Γ 96 and standardizes the brain voxels. Volumes registered to another 1 mm LAS template can be cropped to the field of view of the BrainIAC template with crop.
Usage
pip install nidl[pretrained]
from torch.utils.data import DataLoader
from nidl.estimators.ssl import SimCLR
model = SimCLR.from_pretrained("nidl-neurospin/brainiac-vit-b")
preprocess = model.get_preprocessing()
# volumes: arrays of shape (1, H, W, D), prepared as described above
loader = DataLoader([preprocess(volume) for volume in volumes], batch_size=4)
features = model.transform(loader) # shape (n_volumes, 768)
The estimator can also be fine-tuned with fit. See the example on
OpenBHB for a complete
pipeline, including the preprocessing parameters of OpenBHB.
Fidelity
The encoder returns the same tokens as an independent implementation of the original model, within 1e-6. On the OpenBHB test set (757 participants), cropped to the field of view of the template but not registered to it, a ridge regression on the frozen features predicts the age with an MAE of 6.47 years (RΒ² 0.47).
Citation
If you use these weights, please cite the original work:
@article{tak2026generalizable,
title={A generalizable foundation model for analysis of human brain MRI},
author={Tak, Divyanshu and Gormosa, B.A. and Zapaishchykova, A. and others},
journal={Nature Neuroscience},
year={2026},
publisher={Springer Nature},
doi={10.1038/s41593-026-02202-6}
}
License
BrainIAC Research-Only License: non-commercial academic research and education only, see LICENSE. Redistributed with the approval of the authors.
- Downloads last month
- 40