Downloads · 30 days
18
14% of all-time downloads
Archicava/autism-detector
autism-detector is a machine learning model from Archicava. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A feedforward neural network for autism spectrum disorder (ASD) risk screening using 8 structured clinical input features.
Downloads · 30 days
18
14% of all-time downloads
All-time downloads
131
Public
Repo size
50.5 KB
Likes
1
Public
Click a slice to open those files.
.pt25.3 KB · 64%
From the Hugging Face model README
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.
| Field | Type | Valid Values | Description |
|---|---|---|---|
developmental_milestones | categorical | N, G, M, C | Normal, Global delay, Motor delay, Cognitive delay |
iq_dq | numeric | 20-150 | IQ or Developmental Quotient |
intellectual_disability | categorical | N, F70.0, F71, F72 | None, Mild, Moderate, Severe (ICD-10) |
language_disorder | binary | N, Y | No / Yes |
language_development | categorical | N, delay, A | Normal, Delayed, Absent |
dysmorphism | binary | NO, Y | No / Yes |
behaviour_disorder | binary | N, Y | No / Yes |
neurological_exam | text | non-empty string | N for normal, or description |
{
"prediction": "Healthy" | "ASD",
"probability": 0.0-1.0,
"risk_level": "low" | "medium" | "high"
}
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'}")
| Metric | Value |
|---|---|
| Accuracy | 0.9398 |
| F1 Score | 0.9600 |
| ROC-AUC | 0.9595 |
| Sensitivity | 0.9365 |
| Specificity | 0.9500 |
| Predicted Healthy | Predicted ASD | |
|---|---|---|
| Actual Healthy | 19 | 1 |
| Actual ASD | 4 | 59 |
Best hyperparameters found via 3-fold cross-validation:
| File | Description |
|---|---|
autism_detector_traced.pt | TorchScript model (load with torch.jit.load()) |
config.json | Model architecture configuration |
preprocessor_config.json | Feature preprocessing rules (JSON, no pickle) |
model.py | Model class definition |
requirements.txt | Python dependencies |
@misc{asd_detector_2026,
title={Autism Spectrum Disorder Screening Model},
year={2026},
publisher={Archicava},
url={https://huggingface.co/archicava/autism-detector}
}