SenseAI is a research-grade autism screening tool that uses front-facing camera eye-tracking to assess gaze patterns in young children. The app engages children with interactive games while collecting gaze data, which is analyzed using a machine learning model trained on real clinical data.
- Flutter Mobile App - Cross-platform app with child-friendly games
- FastAPI Backend - Gaze data analysis and PDF report generation
- ML Classifier - GradientBoostingClassifier trained on real toddler ASD eye-tracking data
- Butterfly Chase Game - Tests smooth pursuit eye tracking (15 seconds)
- Bubble Pop Game - Tests visual attention and gaze-touch coordination (30 seconds)
- Real-time face detection and gaze tracking using Google ML Kit
- 9-point eye calibration system
- Comprehensive gaze pattern analysis
- Risk assessment with confidence scores
- Professional PDF report generation
- Pastel color themes (soft greens, pinks, cyans)
- Engaging animations and sounds
- Clear visual instructions
- Non-invasive, game-based assessment
+-------------------------------------------------------------+
| Flutter Mobile App |
| +-------------+ +-------------+ +---------------------+ |
| | Child Info |->| Calibration |->| Games (Butterfly/ | |
| | Screen | | Screen | | Bubbles) | |
| +-------------+ +-------------+ +---------------------+ |
| | |
| Gaze Data Collection |
| (ML Kit Face Detection + Iris Tracking) |
+----------------------------+---------------------------------+
| HTTP/REST API
v
+-------------------------------------------------------------+
| FastAPI Backend |
| +--------------+ +--------------+ +-----------------+ |
| | Gaze Pattern |->| ML Classifier |->| PDF Report | |
| | Analyzer | | (95.2% acc) | | Generator | |
| +--------------+ +--------------+ +-----------------+ |
+-------------------------------------------------------------+
The classifier was trained on the Toddler ASD Eye-Tracking Dataset from Zenodo:
"How Attention to Faces and Objects Changes Over Time in Toddlers with Autism Spectrum Disorders: Preliminary Evidence from An Eye Tracking Study"
Dataset Characteristics:
- Subjects: 27 toddlers (18-33 months old)
- Groups: ASD (Group 1) vs Typically Developing (Group 0)
- Metrics: Fixation Duration, Transition patterns, Dwell time, Gaze shift frequency
- Validation: ADOS scores (Autism Diagnostic Observation Schedule)
| Property | Value |
|---|---|
| Algorithm | GradientBoostingClassifier |
| Features | 31 eye-tracking metrics |
| Accuracy | 95.2% (Leave-One-Out Cross-Validation) |
| AUC-ROC | 0.97 |
| Sensitivity | 93% |
| Specificity | 97% |
The model analyzes these gaze pattern metrics:
-
Fixation Metrics
fixation_count- Number of stable gaze pointsmean_fixation_duration- Average fixation lengthstd_fixation_duration- Fixation variabilitytotal_fixation_time- Total time in fixations
-
Saccade Metrics
saccade_count- Number of rapid eye movementsmean_saccade_amplitude- Average saccade distancemean_saccade_velocity- Saccade speed
-
Attention Metrics
time_on_target- % time looking at targettime_in_center- % time in screen centerattention_switches- Gaze shift frequency
-
Tracking Metrics
smooth_pursuit_ratio- Smooth vs jerky trackinggaze_dispersion- Spread of gaze pointslag_behind_target- Tracking delay
backend/
├── autism_classifier.pkl # Trained classifier model
├── autism_classifier_scaler.pkl # Feature scaler
├── autism_classifier_metrics.json # Training metrics
└── datasets/
└── toddler_asd_eye_tracking.xlsx # Training dataset
- Python 3.10+
- Flutter 3.38+
- Android Studio or Xcode (for mobile development)
- Physical Android/iOS device (camera required)
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv #only the first time # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Start the server:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
The API will be available at
http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Get Flutter dependencies:
flutter pub get
-
Update server IP address:
Edit
lib/main.dartand update thebaseUrl:// Line ~30: Update to your server's IP address static const String baseUrl = 'http://YOUR_SERVER_IP:8000';
-
Run on device:
# List available devices flutter devices # Run on specific device flutter run -d <device_id>
If you want to retrain with updated data:
cd backend
python train_with_real_data.pyThis will:
- Load the dataset from
datasets/toddler_asd_eye_tracking.xlsx - Train a new GradientBoostingClassifier
- Save model files to the backend directory
- Output training metrics and cross-validation results
SenseAI/
├── README.md # This file
├── backend/
│ ├── main.py # FastAPI server & endpoints
│ ├── model.py # ML model wrapper
│ ├── gaze_analyzer.py # Gaze pattern analysis
│ ├── train_with_real_data.py # Model training script
│ ├── requirements.txt # Python dependencies
│ ├── autism_classifier.pkl # Trained model
│ ├── autism_classifier_scaler.pkl
│ ├── datasets/
│ │ └── toddler_asd_eye_tracking.xlsx
│ └── reports/ # Generated PDF reports
│
└── frontend/
├── lib/
│ ├── main.dart # App entry point & screens
│ ├── gaze/
│ │ ├── gaze_service.dart # Gaze tracking service
│ │ └── gaze_calibration_screen.dart
│ └── widgets/
│ ├── animated_butterfly.dart # Butterfly game
│ └── interactive_bubbles.dart # Bubble game
├── pubspec.yaml # Flutter dependencies
└── android/ # Android configuration
- Start the app on a mobile device
- Enter child information (name and age)
- Calibration - Child follows animated characters with eyes
- Butterfly Game (15 seconds) - Child follows butterfly with eyes
- Bubble Game (30 seconds) - Child pops bubbles by looking or touching
- Results - View risk assessment and download PDF report
| Score Range | Risk Category | Interpretation |
|---|---|---|
| 0-30 | Low Risk | Typical gaze patterns observed |
| 31-60 | Moderate Risk | Some atypical patterns; monitoring recommended |
| 61-100 | Elevated Risk | Atypical patterns detected; professional evaluation recommended |
Important: This is a screening tool only, not a diagnostic instrument. Always consult qualified healthcare professionals for diagnosis.
The app analyzes these clinical markers:
-
Joint Attention
- Ability to follow gaze/pointing
- Response to social cues
-
Visual Tracking
- Smooth pursuit accuracy
- Target following ability
-
Attention Patterns
- Fixation stability
- Attention switching frequency
- Center bias (tendency to look at screen center)
-
Motor Coordination
- Gaze-touch coordination (bubble game)
- Response latency
The classifier looks for these patterns:
- Reduced social attention (less time on faces/social stimuli)
- Decreased gaze following ability
- Atypical fixation patterns
- Reduced smooth pursuit
- Limited visual exploration
Submit child information to start a new test session.
{
"name": "Child Name",
"age": 3,
"test_datetime": "2024-12-07T10:30:00"
}Upload gaze tracking data from games.
{
"test_id": "uuid-string",
"events": [
{
"timestamp": 1234567890.123,
"x": 0.5,
"y": 0.5,
"target_x": 0.6,
"target_y": 0.4,
"game": "butterfly",
"on_target": true
}
]
}Download the generated PDF report.
-
Training Dataset:
- Zenodo Dataset: "Toddler ASD Eye-Tracking Study" (https://zenodo.org/records/4062063)
-
Key Research Papers:
- Jones, W., & Klin, A. (2013). Attention to eyes is present but in decline in 2-6-month-old infants later diagnosed with autism.
- Klin, A., et al. (2009). Two-year-olds with autism orient to non-social contingencies rather than biological motion.
- Chawarska, K., et al. (2013). Decreased spontaneous attention to social scenes in 6-month-old infants later diagnosed with ASD.