CoolFace
Modelpublic

Archicava/autism-detector

sourceHugging Facemitupdated 8mo agoView on Hugging Face
1likes12downloads
Model Card

Autism Spectrum Disorder Screening Model

Model Description

A feedforward neural network for autism spectrum disorder (ASD) risk screening using 8 structured clinical input features.

Important: This is a screening tool, NOT a diagnostic instrument. Results must be interpreted by qualified healthcare professionals.

Intended Use

  • —Primary use: Clinical decision support for ASD screening
  • —Users: Healthcare professionals, clinical software systems
  • —Out of scope: Self-diagnosis, definitive diagnosis

Input Features

FieldTypeValid ValuesDescription
developmental_milestonescategoricalN, G, M, CNormal, Global delay, Motor delay, Cognitive delay
iq_dqnumeric20-150IQ or Developmental Quotient
intellectual_disabilitycategoricalN, F70.0, F71, F72None, Mild, Moderate, Severe (ICD-10)
language_disorderbinaryN, YNo / Yes
language_developmentcategoricalN, delay, ANormal, Delayed, Absent
dysmorphismbinaryNO, YNo / Yes
behaviour_disorderbinaryN, YNo / Yes
neurological_examtextnon-empty stringN for normal, or description

Output

json
{
  "prediction": "Healthy" | "ASD",
  "probability": 0.0-1.0,
  "risk_level": "low" | "medium" | "high"
}

Risk Level Thresholds

  • —Low: probability < 0.4
  • —Medium: 0.4 ≤ probability < 0.7
  • —High: probability ≥ 0.7

How to Use

python
import json
import torch
from pathlib import Path
from huggingface_hub import snapshot_download

# Download model
model_dir = Path(snapshot_download("toderian/autism-detector"))

# Load config
with open(model_dir / "preprocessor_config.json") as f:
    preprocess_config = json.load(f)

# Load model
model = torch.jit.load(model_dir / "autism_detector_traced.pt")
model.eval()

# Preprocessing function
def preprocess(data, config):
    features = []
    for feature_name in config["feature_order"]:
        if feature_name in config["categorical_features"]:
            feat_config = config["categorical_features"][feature_name]
            if feat_config["type"] == "text_binary":
                value = 0 if data[feature_name].upper() == feat_config["normal_value"] else 1
            else:
                value = feat_config["mapping"][data[feature_name]]
        else:
            feat_config = config["numeric_features"][feature_name]
            raw = float(data[feature_name])
            value = (raw - feat_config["min"]) / (feat_config["max"] - feat_config["min"])
        features.append(value)
    return torch.tensor([features], dtype=torch.float32)

# Example inference
input_data = {
    "developmental_milestones": "N",
    "iq_dq": 85,
    "intellectual_disability": "N",
    "language_disorder": "N",
    "language_development": "N",
    "dysmorphism": "NO",
    "behaviour_disorder": "N",
    "neurological_exam": "N"
}

input_tensor = preprocess(input_data, preprocess_config)
with torch.no_grad():
    output = model(input_tensor)
    probs = torch.softmax(output, dim=-1)
    asd_probability = probs[0, 1].item()

print(f"ASD Probability: {asd_probability:.2%}")
print(f"Prediction: {'ASD' if asd_probability > 0.5 else 'Healthy'}")

Training Details

  • —Dataset: 315 ASD patients + 100 healthy controls (415 total)
  • —Healthy controls: Include children with ADHD, speech delays, behavioral issues (non-ASD)
  • —Preprocessing: Min-max normalization for numeric, label encoding for categorical
  • —Architecture: Feedforward NN (input → 64 → 32 → 2)
  • —Loss: Cross-entropy
  • —Optimizer: Adam (lr=0.001)

Evaluation

MetricValue
Accuracy0.9398
F1 Score0.9600
ROC-AUC0.9595
Sensitivity0.9365
Specificity0.9500

Confusion Matrix (Test Set, n=83)

Predicted HealthyPredicted ASD
Actual Healthy191
Actual ASD459

Grid Search

Best hyperparameters found via 3-fold cross-validation:

  • —Hidden layers: [64, 32]
  • —Dropout: 0.2
  • —Learning rate: 0.001
  • —Epochs: 300

Limitations

  • —Trained on limited dataset (415 samples)
  • —Healthy controls include children with ADHD, speech delays, and behavioral issues (not ASD)
  • —Not validated across diverse populations
  • —Screening tool only, not diagnostic
  • —Requires all 8 input fields
  • —May have reduced sensitivity for atypical ASD presentations

Ethical Considerations

  • —Results should always be reviewed by qualified professionals
  • —Should not be used as sole basis for clinical decisions
  • —Model performance may vary across different populations
  • —False negatives (4 in test set) may delay intervention
  • —Model trained to distinguish ASD from ADHD/speech delays - not a replacement for differential diagnosis

Files

FileDescription
autism_detector_traced.ptTorchScript model (load with torch.jit.load())
config.jsonModel architecture configuration
preprocessor_config.jsonFeature preprocessing rules (JSON, no pickle)
model.pyModel class definition
requirements.txtPython dependencies

Citation

bibtex
@misc{asd_detector_2026,
  title={Autism Spectrum Disorder Screening Model},
  year={2026},
  publisher={Archicava},
  url={https://huggingface.co/archicava/autism-detector}
}