Deep Learning-Based White Blood Cell Classification Through a Free and Accessible Application
No Thumbnail Available
Date
2025
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Saudi Digital Library
Abstract
Background
Microscopy of peripheral blood smears (PBS) continues to play a fundamental role in hematology
diagnostics, offering detailed morphological insights that complement automated blood counts.
Examination of a stained blood film by a trained technician is among the most frequently performed
tests in clinical hematology laboratories. Nevertheless, manual smear analysis is labor-intensive,
time-consuming, and prone to considerable variability between observers. These challenges
have spurred interest in automated, deep learning-based approaches to enhance efficiency and
consistency in blood cell assessment.
Methods
We designed a convolutional neural network (CNN) using a ResNet-50 backbone, applying
standard transfer-learning techniques for white blood cell (WBC) classification. The model was
trained on a publicly available dataset of approximately 4,000 annotated peripheral smear images
representing eight WBC types. The image processing workflow included automated nucleus
detection, normalization, and extensive augmentation (rotation, scaling, etc.) to improve model
generalization. Training was performed with the PyTorch Lightning framework for efficient
development.
Application
The final model was integrated into a lightweight web application and deployed on Hugging Face
Spaces, allowing accessible browser-based inference. The application provides an easy-to-use
interface to upload images, which are then automatically cropped and analyzed in real-time. This
open and free tool is intended to provide immediate classification results. It is also a useful tool
for laboratory technologists without requiring specialized hardware or software.
Results
Testing on an independent set revealed that the ResNet-50 network reached 98.67% overall
accuracy. Performance was consistently high across all eight WBC categories. Precision, recall, and
specificity closely matched the overall accuracy, indicating well-balanced classification. However,
for the assessment of real-world generalization, the model was tested on an external heterogeneous
dataset from different sources. It performed with 86.33% accuracy, reflecting strong performance
outside of its main training data. The confusion matrix showed negligible misclassifications. This
suggested consistent distinction between leukocyte types.
Conclusion
This study indicates that a lightweight AI tool can support peripheral smear analysis by offering
rapid and consistent WBC identification via a web interface. Such a system may reduce laboratory
workload and observer variability, particularly in resource-limited or remote settings where expert
microscopists are scarce, and serve as a practical training aid for personnel learning cell morphology.
Limitations include reliance on a single dataset, which may not encompass all staining or imaging
variations, and evaluation performed offline. Future work will aim to expand dataset diversity,
enable real-time integration with digital microscopes, and conduct clinical validation to broaden
applicability and adoption.
Application link: https://huggingface.co/spaces/xDyas/wbc-classifier
Description
Keywords
Computer, Computer Science, Hematology, Laboratory, Blood, Cells, Medical, Artificial Intelligence, AI/ML, Machine Learning, Deep Learning
Citation
IEEE
