← Back to projects
SPARK Academy capstone

White Blood Cells as False-Positive Sources in Malaria Detection

YOLOv8OpenCVDBSCANGlobal HealthObject Detection

The clinical picture

A microscopist in a district clinic puts a Giemsa-stained thick blood smear under the lens and starts counting. This is still the WHO-recommended standard for diagnosing malaria, and it has been for decades, because it identifies which Plasmodium species is present and different species need different treatment.

The stakes are large. In 2023 sub-Saharan Africa accounted for roughly 94 percent of an estimated 282 million malaria cases worldwide and 95 percent of 610,000 deaths.

Delivering that standard at scale is the hard part. Trained technicians are scarce, agreement between observers varies, and the infrastructure for consistent diagnosis is often simply not there. Which is why automated detection is attractive.

Why it's hard

Automated detectors have a specific failure mode that matters more in this setting than in most: the false positive. Flagging a parasite where there is none can send an uninfected patient home on antimalarial treatment.

The risk is worst exactly where the technology is most needed. In low-resource settings there is often no confirmatory test to catch the error, so a model's mistake becomes a treatment decision.

There is a long-standing suspicion about where these false positives come from. White blood cells are on every thick smear, unavoidably, because microscopists count parasites against a running WBC tally. And WBC nuclear lobes and chromatin fragments share three properties with early-stage ring-form trophozoites: small size, round shape, and intense purple staining.

So the hypothesis is entirely plausible. A detector trained only on parasite labels has no internal representation for white blood cells, and might be calling their fragments parasites. Plausible, widely assumed, and never directly tested.

The idea

This project ran the controlled experiment that had been missing, and then tried hard to prove the hypothesis wrong.

Two detectors were trained that were identical in every respect except the label set: one with parasite labels only, one with parasite and white blood cell labels. Any difference between them is attributable to the annotation strategy and nothing else.

Then seven independent spatial and statistical analyses asked the same question from different angles: do false positives actually occur where the white blood cells are?

How it works

Both models are YOLOv12s, trained for 75 epochs on 1024x1024 images with AdamW on an NVIDIA A100, using the Lacuna Malaria Detection dataset of 8,000 thick-smear images from Uganda and Ghana. The held-out test set holds 412 images with 2,374 parasite instances.

Errors were decomposed with TIDE, which splits detector failures into interpretable categories (background, localization, classification, duplicate, miss) rather than hiding them inside an aggregate mAP score.

The seven spatial analyses: Euclidean distance from each false positive to the nearest white blood cell via a k-d tree, tested with Mann-Whitney U; stratification into five proximity bands; Ripley's Cross-K against a Monte Carlo complete-spatial-randomness envelope; pixel-wise correlation between kernel density surfaces; global Moran's I with LISA hot-spot mapping; overdispersion testing of per-image counts against Poisson and Negative Binomial nulls; and DBSCAN clustering to see whether false-positive clusters sit near white blood cells.

Model comparison used paired bootstrap with BCa intervals, Wilcoxon signed-rank, and a BH-corrected stratified McNemar test. Calibration was assessed with temperature scaling and multivariate isotonic regression.

What happened

All seven analyses point the same way, and they refute the hypothesis.

The TIDE decomposition is the most direct evidence: 95 percent of false positives are pure background detections that do not overlap any annotated object at all, and there are exactly zero classification errors. Not a single parasite prediction overlaps a white blood cell box. The class-confusion hypothesis is falsified outright.

The spatial evidence goes further and reverses the expected direction. Ripley's Cross-K shows repulsion rather than attraction at every radius tested: false positives occur near white blood cells less often than chance would predict. Distance stratification agrees, with the false-positive rate lowest close to white blood cells and rising steadily with distance. Over 79 percent of false positives fall more than 300 pixels from any annotated white blood cell. DBSCAN found nine false-positive clusters and none of them were near a white blood cell.

So where do the errors come from? Overdispersion testing points at slide preparation. False-positive counts vary by image far more than a Poisson process allows, tracking preparation quality rather than cell density. The likely culprits are Giemsa stain debris, lysed-cell fragments, and early-stage ring forms that were never annotated in the first place.

The two-class model is still better overall, at mAP50 0.859 against 0.755. But the advantage is uniform across every proximity band, including the most distant one. That uniformity is the tell: the gain comes from richer shared representations learned through multi-task training, not from suppressing white blood cell errors.

Limitations and what's next

The practical conclusion changes what you should actually do. If false positives are driven by preparation variability rather than cell confusion, then the fix is augmentation against staining artifacts and broader coverage of preparation conditions, not more white blood cell labels.

That said, adding white blood cell labels is still worth doing. It is effectively free, since microscopists already count white blood cells as part of standard practice. It improves precision from 51 to 57 percent, it improves calibration, and it adds no inference cost at all, which makes it a sensible upgrade for a resource-constrained clinic.

Calibration turned out to matter more than expected. Multivariate isotonic regression cut expected calibration error by 81 percent for the parasite class, with bounding box height and width as the dominant features, consistent with the elongated boxes that ring-stage parasites produce.

The precision number is the one to sit with. At a realistic operating threshold the parasite-only model is right about half the time, which is not deployable where nothing downstream will catch the error.

Next: extend the same spatial-causal framework to other suspected confounders such as platelet clumps and unannotated early-stage parasites, and test whether the overdispersion pattern holds on smears from more countries.