A comprehensive machine learning-based system for detecting Autism Spectrum Disorder (ASD) in children using multiple approaches including questionnaire analysis, video processing, and deep learning CNN models.
- Overview
- Features
- System Architecture
- Technologies Used
- Installation
- Usage
- Project Structure
- Dataset Information
- Model Details
- Web Interface
- API Endpoints
- Contributing
- License
- Acknowledgments
This project implements a multi-modal autism detection system that combines:
- Questionnaire-based Assessment: Uses standardized autism screening questions (A-10 questionnaire)
- Video Analysis: Processes video files to extract behavioral patterns using CNN
- Machine Learning Models: Multiple ML algorithms (Random Forest, Decision Trees, KNN, Naive Bayes)
- Deep Learning: Custom CNN architecture for image-based classification
- Web Application: User-friendly Django-based interface for assessments
The system aims to assist healthcare professionals and parents in early detection of autism spectrum disorder in children, enabling timely intervention and support.
- ๐ฏ Multi-Modal Detection: Combines questionnaire data with video/image analysis
- ๐งช Machine Learning Pipeline: Implements multiple algorithms for comparison and ensemble predictions
- ๐ฅ Video Processing: Extracts frames from videos for behavioral analysis
- ๐ Data Visualization: Interactive charts and analysis using Streamlit and Plotly
- ๐ค User Management: Registration, login, and authentication system
- ๐พ Database Integration: MySQL database for storing user data and results
- ๐ Model Training: Includes scripts for training custom CNN models
- ๐ Admin Dashboard: Separate admin interface for managing the system
- Question-based autism screening (10-question assessment)
- Video upload and frame extraction
- CNN-based image classification (Autistic/Non-Autistic)
- Multiple ML model comparison
- Result visualization and reporting
- Historical data tracking
โโโโโโโโโโโโโโโโโโโ
โ Web Interface โ (Django)
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโดโโโโโ
โ Views โ (Request Handling)
โโโโโโฌโโโโโ
โ
โโโโโโดโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโดโโโโโ โโโโโโโโโโดโโโโโโ
โ MySQL โ โ ML Pipeline โ
โ DB โ โ - CNN โ
โโโโโโโโโโ โ - RF/KNN โ
โ - Analysis โ
โโโโโโโโโโโโโโโโ
- Python 3.8+: Core programming language
- Django 2.2.8: Web framework
- TensorFlow 2.6.2: Deep learning framework
- Keras 2.6.0: High-level neural networks API
- OpenCV 4.5.5: Video and image processing
- scikit-learn 0.24.2: ML algorithms and preprocessing
- pandas 1.3.5: Data manipulation and analysis
- numpy 1.21.6: Numerical computing
- seaborn 0.11.2: Statistical data visualization
- plotly 5.13.1: Interactive visualizations
- HTML/CSS: Web interface templates
- Streamlit 1.19.0: Interactive data apps
- Bootstrap: Responsive design (implied from templates)
- MySQL: Primary database
- mysqlclient 1.4.5: MySQL database connector
- SQLite3: Secondary database option
- Python 3.8 or higher
- MySQL Server
- Git
- pip (Python package manager)
git clone https://github.com/Venu22003/Autism-detection-system.git
cd Autism-detection-system# Windows
python -m venv venv
venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt- Create MySQL Database:
CREATE DATABASE autism;- Import Database Schema:
mysql -u root -p autism < database/autism.sql- Configure Database Settings in
textutils/settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'autism',
'USER': 'root',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '3306',
}
}python manage.py migrate# Create necessary directories
mkdir -p output_frames
mkdir -p static/uploads# Start the development server
python manage.py runserver
# Access the application at:
# http://localhost:8000Or use the provided batch file (Windows):
run.batstreamlit run first.py# Train the CNN model on your dataset
python cnn.pyThis will:
- Load training and test data from
dataset/ - Train the model for 25 epochs
- Save the model as
autism_detection_model.h5
# Process a video file to extract frames
python main.py path/to/video.mp4autism-detection-system/
โโโ manage.py # Django management script
โโโ requirements.txt # Python dependencies
โโโ README.md # Project documentation
โโโ LICENSE # License file
โโโ .gitignore # Git ignore rules
โ
โโโ textutils/ # Main Django app
โ โโโ __init__.py
โ โโโ settings.py # Django settings
โ โโโ urls.py # URL routing
โ โโโ views.py # View functions
โ โโโ models.py # Database models
โ โโโ wsgi.py # WSGI config
โ โโโ asgi.py # ASGI config
โ
โโโ templates/ # HTML templates
โ โโโ index.html # Home page
โ โโโ login.html # User login
โ โโโ registration.html # User registration
โ โโโ autism.html # Assessment results
โ โโโ find_artism.html # Assessment form
โ โโโ analyze1.html # Admin dashboard
โ โโโ analyze2.html # Video upload
โ โโโ analyze3.html # Video listing
โ โโโ analyze4.html # Results display
โ โโโ style.css # Stylesheet
โ
โโโ static/ # Static files
โ โโโ uploads/ # Uploaded videos
โ
โโโ data/ # Data files
โ โโโ Autism-Child-Data.csv # Raw dataset
โ โโโ temp.csv # Temporary data
โ
โโโ dataset/ # Training/test images
โ โโโ training_set/
โ โ โโโ Autistic/ # Autistic class images
โ โ โโโ Non_Autistic/ # Non-autistic class images
โ โโโ test_set/
โ โโโ Autistic/
โ โโโ Non_Autistic/
โ
โโโ database/ # Database files
โ โโโ autism.sql # MySQL schema
โ
โโโ output_frames/ # Extracted video frames
โ
โโโ Models & Scripts:
โโโ cnn.py # CNN model training
โโโ predict.py # Prediction script
โโโ main.py # Video frame extraction
โโโ first.py # Streamlit dashboard
โโโ views.py # Additional views
โโโ test_mysql.py # Database test
โ
โโโ Data Files:
โโโ dataset2.csv # Questionnaire dataset
โโโ featuresdb6.csv # Feature database
โโโ pcdb6.csv # Principal components
โโโ outputs_main.csv # Model outputs
โโโ autism_detection_model.h5 # Trained CNN model
โ
โโโ Documentation:
โโโ SETUP_INSTRUCTIONS.md # Setup guide
โโโ QUICKSTART.md # Quick start guide
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ MYSQL_SETUP.md # MySQL setup guide
โโโ GITHUB_SETUP.md # GitHub setup guide
- Questions: 10 autism screening questions (Q1-Q10)
- Demographics: Age, gender
- Medical History: Jaundice history, family ASD history
- Target: Class label (Autistic/Non-Autistic)
- Source: Based on standardized autism screening questionnaires
- Classes: Autistic, Non_Autistic
- Structure: Organized in training_set and test_set folders
- Format: Images (JPG/PNG)
- Size: 64x64 pixels (resized during preprocessing)
- 10 behavioral assessment scores
- Age (numerical)
- Gender (categorical)
- Jaundice history (Yes/No)
- Family ASD history (Yes/No)
Model: Sequential
_________________________________________________________________
Layer (type) Output Shape Params
=================================================================
Conv2D (32 filters, 3x3) (None, 62, 62, 32) 896
MaxPooling2D (2x2) (None, 31, 31, 32) 0
Conv2D (32 filters, 3x3) (None, 29, 29, 32) 9248
MaxPooling2D (2x2) (None, 14, 14, 32) 0
Flatten (None, 6272) 0
Dense (128 units, ReLU) (None, 128) 802944
Dense (1 unit, Sigmoid) (None, 1) 129
=================================================================
Total params: 813,217
Trainable params: 813,217- Optimizer: Adam
- Loss Function: Binary Crossentropy
- Metrics: Accuracy
- Epochs: 25
- Batch Size: 32
- Input Shape: (64, 64, 3)
- Data Augmentation: Rescaling (1./255)
The system also implements traditional ML algorithms:
- Random Forest Classifier
- K-Nearest Neighbors (KNN)
- Decision Trees
- Naive Bayes
- Logistic Regression
-
Home Page (
/)- Welcome page with system overview
- Navigation to login/registration
-
Registration (
/registration)- New user registration
- Fields: Name, Email, Mobile, User ID, Password
-
Login (
/login)- User authentication
- Redirects to assessment page
-
Autism Assessment (
/analyze)- 10-question autism screening
- Demographic information collection
- Instant result display
-
Video Upload (
/analyze2)- Upload video files for analysis
- Video description input
-
Results (
/autism)- Display assessment results
- Classification: Autistic/Non-Autistic
-
Admin Login (
/login1)- Admin credentials:
admin/admin
- Admin credentials:
-
Admin Dashboard (
/analyze1)- System overview
- User management
-
Video Management (
/analyze3,/analyze4)- View uploaded videos
- Process video files
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Home page |
| POST | /registration |
User registration |
| POST | /login |
User login |
| POST | /login1 |
Admin login |
| GET/POST | /analyze |
Autism assessment form |
| GET | /find |
Assessment page |
| GET | /analyze1 |
Admin dashboard |
| POST | /analyze2 |
Video upload |
| GET | /analyze3 |
Video list view |
| GET | /analyze4 |
Video results view |
| POST | /output |
Video processing |
The system achieves the following performance metrics (approximate):
- CNN Model Accuracy: ~85-90% on test set
- Random Forest Accuracy: ~88% on questionnaire data
- Precision: High precision for early detection
- Recall: Optimized for minimizing false negatives
Note: Performance may vary based on dataset quality and size.
Key configurations to modify:
# Security
SECRET_KEY = 'your-secret-key-here'
DEBUG = False # Set to False in production
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'autism',
'USER': 'your_username',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '3306',
}
}
# Static files
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
# Media files
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static/uploads')python test_mysql.pypython predict.pypython main.py test_video.mp4- Set Environment Variables:
export DEBUG=False
export SECRET_KEY='your-production-secret-key'
export DATABASE_URL='mysql://user:pass@host:port/dbname'- Collect Static Files:
python manage.py collectstatic- Use Production Server (e.g., Gunicorn):
pip install gunicorn
gunicorn textutils.wsgi:application --bind 0.0.0.0:8000- Configure Nginx (optional):
server {
listen 80;
server_name your-domain.com;
location /static/ {
alias /path/to/staticfiles/;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}We welcome contributions to improve this autism detection system! Please see CONTRIBUTING.md for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guide for Python code
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
-
Dataset Sources:
- Autism screening questionnaire data
- Image datasets for CNN training
-
Frameworks & Libraries:
- TensorFlow and Keras teams
- Django community
- scikit-learn developers
-
Research References:
- Autism screening methodologies
- Deep learning for medical diagnosis
- Early autism detection studies
- Project Repository: GitHub
- Issues: Report bugs or request features
If you use this project in your research, please cite:
@software{autism_detection_system,
title={Autism Detection System using Machine Learning and Deep Learning},
author={Your Name},
year={2025},
url={https://github.com/Venu22003/Autism-detection-system}
}This system is designed as an assistive tool for autism screening and should NOT replace professional medical diagnosis. Always consult qualified healthcare professionals for accurate diagnosis and treatment plans. The predictions made by this system are based on machine learning models and may not be 100% accurate.
- Add more diverse datasets
- Implement real-time video analysis
- Add multi-language support
- Integrate with mobile applications
- Improve model accuracy with ensemble methods
- Add detailed reporting and analytics
- Implement user feedback mechanism
- Add API for third-party integrations
- Deploy as cloud service (AWS/Azure/GCP)
- Add explainable AI features (LIME/SHAP)
Made with โค๏ธ for early autism detection and intervention
Last Updated: November 2025