Skip to content

Latest commit

 

History

History
98 lines (71 loc) · 3.19 KB

File metadata and controls

98 lines (71 loc) · 3.19 KB

DigiClinics — Malaria Screening Web App

AI-assisted malaria risk assessment tool that combines deep learning-based blood smear image analysis with a clinical symptom checker.

Features

  • AI Image Analysis — MobileNetV2-based CNN classifies thin blood smear cell images as Parasitized or Uninfected
  • Symptom Checker — Rule-based scoring with weighted malaria symptoms
  • Risk Dashboard — Aggregated risk level (Low/Medium/High) with breakdown and recommendations
  • Responsive UI — Medical-themed interface, works on desktop and tablet

Quick Start

1. Setup Environment

python -m venv venv
source venv/bin/activate    # Linux/macOS
# venv\Scripts\activate     # Windows

pip install -r requirements.txt

2. Train the Model

The training script automatically downloads the NIH Malaria Cell Images dataset (~350 MB) on first run.

python model_train.py

This will:

  • Download and extract the dataset
  • Train a MobileNetV2-based classifier (~20 epochs with early stopping)
  • Save the model to models/malaria_detector.keras
  • Generate evaluation metrics and plots in models/

Training takes approximately 15–30 minutes on CPU, ~5 minutes with GPU.

3. Run the App

python app.py

Open http://127.0.0.1:5000 in your browser.

How It Works

  1. Patient Intake — Enter patient details and select symptoms
  2. Image Upload — Drag-and-drop a Giemsa-stained thin blood smear cell image
  3. Analysis — The AI model classifies the cell image; symptoms are scored with weighted rules
  4. Risk Score — Final risk = 60% model confidence + 40% symptom score
  5. Results — Dashboard shows risk level, breakdown, and actionable recommendations

Project Structure

malaria/
├── app.py              # Flask backend & API
├── config.py           # Centralized configuration
├── model_train.py      # ML training pipeline
├── requirements.txt    # Python dependencies
├── .gitignore
├── templates/
│   ├── index.html      # Patient intake form
│   └── result.html     # Result dashboard
├── static/
│   ├── css/style.css   # Medical-themed styling
│   └── js/script.js    # Client-side logic
├── models/             # Trained model & evaluation artifacts
└── uploads/            # Temporary image storage (auto-cleaned)

Risk Scoring

Component Weight
ML Model Confidence 60%
Symptom Score 40%
Risk Level Score Range
Low < 35%
Medium 35% – 65%
High > 65%

See roadmap.md Section 7 for full scoring specification.

Dataset

  • Source: NIH Malaria Cell Images Dataset
  • Size: 27,558 cell images (13,779 parasitized, 13,779 uninfected)
  • Format: PNG images of individual cells from Giemsa-stained thin blood smears

Disclaimer

This tool is for research and educational purposes only. It is not a substitute for professional medical diagnosis. Always consult a qualified healthcare provider for definitive malaria testing and treatment.