A MATLAB model for diagnosing sickle cells and other blood abnormalities using image processing

The conventional method for detecting blood abnormality is time consuming and lacks the high level of accuracy. In this paper a MATLAB based solution has been suggested to tackle the problem of time consumption and accuracy. Three types of blood abnormality have been covered here, namely, anemia which is characterized by low count of red blood cells (RBCs), Leukemia which is depicted by increasing the number of white blood cells (WBCs), and sickle cell blood disorder which is caused by a deformation in the shape of red cells. The algorithm has been tested on different images of blood smears and noticed to give an acceptable level of accuracy. Image processing techniques has been used here to detect the different types of blood constituents. Unlike many other researches, this research includes the blood sickling disorder which is epidemic in certain regions of the world, and offers a more accuracy than other algorithms through the use of detaching overlapped cells strategy.


INTRODUCTION
The conventional methods for detecting blood abnormality use some physical properties of blood to detect any kind of abnormalities within its constituents. These properties include light scattering and electrical impedance in order to differentiate among the different blood components [1]- [3]. Hematologic analyzer is utilized to count three main components of blood, namely, erythrocytes or what is called red cells, leukocytes which is well known as white cells, and thrombocytes or platelets [4]- [6]. The various ingredients of blood have been observed to reflect contrasted effects on the blood composition properties. Various strategies can be utilized to perform a complete blood count (CBC). These strategies include impedance, light scatter, Florescent, or conductivity under different frequency ranges. For instance, a laser beam is applied to the blood stain through a specified diameter pin whole in order to count the number of red blood cells (RBCs), white blood cells (WBCs), and blood platelets [7]- [9]. Many mathematical models have been used in order to count the approximate number of RBCs, WBCs, and blood platelets. In many cases these models either lack the required accuracy or neglect the very popular mid-eastern disease of blood sickling caused by a disorder in the RBC shapes [10]- [12]. The resulting number of RBCs, WBCs, and sickle cells are to be invested to investigate different sorts of cardiovascular diseases. Three major abnormalities can be recognized when blood particles counting is achieved. These types of abnormality are summarized below: a) Fewer number of RBCs than the normal is a clear clue of blood anemia [13], [14].  [15], [16]. c) Distorted RBCs is used to diagnose sickling anemia [17], [18]. However, since this counting procedure depends on physical features, then it is subject to the external conditions, circumstances and variations [19]. Many of these tests done by blood analyzing device, are transferred to manual cell counting in the lab. This is done if the test results were questionable [20]. Many efforts have been achieved in this field targeting coming up with a way to reduce the number of false readings and accelerate the whole detection process. Image processing techniques offered an excellent alternative to the conventional physical methods. The major challenge these researches faced was counting the overlapped objects in blood smear image [21], [22]. These overlapped cells resulted in a substantial deficiency in these approaches in terms of counting accuracy. The proposed algorithm adopts a new strategy described by detaching the overlapped cells prior to the counting process. Furthermore, this paper introduces a way to count deformed cells well known as sickle cells which is considered epidemic in some regions of the world such as Middle East [23]- [25]. Cells' sickling is detected by measuring their dimensions. Figure 1 shows the flow chart of the proposed blood cells detection algorithm. Different algorithm steps which were achieved using MATLAB programming language were then explained in details in the next section.

RESEARCH METHOD
The various algorithm sections results were recorded in this section to comprehend the effects of each individual action on detecting the required particles.

Reading the colored blood smear image
" " MATLAB instruction was used to read the data matrix of 508×395 png blood smear digital image, the resulted image was shown in MATLAB using the instruction " ℎ ", instructions arguments were explained in details in MATLAB help. Figure 2 shows the original blood smear image.

Converting colored blood smear image into a gray scaled image
In order to accentuate the different blood constituents, colored image needs to be converted into gray scaled image. This will significantly increase the image contrast making it easier to detect the different blood particles. "rgb2gray" instruction was utilized to achieve this task resulting in a 2-D image matrix of size 395×508 unsigned integers. Figure 3 shows the gray-scaled image.

Converting the gray-scaled image into binary image
A higher contract can even be achieved by parsing the gray-scaled image as a binary black-andwhite (BW) image. This operation is performed by determining the average image threshold using the MATLAB instruction " ℎ ℎ". After that, pixels that exceeds this threshold are assigned the value 1, and others are assigned 0 by using the instruction " 2 ". A -2-D logical matrix is yielded as shown in Figure 4.

Removing cells' nuclei
In order to avoid counting the nucleus of a cell as a stand-alone whole cell, these nuclei are to be removed from the smear image. MATLAB supports this facility through the instruction (~, ′ℎ ′) which fills the holes of the inversed binary image. Figure 5 shows the image after removing nuclei and tiny.

Detaching overlapped circles, clearing smear borders and removing tiny particles
Cells that are located in the image border may obstruct the operation of counting these circular shaped blood particles due to the distortion resulting from trimming these shapes. The instruction " " was deployed to achieve this task. Tiny particles in the image which represent blood platelets need also to be removed using the instruction " ". Moreover, overlapped cells need to be detached in order to offer a more accurate cell counting algorithm. The obtained image is shown in Figure 6.

Counting different types of blood cells
Circular Hough transform (CHT) have been used in this algorithm by through the utilizing the instruction " " to detect circular objects with in image. Each individual circular object may be representing WBC, RBC, or sickle cell depending on its size and shape. Bigger objects are considered WBCs whereas smaller ones are considered RBCs. The shape of each hole within the image is determined by rounding it with a bordering box using the " " MATLAB command. The height and width of this box is measured aiming to investigate whether it has a sickling shape or not. This can be achieved by assigning a form factor to each cell according to (1), where the cell is considered sickle if the form factor of less than 2.28.  Figures 2 through 5 show the results of different detection algorithm steps, it is found that the detection process becomes more efficient in the gray level than the case in colored RGB, this can be due to the enhanced contrast gained when moving to gray scale. Similarly, moving further to black and white level can substantially improve the detection process. One of the major problems that may reduce the efficiency of Hough transform approach to detect circular objects is the overlapped circles. This problem was tackled in this algorithm by detaching the overlapped circles prior to applying CHT. Figure 7 shows RBCs and WBCs as detected with the proposed algorithm where RBCs are bordered with red edges and WBCs are bordered with green edges. A good accuracy in detecting red and white cells was obtained by applying the proposed method. Figure 8 on the other hand detects sickle cells and inbounds them with blue color edges. The proposed approach for estimating the high-to-width aspect ratio was invested to give encouraging results. The algorithm then counts the number of red, white, and sickle cells to reveal any probable blood abnormality.

CONCLUSION
Image processing techniques has been used in this paper to accelerate the process of diagnosing a range of blood cells abnormality. Conventional methods are considerably time consuming and less accurate due to the fact that they use physical blood stain properties which are subject to physical and chemical changes. On the other hand, the proposed method offers more accurate testing within relatively shorter time in addition to the more economic option it facilitates. Unlike many other papers which suggested detecting blood abnormalities using image processing, this paper introduces an efficient way of detecting blood sickling which is considered epidemic in middle east region.
MATLAB software has been deployed here to filter the original blood smear image aiming to detect the circular and sickle shaped blood particles. The used algorithm includes converting the colored smear image into gray scale, then into a binary black and white image. The binary image is then analyzed using circular Hough transform in order to detect circular particles. the size of circles is then measured aiming to recognize whether it represents WBC or RBC. Sickle cells are considered a distorted red blood cell whose length-to-width ratio is way higher or lower than 1. The length-to-width ratio, which was termed in this paper as aspect ratio, determines the sickling of the blood cell, where normal blood cells are characterized by an aspect ratio of 1 or something near that. Results showed that the algorithm gives an acceptable range of accuracy in counting the three main constituents of blood smear, namely, RBC, WBC, and sickle cells.