AI-powered ADHD screening through eye movement analysis
Screen in minutes, not months.
EXCITE is pioneering a new frontier in ADHD detection. Our mission is to develop an accessible, non-invasive screening tool that can identify ADHD indicators through eye movement analysis.
Traditional ADHD diagnosis relies on subjective behavioral assessments and lengthy clinical evaluations. EXCITE offers a different approachโusing the eyes as a window into cognitive function. By analyzing how individuals track visual stimuli, our system can detect patterns associated with attention disorders in minutes, not months.
| Feature | Description |
|---|---|
| ๐ฌ Non-Invasive Screening | No blood tests, no brain scans. Simply watch dots on a screen. |
| โก Rapid Results | Complete screening in under 5 minutes with instant AI analysis. |
| ๐ฆ Portable Hardware | Runs on Raspberry Piโdeploy anywhere for ~$50. |
| ๐ง Research-Backed | Trained on 12,000+ eye-tracking recordings from GazeBase. |
| ๐ Real-Time Visualization | Watch gaze patterns as the AI analyzes eye movements. |
| ๐ Privacy-First | All processing happens locally. Data never leaves the device. |
+------------------------------------------------------------------+
| EXCITE Pipeline |
+------------------------------------------------------------------+
| |
| Camera CV Model ML Model |
| -------- ---> ----------- ---> ----------- ---> Result |
| Eye Video Gaze Extraction ADHD Detection |
| (eyetrack.py) (inference.py) |
| |
| Extracts: Analyzes: |
| - Pupil position - Saccade velocity |
| - Pupil diameter - Fixation stability |
| - Gaze coordinates - Gaze entropy |
| - Validity flags - Temporal patterns |
| |
+------------------------------------------------------------------+
Excite/
โโโ webapp.py # ๐ Web application (Flask + beautiful UI)
โโโ app.py # ๐ฑ Basic web interface
โโโ eyetrack.py # ๐ Computer vision pipeline (pupil detection)
โโโ inference.py # ๐ง ADHD detection model
โโโ train.py # ๐๏ธ Model training script
โโโ run_prediction.py # ๐ฎ Batch prediction utility
โ
โโโ src/ # Core modules
โ โโโ data/ # Data loading (GazeBase, ADHD datasets)
โ โโโ features/ # Feature extraction (velocity, BCEA, etc.)
โ โโโ models/ # ML models (Transformer encoder)
โ โโโ training/ # Training pipeline
โ โโโ inference/ # Real-time detection
โ
โโโ checkpoints/ # ๐ฏ Trained model weights
โ โโโ adhd_model.pt # ADHD classifier
โ โโโ encoder_pretrained.pt Pre-trained encoder
โ โโโ best_classifier.pt # Best performing model
โ
โโโ config/ # โ๏ธ Configuration files
โโโ scripts/ # ๐ง Training scripts (GPU cluster)
โโโ data/ # ๐ ADHD training sequences
โโโ uploads/ # ๐ค User uploaded videos
โโโ outputs/ # ๐ Processing results
# Clone the repository
git clone https://github.com/SuhritP/Excite.git
cd Excite
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtpython webapp.py
# Open http://localhost:5000 in your browserfrom inference import ADHDDetector
# Initialize detector
detector = ADHDDetector()
# Feed eye tracking data frame by frame
for frame in video_frames:
x, y, pupil_diameter = extract_gaze(frame)
result = detector.add_frame(x, y, pupil_diameter, validity=0)
if result:
print(f"ADHD Probability: {result['probability']:.1%}")
print(f"Prediction: {result['prediction']}")Our custom CV system extracts eye movement features in real-time:
- Pupil Detection: Dark-region search with ellipse fitting
- Gaze Estimation: Maps pupil position to visual angle
- Glint Tracking: Corneal reflection for calibration
- Blink Detection: Validity flagging for data quality
At the heart of EXCITE is a state-of-the-art Transformer encoder:
ADHDModel(
(proj): Linear(5, 64) # Input projection
(transformer): TransformerEncoder(
(layers): 3x TransformerEncoderLayer(
d_model=64, nhead=4, dim_feedforward=128
)
)
(head): Linear(64, 2) # Classification head
)- Pre-training: Learn general gaze dynamics from GazeBase (12,000+ recordings)
- Fine-tuning: Specialize on ADHD detection with labeled clinical data
| Biomarker | Description | ADHD Pattern |
|---|---|---|
| Saccadic Velocity | Speed of eye jumps | Faster but less accurate |
| Fixation Stability (BCEA) | Eye wobble during fixation | Higher variability |
| Microsaccade Rate | Tiny involuntary movements | Elevated during tasks |
| Gaze Entropy | Randomness of gaze patterns | Higher unpredictability |
| Pupil Dynamics | Diameter changes | Altered responses |
Griffith, H., Lohr, D., Abdulin, E., & Komogortsev, O. (2020)
Large-scale, multi-stimulus, longitudinal eye movement dataset.
Krejtz, K., et al. (2018)
Pupil size dataset for ADHD research.
Your eye tracker must provide these values per frame:
| Parameter | Type | Description |
|---|---|---|
x |
float | Gaze X position (degrees visual angle) |
y |
float | Gaze Y position (degrees visual angle) |
dP |
float | Pupil diameter (pixels or mm) |
val |
int | Validity flag (0=valid, 1=blink/lost) |
# Quick test
python train.py pretrain --rounds 1 --max_subjects 10
# Full training
python train.py pretrain --rounds 1 2 3 --epochs 50python train.py finetune --pretrained_path checkpoints/encoder_pretrained.pt# Setup environment
./scripts/setup_cluster.sh
# Run training
./scripts/train_full.shEXCITE is a screening tool designed to complementโnot replaceโprofessional clinical evaluation for ADHD.
This software is for research and educational purposes. Always consult qualified healthcare professionals for medical diagnoses.
MIT License - see LICENSE for details.