You are on page 1of 5

1.

preliminary
Blood type in the medical world can be divided into 4 groups, namely A, B, AB and O. So far, human
blood group detection is still done manually by a laboratory assistant, by taking two drops of blood to be
identified. The blood will be placed on a blood group paper and divided into 2 parts. Each part of the blood will
be dripped with antisera A and antisera B fluids to observe the agglutination process.
Observation of the agglutination process is carried out by the laboratory assistant through eye
observation so that the error rate is still very possible due to the fatigue or saturation of the laboratory
assistant's eye, which makes the accuracy of the data depending on the eye of the laboratory assistant.
Therefore, the researcher had the idea to apply the blood group identification process using image processing.
There are several studies that discuss this background. In the first study, there is a system that
determines blood type using image processing using the robert, prewitt and sobel method, with the success
percentage of the robert operator 38.89%, the prewitt operator 83.33%, and the single operator 94% [1]. In
the second research, a blood group detection system using digital images using fuzzy logic, with a success rate
of 83% [2]. In the third study, there is a classification system for blood type using Fuzzy C-Mean Clustering
(FCM) and Learning Verctor Quantization (LVQ), with success rates of 92% to 98% [3].
From some background and research that has been done previously, this final project will develop a
blood type detection system with the ABO system using image histograms and Artificial Neural Networks
(ANN).
Classification of blood groups using image histograms with Artificial Neural Networks (ANN) is an
attempt to determine blood type by using image processing based on the minimum and maximum values of
three color channels, namely RGB and its pixel location from the image histogram which will then be classified
using Artificial Neural Networks (ANN).

2. Literature review
2.1 Image processing
Image processing is an image processing, especially by using a computer, into an image of a better
quality [5]. Mathematically, image processing can be defined as two-dimensional processing of an image by a
computer that is, an image is defined as a function of two real variables, such as t (x, y) with an amplitude such
as the brightness of the image at coordinate points (a, b) [6].
Digital images are generally two-dimensional (2D) expressed in the form of a matrix with a finite
number of elements. Each element of the image matrix has a certain x and y coordinate position and of course
has a value. In general, a digital image is a representation of pixels in 2D space expressed in a matrix of size N
rows and M columns as in Figure 1, each element of the image matrix is called a pixel (picture element, image
element or mop). The value of each pixel f at the x and y coordinate positions represents the color intensity
and can be encoded in 24 bits for color images (with three color components, namely RGB: R =red, G = green, B
= blue) 8 bits for the gray image orgray-level or 1 bit for binary image.

Figure 1. Image matrix equation


2.2 Blood group
Blood type is a special characteristic possessed by each individual, due to differences in the types of
carbohydrates and proteins on the membrane surface of erythrocytes (red blood cells) [7]. Each individual has
a different blood type. The differences in blood groups can be grouped into 4 types, namely A, B, AB and O.
Individuals with blood type A have red blood cells with antigen A, and produce antibodies B, thus
rejecting red blood cells with antigen B. While individuals with blood type B have red blood cells with antigen
B, and produce antibodies A, thus rejecting blood cells red with the A antigen [8].
Individuals with blood type AB have red blood cells with 2 antigens, namely A and B, but do not
produce antibodies against antigen A or antigen B. While individuals with blood type O have blood cells
without antigens, but produce 2 antibodies at once, namely A and B, thus rejecting red blood cells with both
antigens [8].
The most recognized and medically important blood grouping system is the ABO system [9]. The ABO
system is carried out based on the clotting process (agglutination) / no clotting (non-agglutination) of red blood
cells against antisera A and antisera B fluids.
2.3 Antisera Liquid
The most important blood group antisera are A antisera and B antisera. The characteristic is present
at the end of the sugars attached to the cell wall or on the protruding protein on the bilipid layer [10]. The
antisera fluid is a fluid used to detect blood groups using the ABO system. The detection using this system is
done by mixing the blood sample with antisera fluid to determine whether the agglutination process is or not.
Agglutination is the clumping of red blood cells due to the binding of antibodies to antigens on red
blood cells which produce bonds that hold several cells together [11]. The working principle is that when red
blood cells contain the same antigen as the antisera fluid, agglutination will occur.
2.4 Segmentation
Segmentation is a process that aims to separate the foreground region from the background region
based on the striking differences in the characteristics of each region [12]. The purpose of segmentation is to
classify each color pixel in the image as belonging to a color within a specified range or not. A segment can
represent the characteristics of an object or part of an object in an image.
2.5 Cropping (Image Crop)
Croppingis a process of cutting an image at certain coordinates in the image area. The process of
cutting part of the image uses two coordinates, namely the initial coordinate which is the initial coordinate for
the cut image and the final coordinate which is the final coordinate point of the cut image. So that a
rectangular shape will be formed in which every pixel in a certain coordinate area will be stored in a new
image.
2.6 Image Histogram
An image histogram can be defined as the number of pixels in an image that have the same intensity
value regardless of where the pixels are located. A histogram does not describe the spatial position
information of each pixel or every object in the image, but rather a description of statistical information, such
as the distribution of intensity or the distribution of the color of the image. An image histogram can be
represented in the form of a one-dimensional or three-dimensional graph (curve). The histogram curve of an
image will represent the overall picture of the brightness level of the image.
In a grayscale image, the histogram curve describes the distribution of the brightness / grayscale of
the image from the darkest to the brightest [13]. The histogram can also show a lot about the brightness
(brightness) and the contrast (contrast) of an image. Therefore, histograms are valuable tools in image
processing work both qualitatively and quantitatively.
2.7 Artificial Neural Networks (ANN)
Artificial Neural Networksor artificial neural network is a network of a group of processing units
modeled on the basis of human neural networks. ANN is an adaptive system that can change its structure to
solve problems based on external and internal information [14].
Neurons in a neural network are arranged in groups, called layers. Basically ANN consists of 3 layers
(layers), namely the input layer, process, and output layer. The input layer contains input data variables, the
process layer contains the object recognition steps and the output layer contains the results of the
introduction of an object.
Backpropagationis one of the directed training algorithms. Backpropagation is commonly used by
percepteron with multiple layers to change the weights associated with neurons in the hidden layer.
Backpropagation uses the output error to change its weight values in the backward direction. To get this error,
the forward propagation stage must be done first. In forward propagation, the neurons will be activated using
differentiable activation functions [15], such as sigmoid, tansig, and linear.

3. Research methods
Broadly speaking, the block diagram for blood group classification uses an image histogram
withartificial neural networks (ANN) can be seen in Figure 2, there are 3 parts in the block diagram there are
parts input, matlab, and the output. InputThis system is in the form of an image of a blood group card, which
previously contained a blood sample mixed with antisera. Then for the matlab used consists of 4 parts as data
processing, namely segmentation,cropping, histogram, and ANN. Forthe outputit is the type of blood group
that has been classified by ANN withinput neurons are the minimum and maximum values of RGB and pixel
location of the blood sample image.

The block diagram above describes the sequence of detecting blood groups, input system in the form
of a blood group card image, then the segmentation process is carried out with the aim of removing the color
background so that the only color available is the color of the blood sample. After the segmentation process,
the process is carried out croppingor cutting with the aim of dividing the image into 2 parts between sample A
and sample B. The cut image is the original image not the segmentation result. After this process, a histogram
process is carried out on the image to determine the RGB value of the image. The RGB value that is looking for
is the highest and lowest value along with the location of the values of the three color kernels. If the RGB value
and pixel location of the two images are known, this data will be used as ANN input to classify the type of
blood group from the values obtained.

3.1 Blood Image


In general, in this final project, the image of blood that has been mixed with antisera is an input for
the system being made. Where the blood sample must be placed on the blood group paper, the blood sample
is placed on the right and left sides, after the blood sample is given on the blood group paper then added with
antisera A for the left side and antisera B for the right side. If the antisera is added on both sides, the blood
sample and antisera liquid must be stirred so that they are evenly mixed. After mixing well, there will be a
physical reaction from the two samples. Where the physical reaction is in the form of agglutination. This
agglutination will later be analyzed using the histogram asinput for prapocessing.
Table1. Blood Group Classification
Antisera A Antisera B Blood group
Agglutination Non-Agglutination A
Non- Agglutination B
Agglutination
Agglutination Agglutination AB
Non- Non-Agglutination O
Agglutination

The blood and antisera will then be drawn so that it can be used as input for the system in the form of
images.
3.2 Segmentation Design
Segmentation is used to separate the background color from blood samples on blood group paper in
order to facilitate analysis. The color that is removed in this case is green, so that the blood sample color and
the background are black.
Segmentation in this process is segmentation based on color similarity, which means the process of
forming an area where a number of pixels are connected to each other because they have the same color or
visually have similar colors. This segmentation process will form segments according to the characteristics of
each color. The segmentation process in this system uses HSV elements. The HSV color space refers to hue,
saturation, and value.
3.3 Cropping Design
Croppingor image cutting is a process of cutting an image which has the aim of separating images that
have certain characteristics from the original image. Image cropping is used to separate blood samples mixed
with antisera A and antisera B, making it easier for further processing. So that after the cutting process is
carried out, there will be two blood samples, namely a blood sample with antisera A and a blood sample with
antisera B.
3.4 Image Histogram Design
The image histogram is used to get the highest and lowest RGB values with the pixel location of the
blood sample. That later the clotting blood sample will have a range of color values, as well as the non-clotting
blood sample, this intensity range value will later be used as neuron input for the ANN training process. In
addition, this histogram process will get the pixel location of the lowest and highest values of each color
kernel.
From this histogram process, the parameters will be used as input (input) for ANN. These parameters
include: Max R, Location Max R, Max G, Location Max G, Max B, Location Max B, Max R1, Location Max R1,
Max G1, Location Max G1, Max B1, Location Max B1, Min R, Location Min R, Min G, Location Min G, Min B,
Location Min B, Min R1, Location Min R1, Min G1, Location Min G1, Min B1, Location Min B1.
3.5 Artificial Neural Networks Design
In this section, ANN training will be conducted to form the characteristics of artificial neural networks.
This is done by pairing the input and target target (supervised learning) using 7 RGB values from the sample of
each image. The following is a flowchart for ANN training data:
As for the overall flowchart in the blood group classification process using an image histogram with
ANN is as follows:

From the flowchart above, it can be seen that the whole system is divided into 3 parts, namely
preprocessing, training and identification. In the preprocessing stage, the reagent image will be processed
through several processes including segmentation, cropping, and histogram.
At the training stage, ANN training is carried out with input in the form of a minimum and maximum
value of 3 color kernels namely Red, Green and Blue, along with the location of the pixels, after which the
weight value adjustment process is carried out.
The third stage is identification, namely the process of introducing incoming data to training data, by
matching the weight values. At this stage the output of the blood group classification that has been carried out
by ANN will be determined.
The ANN algorithm used in this system is backpropagation. The backpropagation model is a guided
training method. This network consists of one input layer with 24 neuron units, one hidden layer, and one
output layer with 2 output units. The activation function used in the hidden layer is tansig, while the activation
function in the output layer is also tansig.

4. Results and Discussion


This chapter will discuss the process of collecting and reading blood group images. preprocessing,
traningas well as the identification results previously discussed. This discussion covers the system as a whole.
After getting the test results, the next step is to analyze each stage of the test, according to the test objectives.
4.1. Blood Type Image Collection and Reading
At this stage is the beginning of the test, which is to collect blood group data in the form of images
(images) which will be used as input to the system. The total data collected was 40 data divided into 4 groups,
namely 10 data for each blood group. Of the 10 data, 70% will be used as a processlearning (training data) and
30% for test data.
4.2. Preprocessing
4.2.1. Segmentation Process
This process changes the color elements from the blood group image from RGB to HSV. In this
process, segmentation is used to remove green color, in this case, changing the saturation value so that the
green color becomes dark / black.
4.2.2. Process Cropping
Process croppingor image cutting in this stage is used to separate the two blood samples between the
samples with antisera A and antisera B with the aim of being processed respectively. This process uses the
coordinate point (x, y) as a reference point for cutting. These coordinates will later determine the area to be
cut, the longer it will berange between the coordinates, the wider the cut area, and vice versa.
4.2.3. Histogram Process
The use of a histogram is carried out when there has been a cropping process in the blood sample, so
that there will be two images which will be processed by the histogram. In this process the histogram is used
to perform feature extraction based on the minimum and maximum values of the RGB color kernel and the
location of the pixels where the values are located. One image that is characterized using a histogram will get
24 variables which will be used forinput ANN.
Table 1. Example of Histogram Process Result Data
O A B AB
Max R 3051 4977 2489 2290
Max R location 214 223 2 207
Max G 3839 3589 4612 3365
Max G location 235 1 2 217
Max B 9665 6981 10546 2808
Max B location 1 2 1 221
Max R1 3969 3340 3066 1135
Max R1 location 216 219 5 214
Max G1 3873 4761 9004 1594
Max G1 location 234 2 1 215
Max B1 18917 16344 20410 787
Max B1 location 1 2 1 113
Min R 0 0 0 0
Location of Min R 238 232 245 1
Min G 20 0 8 0
Location of Min G 124 216 132 1
Min B 1 0 17 0
Location of Min B 254 244 150 1
Min R1 0 0 13 0
Min R1 location 249 1 253 1
Min G1 26 0 22 0
Min G1 location 37 215 95 1
Min B1 0 0 15 0
Location Min B1 246 242 139 1

4.3. Artificial Neural Networks Training


After doing the stages preprocessing next is to do training (training) data for artificial neural networks.
Total training data ortraining for this process there are 28 data consisting of 7 data for each blood group.
The type of network used in this system isfeed-forward backpropagation with traingd (gradient
descent) as a function training. Apart from that in this system also useslearngd as a learning adaptation
function with 2 layers.
The data obtained from the histogram process is used as input for training artificial neural
networks(ANN), while the target data are values [0 0] for blood group O, [1 0] for blood group A, [0 1] for blood
group B, and [1 1] for blood group AB. Quantity determinationhidden layer done by trial and error to get
maximum results.
4.4. System Testing
The system testing uses 3 data samples that represent each blood group, so that the total data for
testing is 12 samples. The steps start by inserting the blood group card image until the final detection. The
following is a system test table that is matched with manual observation:

From the table above, it can be analyzed that detection failure during testing can occur due to two
things, firstly because the image processing process is not optimal, the cutting process is not good and the
intensity level of the image color varies so that it affects the characteristic extraction process. Second, in the
ANN, more data needs to be added at the timetraining to improve its accuracy.
From table 2, it can be seen that the percentage of conformity between manual observation and the
program system is obtained 2 times the mismatch of identification from 12 trials. The percentage of errors is
obtained as follows:
jumlah error
Average error = x 100%
jumlah seluruh data uji
2
= x100%
12
= 16.67%
5. Conclusion
From the results of the research and analysis of the system testing that has been made, several
conclusions can be drawn, namely: the application of an image histogram with ANN for blood type detection
has been successfully carried out and the error percentage is 16.67%. In taking blood sample images, the
lighting factor greatly affects the RGB value in the image.
From the results of system testing, there are several shortcomings. We recommend that when taking
blood sample images using a scanner so that the results obtained are the same. In addition, it is also necessary
to add several other image operators besides the histogram to add several parameters that can be used to
improve system accuracy. Further research should be inclined toprototype and use a reading system real time.

You might also like