The problem
Malaria diagnosis still rests on the manual examination of Giemsa-stained thin blood smears: a microscopist scans thousands of red blood cells per slide looking for parasites, a 10 to 30 minute task per patient that suffers from fatigue and varies between readers. In many endemic regions, expert readers are simply unavailable. Convolutional neural networks fit this problem naturally because the decision is visual and local — parasite chromatin dots, ring forms and texture changes inside individual cells are exactly the patterns CNN filters learn. This project builds the complete pipeline on the public NIH malaria cell-image dataset: 27,558 segmented red blood cells, half parasitized and half uninfected, collected from 150 P. falciparum-infected and 50 healthy patients in Bangladesh and annotated by an expert slide reader. The demo presents the result the way a lab would use it — a field of cells scanned and flagged — while the documentation states the boundary clearly: an academic prototype whose every decision needs confirmation by a trained microscopist.
How it works
- Segmented cell images from the NIH set are resized to 128x128 RGB and stain-normalized to reduce color variation between slides.
- Folds are created at the patient level so all cells from one donor stay in a single fold.
- Training applies augmentation — rotations, flips, zooms and stain-color jitter — and optimizes binary cross-entropy with the Adam optimizer.
- Each epoch logs training/validation loss and accuracy; the best checkpoint on validation is kept and exported as weights.
- At inference, each cell passes through the convolutional blocks to a single sigmoid output: the probability of being parasitized.
- The scanner view runs this over a field of cells, flags cells above threshold and reports the field summary.
- The analysis view computes mid-level filter activations on a selected cell and overlays parasite markers where chromatin responses peak.
Tech stack:
- Python 3.10, TensorFlow/Keras or PyTorch (CNN training and inference)
- OpenCV (image loading, preprocessing), NumPy, pandas
- scikit-learn (patient-level splits, metrics)
- Matplotlib, Seaborn (training curves, confusion matrix, ROC)
- Flask demo app (smear scanner + cell analysis views)
- NIH malaria cell-image dataset (27,558 segmented cells, 13,779 per class)
| Parameter | Value |
|---|---|
| Model | 4-block CNN (32-64-128-256 filters) + GlobalAvgPool + Dense(128) + sigmoid |
| Task | Binary classification: parasitized vs uninfected red blood cell |
| Input | Segmented cell image, 128x128 RGB |
| Preprocessing | Stain normalization, resize; augmentation: rotation, flip, zoom, stain jitter |
| Split | Patient-level 80/10/10 train/validation/test |
| Output | Per-cell probability, field-level flagged count |
| Evaluation | Accuracy, precision, recall, F1, ROC-AUC — computed by the notebook during the build |
| Design target | High-90s validation accuracy on the balanced set (target, not a claimed result) |
| Demo | Flask app: scanner grid + single-cell analysis views |
Project features
- [CNN cell classifier] 4-block convolutional network (32 to 256 filters with batch normalization and max-pooling) plus global average pooling and a sigmoid head, trained for binary parasitized/uninfected classification
- [Smear-scanner demo] Grid view that classifies every cell in a field, color-codes parasitized vs uninfected cells and summarizes the field count
- [Single-cell analysis view] Large-cell inspection with activation-derived parasite-chromatin markers and mid-level feature-response readouts (chromatin response, ring-form texture, edge density)
- [Stain-aware preprocessing] Resize to 128x128 RGB, stain normalization and stain-color jitter augmentation to handle the staining variation across slides
- [Patient-level splitting] Train/validation/test folds grouped by patient, so cells from the same donor never appear on both sides — the honest evaluation protocol
- [Full evaluation suite] Accuracy, precision, recall, F1 and ROC-AUC logged by the notebook, with confusion matrix on the held-out split
- [Balanced-dataset design] The NIH set is exactly 50/50, which the report uses to discuss why accuracy alone would be misleading on real-world imbalanced slides
- [Viva-ready documentation] Report covering CNN design, augmentation choices, leakage prevention, error analysis and the medical-prototype disclaimer
What is included
- Complete source code (data pipeline, CNN training script, scanner demo app)
- Trained model weights exported from the included training run
- Jupyter training and evaluation notebook (buyer-run procedure: train, validate, evaluate)
- Project report PDF (background, dataset analysis, methodology, evaluation, error analysis, medical-prototype disclaimer)
- PPT presentation for final review
- Viva Q&A preparation document (CNNs, augmentation, patient-level splits, metrics)
- Setup guide (environment, dataset download, training, running the demo)
Limitations & prerequisites
- This is an academic research prototype, not a medical device: it classifies pre-segmented cell images and cannot diagnose malaria; every flagged cell needs confirmation by a trained microscopist.
- No accuracy figure is promised: the balanced dataset makes high accuracy easier than on real slides, where uninfected cells vastly outnumber infected ones — the report discusses this gap explicitly.
- The model works on segmented cells, not whole slides: cell segmentation is assumed as input, and whole-slide scanning is listed as future scope.
- Staining and microscope variation across labs can shift performance; the build's stain-jitter augmentation mitigates but does not eliminate this.
- Parasite life-stage typing (ring vs trophozoite vs schizont) is not implemented in the base build.
Frequently Asked Questions
Which dataset is used?
The NIH malaria cell-image set: 27,558 segmented red-blood-cell images from Giemsa-stained thin smears (150 P. falciparum-infected + 50 healthy patients, Chittagong, Bangladesh), annotated by an expert reader and curated by the NLM Lister Hill Center (Rajaraman et al., PeerJ 2018). Exactly 13,779 parasitized and 13,779 uninfected.
Why patient-level splits?
Cells from the same patient look alike (same stain batch, same donor). Splitting randomly by cell lets the model memorize donors and inflates scores. Grouping by patient is the honest protocol, and the notebook implements it — a strong viva talking point.
Is the accuracy guaranteed?
No. The design target is high-90s validation accuracy on this balanced set, but the real figures — accuracy, precision, recall, F1, ROC-AUC — are computed by the training notebook during the build and reported in the report. Real-world slides are far more imbalanced, which the report discusses.
Is this a medical device? Can it diagnose malaria?
No. It is an educational research prototype that scores pre-segmented cell images. Diagnosis requires a trained microscopist (or certified device) examining the full slide; this system is never a substitute.
Can it identify the parasite life stage?
Not in the base build — it outputs parasitized vs uninfected only. Life-stage classification (ring, trophozoite, schizont, gametocyte) is documented future scope.
Can it scan a whole microscope slide?
The base build classifies pre-segmented cells. Whole-slide scanning with automatic cell segmentation (e.g. a U-Net segmenter) is listed as future scope and can be developed as an extension. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Biomedical streams.
Components & software requirements
- Python 3.10, TensorFlow/Keras or PyTorch (CNN training and inference)
- OpenCV (image loading, preprocessing), NumPy, pandas
- scikit-learn (patient-level splits, metrics)
- Matplotlib, Seaborn (training curves, confusion matrix, ROC)
- Flask demo app (smear scanner + cell analysis views)
- NIH malaria cell-image dataset (27,558 segmented cells, 13,779 per class)
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.