EMFE: A lightweight, explainable machine learning framework for malaria cell classification
Authors: Md Abdullah Al Kafi, Walayat Hussain, Mousumi Karmakar, Sumit Kumar Banshal, Ahmed Al Marouf
Organizations: Multidisciplinary Action Research (MARS) Lab, Daffodil International University, Dhaka, Bangladesh · Artificial Intelligence for Decision Excellence (AIDX) Lab, Peter Faber Business School, Australian Catholic University, North Sydney, Australia · Department of Computer Science and Engineering, Alliance University, Bangalore, India · Department of Medicine, Faculty of Medicine & Dentistry, University of Alberta, Edmonton, Canada
Automated malaria diagnosis from stained blood-smear microscopy is dominated by deep convolutional neural networks that are accurate but computationally expensive, poorly interpretable, and rarely validated with patient-level rigor. We present EMFE (Efficient Mathematical Feature Extraction), a five-feature framework for classifying single red-blood-cell images as parasitized or uninfected using Gray World color normalization, adaptive green-channel thresholding, morphological spot detection, and classical machine learning. Using the NIH LHNCBC malaria dataset (27,558 images from 200 patients), we evaluate Random Forest, Histogram Gradient Boosting, and Support Vector Machine classifiers under patient-grouped nested cross-validation (K_outer=20, K_inner=3), ensuring that cells from each patient remain within a single fold. The optimized Random Forest achieves 94.6% pooled out-of-fold accuracy (95% CI [93.6, 95.7]), corroborated by an untouched 40-patient holdout test (94.3%) and a patient-level permutation test (p<0.001, 1,000 permutations). Ablation experiments quantify the contribution of individual features and pipeline stages. Hardware-matched comparisons with retrained DenseNet121, ResNet50, and MobileNetV2 models assess the accuracy-efficiency trade-off. Synthetic perturbations characterize three failure modes, while explainability analysis identifies spot saturation as the dominant discriminative feature. Patient-level aggregation further quantifies sensitivity-specificity trade-offs and false-positive accumulation. These results demonstrate a statistically rigorous, interpretable, and computationally lightweight alternative to deep learning, while explicitly quantifying its limitations.
Figures & tables
Fig 1: Representative sample images from the dataset. Parasitized cells (containing visible Plasmodium chromatin, ring forms, or trophozoites) and uninfected erythrocytes, illustrating the range of staining intensity, illumination, and background artifact present in the raw data.
Fig 2: Comparative visualization of the feature-extraction process. Original image, color normalization, isolated green channel, raw adaptive threshold, morphologically cleaned spot mask, and final detected contours, for an uninfected cell (top) and a parasitized cell (bottom).
Classifier
Search space
SVM
C∈[10−1,102] (log-uniform); kernel ∈{ RBF, linear } ; γ∈{ scale, auto }
Table 3: Pooled out-of-fold metrics under patient-grouped nested cross-validation ( n=27,558 ; 95% CI across the 20 outer folds).
Fig 3: Pooled out-of-fold confusion matrix. Random Forest predictions across all 20 patient-grouped outer folds ( n=27,558 ), with counts and row-wise percentages for each true class.
Fig 4: ROC and precision-recall curves. Pooled out-of-fold ROC curves (left) and precision-recall curves (right) for all three classifiers, computed from the 27,558 pooled out-of-fold predictions of the patient-grouped nested cross-validation. AUC and average precision (AP) values match Table 3 ’s ROC-AUC and PR-AUC columns exactly, as both are computed from the identical prediction set.
Metric
Random Forest
Hist. Gradient Boosting
SVM
Accuracy
0.9429 [0.9263, 0.9582]
0.9424 [0.9255, 0.9581]
0.9440 [0.9277, 0.9591]
Table 4: Held-out patient-level test set (160 train / 40 test patients; 21,915 / 5,643 cells; 95% patient-cluster-bootstrap CI).
Descriptor
Accuracy
F1
Δ Accuracy
Color histogram [ 23 ]
0.9311
0.9299
−0.0149
Local Binary Patterns [ 16 ]
0.7061
0.7078
−0.2284
Gray-Level Co-occurrence Matrix [ 15 ]
0.6448
0.6516
−0.2917
Histogram of Oriented Gradients [ 17 ]
0.8567
0.8591
−0.0832
Table 5: Baseline-descriptor comparison (Random Forest, reduced 5-fold protocol) against the full EMFE pipeline (accuracy 0.9460, F1 0.9453).
Variant
Accuracy
F1
Wilcoxon p
Stage ablations
No color normalization
0.9435
0.9431
0.4375
Otsu threshold (vs. adaptive)
0.9381
0.9351
0.1875
Fixed global threshold
0.9430
0.9425
1.0000
No morphological opening
0.9430
0.9421
0.0625
Leave-one-feature-out
Table 6: Stage-ablation and leave-one-feature-out results (Random Forest, reduced 5-fold protocol, default configuration: accuracy 0.9463, F1 0.9456).
Perturbation
Accuracy
F1
Sensitivity
Specificity
Brightness, dimmer ( ×0.7 )
0.9415
0.9409
0.9068
0.9782
Brightness, brighter ( ×1.3 )
0.9240
0.9248
0.9106
0.9381
Contrast, reduced ( ×0.7 )
0.5150
0.6791
1.0000
0.0036
Contrast, increased ( ×1.3 )
0.9279
0.9286
0.9137
0.9428
Hue shift, 10∘
0.9421
0.9425
0.9254
0.9596
Hue shift, 20∘
0.9454
0.9459
0.9302
0.9614
Table 7: Full synthetic-perturbation robustness sweep.
Model
Accuracy
F1
Size
Latency (CPU)
Latency (GPU)
EMFE (Random Forest)
0.9463
0.9456
6.3 MB
4.6 ms
N/A (CPU-only)
DenseNet121
0.9698
0.9695
27.1 MB
197.4 ms
35.7 ms
ResNet50
0.9676
0.9674
90.0 MB
105.4 ms
11.7 ms
MobileNetV2
0.9670
0.9666
8.7 MB
17.3 ms
4.8 ms
Table 8: Deep-learning baselines , retrained under the identical patient-grouped protocol as EMFE’s headline evaluation (pooled over 20 outer folds; n=27,558 ).
Comparison
Metric
Median Δ
Folds won by DL model
Wilcoxon p
DenseNet121 vs. EMFE
Accuracy
+0.0198
20 / 20
1.9×10−6
DenseNet121 vs. EMFE
F1
+0.0189
20 / 20
1.9×10−6
ResNet50 vs. EMFE
Accuracy
+0.0171
20 / 20
1.9×10−6
ResNet50 vs. EMFE
F1
+0.0178
20 / 20
1.9×10−6
MobileNetV2 vs. EMFE
Accuracy
+0.0177
20 / 20
1.9×10−6
MobileNetV2 vs. EMFE
F1
+0.0169
20 / 20
1.9×10−6
Table 9: Paired Wilcoxon signed-rank test : each deep baseline vs. EMFE, matched per fold (20 folds, identical partition).
Fig 5: Per-feature distributions by class. Distribution of each of the five EMFE features, split by true class, on the held-out test set.
Feature
Importance
Spot saturation ( Smax )
0.2670±0.0056
Total spot area ( Atotal )
0.0341±0.0025
Max spot area ( Amax )
0.0301±0.0016
Number of spots ( Nspots )
0.0098±0.0010
Gray standard deviation ( σgray )
0.0021±0.0009
Table 10: Permutation feature importance (30 repeats, mean ± std, held-out test set).
Fig 6: Partial dependence. Partial dependence of the predicted Parasitized probability on each of the five features individually, with the other four held at their observed distribution.
Fig 7: Representative prediction-category gallery. True-positive, false-negative, false-positive, and true-negative example cells from the held-out test set, with their corresponding feature-extraction pipeline visualization.
Feature
FN mean
TP mean
p (FN v. TP)
FP mean
TN mean
p (FP v. TN)
Nspots
5.57
8.16
1.8×10−15
6.75
3.35
9.4×10−16
Amax
72.21
170.87
2.4×10−81
148.74
42.53
9.9×10−44
Atotal
171.03
367.28
1.4×10−52
263.85
70.62
6.4×10−38
Smax
19.06
104.76
1.2×10−128
77.31
8.48
2.1×10−53
σgray
19.73
20.46
1.5×10−5
20.85
17.77
2.0×10−17
Table 11: Failure-mode feature comparison (Mann-Whitney U , held-out test set).
Variant
Accuracy
F1
Wilcoxon p
Block size 11 (default 21)
0.9520
0.9513
0.0625
Block size 31 (default 21)
0.9312
0.9303
0.0625
Block size 41 (default 21)
0.9212
0.9204
0.0625
Adaptive C=2 (default 5)
0.8916
0.8897
0.0625
Adaptive C=8 (default 5)
0.9514
0.9508
0.0625
Adaptive C=12 (default 5)
0.9542
0.9536
0.0625
Table 12: Threshold-parameter sensitivity (Random Forest, reduced 5-fold protocol) against the default configuration (accuracy 0.9463, F1 0.9456).
τ
Infected flagged
Sensitivity (95% CI)
Control flagged
Specificity (95% CI)
1
150/150
1.000 (0.975–1.000)
43/50
0.140 (0.070–0.262)
2
149/150
0.993 (0.963–0.999)
31/50
0.380 (0.259–0.518)
3
148/150
0.987 (0.953–0.996)
18/50
0.640 (0.501–0.759)
5
144/150
0.960 (0.915–0.982)
7/50
0.860 (0.738–0.930)
10
131/150
0.873 (0.811–0.917)
0/50
1.000 (0.929–1.000)
20
95/150
0.633 (0.554–0.706)
0/50
1.000 (0.929–1.000)
Table 13: Patient-level sensitivity/specificity under a minimum predicted-positive-cell threshold τ (Random Forest).
True parasitemia range
n patients
Mean parasitemia
Sensitivity (95% CI)
0.000–0.158
38
0.086
0.947 (0.827–0.985)
0.158–0.328
37
0.225
1.000 (0.906–1.000)
0.328–0.583
37
0.440
1.000 (0.906–1.000)
0.583–0.902
38
0.761
1.000 (0.908–1.000)
Table 14: Sensitivity at τ=3 , stratified by true parasitemia quartile (infected patients only).
Automated malaria diagnosis from blood smear microscopy is a critical challenge in global health AI; in resource-limited settings, the scarcity of expert microscopists remains the primary bottleneck to timely and accurate diagnosis. Three compounding failure modes prevent reliable clinical deployment of existing deep learning systems. First, end-to-end detectors treat unannotated cells as background during training, producing recall figures that are strongly influenced by annotation completeness rather than reflecting true cell recovery. Second, Non-Maximum Suppression tends to suppress valid detections in dense smear regions where infection counts matter most. Third, existing whole-slide detection pipelines lack per-cell spatial evidence for clinical audit, despite image-level explainability methods such as Grad-CAM having been applied to malaria image classification tasks. We present MalariAI, a two-stage decoupled framework that addresses all three failure modes in a unified pipeline. Stage 1 applies an annotation-agnostic distance-transform guided watershed algorithm to isolate every cell in a full 1600x1200 blood smear image, recovering 75.95% of ground-truth cells by centroid localisation across the 120-image NIH BBBC041 test set without any ground-truth input. Stage 2 fine-tunes EfficientNet-B0 with Focal Loss (gamma = 2.0, per-class inverse-frequency weights) on 64x64 crops, achieving 98.36% overall classification accuracy with 87.5% and 75.0% per-class accuracy on the rare schizont and gametocyte stages, compared to only 24.57% and 25.95% AP for a Faster R-CNN baseline on the same classes. Grad-CAM++ heatmaps generated per detected cell provide instance-level spatial evidence for clinical audit, enabling microscopists to verify model predictions at the individual parasite level without sacrificing classification performance.
Kaysarul Anas Apurba, Md Hasibul Hasan, Mohammed Ali +1
Department of Electrical and Computer Engineering, North South University, Dhaka 1229, Bangladesh · Department of Computer Science and Engineering, International University of Business Agriculture and Technology (IUBAT), Dhaka 1230, Bangladesh
Automated malaria diagnosis from thin blood-smear microscopy could meaningfully reduce the burden on under-resourced laboratories, but a model that maximises accuracy on clean laboratory images fails badly the moment an inexpensive smartphone camera introduces sensor noise. This paper introduces MalariaCascade, a two-stage inference system in which a lightweight MobileNetV2 sentinel (2,225,153 parameters) makes confident classifications at low compute cost and escalates uncertain cases to an EfficientNet-B3 expert (10,697,769 parameters) that sees only clean, standardised images regardless of how corrupted the incoming frame is. Structural isolation of the expert stage, not learned robustness, is the mechanism. The sentinel is trained under a safety-score objective that places an explicit floor on Recall(Parasitised) (>=0.95) and Recall(Uninfected) (>=0.40) before precision is optimised, ensuring the checkpoint satisfies clinical safety constraints by construction. On the NIH Malaria Cell Images Dataset (27,558 cells), the cascade reaches Accuracy=0.9736, Recall(Parasitised)=0.9570, Precision(Parasitised)=0.9912, F1=0.9738, and AUROC=0.9955 on the clean test set. Under Gaussian sensor noise at full severity, cascade Recall(Parasitised) degrades by only 2.4 pp (0.9570 to 0.9329), while the flat single-model baseline collapses by 63.0 pp (0.9584 to 0.3281). McNemar's test confirms the cascade improvement is statistically significant (chi^2=11.14, p=0.00085). An ablation isolating the structural property shows that routing clean images to the expert is responsible for a 16.8 pp Recall(Parasitised) advantage under sensor noise relative to a cascade where the expert also sees corrupted inputs.
J. T. Hagbe, Michel Emel
African School of Economics, Abomey-Calavi, Benin · African Institute for Mathematical Sciences (AIMS), Cameroon
Malaria remains a leading cause of mortality in sub-Saharan Africa, where scarce diagnostic infrastructure makes timely, accurate diagnosis particularly challenging. While deep learning offers a compelling path toward automated malaria screening, clinical adoption is hindered by computational cost and opacity in decision-making. This work benchmarks four deep learning models spanning a wide range of designed design architectures and model capacities on the NLM-Malaria dataset, jointly evaluating predictive performance, robustness, and post-hoc explainability. We find that lightweight, efficient-by-design models match their heavier counterparts in predictive performance, and the Friedman test confirms no statistically significant performance differences. CAM-based XAI methods consistently localize diagnostically relevant regions, while fine-grained attribution methods produce less targeted explanations, particularly with heavier backbones. Robustness evaluation under three types of image corruption further reveals that model confidence degrades faster than accuracy, providing a practical signal for human review. However, no XAI method is robust to corruption, with explanation reliability degrading at noise levels plausible in clinical practice, even when predictions remain accurate. These findings support the deployment of lightweight architectures for malaria diagnosis in resource-constrained settings, while highlighting the vulnerability of post-hoc explanations as an important consideration for responsible clinical deployment.
Olivier Kanamugire, Kerol Djoumessi
African Institute for Mathematical Sciences, Kigali, Rwanda · Hertie Institute for AI in Brain Health, University of Tübingen, Germany