Application of Dynamic Segmentation in Stroke Detection Software with ANN

—One way to find out whether there is a stroke is to do a CT scan . But the results of the examination with a new CT scan can be obtained in quite a long time. In addition, sometimes there are differences of opinion between doctors and radiologists regarding what is seen from the results of the examination. This research was conducted to produce a software that can later be integrated with the existing system on the CT Scan tool so that it can immediately be known whether or not stroke is present from the CT Scan results. In this study, a dynamic image segmentation method is implemented, namely the watershed transformation method which will later produce regions as a feature for the stroke detection process carried out with the backpropagation algorithm. From experiments conducted on CT scan images of the brain, this method can detect stroke well. The results obtained are 100% for training data (20 images consist of 10 normal brain and 10 stroke brain) and 90% for test 10 images of data.


A. Problem Background
Stroke is the second leading cause of death in the world, Valery Feigen in [1]. Every year, more than 700,000 people have a stroke, 25% of whom are under 65 years old [2]. Stroke can be interpreted as damage to blood vessels in the brain which results in persistent nerve disorders. Stroke occurs suddenly due to disruption of blood supply to the brain. A series of biochemical reactions caused by lack of blood flow and oxygen can kill nerve cells and damage these cells, causing speech disorders, paralysis and decreased consciousness [3].
In order to prevent errors in diagnosis, it is advisable to carry out diagnostic investigations. Diagnostic support tests that can be performed include laboratory tests such as angiography, Magnetic Resonance Imaging (MRI) and Computed Tomography Scan (CT-Scan).
By doing a CT scan, we can get very accurate pictures of the bones, blood vessels and organs in the body. A CT scan uses X-rays to take pictures. In the brain and head, X-rays are absorbed differently by different parts of the body. Bone will absorb the most X-rays, so the image that appears to be photographed is white. Meanwhile, the fluid in the brain is black [3]. However, CT-Scan cannot detect damage when the damage is too small. CT-Scan cannot determine instantly the type of disorder. This causes some cases of stroke difficult to detect quickly using a CT-Scan.
To establish the diagnosis that someone has a stroke or not is not an easy thing. Various examination procedures must be carried out by the patient before the doctor finally diagnoses a mild or severe stroke. One of the steps that is usually done is an examination of the brain and head with a CT-Scan. Problems that usually occur when examining the brain and head with a CT scan include:

-
The results of the CT-Scan examination are obtained in quite a long time - The patient or the patient's family cannot see or translate the CT-Scan results -Doctors and radiologists who make diagnoses often have different opinions Therefore, we need a software that is integrated with the existing system on the CT-Scan so that it can detect the damage that occurs more quickly and accurately.
One of the processes used to process the CT-Scan images of the brain is the segmentation process. Segmentation is the first thing that is usually used before we perform the analysis process on an image [4]. The segmentation process can be interpreted as a process to separate one object from another, a process that separates between objects, or object with a background in an image. By doing the segmentation process, each object in the image can be taken individually so that it can be used as input for other processes [5]. Some of the methods included in image segmentation are: Histogram-Based Methods, Region Growing Methods, Clustering Methods, Level
In medical imagery, identification of the object or area of interest can provide useful information for the diagnosis and treatment of disease. However, often the segmentation process involved is done manually and depends on user involvement so it is very time consuming and difficult for users. Therefore, the dynamic segmentation process is more popular. Dynamic segmentation means that all segmentation processes are carried out automatically without user intervention in determining the starting point of segmentation, target tracking and contour formation. The segmentation used is segmentation based on area where the segmentation process is carried out to get an area that is believed to be an object [7]. We are using the watershed transformation as the method of dynamic segmentation that is good for getting an object from segmentation [7].
From the results of segmentation, it will be obtained patterns that become dominant characteristics. This dominant characteristic is used in artificial neural networks for the stages of learning, training and testing or simulation [8].

B. Problem Background
The aims of this research are: -Develop software that applies dynamic segmentation with the Watershed Transformation method in detecting stroke from CT-Scan images -Knowing the level of accuracy of the Watershed transformation in the CT-Scan image segmentation process that will be used to detect stroke While the benefits to be achieved from this research are to produce software that can be integrated with existing systems on CT scans so that they can find out early diagnoses of stroke faster.

A. Stroke Disease
Based on the cause, stroke can be divided into two types, namely [9]:

1) Bleeding Stroke
This type of stroke is often referred to as a haemorrhagic stroke. It is usually caused by the rupture of a blood vessel in the brain resulting in the accumulation of blood in the brain. As we know, that the brain is located in a hard cranium so that there is not enough room for blood, this can cause pressure or compression on brain tissue, causing brain tissue to be damaged or die. This type of stroke can usually be detected with a CT-Scan examination where a collection of blood will be found pressing on the brain tissue. The following image shows white area discharge that is bleeding.

2) Non-Bleeding Stroke
This type of stroke is often referred to as an infarct stroke or ischemic stroke . This type of stroke is caused by a lack of blood supply to the brain as a result of blockages in blood vessels that cause brain tissue to lack nutrients and oxygen obtained from the blood which is usually caused by fat blockages or blood clots. This type of stroke can also be examined through a CT-Scan. The following CT-scan image shows the area on the left is darker which indicates the presence of tissue death in the brain.

B. Image Preprocessing
Watershed transformation is one method that is quite good for getting an object from segmentation results. But this method has one weakness, namely the presence of excessive segmentation (over segmentation) [10]. Therefore, before doing the transformation, it is necessary to do a preprocessing. Preprocessing used is a collection of processes that can produce better segmentation. There are many processes that can be used. The processes used are: grayscaling, dilation, erosion, morphological gradient and minima removal

1) Grayscaling
Grayscaling is the process of changing the pixel value from color (RGB) to graylevel [11]. Basically this process is done by leveling the pixel values from 3 RGB values to 1 value. using the YUV system by taking the Y component (illumination). Y value is obtained from 29.9% of red ( Red ), 58.7% of green ( Green) and 11.4% of blue ( Blue ) [11]. Mathematically, it can be seen in the following equation:

2) Histogram Equalization
Histogram equalization aims to change the intensity of an image into an image with relatively the same histogram value at each level. The purpose of using the histogram equalization process in this study is to bring out the parts that are not visible so that they become clearer.

3) Dilation
The dilation process can also be interpreted as a thickening process. Dilation is done to produce a smoother image so that it is easy to segment. With A and B lying on Z 2 , the dilation of A by B , denoted by A B , is defined (2) In the above equation, the dilation process A by B means that for each point a, shift will be made and then combined.

4) Erosion
This process is the opposite of the dilation process . This process is an image thinning process. Erosion is done to produce a smoother image, by increasing the value of darker colors.

5) Morphological Gradient
Morphological gradient will produces output in the form of images. This process make the output obtained from reducing the dilation of the first (original) image with the erosion of the first (original) image, so it can be defined: (4) In this study, Morphological Gradient is used to find the edges of the image.

6) Minima Removal
The minima removal process can be said to be a basic smoothing process from the minimum area to make the minimum area has a uniform value. As we know that the image produced by preprocessing without a threshold has an uneven minimun value, so this process carried out before the image is segmented.

C. Image Segmentation
In this study, image segmentation is carried out dynamically using the watershed transformation. Because it uses morphological preprocessing the watershed transformation is also called morphological watershed. The watershed transformation is an approach to segmentation. The concept of the watershed transformation is to assume that an image is 3 dimensional [12] and assuming the gray level is the height and it is assumed that the higher the white color, the higher". The principle of the watershed transformation is to find the watershed line. The watershed line is a line where the points are the highest points of the depiction of an image into a 3dimensional form, namely the x position and y position, where the x and y positions are the base plane and pixel color. In this case, the gray level that is close to white has the highest value [13]. The segmentation stage in the CT Scan brain image is very important because the more accurate the segmentation results to separate objects and backgrounds, the more information that can be built and developed from the calculation stage to stroke identification. [14]

D. Artificial Neural Network
Artificial Neural Network (ANN) is an information processing model that was developed based on the working principle of the human brain's nervous system [15]. In the neural network, neurons will be collected in layers (layer) layer called neurons (neurons layers). Usually the neurons in one layer will be connected to the layers before and after it. The information given to the neural network will be propagated layer to layer, starting from the input layer to the output layer through another hidden layer, which is often known as the hidden layer.
The ANN using backpropagation algorithm consists of a forward action process and a backward action process . In the forward action process , the first thing to do is create a random weight as the initial weight. The next process is to get the output value (y) using the random weights that have been obtained. If the output value obtained is not in accordance with the target, then the program will perform a backward action process . The process carried out is the training process or the training process. In this process, the program will again look for the right weight so that the resulting output value is in accordance with the set target. Next, the program will look for the values of z and y as was done in the forward action stage . If the y value obtained is not in accordance with the intended target, then the next ISSN 2354-0082 process is to calculate the output weight variable and the hidden layer weight variable factor . Next the weights are updated. The process of updating the weights is carried out by adding up the old weights with the weight variables that have been obtained. The training process is carried out continuously until it converges. After obtaining the optimum weight , the program is ready to be tested.

III. RESULT AND DISCUSSION
The study was conducted using 20 training data consisting of 10 CT scan images containing infarction and 10 normal brain CT scan images. In addition, 10 test data were used, consisting of 4 CT scan images containing infarction and 6 normal brain CT scan images. The results of image preprocessing can be seen in Figure 3. Figure 3 (a) is the initial input image. Then the image is processed to produce a grayscalling image as shown in Figure 3(b). The next process is histogram equalization which can be seen in Figure 3(c). The next process is the morphological gradient process as shown in Figure 3(f). The morphological gradient process is the result of the reduction of the dilation process in Figure 3(d) and the erosion process in Figure 3(e). The last step in preprocessing is the minima removal process, the results of which can be seen in Figure 3(g).
After preprocessing, the image is ready for segmentation. The segmentation results can be seen in the following figure: From the segmented image, we have the obtained regions that will be used for the detection process by the backpropagation algorithm. ANN using backpropagation will do the detection process consists of a learning process and a testing process. In the learning process, the input value is obtained from the segmentation results. The segmented image is divided into 10x10 blocks. From each block will be taken how many regions are in the block. So in the end obtained 100 blocks containing the segmented regions. The 100 blocks will then become input neurons in the backpropagation algorithm . The trained patterns are 10 patterns for images containing infarction and 10 patterns for normal images. The target set for the first 10 patterns (patterns containing infarction ) was 0 and the target for the next 10 patterns (normal brain patterns) was 1. After the learning process is carried out and the optimum weight is obtained, we are ready to test the image. The test results can be seen from the following picture: All the process can be seen in Fig. 7. There is three main process in this research. The first is preprocessing, the second is dynamic segmentation and the third is detection using ANN. In the preprocessing segment, we are using grayscale, histogram equalization, morphological processing (dilation, erosion, morphological gradient and minima removal). For the dynamic segmentation we used Watershed transformation. And last for detection we used backpropagation algorithm.

IV. CONCLUSION
The conclusion obtained in this study is that this software has been able to detect stroke. From the results of this study, the accuracy of this software is 100% for training data and 90% for test data. Of the 10 test data, there is one data that failed to be detected. This is probably due to the similarity between normal brain images and brain images that have not too large infarcts.