The problem
Manual microscopy is still the reference method for malaria diagnosis, and it is slow, tiring and depends on the examiner's experience. A pre-screening classifier only helps if its decisions can be checked, so accuracy and interpretability were treated as equally important deliverables.
Approach
- Data: NIH / NLM Malaria Cell Images, 27,558 thin-smear images (about 800 MB), exactly balanced at 13,779 per class, with data augmentation.
- Architecture: four blocks of two Conv2D layers, each closed by batch normalisation and dropout, feeding a Dense(512) → Dense(256) → softmax head. 818k parameters (about 3.1 MB), small enough to train on a laptop.
- Training: early stopping on validation loss to pick the checkpoint and resist over-fitting.
- Explainability: LIME for superpixel-level evidence and class-activation mapping (CAM) for spatial attention, two complementary views of every prediction.
Result
96.19% test accuracy on 5,512 held-out images and AUC 0.99, with visual explanations that highlight the parasite regions inside infected cells.
