AI-powered differential diagnosis for malaria, dengue, chikungunya, and typhoid in Ghana's resource-limited settings using fine-tuned MedGemma 1.5
# 🏥 FeverDiff AI: Differential Diagnosis Assistant
**FeverDiff AI** is a MedGemma-powered clinical decision support tool designed to differentiate between four common causes of fever in Ghana: **Malaria, Dengue, Chikungunya, and Typhoid**.
---
## 🚀 Overview
In Ghana, overlapping symptoms lead to dangerous misdiagnosis. FeverDiff AI bridges the gap between rural clinics and specialist support using a hybrid AI approach.
### Key Features
- **MedGemma 1.5 4B + Gemini 2.5-Flash**: Core clinical reasoning powered by specialized medical LLMs.
- **Ghana-Specific Clinical Scoring**: Tailored logic for regional epidemiological patterns.
- **High-Fidelity Dashboard**: Comprehensive data entry for 26+ clinical variables.
- **Researcher Workspace**: Direct JSON import for rapid test scenario validation.
- **GPU-Powered Backend**: Scalable serverless inference via Modal Labs.
---
## 📸 Screenshots
| Dashboard Overview | Clinical Reasoning | Statistical Distribution |
| :---: | :---: | :---: |
| | | |
---
## 🛠️ Tech Stack
- **Frontend**: Vanilla HTML5, CSS3 (Glassmorphism), JavaScript (ES6+).
- **Backend API**: FastAPI on Modal Labs (GPU T4).
- **AI Models**: MedGemma 1.5 4B (Quantized 8-bit), Gemini 2.5-flash for reasoning refinement.
- **Data**: 10,000 synthetic clinical records validated by WHO/CDC guidelines.
---
## 📂 Project Structure
- `modal_backend.py`: GPU serving logic with volume caching.
- `model.py`: Diagnostic engine and prompt engineering.
- `feverdiff_opt.ipynb`: Model optimization and clinical rule validation notebook.
- `static/`: High-fidelity UI assets.
- `test_scenarios.json`: Pre-defined clinical cases for validation.
---
## 🧠 Clinical Intelligence Engine
FeverDiff AI employs a multi-layered diagnostic approach combining hard clinical rules with targeted LLM prompting.
### 1. Unified Targeted Prompting (UTP)
The model receives a structured clinical profile rather than a conversational query. The prompt is engineered to:
- **Enforce …