SSAE-METAFormer: Multi-Atlas rs-fMRI Classification for Autism Spectrum Disorder

Research model | PyTorch | ABIDE-I | Leave-One-Site-Out (LOSO) evaluation

Research use only. This model is an experimental classifier of ASD versus control based on resting-state fMRI functional connectivity. It is not a medical device, has not been prospectively clinically validated, and must not be used on its own to diagnose ASD, assess severity, or make treatment decisions.

Overview

SSAE-METAFormer is a hybrid deep-learning architecture developed for binary classification of Autism Spectrum Disorder (ASD) versus neurotypical/control participants from multi-atlas resting-state functional MRI (rs-fMRI) connectivity features. It combines separate stacked sparse autoencoders (SSAE) for atlas-specific representation learning with a METAFormer-style attention-based fusion network that learns relationships among the atlas representations.

The model was developed as part of the final-year Bachelor of Engineering project “Hybrid Deep Learning Model for Diagnosis of Autism Spectrum Disorder” at ISB&M College of Engineering, Pune (Savitribai Phule Pune University), academic year 2025–2026.

Reported final results

The final project report presents the following LOSO cross-validation results on the ABIDE-I research dataset:

Metric Reported result
Accuracy 75.90%
ROC-AUC 0.8261
Precision 0.7686
Recall / sensitivity 0.7440
F1-score 0.7561

These are the final results reported in the project report, not the older 5-fold, 3-seed figures in the previous model card. LOSO evaluates generalization to acquisition sites excluded from each fold's training data. Performance may differ at other sites and in clinical populations. The report's confusion-matrix description lists 96 correctly classified controls, 93 correctly classified ASD participants, 28 controls misclassified as ASD, and 32 ASD participants misclassified as controls (249 evaluated predictions). The README does not assert that this checkpoint was independently re-evaluated after export.

Dataset and evaluation protocol

  • Dataset: Autism Brain Imaging Data Exchange I (ABIDE-I), a multi-site resting-state fMRI research dataset with ASD and control participants.
  • Evaluation: Leave-One-Site-Out (LOSO) cross-validation. Each iteration holds out one acquisition site for testing and trains on the remaining sites. The project report describes using part of the training data for validation and hyperparameter tuning.
  • Why LOSO: MRI acquisition protocols, scanner hardware, participant composition, and preprocessing can vary by site. Holding out entire sites provides a more demanding cross-site assessment than a random subject-level split.
  • Reporting caveat: These are aggregate results. Per-site performance and external clinical validation are necessary to characterize deployment behavior. All learned preprocessing, feature selection and threshold choices should be fit or selected using training-site data only in each fold to avoid leakage.

Data access: ABIDE / Preprocessed Connectomes Project. Subject-level fMRI scans are not included in this model repository.

Model architecture

Component Configuration
Framework PyTorch
Task Binary ASD (1) vs control (0) classification
Atlas inputs AAL, Schaefer, Harvard–Oxford
Selected connectivity features 50 per atlas
Multi-atlas input tensor (3, 50) per participant
Atlas-specific encoder SSAE, 50 → 128 → 64 → 32
Latent tensor (3, 32)
Fusion METAFormer-style attention-based fusion
Embedding dimension 128
Fusion depth 4 blocks
Attention heads 2 (per supplied deployment manifest)
Dropout 0.25
Auxiliary input Mean framewise displacement (mean FD), when enabled

Processing overview:

Preprocessed resting-state fMRI
          |
  Atlas ROI time series
          |
 Functional connectivity
  (Pearson correlation)
          |
 Fisher z-transform and
 selected FC features
          |
 AAL (50)  Schaefer (50)  Harvard–Oxford (50)
      |          |               |
  Atlas-specific scaling and SSAE encoders
      |          |               |
      32         32              32
          \      |      /
        METAFormer fusion
                |
         Binary classifier
                |
        ASD probability / label

The full scan-to-feature preprocessing must match the pipeline used for training; the .pt checkpoint does not accept raw NIfTI files directly.

Model files

File Purpose
ssae_metaformer_optimized.pt Exported PyTorch checkpoint / deployment bundle
manifest.json Architecture configuration, atlas ordering, feature dimensions, checkpoint and scaler filenames
feature_means.npy Saved feature means used by preprocessing
scaler_AAL.pkl AAL feature scaler
scaler_Schaefer.pkl Schaefer feature scaler
scaler_HarvardOxford.pkl Harvard–Oxford feature scaler
scaler_mean_fd.pkl Mean framewise displacement scaler
preprocessing/ssae_metaformer_inference.py Custom model loading and feature-based inference (upload separately)
preprocessing/fmri_processor.py Scan-to-feature processing (upload separately if redistribution is permitted)

The deployment manifest identifies an input shape of (3, 50), a latent shape of (3, 32), and mean-FD use. Preserve atlas order: AAL → Schaefer → Harvard–Oxford. Some preprocessing information may also be embedded in the checkpoint bundle; retain the external files for compatibility with the original backend unless the inference code is updated and tested.

Installation

Use a Python environment compatible with your original inference implementation (the project manual specifies Python 3.11):

python -m pip install torch numpy scipy scikit-learn joblib huggingface_hub

For raw fMRI preprocessing, the original application additionally uses neuroimaging packages such as nibabel and nilearn. Consult the original project's pinned requirements.txt when available.

Download

from huggingface_hub import snapshot_download

model_dir = snapshot_download(
    repo_id="Vinay2209/ssae-metaformer-asd",
    repo_type="model",
)
print(model_dir)

Custom inference: This is not a standard transformers.AutoModel checkpoint. To obtain predictions, load the exported weights using the matching SSAE-METAFormer architecture and the original preprocessing/inference modules. Follow the bundled manifest and use the fitted scalers; do not substitute freshly fitted scalers or arbitrarily selected connectivity features. The repository needs those custom Python modules before it is independently runnable. Only load PyTorch checkpoints and pickle files from trusted sources.

The original application exposes a FastAPI backend for preprocessing and prediction; the model repository itself is not a hosted inference endpoint. A separate Hugging Face Space or another application deployment is required for an interactive demo.

Training approach

  1. Extract multi-atlas functional-connectivity features from preprocessed rs-fMRI.
  2. Select the training-defined 50 features for each of the three atlases and normalize with training-fitted scalers.
  3. Pretrain atlas-specific sparse autoencoders to learn compact representations with reconstruction and sparsity objectives.
  4. Fuse the three atlas embeddings with attention-based METAFormer blocks and train the binary classification head.
  5. Optimize the classifier using AdamW, learning-rate scheduling, regularization and early stopping as described in the project report.
  6. Evaluate with LOSO cross-validation, holding out one acquisition site at a time.

For reproducibility, consult the project's original training notebook and preprocessing code. Exact checkpoint provenance, split definitions and fold-level predictions should accompany any independently reproduced performance claims.

Intended use and limitations

Intended use: Research on cross-site rs-fMRI functional connectivity, multi-atlas feature fusion, and experimental ASD-versus-control classification.

Not intended for: Standalone ASD diagnosis, population screening, severity grading, treatment decisions, or use with unvalidated scanner sites and patient populations.

Limitations include acquisition-site differences, head-motion confounding, sample-size and demographic imbalances, dependence on exact atlas and feature-selection definitions, and incomplete clinical interpretability. A classifier's probability is not a calibrated measure of ASD severity. Further external validation, calibration assessment, subgroup analysis, and prospective clinical evaluation are needed before clinical use.

Project team and acknowledgements

Developed by Vinay J. Marabe, Vaibhav R. More, Sahil R. Chandankhede, and Darshan V. Chandankhede as a 2025–2026 BE (Artificial Intelligence & Machine Learning) project at ISB&M College of Engineering, Nande, Pune, affiliated with Savitribai Phule Pune University. Project guide: Prof. Kirti Randhe. The project report acknowledges support from MASS IT Solutions.

Citation

If you use this repository in research, please cite the project and this model repository. A journal DOI is not supplied here.

@misc{marabe2026ssaemetaformer,
  title = {SSAE-METAFormer: Multi-Atlas rs-fMRI Classification for Autism Spectrum Disorder},
  author = {Marabe, Vinay J. and More, Vaibhav R. and Chandankhede, Sahil R. and Chandankhede, Darshan V.},
  year = {2026},
  howpublished = {Hugging Face model repository},
  url = {https://huggingface.co/Vinay2209/ssae-metaformer-asd},
  note = {Final-year BE project; reported LOSO evaluation on ABIDE-I}
}

License

Not specified in this model card. The repository owner should choose a license only after confirming permission to distribute the project code, trained weights, and any third-party materials. Dataset access and reuse remain subject to the original ABIDE data terms.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support