Standard laboratory diagnosis in high-burden, low-resource clinical settings continues to rely predominantly on the manual microscopic evaluation of Giemsa-stained dermal scrapings to detect intracellular amastigotes. While conventional light microscopy is inexpensive and widely available, its diagnostic sensitivity is substantially degraded by smear quality inconsistencies, variable staining intensities, low parasite densities, and visual confusion caused by cellular debris, nuclear fragments, inflammatory cells, and fungal or parasitic look-alikes such as Histoplasma yeast forms and Trypanosoma cruzi trypomastigotes.
To address the diagnostic bottlenecks that hinder manual parasite identification and overcome the practical barriers of conventional computational pathology, a research team developed an automated diagnostic framework utilizing an enhanced U-Net architecture optimized specifically for stain-aware semantic segmentation. Previous computational methods for automated parasite detection largely depended on classical edge detection, fixed thresholding, and morphological filtering, which frequently falter under non-uniform illumination and background artifacts. More recent deep learning contributions have focused primarily on image-level classification rather than fine-grained localization. While image classification indicates whether a microscopic field contains parasites, it fails to delineate the boundaries of individual amastigotes, thereby depriving clinical microscopists of the spatial interpretability required to visually confirm diagnostic predictions.
The newly introduced methodology operates directly on Giemsa-stained microscopy images acquired from clinical patients suspected of cutaneous leishmaniasis at the Leishmaniasis Regional Diagnostic Laboratory situated in Sari, Iran. The original clinical dataset comprised 292 digitized fields of view photographed using an Olympus CX23 microscope at 100x magnification with an initial resolution of 224 by 224 pixels, containing 138 confirmed parasite-positive samples and 154 parasite-negative control smears. Because manual pixel-level annotation of microscopic amastigotes is an exceptionally laborious, time-consuming task requiring scarce parasitological expertise, the investigators established an automated weak-supervision pipeline operating within the hue, saturation, and value color space. By analyzing chromatic distributions characteristic of Giemsa stain and coupling adaptive saturation thresholding with Otsu thresholding on the value channel, the system generates robust pseudo-ground-truth binary masks on positive smears, isolating candidate purple parasite pixels while suppressing pale background areas without manual tracing.
Semantic segmentation of amastigotes presents extreme class imbalance because these small intracellular organisms measure merely two to five micrometers in diameter, typically occupying less than five percent of the total pixel area within a microscopic field. To mitigate this imbalance and improve training stability, the researchers implemented a paired data augmentation strategy alongside balanced sampling across subsets. Every positive training sample underwent twelve distinct geometric and stain-preserving photometric transformations, while negative samples underwent ten transformations, including horizontal and vertical reflections, orthogonal rotations, contrast scaling, brightness adjustments, gamma corrections, and mild Gaussian filtering. Following class balancing to equalize positive and negative instances, the augmented dataset contained 3,388 paired image-mask samples uniformly resized to 128 by 128 pixels. The balanced corpus was partitioned using a stratified split into a training cohort of 2,372 samples, a validation cohort of 677 samples, and an independent test cohort of 339 samples, each preserving an exact one-to-one ratio between parasite-positive and parasite-negative images.
The structural backbone of the segmentation framework consists of an enhanced symmetric U-Net featuring four encoder blocks, a central bottleneck, and four corresponding decoder blocks connected by long skip connections. Each encoder stage incorporates two successive 3 by 3 convolutional layers activated by rectified linear units, followed by batch normalization, 2 by 2 max pooling with stride two, and a dropout regularization rate of 0.1 to prevent overfitting. Feature channels progressively expand from 32 to 64, 128, and 256 before reaching the bottleneck block. The decoder progressively reconstructs spatial resolution through 2 by 2 transposed convolutions, concatenates incoming encoder feature maps via skip pathways to preserve fine spatial details, and processes features through mirrored double convolutions with batch normalization and dropout before reducing channel dimensions from 128 down to 32. The output layer applies a 1 by 1 convolution paired with a sigmoid activation function, generating a continuous pixel-wise probability map reflecting parasite presence across the smear field.
Optimization of the neural network was governed by a composite loss function integrating Dice loss and Focal loss with equal weighting coefficients of 1.0, explicitly tailored to resolve the dual challenges of extreme foreground sparsity and ambiguous boundary classification. The Dice loss component minimizes spatial discrepancy over contiguous regions, while the Focal loss component applies an alpha weighting of 0.75 and a gamma focusing parameter of 2 to suppress easily classified background pixels and compel the network to prioritize hard-to-distinguish parasite boundaries. Models were trained for up to 50 epochs utilizing the Adam optimizer with an initial learning rate of 0.0001, a batch size of four, and an automated learning rate scheduler that halved the learning rate upon plateauing. Validation loss monitored through early stopping with a patience window of five epochs ensured convergence, with model parameters ultimately reaching peak validation accuracy of approximately 0.979 and a minimal validation loss of 0.165 at epoch 50.
When evaluated on the independent test partition of 339 held-out microscopic images, the proposed stain-aware U-Net demonstrated strong, well-balanced diagnostic precision and robust spatial segmentation. The network achieved an overall pixel-level accuracy of 0.9793, a Dice similarity coefficient of 0.8414, an intersection over union of 0.7471, a precision of 0.8986, a sensitivity recall of 0.8631, and a specificity of 0.9901, with an overall test loss of 0.1782 and an aggregate F1-score of 0.8805. Receiver operating characteristic analysis demonstrated high discriminative performance, yielding an image-level area under the curve of 0.9754 and an individual pixel-level area under the curve of 0.9950. Confusion matrix tallies confirmed the accurate identification of 424,478 true parasite pixels against 67,328 false negatives, alongside 5,014,480 true negative background pixels against 47,890 false positives, demonstrating that the network successfully restricts spurious detections on parasite-free backgrounds while maintaining high sensitivity to minute amastigotes.
To rigorously contextualize the performance of the proposed pipeline, the researchers conducted controlled benchmarking against several widely recognized medical segmentation architectures trained under identical data splits, input dimensions, and optimization parameters. In direct comparisons with standard U-Net, nested U-Net++, full-scale connected UNet3+, Attention U-Net, and DeepLabV3+, the proposed enhanced U-Net with hybrid Dice and Focal loss achieved the superior Dice coefficient of 0.8414, outperforming Attention U-Net at 0.8354, U-Net++ at 0.8189, UNet3+ at 0.8179, and DeepLabV3+ at 0.6593. Furthermore, boundary precision evaluations demonstrated that the proposed model achieved the lowest average symmetric surface distance of 0.3399 and the lowest 95th-percentile Hausdorff distance of 1.3436, substantially outperforming DeepLabV3+, which recorded an average surface distance of 2.1603 and a Hausdorff distance of 5.6132. Although U-Net++ achieved a marginally higher intersection over union of 0.7670 and Attention U-Net attained an accuracy of 0.9808, their substantially greater architectural complexity offered no systematic advantage in contour boundary precision.
To foster clinical interpretability and verify that the segmentation network bases its diagnostic decisions on authentic biological structures, the investigators conducted gradient-weighted class activation mapping across positive and negative smear fields. The resulting activation heatmaps confirmed that the internal convolutional layers consistently focus on distinctive amastigote morphology, producing prominent warm-color activations over purple intracellular parasite clusters while exhibiting minimal or negligible response across host erythrocytes, cellular debris, and stain precipitations. Qualitative evaluations across diverse infection severities revealed that the model reliably delineates both isolated, sparse amastigotes in low-burden smears and crowded parasite aggregations in heavily infected specimens. Conversely, on parasite-negative slides, the framework consistently yielded near-zero probability surfaces, entirely avoiding false-positive segmentations and confirming that the model captures genuine biological structures rather than exploiting imaging artifacts or color shifts.
Despite these promising experimental findings, the authors detailed several methodological constraints that define the scope of their investigation and delineate necessary future research directions. First, because the pseudo-ground-truth masks were generated using an automated HSV-Otsu thresholding heuristic rather than manual expert delineations, the training labels retain inherent systemic noise that could propagate through optimization. Second, because all 292 source microscopy images originated from a single clinical diagnostic facility in Sari, Iran, the dataset does not encompass the broad range of staining protocols, lens artifacts, and visual variations encountered across different global diagnostic centers.
Subject of Research: Automated segmentation of cutaneous leishmaniasis amastigotes in Giemsa-stained microscopic smears using an enhanced U-Net architecture
Article Title: Automated detection of Cutaneous Leishmaniasis in Giemsa-stained smears using a stain-aware U-Net: A diagnostic support tool for low-resource settings
Article References: Ahmed, N. O. E., Mwalili, S., & Elbashir, M. K. (2026). Automated detection of Cutaneous Leishmaniasis in Giemsa-stained smears using a stain-aware U-Net: A diagnostic support tool for low-resource settings. Computer Methods and Programs in Biomedicine Update, 9, Article 100255. https://doi.org/10.1016/j.cmpbup.2026.100255
Image Credits: AI Generated
DOI: 10.1016/j.cmpbup.2026.100255
Keywords: Cutaneous Leishmaniasis, U-Net Segmentation, Giemsa Staining, Microscopy Image Analysis, Deep Learning Diagnostics, Neglected Tropical Diseases, Amastigote Detection, Computer Vision in Medicine, Weakly Supervised Learning, HSV Color Space, Otsu Thresholding, Dice Loss, Focal Loss, Parasitology Diagnostics, Medical Image Segmentation, Convolutional Neural Networks, Boundary Accuracy Metrics, Low-Resource Healthcare
News Source: Blake Davidson. (November 23, 2026). Stain-Aware Neural Network Improves Microscopic Cutaneous Leishmaniasis Detection in Low-Resource Settings. Scienmag.



