A multi-modal anemia risk screening system combining questionnaire-based assessment with optional eye image analysis using deep learning.
Modern, professional landing page with medical disclaimers
Interactive chatbot with progressive questioning
Comprehensive risk assessment with AI-powered analysis
Track all past screenings with detailed statistics
Note: Screenshots will display once images are added to the
screenshots/folder.
Run locally to see the application in action:
python app.py
# Open http://localhost:5000Key Features:
- π¬ Interactive chat interface with smooth animations
- π€ ML-powered image analysis (EfficientNet-B0)
- π Comprehensive risk dashboard
- π Screening history tracking
- π¨ Professional medical-grade UI
This tool is for screening purposes only and does NOT provide medical diagnosis.
- Not a substitute for professional medical advice
- Not a replacement for laboratory testing
- Always consult healthcare providers for proper diagnosis
- Interactive Chatbot Interface: Natural conversation flow for symptom assessment
- Rule-Based Screening: Evidence-based risk scoring from clinical indicators
- Optional Image Analysis: Deep learning analysis of conjunctival images (EfficientNet-B0)
- Multi-Modal Fusion: Combines questionnaire + image data for improved accuracy
- Instant Results Dashboard: Clear risk visualization and recommendations
- Session History: Track screening results over time
Frontend (HTML/CSS/JS)
β
Flask Backend (app.py)
β
βββ Rule Engine (rules.py) βββ Risk Score
βββ ML Model (ml_model.py) βββ Image Analysis
βββ Database (database.py) βββ Storage
β
Results Dashboard
anemia_chatbot/
β
βββ app.py # Flask backend
βββ rules.py # Risk calculation logic
βββ ml_model.py # ML model integration
βββ database.py # SQLite database
βββ requirements.txt # Dependencies
β
βββ templates/
β βββ index.html # Landing page
β βββ chat.html # Chat interface
β βββ dashboard.html # Results display
β
βββ static/
β βββ style.css # Styling
β βββ chat.js # Frontend logic
β
βββ uploads/ # User images (created automatically)
cd anemia_chatbot
pip install -r requirements.txtpython app.pyNavigate to: http://localhost:5000
The system uses a trained EfficientNet-B0 model from the parent directory:
../models/image2/efficientnet_b0_cv3_models.pt
Model Performance:
- Accuracy: 66.0%
- ROC-AUC: 0.712
- Trained on 468 pediatric conjunctival images
If the model is not found, the system falls back to rule-based screening only.
- SQLite database:
anemia_screening.db(auto-created) - Stores: answers, risk levels, scores, image paths
- Max file size: 16MB
- Accepted formats: PNG, JPG, JPEG
- Storage:
uploads/folder
Rule-Based Points:
- Age < 18: +1
- Female gender: +1
- Each symptom (fatigue, dizziness, etc.): +1-2
- ML prediction high (>0.7): +3
- ML prediction moderate (0.5-0.7): +2
- ML prediction low-moderate (0.3-0.5): +1
Risk Levels:
- Low Risk: 0-3 points
- Moderate Risk: 4-8 points
- High Risk: 9+ points
- Landing Page β User clicks "Start Screening"
- Chat Interface β Bot asks 10 questions (7 required, 3 optional)
- Image Upload β Optional eye image upload
- Processing β Rule-based + ML analysis
- Dashboard β Results, recommendations, risk score
# System works with rules only if model file is missing
python app.py# Ensure model path is correct in ml_model.py
# Default: ../models/image2/efficientnet_b0_cv3_models.pt
python app.pyGET / Landing page
GET /chat Chat interface
POST /api/submit_answer Save answer
POST /api/upload_image Upload eye image
POST /api/calculate_risk Get risk assessment
GET /dashboard Results page
GET /api/history Get screening history
- No personal identifiers collected
- Images stored locally with timestamps
- Session-based data handling
- No external API calls
- SQLite database (local storage)
Edit rules.py β get_questions() function
Edit rules.py β calculate_risk() function
Replace model file and update path in ml_model.py
Edit files in templates/ and static/ folders
If using this system for research:
Pediatric Anemia Detection using Multi-Modal AI
Authors: [Your Name]
Year: 2025
Institution: [Your Institution]
"Model not found" warning:
- Check model path in
ml_model.py - System works without model (rule-based only)
Images not uploading:
- Check
uploads/folder permissions - Verify file size < 16MB
Database errors:
- Delete
anemia_screening.dbto reset - Database auto-recreates on restart
- Python 3.8+
- Flask 3.0+
- PyTorch 2.1+
- Pillow (PIL)
- NumPy
This project demonstrates:
- Full-stack web development
- ML model deployment
- Medical AI ethics
- User experience design
- Multi-modal data fusion
For questions or issues, please refer to the code comments or create an issue in the repository.
Remember: This is a screening tool, NOT a diagnostic system. Always consult healthcare professionals for medical advice.