BrainRotViT: Transformer-ResNet Hybrid for Explainable Modeling of Brain Aging from 3D sMRI
Organizations: Department of Computer Science and Engineering, Bangladesh University of Engineering and Technology
Abstract
Accurate brain-age estimation from structural MRI provides a valuable biomarker for studying healthy aging and neurodegenerative disease. We propose BrainRotViT (Brain ResNet over trained Vision Transformer), a two-stage, slice-based (2.5D) framework that approximates volumetric context while combining the strengths of CNNs and transformers. A Vision Transformer is pretrained on an auxiliary age-sex composite classification task and subsequently frozen. Its per-slice embeddings are stacked into a 160 x 768 feature matrix and processed as a pseudo-image by a lightweight 2D residual CNN regressor, with subject sex incorporated at the final prediction layer. Trained and validated on 5,108 samples from 11 multi-site datasets and tested on four independent held-out cohorts comprising 948 samples, BrainRotViT achieves a validation mean absolute error (MAE) of 3.43 years (Pearson r = 0.98, = 0.96, Spearman = 0.97) and cross-cohort MAEs of 4.79-5.35 years, outperforming retrained 3D-ResNet, SFCN, 3D-ViT, Global-Local Transformer, Triamese-ViT, and TSAN baselines. After age-bias correction and covariate adjustment, brain-age gap is significantly associated with Alzheimer's disease, mild cognitive impairment, and autism spectrum disorder. An interpretability pipeline combining ViT attention with guided backpropagation, saliency sanity checks, and AAL3-based anatomical localization identifies aging-related regions including the occipital lobe, cerebellum, precentral and postcentral gyri, temporal lobes, and medial superior frontal gyrus. BrainRotViT thus provides an efficient and interpretable bridge between CNN and transformer paradigms, demonstrating cross-cohort generalization while yielding biologically meaningful insights into brain aging.
Figures & tables
| Dataset | # Total Samples | # Samples Used | Age (Mean SD) |
| Training + Validation Datasets (Total = 5,108; Train = 4,086, Val = 1,022) | |||
| ADNI [ 36 ] | 5881 | 900 | 63.04 3.54 |
| IXI [ 37 ] | 565 | 565 | 48.69 16.46 |
| ABIDE [ 38 ] | 1114 | 750 | 17.99 9.72 |
| DLBS [ 39 , 40 ] | 315 | 315 | 54.62 20.09 |
| COBRE [ 41 ] | 147 | 146 | 36.98 12.78 |
| Method | MAE | Pearson | Spearman | |
| 3D-ResNet (baseline) | 5.55 | 0.96 | 0.92 | 0.88 |
| 3D-ViT (baseline) | 6.37 | 0.81 | 0.87 | 0.78 |
| SFCN [ 24 ] | 5.03 | 0.96 | 0.95 | 0.91 |
| Two-Stage Age | ||||
| Network (TSAN) [ 67 ] | 3.72 | 0.92 | 0.98 | 0.92 |
| TSAN 1 st -stage | 4.23 | 0.92 | 0.97 | 0.91 |
| Cohort | MAE | Pearson | Spearman | ||
| SALD | 494 | 5.35 | 0.850 | 0.925 | 0.906 |
| AgeRisk | 186 | 5.12 | 0.880 | 0.940 | 0.936 |
| SUDMEX | 135 | 4.87 | 0.350 | 0.740 | 0.760 |
| TrueCrime | 133 | 4.79 | 0.500 | 0.810 | 0.512 |
| Overall | 948 | 5.15 | 0.854 | 0.925 | 0.901 |
| Dataset | Ours | TSAN [ 67 ] | SFCN [ 24 ] | 3DResNet |
| SALD | 5.35 | 5.91 | 5.48 | 6.94 |
| TrueCrime | 4.79 | 5.18 | 6.09 | 12.71 |
| AgeRisk | 5.12 | 5.57 | 7.20 | 8.85 |
| SUDMEX | 4.87 | 5.29 | 7.12 | 10.26 |
| Overall | 5.15 | 5.65 | 6.14 | 8.59 |
| Model | Training Time (h) | Trainable Params | GFLOPs /sample | Peak VRAM |
|---|---|---|---|---|
| BrainRotViT | ||||
| (CNN head) | 4 | 50.4M | 1.6 | 0.23 GB |
| BrainRotViT | ||||
| (Transformer) | 12 | 0.33M | 1,098 | 1.38 GB ‡ |
| SFCN | 20 | 2.96M | 131.7 | 8.03 GB ‡ |
| 3D-ResNet | 24 | 64.2M | 253.4 | 3.98 GB ‡ |
| Component | Alternatives tested | Selected | Alt. MAE |
| ViT pretraining | |||
| ViT backbone | ViT-small, ViT-large, DeiT [ 101 ] , DeiT-tiny, RoPE ViT [ 102 ] , MaxViT [ 103 ] , Swin-tiny [ 104 ] | ViT-base | 3.48–3.71 |
| Age–sex group width | 5 and 20 years | 10 years | 4.72–5.26 |
| Slices per volume | 16 and 64 | 32 | 3.77–3.95 |
| Age/sex supervision | Age classes only; age classes + FiLM sex input; direct age regression (with or without FiLM sex input); no sex input in CNN head | Composite age–sex classes, sex fused in CNN head | 3.56–7.06 |
| Regression head | |||
| Stratum Type | Stratum | MAE (95% CI) | RMSE | Bias | |
| Overall | All | 1119 | 3.517 (3.356–3.683) | 4.509 | -0.158 |
| Age decade | 50s | 32 | 6.085 (5.193–6.927) | 6.561 | 6.056 |
| Age decade | 60s | 208 | 3.629 (3.108–4.164) | 5.220 | 3.098 |
| Age decade | 70s | 620 | 2.921 (2.762–3.090) | 3.623 | 0.123 |
| Age decade | 80s | 230 | 4.027 (3.699–4.353) | 4.787 | -3.664 |
| Age decade | 90s | 29 | 8.587 (7.839–9.462) | 8.891 | -8.587 |
| Analysis | Uncorrected (crude) | (a) Corrected BAG | (b) Corrected + adjusted |
|---|---|---|---|
| AD/MCI, High vs rest (threshold OR) | 5.49 [3.74–8.06] | 4.17 [3.04–5.74], | (secondary) 4.17 |
| AD/MCI, High vs Low (threshold OR) | 6.59 [4.03–10.77] | 6.96 [4.04–11.99], | (secondary) 6.96 |
| AD/MCI ~ BAG, adjusted (age+sex+site) | — | — | OR 1.72 per +1 SD [1.43–2.07], (1.16/yr) |
| AD ~ BAG, adjusted (age+sex+site) | — | — | OR 2.28 per +1 SD [1.73–3.00], |
| Rank | Region | Max Intensity | Total Voxels |
| 1 | Calcarine | 0.999609 | 32921 |
| 2 | Precentral | 0.999533 | 27058 |
| 3 | Occipital | 0.999030 | 79832 |
| 4 | Cuneus | 0.998887 | 40388 |
| 5 | Temporal | 0.998687 | 211174 |
| 6 | Fusiform | 0.998079 | 69355 |
| 3D-ResNet | 3D-ViT | SFCN | Global–Local | Triamese-ViT | TSAN | |
| Type | Baseline | Baseline | Reference | Reference | Reference | Reference |
| Backbone | ResNet-34 (3D) | ViViT tubelet | SFCN | VGG8 + transformer | MultiView ViT ( ) | ScaleDense (2-stage) |
| Key config | blocks [3,4,6,3]; ch. 64–512 | patch , depth-patch 16; dim 512, 8 layers, 8 heads, MLP 2048 | 6 conv stages [32–256,64]; soft-label head | patch 64, step 32; 6 blocks, hidden 512, 8 heads, drop 0.5 | emb 768, 10 layers, 12 heads, MLP 3072; patch , drop 0.1 | , 5 blocks; scale attention; uses sex |
| Input | 2D slices | 3 orthogonal views | MNI vol. + sex | |||
| Loss | MSE | MSE | soft-label KL (bin 1 yr, ) | L1 (MAE) | L1 (MAE) | MSE + ranking ( , ) |
| Optimiser | Adam (amsgrad) | AdamW | SGD ( ) | Adam | Adam (amsgrad) | Adam |
| Baseline | Search space | Budget | Selection metric |
| 3D-ResNet | depth 18, 34, 50 ; lr ; weight decay ; batch size | 10 configs, 1 seed | validation MAE (best checkpoint) |
| 3D-ViT | dim ; depth ; lr ; weight decay | 10 configs, 1 seed | validation MAE (best checkpoint) |
| Stratum | MAE [95% CI] | RMSE | bias | |||
| Overall | all | 1022 | 3.43 [3.24, 3.63] | 4.66 | 0.98/0.97 | |
| Age decade | 10s | 141 | 1.53 [1.30, 1.81] | 2.14 | 0.86/0.79 | |
| 20s | 198 | 2.63 [2.29, 2.97] | 3.58 | 0.64/0.66 | ||
| 30s | 115 | 4.09 [3.49, 4.67] | 5.18 | 0.41/0.42 | ||
| 40s | 92 | 5.07 [4.21, 5.97] | 6.61 | 0.41/0.42 | ||
| 50s | 103 | 4.20 [3.60, 4.83] | 5.21 | 0.48/0.49 |
| Dataset | Excluded | Failure rate | ||
| Training cohorts | ||||
| ADNI | 5896 | 5881 | 15 | 0.3% |
| IXI | 581 | 565 | 16 | 2.8% |
| ABIDE-II | 1114 | 1114 | 0 | 0.0% |
| DLBS | 315 | 315 | 0 | 0.0% |
| COBRE | 148 | 146 | 2 | 1.4% |
| Backbone | MAE |
| ViT-base (ours) | 3.43 |
| ViT-small | 3.67 |
| ViT-large | 3.71 |
| DeiT | 3.59 |
| DeiT-tiny | 3.66 |
| RoPE ViT | 3.62 |
| Group Width (years) | MAE |
| 5 | 4.72 |
| 10 (ours) | 3.43 |
| 20 | 5.26 |
| Slices per Volume | MAE |
| 16 | 3.95 |
| 32 (ours) | 3.43 |
| 64 | 3.77 |
| Front End | MAE |
| CNN with residual blocks (ours) | 3.43 |
| ViT | 6.51 |
| MLP only | 8.12 |
| Bidirectional GRU | 3.76 |
| Bidirectional Mamba | 3.81 |
| Sequential Transformer | 3.76 |
| Model Variant (ViT) | MAE |
| With age–sex composite classes (ours) | 3.43 |
| With age classes only (no sex) | 5.07 |
| With age classes + sex input via FiLM | 5.76 |
| With direct age regression head (no sex) | 5.35 |
| With regression head + sex input via FiLM | 7.06 |
| With sex-aware encoder but CNN without sex input | 3.56 |
| Model Variant | MAE |
| 2D CNN | 3.43 |
| 1D CNN | 3.64 |
| Number of Conv Blocks | MAE |
| 1 | 4.23 |
| 2 | 3.76 |
| 3 (ours) | 3.43 |
| 4 | 3.49 |
| 5 | 3.54 |
| 6 | 3.73 |
| Kernel Sizes | MAE |
| (10,60),(5,15),(2,6) (ours) | 3.43 |
| (12,80),(6,20),(3,8) | 3.47 |
| (6,40),(4,12),(2,6) | 3.82 |
| (8,50),(5,15),(1,4) | 3.54 |
| Dilated variant | 3.50 |
| Activation | MAE |
| SiLU (ours) | 3.43 |
| ReLU | 3.48 |
| Leaky ReLU | 3.52 |
| GELU | 3.71 |
| Configuration | Validation MAE (years) |
| With Sex Fusion | 3.43 |
| Without Sex Fusion | 3.56 |
| Learning Rate | (ours) | ||||
| MAE | 4.52 | 3.43 | 3.83 | 5.10 | 6.13 |
| r | 0.96 | 0.98 | 0.97 | 0.94 | 0.92 |
| R 2 | 0.90 | 0.96 | 0.92 | 0.86 | 0.80 |
| Model Variant | MAE |
| With Residual Connections | 3.43 |
| Without Residual Connections | 3.70 |
| Seed | With residual | Without residual |
| 700 | 3.51 | 3.92 |
| 701 | 3.43 | 3.70 |
| 702 | 3.48 | 3.78 |
| 703 | 3.56 | 5.01 |
| 704 | 3.50 | 4.53 |
| Mean SD |
| Seed | CNN front-end | Bidirectional GRU | Bidirectional Mamba | Sequential Transformer |
| 700 | 3.51 | 3.83 | 3.805 | 3.744 |
| 701 | 3.43 | 3.76 | 3.814 | 3.758 |
| 702 | 3.48 | 3.81 | 3.599 | 3.774 |
| 703 | 3.56 | 3.78 | 3.688 | 3.654 |
| 704 | 3.50 | 3.73 | 3.642 | 3.880 |
| Mean SD |
| Seed | Sex incorporated | Sex not incorporated |
| 700 | 3.51 | 3.71 |
| 701 | 3.43 | 3.56 |
| 702 | 3.48 | 3.74 |
| Mean SD |
| Seed | 2D CNN | 1D CNN |
| 700 | 3.51 | 3.55 |
| 701 | 3.43 | 3.64 |
| 702 | 3.48 | 3.61 |
| 703 | 3.56 | 3.59 |
| 704 | 3.50 | 3.58 |
| Mean SD |
| Cohort | Available | Used | Unique subjects | Selection rule |
| ADNI | 5,881 | 900 | 900 | 1 scan/subject; youngest 900 subjects (50.5–76.4 y) |
| ABIDE-II | 1,114 | 750 | 749 | oldest 750 scans (10–64 y) |
| FCON1000 | 1,355 | 763 | 763 | all processed scans with age and sex recorded |
| CoRR | 3,357 | 377 | 256 | all scans meeting the MPRAGE T1w criterion |
| OASIS-1 | 416 | 300 | 294 | oldest 300 scans (25–96 y) |
Brain Age Prediction
Brain age prediction estimates chronological age from brain scans and uses age gaps to study development, aging, and disease.
See all 17 papers