Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Microscopic Image Analysis and Counting of Red Blood

Cells and White Blood Cells in a Urine Sample


Jennifer C. Dela Cruz Ramon G. Garcia Mikko Ivan D. Avilledo
School of EECE School of EECE School of EECE
Mapua University Mapua University Mapua University
jcdelacruz@mapua.edu.ph rggarcia@mapua.edu.ph mikkoavilledo@gmail.com

John Christopher M. Buera Rom Vincent S. Chan Paul Gian T. Espana


School of EECE School of EECE School of EECE
Mapua University Mapua University Mapua University
chris.buera@gmail.com romvincentschan@yahoo.com pg_espana@yahoo.com

ABSTRACT incorrect count of blood cells in urine. To solve this problem, an


Traditional counting of red blood cells (RBC) and white blood image processing method in RBC and WBC counting is proposed.
cells (WBC) in a urine sample is done manually by a medical On these terms, even after many repetitions a consistent and
technologist. However, this makes the blood cell count subjective accurate counting of blood cells is done.
to the skill of the laboratory technician and will take much longer Difficulty in counting the blood cells automatically is likely to
time in doing the task. This paper proposes the use of image happen and this is due to its complex nature in segmentation.
processing in counting the WBCs and RBCs in a urine sample Various methods from past studies that address the same issue
through use of Canny Edge Detection and Circular Hough already existed. Using K-mean clustering was once applied for
Transform algorithm. The process consists of two (2) main parts. segmentation purposes on an enhanced color image. Another is
First is the Canny Edge Detection and the final part is Circular the use of the Circular Hough Transform which has a feature of
Hough Transform algorithms. It shows that the proposed system detecting the boundaries of the circles; applying it to cells. The
has a percentage accuracy of at least 93.229% in reference to the use of dynamic appearance model such as circular shape counter
actual RBC and WBC count result. has been applied in RBC segmentation before.
CCS Concepts The main objective of this research is to count and display the
number of blood cells present in a stitched image of urine sample
Computing methodologies ➝ Computer Graphics ➝ Image using microscope image processing. Specific objectives are as
Manipulation ➝ Image Processing follows: (a) To use Canny Edge Detection and Circular Hough
Transform as algorithms for detection and automatic counting of
Keywords red blood cells (RBC) and white blood cells (WBC), and (b) To
Blood cell counter; Canny Edge Detection; Circular Hough; test the accuracy of the device by comparing its output with the
Microscopic; RBC; Urine; WBC manual testing results from laboratories.
This study aims to be beneficial to the field of medicine
1. INTRODUCTION particularly in urinalysis. Knowing the presence of blood cell in a
In the field of biomedical science, urinalysis plays a basic part in urine sample can help determine if a patient has a urinary tract
terms of health diagnosis. It is a laboratory test of urine that can infection (UTI) or kidney stones. The classical method of
assess presence of blood in urine (hematuria) through the detecting disease using urinalysis is by manually counting red
sediment microscopic examination. One way of conducting the blood cells and white blood cells through microscopic analysis.
hematuria test is by simply using a microscope to evaluate And for the manual focusing and counting, it is subjective to the
presence of blood on the urine sample – manually counting the skill of the technician doing the task unlike in automatic counting
number of red blood cells (RBC) and white blood cells (WBC) which is constant all throughout the process; thus, making it a
present on the sample. Manual counting is subjective to the skill scientific approach.
of a lab technician performing the action. This process is also
known to be tedious and repetitive. These factors may lead to The scope of this study is it only focuses on the detection and
Permission to make digital or hard copies of all or part of this work for counting of blood cells, RBC and WBC, which are present in a
personal or classroom use is granted without fee provided that copies pre-centrifuged urine sample. Other urine content such as bacteria,
are not made or distributed for profit or commercial advantage and casts, epithelial cells and fat are not considered by the device. The
that copies bear this notice and the full citation on the first page. result of this device will just be available at the time the device
Copyrights for components of this work owned by others than ACM was used; thus, no data storage feature is included.
must be honored. Abstracting with credit is permitted. To copy
otherwise, or republish, to post on servers or to redistribute to lists, 2. REVIEW OF RELATED LITERATURE
requires prior specific permission and/or a fee. Request permissions
This paper proposes microscopic analysis of blood cells present in
from Permissions@acm.org.
ICBET ' 19, March 28–30, 2019, Tokyo, Japan a urine sample through integration of various features namely
© 2019 Association for Computing Machinery. auto-focus, image stitching, and automatic detection and count of
ACM ISBN 978-1-4503-6130-9/19/03…$15.00 blood cells. In this chapter, different research papers that share the
https://doi.org/10.1145/3326172.3326185 same features as mentioned above are presented.

113
Based from the previous studies using microscopic images in examined with the use of microscope with a magnification of
analyzing urine, researchers focused on the detection of red blood 400x equipped with Motic camera for capturing.
cells in urine image captured under microscope by image
processing. From the study of Xu Ma, Gang An, and Bin Li [1], it 3. METHODOLOGY
was found out that autofocus feature was not applied. Compared The study makes use of pre-centrifuged urine sample as the
to this study, the variance of Laplacian method will be used for subject to the image processing algorithms namely Canny Edge
autofocusing of the microscope.In this paper of Navea, Dupo, and Detection, and Circular Hough Transform. Upon undergoing these
Bacudio arises as closest to this study. According to their paper, a processes, the result shall be the count of detected blood cells,
blob detection algorithm was used to detect and differentiate both red blood cell (RBCs) and white blood cells (WBCs) present
RBCs from WBCs [1]. Another technique that was used from in the urine sample. Please refer to Figure 2.
other paper is the Hue, Saturation, Value (HSV) thresholding
method and connected component labeling [2]. According to the
paper of Dela Cruz, et al., HSV thresholding background
subtraction was used for blood cell segmentation while connected
component labelling was used for blood cell counting. The study
of Tangsuksant, et al. proposed the segmentation and detection of
RBCs and WBCs in urine sediment images [3]. This is through
use of development algorithm to count blood cells in urine
sediment using ANN and Hough Transform. From the study of
Dela Cruz, et al., the researchers determined blood components
(WBCs, RBCs, and Platelets) count in microscopic images using
image processing and analysis [4]-[6]. Here, the sample used for
the image processing is a stained blood. The process of classifying Figure 2. Conceptual framework of methodology
and placing sharp discontinuities in an image is called the edge
detection [7].
The canny edge detection algorithm also known as optimal edge
detector is used for medical and defense application. Also, in
industry, the Canny edge detection technique is one of the
standard edge detection techniques. The algorithmic steps are as
follows as can be seen in Figure 1.
• Convolve image f(r, c) with a Gaussian function to get
smooth image f^(r, c). f^(r, c)=f(r,c)*G(r,c,6)
• Apply first difference gradient operator to compute edge
strength then edge magnitude and direction are obtained as
before.
• Apply non-maximal or critical suppression to the gradient
magnitude
• Apply threshold to the non-maximal suppression image.

Figure 3. Canny edge detection flowchart

The processes were employed through use of the Raspberry Pi,


Figure 1. Implementation of Canny Edge Detection on a cell Raspberry Pi Camera Module, image pre-processing. The Canny
sample Edge Detection is the algorithm used for rescaling the image into
grayscale and forms the edges of the image. Please refer to
The study done by Mazalan, Mahmood and Razak is about
Figures 3 and 4. It is used for the rescaling part since it is less
counting of red blood cells with the use of Circular Hough
susceptible of noise compared to any other edge detection
Transform [8]. From their research, a blood was sampled and was
algorithms. On the other hand, the Circular Hough Transform is
the one responsible in detecting the blood present in the urine.
114
Python and OpenCV are the software used with stitched image,
radius range, sensitivity factor, and edge threshold as the input. The Circular Hough Transform is the algorithm used for detection
Once these algorithms were implemented, the output will then be and counting of the Red blood cells and White blood cells. A
the count of the detected blood cells as displayed from a graphical range of radii will be set. From the image formed from the last
user interface (GUI). procedure for the canny edge, this algorithm detects and counts
the blood cells and encircles them with red circles (RBCs) and
1 2a 2b green circles (WBCs). (Please see Figures 5-6 for the flowchart
and sample images) Once the circles are identified, the center and
the radius will be determined. Based from the radii range, the
circles within the given range will be found by the algorithm and
they will be specified as a scalar of any numeric type. It will be
counted as a red blood cell if the radius is within the 2 to 4-pixel
2c 3 4 range. When the radius is within 4.5 to 15 pixels, the contour will
be counted as a white blood cell.

Figure 4. Implementation of Canny Edge Detection: (1)


Gaussian Smoothing, (2a) Gradient (magnitude), (2b)
Gradient in X, (2c) Gradient in Y, (3) Non-maximum
suppression, and (4) Hysteresis Threshold
Figure 6. Implementation of Circular Hough Transform;
RBCs enclosed in red circles, and WBCs enclosed in green
circles
For automatic blood cells counting, the automatic blood cell count
for RBCs and WBCs are obtained by using equations 1 and 2.
Here, actual blood cell count is equated to the total number of
detected blood cells divided by the number of fields considered
for the process of SIFT image stitching. These numerical values
are then to be compared with the manual blood cells counting. For
automatic blood cell counts:

(1)

(2)

4. RESULTS AND DISCUSSION


The comparison between manual counting versus the automatic
counting of RBCs and WBCs is shown in Table 1. For automatic
blood cells counting, the automatic blood cells actual count for
RBCs and WBCs are obtained by dividing the total number of
detected blood cells by the number of images stitched in the
process of SIFT image stitching. These numerical values are to be
compared with the manual blood cells counting.
Test comparisons for manual RBC and automatic RBC counts are
shown in Figure 7. Test comparisons for manual WBC and
automatic WBC counts are shown in Figure 8.

Figure 5. Circular Hough Transform Flowchart

115
Table 1. Comparison between manual and automatic blood cell count
Number of Fields considered for Manual Counting: 88
Number of Fields considered for Automatic Counting: 32
Manual Blood Cell Count Automatic Blood Cell Count
Automatic Blood
Actual Blood Cell Total Blood Total Detected
Urine Sample Cell Actual
Count Cell Count Blood Cell Count
Count
RBC WBC RBC WBC RBC WBC RBC WBC
1 6 10 48 80 185 324 5.78 10.13
2 1 6 8 48 33 191 1.03 5.97
3 4 29 32 232 126 924 3.94 28.88
4 2 6 16 48 63 193 1.97 6.03
5 0 1 0 8 2 33 0.06 1.03
6 3 16 24 128 93 505 2.91 15.78
7 9 56 72 448 288 1804 9 56.38
8 5 9 40 72 159 281 4.97 8.78
9 7 12 56 96 225 375 7.03 11.72
10 9 9 72 72 286 282 8.94 8.81

The percentage errors for both RBCs and WBCs are shown on
Table 2 using the percentage error formula as defined in (3).

(3)
The average percentage errors (Mean of Error %) for RBC and
WBC counts are 1.56 and 1.06, respectively.

Table 2. Average percentage error of actual RBC and WBC


count
Urine Sample % Error
Figure 7. Test comparisons for Manual RBC count VS. RBC WBC
Automatic RBC Count 1 3.67 1.30
2 3.00 0.50
3 1.50 0.41
4 1.50 0.50
5 0 3.57
6 3.00 1.38
7 0.00 0.68
8 0.60 2.44
9 0.43 2.33
10 0.67 2.11
Mean of Error (%) 1.55 1.06
Figure 8. Test comparisons for Manual WBC count VS.
Automatic WBC Count

116
Table 3. RBC actual count result and WBC count results have no significant difference in
comparison to the manual RBC and WBC count results because
Urine Automatic Manual
d the absolute values of the calculated Ts for both RBC and WBC
Sample Count Count
are less than the t-table at an alpha level of 0.05.
1 5.78 6 -0.22
Table 5. Normal range of RBC and WBC in a urine sample
2 1.03 1 0.03
Parameter Normal Range
3 3.94 4 -0.06
Red Blood Cell (RBC) 0 – 2 RBCs/hpf
4 1.97 2 -0.03
White Blood Cell (WBC) 0 – 5 WBCs/hpf
5 0 0 0
6 2.91 3 -0.09
Indicated above in Table 5, is the normal range of red blood cells
7 9 9 0
(RBCs) and white blood cells (RBCs) in a human urine sample.
8 4.97 5 -0.03
9 7.03 7 0.03
5. CONCLUSIONS
The study has successfully integrated image processing
10 8.94 9 -0.06 algorithms that allows determination, differentiation, and counting
Mean of differences -0.0446 of red blood cells (RBCs) and white blood cells (WBCs) present
in a urine sample. This research employed Canny Edge Detection
Standard deviation of differences 0.137 and Circular Hough Transform using Raspberry Pi 3 Model B.
t -1.778 These were used for the detection and counting of the WBCs
present in a urine sample. For the output, the final counts are
displayed on a GUI made. The result from the automatic blood
Table 4. WBC actual count result cell count were compared to the manual blood cell count on the
same urine samples, and this was made possible with the help of
Urine Automatic Manual
d the partner laboratory. Furthermore, the researchers have tested
Sample Count Count
the accuracy of the device base on the manual blood cell count by
1 10.13 10 0.13 determining the mean of error for white blood cell and red blood
2 5.97 6 -0.03 cell. The RBC count mean of error (1.55%) produced a higher
error compared to that of the WBC count (1.06%). With this,
3 28.88 29 -0.12 using a sample size of thirty (30), the proposed system has a
4 6.03 6 0.03 percentage accuracy range of at least 93.229% with respect to the
manual blood cell count administered by the partner laboratory.
5 0.97 1 -0.03
6 15.78 16 -0.22 6. RECOMMENDATIONS
It is recommended to improve the accuracy of the proposed
7 56.38 56 0.38 system. Other image processing algorithms can be applied, and
8 8.78 9 -0.22 more urine samples can be examined to verify the effectivity of
the system. Future researchers are also advised to include a
9 11.72 12 -0.28
system data storage so that data retrieval will be easier. Finally, it
10 8.81 9 -0.19 is recommended to count other urine components such as crystals
Mean of differences 0.0497 and bacteria.

Standard deviation of differences 0.234 7. REFERENCES


t 1.278 [1] Ma, X., An, G., & Li, B. (2009, May). Design and
Implementation of an Automated Microscope Stage. In
Information Technology and Applications, 2009. IFITA'09.
The average percentage error of actual RBC and WBC are shown International Forum on (Vol. 1, pp. 603-605). IEEE.
in Tables 2-4. [2] Navea, R. F., Dupo, V., & Bacudio, L. (2015). Red Blood
The null and alternative hypotheses for t-tests shown above are as Cells and White Blood Cells Detection, Differentiation and
follows: Counting using Image Processing.
[3] Tangsuksant, W., Pintavirooj, C., Taertulakarn, S., &
• Null Hypothesis: There is no significant difference on the
Daochai, S. (2013, October). Development algorithm to
manual RBC and WBC count results of the urine samples count blood cells in urine sediment using ANN and hough
tested, with that of the proposed automatic count. transform. In Biomedical Engineering International
• Alternative Hypothesis: There is significant difference on the Conference (BMEiCON), 2013 6th (pp. 1-4). IEEE.
manual RBC and WBC count results of the urine samples [4] Dela Cruz J.C. et al., "Determination of blood components
tested, with that of the proposed automatic count. (WBCs, RBCs, and Platelets) count in microscopic images
Through use of the t-distribution table, with 2-tail confidence using image processing and analysis," 2017IEEE 9th
level of 95% and alpha (significance) level of 5%, t-values within International Conference on Humanoid, Nanotechnology,
the range -2.2622 to +2.2622 are accepted. Given the data Information Technology, Communication and Control,
presented above, it was proven that the proposed automatic RBC
117
Environment and Management (HNICEM), Manila, 2017, pp. International Conference on Control and Robotics
1-7. Engineering, ICCRE 2018,pp 259-263.
[5] Quiñones, V.V., Macawile, M.J., Ballado, A., Dela Cruz, [7] Muthukrishnan, R., & Radha, M. (2011). Edge detection
J.C., Caya, M.V.,” Leukocyte segmentation and counting techniques for image segmentation. International Journal of
based on microscopic blood images using HSV saturation Computer Science & Information Technology, 3(6), 259
component with blob analysis”, 2018 3rd International [8] Mazalan, S. M., Mahmood, N. H., & Razak, M. A. A. (2013,
Conference on Control and Robotics Engineering, ICCRE December). Automated red blood cells counting in peripheral
2018,pp 254-258. blood smear image using circular Hough transform. In
[6] V.V., Macawile, Quiñones, M.J., Ballado, A.,Dela Cruz, Artificial Intelligence, Modelling and Simulation (AIMS),
J.C., Caya, M.V.,” White blood cell classification and 2013 1st International Conference on (pp. 320-324). IEEE
counting using convolutional neural network”, 2018 3rd

118

You might also like