autism-detector

28
license:mit
by
Archicava
Other
OTHER
New
28 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Code Examples

Outputjson
{
  "prediction": "Healthy" | "ASD",
  "probability": 0.0-1.0,
  "risk_level": "low" | "medium" | "high"
}
Risk Level Thresholdspythonpytorch
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'}")

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.