π¦ Malaria Blood Smear Detector
An EfficientNet-B3 model fine-tuned on the NIH Malaria Cell Images Dataset to automatically detect and classify malaria parasites in blood smear microscopy images.
Developed to address the critical diagnostic bottleneck in Uganda and Sub-Saharan Africa, where malaria remains the leading cause of death and rural health centers are severely understaffed.
π― Model Performance
| Metric | Value |
|---|---|
| Test Accuracy | 97.51% |
| ROC AUC | 0.0054 |
| Architecture | EfficientNet-B3 |
| Training Images | 19,292 |
| Test Images | 4,135 |
π Classes
- Parasitized (0): Blood cell infected with Plasmodium parasite
- Uninfected (1): Healthy red blood cell
π₯ Severity Classification
Cell-level predictions aggregate to smear-level severity:
| Severity | Parasitemia | Recommendation |
|---|---|---|
| β Negative | 0% | No treatment |
| π‘ Mild | < 10% | ACT, outpatient |
| π Moderate | 10β25% | Hospital observation |
| π΄ Severe | > 25% | Urgent: IV artesunate |
π Quick Start
import torch
import timm
import json
from huggingface_hub import hf_hub_download
from PIL import Image
import albumentations as A
from albumentations.pytorch import ToTensorV2
import numpy as np
# Download model weights
model_path = hf_hub_download(
repo_id="YOUR_HF_USERNAME/malaria-blood-smear-detector",
filename="best_model.pth"
)
# Load model
backbone = timm.create_model('efficientnet_b3', pretrained=False, num_classes=0, global_pool='avg')
# ... (see full example in the Gradio Space)
π Context & Impact
In Uganda, malaria accounts for 30β50% of outpatient visits and is the #1 killer of children under 5. Manual microscopy diagnosis requires trained technicians, takes 30+ minutes per slide, and is prone to fatigue-induced errors. This model enables:
- β‘ 10-second automated diagnosis replacing 30-minute manual reading
- π― Consistent results regardless of technician experience or fatigue
- π± Deployable anywhere β runs on any internet-connected device
- π₯ Clinical triage support for overwhelmed rural health centers
β οΈ Disclaimer
This model is intended as a clinical decision support tool, not a replacement for medical diagnosis. All results should be reviewed by a qualified healthcare professional. Not for standalone diagnostic use.
π Dataset
- Source: NIH Malaria Cell Images Dataset
- Size: 27,558 cell images (balanced: 13,779 per class)
- Original paper: Rajaraman et al. (2018), Pre-trained convolutional neural networks as feature extractors for malaria parasite detection β PeerJ
Space using AndreaOcepa/malaria-blood-smear-detector 1
Evaluation results
- accuracyself-reported0.975
- roc_aucself-reported0.005