In an emergency, an urgent blood transfusion from a person to the patient is required and blood group identification is the first process to do so. In addition, a hemoglobin test is often required to make decisions about blood transfusion as well as to check anemia. Hemoglobin testing is also required for complete blood count and monitoring a number of diseases. These blood tests are almost difficult in rural areas where lab facilities are not sufficient. Researchers proposed a number of methods to identify blood groups using computer vision techniques. However, no study was conducted to identify blood group and hemoglobin level in a work using image processing techniques and an android mobile application which shows high detection accuracy. In this paper, manual clinical experiments have been replaced by an android app using image processing techniques to detect blood groups and hemoglobin levels except users require using antigen before taking samples. The proposed technique is divided into two portions. The first portion is blood group detection, which is done by taking a blood sample and performing the grayscale conversion, binary conversion, segmentation, edge detection, and computation to make the decision. The second section describes how to determine hemoglobin levels by comparing a blood sample image to a hemoglobin color scale (HCS). Here, the Hemoglobin value is determined from their RGB values. It has been discovered that the proposed approaches are capable of detecting hemoglobin levels and blood groups in a cost-effective and error-free manner. As a result, the tests can be conducted in a remote area without adequate lab facilities and the proposed work can solve major steps in blood transfusion difficulties and anemia.
Blood is a composition of red blood cells, white blood cells, and platelets in liquid plasma. Blood groups are identified by antibodies and antigens present in plasma. There are four blood groups i.e. A, B, AB, and O (NHS, 2020). If the blood is agglutinated by the pre-sence of Rh-D antigen, the group of the blood is posi-tive, otherwise negative (K et al., 2016; Dong et al., 2017). This blood groups identification is often requi-red in case of blood transfusion. The identification of the blood group is not enough at all. A hemoglobin test helps to decide blood transfusion. In addition, a lack of hemoglobin leads to Anemia. Anemia is a type of disease in which a person lacks enough red blood cells for carrying necessary oxygen for soft body tis-sues. Pregnant women, as well as young children, are the most vulnerable to its devastating effects (Kharkar et al., 2013). So, the blood group detection and hemo-globin test are often required in case of any emergency and these tests are conducted manually in a laboratory. Unfortunately, the problem arises for the people who live in rural areas. The scarcity of enough lab facilities and trained personnel are often noticed. To address these problems, researchers have proposed a lot of techniques to identify blood group and hemoglobin (Hb) levels to support those people in case of emer-gency. The authors in (Ravindran et al., 2017) have proposed image processing techniques to deter-mine and classify blood types. In the experiment, slide testing is done using thresholding and morphological gradient operations. This developed method shows greater accuracy. Authors in (Dong et al., 2017) pro-posed another image processing technique based on feature extraction by exploiting Niblack segmentation, Otsu algorithm to identify the ABO blood group. The most extensively used blood grouping system is ABO, which was invented by Austrian Rand Steiner. It provides accurate results but consumes a lot of time, which is the main constraint of this technique. Authors in (Dhande et al., 2018) proposed a cost-effective technique using an image processing technique for blood typing. The key technologies in the research are morphological operations, erosion, dilation, and thres holding. The only limitation is observed in the res-earch is that the research does not identify the Rh factor of the blood. In another research, blood group-ing and typing are done using image processing, conveyor belt, and digital microscope (Azam et al., 2020; Jayakumar et al., 2020).
This technique can process a lot of samples at a time in the laboratory but it does not proceed to a process of testing blood outside of laboratories such as in rural areas or on mountain trails. Our proposed methodo-logy would be capable to complete blood grouping or typing without any help from a medical technician so that major steps in blood transfusion problems can be eradicated. In addition, Anemia is a major problem commonly found in women. A study shows that 77% of the female workers among the total garments workers suffer from different grades of anemia in Bangladesh (Khatun et al., 2013). In this circum-stance, sophisticated low-cost Hb testing equipment must be developed. Authors in (Ahsan et al., 2017) proposed Hb level detection technique from video images. The limitation is that a mobile application is used to collect the required video but the detection process needs computer analysis. Mobile application only enhances the video. Authors in (Zafar et al., 2018) investigated ultra-compact plasmonics-based sensors with fano resonance. The prototypes appli-cability to detect Hb concentration was investigated using metal-insulator-metal (MIM) waveguide geo-metry. Authors in (An et al., 2019) developed a micro-chip electrophoresis named HemeChip+ to identify anemia and hemoglobin variants. One observation is found that the HemeChip+ single-use cartridge is a good solution but it requires Gazelle (Display analyzer by Hemex Health Inc.). From these studies, some observations are found these are: most of the bloods grouping techniques are not applicable in rural and remote areas, some tests require additional equipment which can be afforded in a lab environment but in case of rapid test this equipment cannot be afforded. No study was conducted for combing the blood grouping and Hb test in a combined cost-effective manner. By addressing these limitations, this paper proposes a high efficient blood grouping and Hb level testing by exploiting image processing mechanisms through an android smart phone.
The testing procedure does not require an additional instrument. It only requires A, B, and D antigens for blood testing and a test strip for Hb level testing. Blood grouping and Hb level testing are carried out in this work using an image processing method included in an Android mobile application. The initial step is to take a blood sample, after which the slide testing procedure is considered. In this scenario, three drops of blood are mixed with antigens A, B, and D by placing them serially. The captured image is then processed through a variety of stages, including gray-scale conversion, binary conversion, image segmen-tation, edge detection, and edge calculation. After these series of processing, a blood group is detected. In the case of Hb level detection we consider, World Health Organization (WHO)s HCS method. The WHO HCS method is a low-cost color-scale method for measuring hemoglobin concentration from a drop of blood (Kumar et al., 2014; Lewis et al., 1998; Stott et al., 1995). The hemoglobin detection process of this work is inspired by the manual HCS method and it is taken over by an automatic android app-based detec-tion system composed of several image processing techniques. Such as RGB value comparison, color intensity calculation, background removal, and result in analysis. The proposed mechanism shows an opti-mal accuracy for blood grouping and Hb level detec-tion. It has a hundred percent accuracy in blood group-ing and maximum accuracy in Hb level measurement.
ABO Group Classification
The schematic representation of the blood group detection technique is shown in Fig 1. The blood sample that will be analyzed has to take over a slide. The grouping is decided from when antibodies of blood cells make sure the reaction with erythrocyte antigens i.e. agglutination. The antigen response over antibody is shown in Table 1.
Fig 1: Block diagram of working procedure for detecting Blood Group.
Table 1: Antigen response over antibody of a blood cell.
Fig 2: Blood Sample after mixing antigens, (a) Original image; (b) No Agglutination; and (c) Agglutination.
Fig 3: Flow chart for detecting ABO group type.
N means there is no reaction occurs between antigen and antibody i.e. no agglutination and Y represents the agglutination that occurs. Image is taken from the blood sample slide by image acquisition device and the image after being mixed with antigen is shown in Fig 2(a). The occurrence of non-agglutination and agglutination of blood is respectively shown in Fig 2(b) and 2(c). To figure out and analyze the reaction between antigen and reagent by image processing the several methods like segmentation, edge detection, the calculation is used, and then the grouping decision is made from Table 1. The input image is followed by the flow chart pro-cedures for ABO-type blood grouping shown in Fig 3. Firstly, the grayscale conversion of the input image is done through binary conversion then segmentation. Hence edge is detected and derived from these seg-ments.
The flow chart finally ends with the decision-making process. Grayscale conversion is one of the funda-mental approaches for converting RGB color images into a grayscale image. The basic method of this trans-formation is taking the contribution of red, green, and blue intensity partially. In comparison to the average method, the Luminosity method produces better gray-scale conversion results. In equation (1), r,g,b denotes the intensity value of red, green, blue respectively of the color image and g(x,y) is the grayscale image. In Fig 4, the gray scale image of Fig 2(a) is shown.
Fig 4: Gray scale image of Fig 1(a).
A threshold is employed in the transformation of a gray-scale image to binary. The variety of intensity 0-255 of gray image is mapped into 0-1 i.e. binary image shown in Fig 5. This is done by accepting a custom threshold value T and producing a binary image as an output, b(x,y).
g(x,y)=0.299 * r + 0.587 * g + 0.114 *b (1)
b(x,y)={█( 1,&if g(x,y)≥T@0,& otherwise)┤ (2)
Fig 5: Binary image from gray scale image.
A method of splitting an image into different parts is called segmentation (Vala et al., 2013). The converted binary image, b(x,y) is divided vertically into three block segments i.e. s_1 (x,y),s_2 (x,y), and s_3 (x,y). The original images number of columns determines how many segments are needed. In equation (4), (5) and (6), i denotes the number of columns of each block, Fig 6 shows the three segments of the binary image. Canny image detection is a technique of detecting an edge from the binary image, having a Gaussian filter to reduce noise and provides the smooth image as output Fig 7 shows the canny edge detection from a binary image.
i=(no. of coumn of b(x,y))/3
b(x,y)=[■(b(0,0)&b(0,1)&⋯&b(0,N-1)@b(1,0)&b(1,1)&⋯&b(1,N-1)@⋯&⋯&⋯&⋯@b(M-1,0)&b(M-1,1)&⋯&b(M-1,N-1))] (3)
s_1 (x,y)=[■(b(0,0)&b(0,1)&⋯&b(0,i-1)@b(1,0)&b(1,1)&⋯&b(1,i-1)@⋯&⋯&⋯&⋯@b(M-1,0)&b(M-1,1)&⋯&b(M-1,i-1))] (4)
s_2 (x,y)=[■(b(0,i)&b(0,i+1)&⋯&b(0,2i-1)@b(1,i)&b(1,i+1)&⋯&b(1,2i-1)@⋯&⋯&⋯&⋯@b(M-1,i)&b(M-1,i+1)&⋯&b(M-1,2i-1))] (5)
s_3 (x,y)=[■(b(0,2i)&b(0,2i+1)&⋯&b(0,N-1)@b(1,2i)&b(1,2i+1)&⋯&b(1,N-1)@⋯&⋯&⋯&⋯@b(M-1,2i)&b(M-1,2i+1)&⋯&b(M-1,N-1))] (6)
Fig 6: Segmentation of binary image.
Fig 7: Canny edge detection from binary image.
Fig 8: Edge computation process.
After detection process is done the edges are counted from the total number of connected objects found in that binary image. The edge computation process is illustrated in Fig 8.
Hemoglobin (Hb) Detection Process
HCS is a simple, accurate and cheap quantitative method to assess hemoglobin concentration outside of the laboratory, containing six different hues of color, which refers 4, 6, 8, 10, 12, 14 g/dL values of hemo-globin related to the blood sample (Marn et al., 2016; Hasan et al., 2021). Fig 9 shows the WHO HCS. The hemoglobin estimation is illustrated in the Fig 10. A drop of blood is placed on the test strip, and after about 30 seconds, the blood samples color matches one of the hues on the HCS. The Hemoglobin level of a blood sample is estimated based on the closest match with HCS. Our goal is to take a photograph of both HCS and blood samples, and its also important to make sure that both images are in the same environment i.e. same distance, angle, illumination, resolution, etc. thus its monotonicity remains cons-tant. At least 5MP Smart Phone Camera, 90-degree camera angle, a distance of around 7.5 cm, and illumination above 500 lux in natural outdoor light has been regarded as a standard for our work which provides a comparatively high inter-cluster distance (ICD) and the monotonicity is maintained too.
Fig 9: WHO hemoglobin color scale (HCS).
Fig 10: Working procedure of determining Hemoglobin level.
Android Application Layout
The recommended methodology is translated into an android application so that people in remote regions can benefit from it. Moreover, the application will pro-vide some real blood groups and Hb test reports. Using Android Studio, an .apk file is created initially. Then the android application is installed in an android. A user interface, some layouts will be opened at the moment of usage. These layouts are described here: After opening the mobile app or android application the users "Home Layout" will be displayed (Fig 11). Two buttons are available in the home layout. If the user wants to check the Hb level, he/she just needs to touch the Test Hemoglobin level button.
Fig 11: Home Layout. Fig 12: (a) Image Capture layout for Blood group detection, (b) Blood group testing result.
Fig 13: (a) Image capture layout for Hb level testing; (b) Hb testing result.
If the user needs blood group information, he/she just needs to touch the Test Blood Group button. Con-sider the case of a user who wants to know his/her blood group. Then he/she will be required the A, B, D antigens and blood samples of interest. It must be ensured that mixing the antigens with the blood sam-ples must be aligned sequentially (Antigen-A, Anti-gen-B, and Antigen-D) on a glass slide as depicted in Fig 12(a). Then the report layout will be generated after touching the Go forward button as an immediate effect which is depicted in Fig 12(b). Let the user check the Hb level, he/she just needs to touch the Test Hemoglobin level button from Home Layout.
For testing Hb, the user just needs a test strip. After collecting the blood sample, it needs to be placed on the test strip and allowed to dry for 30 seconds. Then we just need to capture the image from the Test Hemoglobin Level for taking the image shown in Fig 13(a). If the proper image is captured then the Go forward button will be visible for the next action. Finally, the user will have the ability to see his level of hemoglobin in the layout after touching the Go forward button which is shown in Fig 13(b).
Based on our research of about 50 samples, a number of edges greater than 17 indicate agglutination, where-as a number less than 17 indicates the absence of agg-lutination. Table 2 displays the experimental data of five different samples. N_A, N_B, and N_D represent edge count for segments S_1, S_2, and S_(3 )respectively (Fig 8).
Table 2 shows that the edge value of〖 N〗_A for sample No 1 is less than 17, indicating that there was no agglutination between anti-A and antibody in the blood sample. But the edges of N_B and N_D are much more than 17 i.e. agglutination occurred with anti-B and D respectively. So, this data indicates the B posi-tive (B+) type blood. For the remaining data, a similar type determination is obtained. Then, for each hue, we calculated the Euclidean distance between the blood cluster and the Hemoglobin scale cluster, assuming that the closest cluster would be closest to the actual Hemoglobin value of the blood. If the Euclidean dis-tance of two HCS colors is equal, another situation could occur, i.e. if the RGB of a blood sample falls between two Hemoglobin values like 10 and 12, or 8 and 10, then the average value will have considered i.e. 11 or 9 respectively.
Table 3 demonstrates anemic condition for corres-ponding. Hemoglobin values of HCS. This technique helps initially to indicate that a patient is anemic or not. In this second part of this document, we digitize the HCS of WHO and took a digital photograph of the blood sample after that compared them using image processing techniques. Each hue of HCS is different and their clusters for each Hemoglobin value are distinct.
Table 2: Result analysis based on edges.
Table 3: Anemic condition defined in HCS.
Table 4: Table for measuring Euclidian distance between RGB of each Hue and RGB of Blood sample.
Table 5: Comparison of proposed method with typical Sahlis method.
From the RGB color space analysis of each hue, the Red intensity gives a better distinguishable value than Green intensity for calculating higher Hemo-globin levels like 12 gm/dL, 14 gm/dL, etc, as well as for the lower Hemoglobin levels green intensities perform better. The distinct clusters of each Hemo-globin level are arranged such that the monotonicity is maintained i.e clusters of 6 Hemoglobin level comes after the next Hemoglobin level 8, 8 comes after 10, 10 comes after 12, and so on. In Table 4, the "RGB Scale Hue" column represents the RGB value of the corresponding hue. Blood samples are taken with their RGB. Hence, Euclidean distance is derived from the RGB of each hue and RGB of the blood sample. The "Euclidean Distance" column is showing the distance value of Sample 1, 2, and 3. The minimum distance value refers to the correspond-ding Hemoglobin level. The minimum Euclidean dis-tance value for sample 1 is 17.23, so the Hemoglobin value for sample 1 is 14 g/dL. Similarly, the Hemo-globin values of samples 2 and 3 are 6 and 14 g/dL respectively. A comparison between our proposed model and popular standard Sahlis Hemoglobin detection met-hod (Kharate et al., 2020; Patil et al., 2013) is represent-ted in Table 5. Our proposed method provides the same result as the HCS scale since it is inspired by the HCS method and provides a more accurate value compared to Sahlis method. Hemoglobin values for five samples are measured from Sahlis, WHOs HCS, and the proposed method is shown in Table 5.
In this research work, the proposed techniques are uti-lized for the image sets that are collected from blood samples and then processed by efficient image pro-cessing methods and algorithms. We have collected data by counting the edges for each captured image and carefully examining the data we can compute the blood group. In addition, we have computed the Hb level from the captured image of the blood sample by comparing it with the standard WHOs HCS scale. The experimental findings obtained from the traditional technique and those obtained from our proposed method are nearly identical, indicating that our proposed method pro-vides optimal precision. Consequently, the proposed method of digital identification of blood group and Hb levels replaces the traditional manual lab testing process. Also, it can detect blood group and Hb levels quickly, easily, and with high reliability. As an and-roid mobile phone is used here for image capturing and processing purposes, no one needs to buy an additional device for testing without three antigens (A, B, and D) and filter paper. Thereby, a cost-saving detection strategy has been possible. Thus, we can conclude that the approaches weve described are capable of detecting blood groups and Hemoglobin levels through an Android smart phone.
The authors thank the authority of the Department of Information and Communication Engineering, Pabna University of Science and Technology (PUST), for their necessary support to conduct the study.
The writers of this article stated that, there are no con-flicts of the interest to publish the research article under the current issue.
Academic Editor
Dr. Toansakul Tony Santiboon, Professor, Curtin University of Technology, Bentley, Australia.
Department of Information and Communication Engineering, Pabna University of Science and Technology, Pabna-6600, Bangladesh
Khaleduzzaman K, Mahmud MH, Debnath T, Sohag Sarker S, and Podder PK. (2021). Detection and implementation of blood group and Hb level by image processing techniques. Aust. J. Eng. Innov. Technol., 3(5), 73-81. https://doi.org/10.34104/ajeit.021.073081