Automated Blood Cell Counting with YOLO
Automated Blood Cell Counting with YOLO
Published in Healthcare Technology Letters; Received on 20th October 2018; Accepted on 3rd May 2019
A complete blood cell count is an important test in medical diagnosis to evaluate overall health condition. Traditionally blood cells are counted
manually using haemocytometer along with other laboratory equipment’s and chemical compounds, which is a time-consuming and tedious
task. In this work, the authors present a machine learning approach for automatic identification and counting of three types of blood cells using
‘you only look once’ (YOLO) object detection and classification algorithm. YOLO framework has been trained with a modified configuration
BCCD Dataset of blood smear images to automatically identify and count red blood cells, white blood cells, and platelets. Moreover, this study
with other convolutional neural network architectures considering architecture complexity, reported accuracy, and running time with this
framework and compare the accuracy of the models for blood cells detection. They also tested the trained model on smear images from a
different dataset and found that the learned models are generalised. Overall the computer-aided system of detection and counting enables
us to count blood cells from smear images in less than a second, which is useful for practical applications.
1. Introduction: A complete blood cell (CBC) count is an Also, the trained model has been tested with images from another
important test often requested by medical professionals to dataset to observe the generalisation of the method. Fig. 1 shows
evaluate health condition [1, 2]. The main three types of cells that the proposed deep learning based blood cell identification and
constitute blood are red blood cells (RBCs), white blood cells counting system.
(WBCs), and platelets. RBCs also known as erythrocytes
are the most common type of blood cell, which consists of 2. Related works: In general, there are generally two different
40–45% of blood cells [American Society of Haematology: approaches in the automated counting process of blood cells.
[Link] Platelets also known They are the image processing approach [1, 3, 10–12] and the
as thrombocytes are also in huge number in blood. WBCs also machine learning approach [2, 4, 13–15].
known as leukocytes, are just 1% of total blood cells. RBCs carry Acharya and Kumar [10] proposed an image processing
oxygen to our body tissues and the amount of oxygen tissues technique for RBCs count. It processed the blood smear image to
receives is affected by the number of RBCs. WBCs fight against count RBCs along with the identification of normal and abnormal
infections and platelets help with blood clotting. As these blood cells. They used the K-medoids algorithm to extract WBCs from
cells are huge in number, traditional manual blood cell counting the image and granulometric analysis to separate the RBCs from
system using haemocytometer is highly time consuming and WBCs and then counted the number of cells using the labelling
erroneous and most of the cases accuracy vastly depends on the algorithm and a circular Hough transform (CHT). Sarrafzadeh
skills of a clinical laboratory analyst [3, 4]. Therefore, an et al. [11] proposed circlet transform to count RBCs on the grey-
automated process to count different blood cells from a smear scale image. They used iterative soft-thresholding method for
image will greatly facilitate the entire counting process. identification and counting purposes. Kaur et al. [12] proposed a
With the development of machine learning techniques, image method to count platelets automatically by applying a CHT in a
classification and object detection applications are becoming microscopic blood cells image. They used the size and shape
more robust and more accurate. As a result, machine learning features of platelets from the CHT in the counting process.
based methods are being applied in different fields. Particularly, Cruz et al. [1] presented an image processing system to count
deep learning methods are being applied in different medical appli- blood cells. They used hue, saturation, value thresholding
cations such as abnormality detection and localisation in chest method, and connected component labelling for the identification
X-rays [5], automatic segmentation of the left ventricle in cardiac and counting of blood cells. Acharjee et al. [3] proposed a
MRI [6], and detection of diabetic retinopathy in retinal fundus semi-automated process by applying a Hough transform to count
photographs [7]. Thus, it is worth to look into deep learning RBC by detecting their oval and biconcave shape. Lou et al. [4]
based methods that can be applied to identify and count the blood provided a method to automatically count RBCs using spectral
cells in the smear images. angle imaging and support vector machine (SVM). Zhao et al.
In this Letter, a deep learning based blood cell counting method [13] proposed an automatic identification and classification
has been proposed. We employ a deep learning based object system for WBCs using the convolutional neural network (CNN).
detection method to detect different blood cells. Among the Firstly, they detected WBCs from the microscopic images, and
state-of-the-arts object detection algorithms such as regions with then CNN was used to detect kinds of WBCs. Habibzadeh et al.
convolutional neural network (R-CNN) [8], you only look once [2] presented a system for classifying five different types of
(YOLO) [9], we chose YOLO framework which is about three WBCs. They used three classifiers, which include two different
times faster than Faster R-CNN with VGG-16 architecture [9]. SVMs and one CNN classifier. Habibzadeh et al. [14] employed
YOLO uses a single neural network to predict bounding boxes pre-trained CNNs, ResNet [16] and Inception Net [17], to count
and class probabilities directly from the full image in one evalu- WBCs from segmented images. The images were segmented
ation. We retrain YOLO framework to automatically identify employing colour space analysis. Xu et al. [15] employed patch
and count RBCs, WBCs, and platelets from blood smear images. size normalisation on pre-processed images and then applied
To improve the counting accuracy, a verification method has been CNN to classify RBC shapes from microscopy images of patients
developed to avoid repeated counting by the framework. of sickle cell disease.
Fig. 5 Comparison of the ground truth and predicted blood cell identifica- Then, we have calculated the accuracy from the total number
tion output of ground truths cells and the total number of estimated cells
a Ground truth labels of cells in a smear image in the test dataset. With a confidence threshold of 55% for RBC,
b Automatically estimated labels of cells by our model we achieved 96.09% accuracy for RBC. Total estimated numbers
of cells of different types with accuracy calculated at their appropri-
ate confidence threshold value are presented in Table 2. It may seem
that the proposed algorithm is counting more or extra RBCs that are
not in the images. However, we would like to note that the ground
truth labels were not present for some of the RBCs that are at the
edge of the image. The YOLO algorithm can detect these RBCs,
and thus, the RBC count is high.
To visualise, the output of the proposed method concerning
ground truth, a sample smear image from the test set is shown in
Fig. 5. It is seen from the figure that all the WBC and platelets
are detected without error. The method has missed one RBC in
the middle, whereas detected another RBC from the edge of the
image which is not present in the ground truth.
Table 3 Accuracy of detecting different cells using different CNN architecture with YOLO algorithm
7 References
[1] Cruz D., Jennifer C., Valiente L.C., ET AL.: ‘Determination of blood
components (WBCs, RBCs, and platelets) count in microscopic
images using image processing and analysis’. Proc. Int. Conf.
Fig. 7 Blood cells detection in an image from the dataset [11] on Humanoid, Nanotechnology, Information Technology,
a Image divided into 3 × 3 grids Communication and Control, Environment and Management
b Combined output (HNICEM), December 2017
[2] Habibzadeh M., KrzyÅijak A., Fevens T.: ‘White blood cell differen-
tial counts using convolutional neural networks for low resolution
shown in Fig. 6. It is seen from the figure that, InceptionV3 and images’. Proc. Int. Conf. on Artificial Intelligence and Soft
ResNet50 achieves the lowest error. Computing, 2013, pp. 263–274
The accuracy of counting RBC, WBC, and platelets on the test [3] Acharjee S., Chakrabartty S., Alam M.I., ET AL.: ‘A semiautomated
approach using GUI for the detection of red blood cells’. Proc. Int.
set is shown in Table 3. It is seen from the table that, the highest Conf. on Electrical, Electronics, and Optimization Techniques,
accuracy for counting RBCs and platelets is found for the Tiny 2016, pp. 525–529
YOLO architecture, which achieved 96.09% accuracy in counting [4] Lou J., Zhou M., Li Q., ET AL.: ‘An automatic red blood cell counting
RBCs and 96.36% accuracy in counting platelets. On the other method based on spectral images’. Proc. Int. Congress on Image and
hand, VGG-16 and InceptionV3 both have achieved the highest Signal Processing, BioMedical Engineering and Informatics, October
accuracy in counting WBCs (100%). Thus, different models can 2016, pp. 1391–1396
[5] Islam M.T., Aowal M.A., Minhaz A.T., ET AL.: ‘Abnormality
achieve the highest accuracy for different cells. We have also com- detection and localization in chest X-rays using deep con-
puted the mean average precision (mAP) of these CNN architec- volutional neural networks’, arXiv preprint arXiv:1705.09850v3,
tures and their execution time per test image listed in Table 3. 2017
It is seen from the table that ResNet50 achieves highest mAP [6] Avendi M.R., Kheradvar A., Jafarkhani H.: ‘A combined
value. Our proposed method is extremely fast requiring less than deep-learning and deformable-model approach to fully automatic seg-
a second even for deeper networks. We calculate the forward mentation of the left ventricle in cardiac MRI’, Med. Image Anal.,
2016, 30, pp. 108–119
propagation time for each of the test images on a computer with [7] Gulshan V., Peng L., Coram M., ET AL.: ‘Development and validation
Intel Core i5 6500 with 8 GB memory and Nvidia GTX1050 Ti of a deep learning algorithm for detection of diabetic retinopathy in
GPU with 4 GB memory. Estimation time is reported by computing retinal fundus photographs’, J. Am. Med. Assoc., 2016, 316, (22),
the average to get the final execution time. pp. 2402–2410
[8] Ren S., He K., Girshick R., ET AL.: ‘Faster R-CNN: towards teal-time
object detection with region proposal networks’, IEEE Trans. Pattern
4.2. Testing using a different dataset: To observe, whether the Anal. Mach. Intell., 2017, 39, (6), pp. 1137–1149
[9] Redmon J., Divvala S., Girshick R., ET AL.: ‘You only look once:
trained model is database dependent, we have also tested our unified, real-time object detection’. IEEE Conf. on Computer
model using blood smear images from another dataset [11]. The Vision and Pattern Recognition, December 2016
images of this dataset were of higher resolution, and thus the [10] Acharya V., Kumar P.: ‘Identification and red blood cell automated
images were divided into grids to create sub-images, and each of counting from blood smear images using computer-aided system’,
the sub-images has been processed individually in the proposed Med. Biol. Eng. Comput., 2018, 56, (3), pp. 483–489
pipeline. The detection and counting from each of the sub-images [11] Sarrafzadeh O., Dehnavi A.M., Rabbani H., ET AL.: ‘Circlet based
framework for red blood cells segmentation and counting’. IEEE
are then projected back on the original image. A blood smear
Workshop on Signal Processing Systems, December 2015
image which has been divided into a 3 × 3 grid, which causes 9 [12] Kaur P., Sharma V., Garg N.: ‘Platelet count using image processing’.
sub-images to be processed in the proposed method, is shown in Int. Conf. on Computing for Sustainable Global Development
Fig. 7. It is seen from the figure that, the output image correctly (INDIACom), March 2016