Parameter Optimization of Support Vector Machine using River Formation Dynamic on Brain Tumor Classification

Brain tumor classification plays an important role in determining the effective treatment a patient can receive. MRI is employed as a diagnostic tool when a patient has a brain tumor . The doctor analyses the images obtained through MRI to determine the type of tumor. This study aims to propose a novel model for brain tumor classification using a combination of support vector machine (SVM) and river formation dynamic (RFD) algorithm. The number of MRI images employed in this study is 3264 images. This dataset consists of 4 types, i.e., pituitary tumor, glioma tumor, meningioma tumor, and no tumor images. The image was extracted by employing the HOG method and then classified by implementing SVM. Certain measures can be taken to improve SVM performance, such as optimizing its parameters. This research presents a system that employs a novel combination between the SVM and the River Formation Dynamic (RFD) algorithm, to classify brain tumors. RFD is employed to optimize the parameters of SVM (C and gamma). The basic idea of RFD is to imitate the movement of water droplets flowing from high to low areas. This research compares the accuracy produced by SVM with the accuracy produced by SVM-RFD. The experimental result is the SVM-RFD provides better accuracy than employing SVM. The accuracy result by SVM is 74.37%. Compared to SVM-RFD, the accuracy increased by 13.19% to 87.56%. Future work will explore other SVM parameter values using the SVM-RFD method. Therefore, the performance of the model can increase and achieve better results.


I. INTRODUCTION
Brain tumors are disorders caused by the abnormal development of cells in the brain.Brain tumors can be benign or cancerous, depending on the form.This condition can affect anyone, whether they are an infant or an adult, a man or a woman.It was reported that 308102 people were diagnosed with brain tumors in 2020 [1].Additional tests, such as an MRI, are required to diagnose a patient with a brain tumor.MRI images are employed to detect and classify the sort of brain tumor that the patient is experiencing.When compared to ultrasound or CT images, MRI provides more detailed information on brain anatomy and tissue [2].To offer patients with the best diagnosis and treatment, brain tumors need to be classified utilizing MRI images.Vani et al. employed SVM to categorize and diagnose brain cancers based on MRI images.The proposed approach was 82% accurate [3].
Research focusing on the employ of MRI images to classify different types of brain tumors has been conducted.In 2020, Ashfaq and Ajay built a brain tumor classification system with MRI images as input data, GLCM as feature extraction, and SVM as a machine learning model.The proposed model provides better results compared to other conventional models [4].In 2018, brain tumor classification research was conducted by combining PSO and SVM.PSO as feature selection and SVM as the classification algorithm.This hybrid model performs better than the SVM model since it provides an accuracy increase of 8.41%.[5].
SVM is verified to have succeeded in providing better recognition performance than other methods [6].Certain measures can be taken to improve SVM performance, such as optimizing its parameters [7].One of the optimization algorithms that can be employed is the nature-inspired algorithm.The RFD is one example of a nature-inspired algorithm.RFD is the gradient version of Ant Colony Optimization (ACO) [8] [9].Xiangying Liu, Huiyan Jiang, and Fengzhen Tang showed SVM parameters optimized by implementing ACO.The result confirms that ACO has succeeded in increasing classification accuracy [10].Pablo Rabanal et al. showed that optimization by employing RFD provided better results than ACO for NP-hard problems.[11].
RFD has also been employed in the traveling salesman problem (TSP).Several studies have shown that the results provided by RFD are better.Therefore, the experiment was conducted to determine the ability of RFD to discover suitable parameters used by SVM in the case of brain tumor classification.Grzegorz et al. found the shortest path by comparing four optimization algorithms.The experimental result demonstrated that the RFD algorithm is more efficient than other algorithms [12].The fundamental principle of RFD is to mimic the process of river formation by nature [13].The basic idea is to imitate the movement of water droplets flowing from high to low areas.Along the way, the water influences the environment by reducing (erosion) and increasing (sedimentation) the ground level [11].
It is also critical to note that preprocessing operations such as feature extraction play an essential role in achieving good performance.The feature extraction method employed in this study is HOG.HOG is an object detector extensively employed in image processing [14].HOG has outstanding edge recognition features and offers information on luminance and shape orientation for each pixel [15] [16].
There have been many studies on the implementation of HOG as feature extraction.In [17], the researcher employed HOG as feature extraction and SVM as the classification method.The proposed model successfully improved the face recognition rate [17].The handwriting character recognition system developed by Amitava also employs HOG to represent each digit sample in the feature space [18].Another study employs SVM as a classifier and HOG to extract image characteristics as input to the classification process for Indian traditional dance classification [19].In HOG, the image is initially convolved with a kernel operator to obtain a gradient value.After that, the magnitude and orientation value of each cell are calculated.Finally, the histogram based on the gradient value and orientation can be obtained.
This research aims to increase the performance of SVM in classification tasks.Therefore, the main contribution of this research is employing RFD to optimize SVM parameters so that classification accuracy increases.In this connection, the combination of SVM and RFD has not been studied before.

II. MATERIAL AND METHODS
Generally, the design of the system to be developed is made into two processes, i.e., training and testing.The training process is a learning process to discover the most optimal model.The testing process is the process of making predictions employing the model created during the training process.In the training process, the MRI images are preprocessed, which resizes the image and then converts RGB images to grayscale images.After that, the image is extracted by employing the HOG method.The generated image is then categorized by employing the SVM model.The classification results are stored in a model that will be reused during testing.
In the testing process, the preprocessing stage is conducted by utilizing different datasets.In addition, the classification model has been trained so that the prediction process will compare the testing data with the training data.The proposed model can be seen in FIGURE 1.

A. DATASET
The dataset utilized for this study was taken from the internet and is publicly available [20].

B. PREPROCESSING
Preprocessing is the process of improving the quality of raw data before utilizing it in the next process [21].The preprocessing method employed in this research is resizing and converting to grayscale images.The images in the dataset have different sizes.Therefore, the input images are resized.In this connection, the images are resized to 128×128 pixels since the images must be divided into 8×8 pixels and 16×16 pixels for the feature extraction process.
After that, the images are also converted from RGB to grayscale images.Two methods can be employed to convert RGB images to grayscale images, i.e., the average and the weighted method.The average and the weighted method can be seen in Eq.( 1) and Eq.( 2), respectively [22].

𝑦 = 𝑅 + 𝐺 + 𝐵 3
(1) Eq.( 1) cannot work as intended because the human eyeball does not see RGB colors as the same color.Therefore, Eq.( 2) is most commonly employed for color-to-grayscale pixel conversion because the ratio has been adapted to the human eye.

C. FEATURE EXTRACTION
Feature extraction is a process of obtaining characteristics that characterize an image.The feature extraction method to be employed is HOG.HOG is a feature extraction method implemented in image processing to identify an object with a locally oriented gradient histogram [23][24].This method calculates the gradient orientation occurrence in a certain part of an image.Each image has characteristics indicated by the gradient distribution.This gradient distribution is obtained by dividing the image into small sections called cells [25].HOG focuses on the shape and structure of an object.Before performing the HOG, the image is resized into 128×128 pixels.Then, the images are converted to the grayscale image.The image gradient value is then calculated by employing Eq.( 3) [26].
where G is the grayscale image,   is an x-axis matrix,   is a y-axis matrix,   and   is the kernel operator.There are two kinds of kernel operators, namely, the centered derivative kernel operator and the Sobel kernel operator.
After calculating the gradient value, the magnitude is calculated by employing Eq.( 4) [21].
A histogram is created based on the acquired magnitude and orientation (theta) values.

D. SUPPORT VECTOR MACHINE
SVM is a method of supervised learning that can be employed to solve regression and classification problems [27].SVM is one of the machine learning methods that is easy to implement.The parameter of SVM can be explored through hyperparameters [28].In this system, SVM is employed to classify MRI images into four classes, namely, pituitary tumor, glioma tumor, meningioma tumor, and no tumor.The SVM method discovers the best hyperplane value to separate a set of objects into classes [29].The optimum hyperplane is obtained by maximizing the margin between two classes [30].An illustration of the binary class dataset separated by the optimal SVM hyperplane is shown in FIGURE 3. To improve the accuracy of SVM, hyperparameter tuning can be performed.By tuning a hyperparameter, optimal prediction can be achieved [31].In this connection, C represents the penalty for prediction error [32].If the value of C is too large or small, then the ability of SVM to generalize will be weakened because the smaller the value of C, the more likely it is to underfit.In contrast, the higher the value of C, the smaller the error.However, this condition led to overfitting [33][34].The gamma parameter is employed to control the speed of the learning process.The larger the value of gamma, the better the prediction in training and the worse the prediction in validation [35].To discover the best values for the C and gamma parameters, parameter optimization was performed by implementing the RFD algorithm.

E. RIVER FORMATION DYNAMIC
The principle of RFD is to mimic the formation process of riverbeds.The basic idea is to mimic the motion of drops flowing from a high to a low area.Along the way, water affects the environment by reducing (erosion) and increasing (sedimentation) ground levels [11].The algorithm of RFD is shown in the algorithm (1): Algorithm 1

Initialize drops Initialize nodes while (not end condition met) Move the drop Erode the path Deposit the sediment Analyze the path endwhile end
The first step is to initialize the node height.Then initialize the target node to 0. The target node is the final destination of the drop.The loop will only stop once all drops follow the same node or the loop is given a special condition, such as the number of iterations.Inside the loop, there are several functions.Move the drop function is a step to move the drop from one node to another node.The transition rule describes the probability of a k-drop at node i selecting node j as the next step (shown in Eq.( 6) [36]): where   (i) is a set of the neighbor nodes from node i that a drop can visit.decreasingGradient(i,j) is the negative gradient of node i and j.The formula of negative gradient can be seen in Eq.( 7) [12]: where altitude(x) represents the altitude of node x and the distance(i,j) represents the length of the edge between nodes i and j.After all drops have moved, an erosion process is performed on all moved paths.Erosion reduces the height of a node in proportion to its gradient with the next node.In particular, when a drop travels from node A toward node B, A is eroded.After the erosion process is complete, the altitude of all nodes in the graph will increase slightly.After several iterations, the erosion function produces a scenario with nearly zero height.Thus, causing the gradient to be negligible and disrupting all the paths created.The final step involves reviewing all the solutions discovered by the drop and saving the best solution discovered up to that point.

F. THE PROPOSED SVM-RFD MODEL
This study employs the RFD algorithm to propose a novel SVM-RFD model for the parameter optimization of SVM.RFD optimizes SVM parameters by implementing river formation.First, the classification process is performed by utilizing the default parameter of SVM.Then, optimization is performed on the SVM parameters (C and gamma) by implementing the RFD algorithm.The results of the RFD algorithm are given in the form of an array.The first five indices are utilized as C values, and the last five indices as gamma values [37].The SVM is trained by employing these parameters.The parameter combination with the highest accuracy is utilized as the C and gamma parameter values.The flow of the proposed method is depicted in FIGURE 4.

III. RESULT
This section compares the accuracy generated by SVM and SVM-RFD to determine the success of the SVM-RFD.The dataset must be preprocessed before it can be utilized in the classification process., where x denoted the gamma value.From our experimental result, utilizing y instead of x provides better accuracy.After analyzing the combinations of numbers above, the parameter C with a value of 1 and gamma with a value of 13 provides better accuracy, i.e., 87.56%.As a result, these values are utilized as the C and gamma values of the SVM.The confusion matrix is also employed to evaluate the classification results for each class, as shown in FIGURE 7 and FIGURE 8. FIGURE 7 and FIGURE 8 show that the total correctly predicted data is 293 samples for SVM and 345 samples for SVM-RFD.From the experimental results, the SVM-RFD model provides improvement compared to applying SVM.The proposed model produces a better result.Rezaei and H. Agahi also classified brain tumors and obtained an SVM accuracy of 76% [39].Our proposed model provides better accuracy results for brain tumor classification tasks from the three previous studies utilized as a comparison.Therefore, RFD can be employed for tuning SVM parameters.The weakness of this research is the result of classification in each class.After analyzing the confusion matrices, the classification results on the pituitary tumor class decreased.The true positive value produced by SVM-RFD was less than that produced by the SVM model.After employing SVM-RFD, recall for the pituitary tumor class decreased from 86% to 46%.This research has not discussed the solutions to overcome this problem.However, we will investigate this problem for future work.

V. CONCLUSION
This paper presents a nature-inspired algorithm, namely, RFD to optimize SVM parameters.By implementing RFD, the classification accuracy of SVM increased.Experimental results demonstrated the accuracy of SVM in brain tumor classification is 74.37%.By implementing the proposed method (SVM-RFD), classification accuracy increased as much as 13.19%, i.e., SVM-RFD produced an accuracy of 87.56%.Therefore, RFD can be employed for tuning SVM parameters.Future work will explore other SVM parameter values using the SVM-RFD method.Therefore, the performance of the model can increase and achieve better results.

FIGURE 2 .
FIGURE 2. (a) MRI Image of pituitary tumor,(b) MRI image of glioma tumor,(c) MRI image of meningioma tumor, (d) MRI image of no tumor

FIGURE 3 .
FIGURE 3. Optimal Hyperplanes SVM There are several steps to preprocess the dataset, e.g., resizing and converting the RGB image to a grayscale image.The feature extraction process is performed after the preprocessing process is completed.The result of feature extraction is shown in FIGURE 5.The result of preprocessing and feature extraction are employed in the training and testing processes.

FIGURE 6 .FIGURE 5 . 1 𝑥
FIGURE 6. Result of Feature Extraction in Bar ChartTo simplify the classification step, the feature extraction result that was previously in the form of bar charts was converted into a two-dimensional table.For the training

TABLE 3 Parameter combination of SVM-RFD
[38]images are resized to 128×128 pixels.This process successfully helps to reduce the computational complexity of the classification process.In addition, resizing the images can solve the problem of datasets with different image sizes and ensures that the feature extraction procedure remains consistent across datasets.The conversion of MRI images to grayscale reduces computational complexity since grayscale images have lower dimensions than color images.Grayscale images have only one channel, and RGB images have three channels.The feature extraction stage produces 8100 features for each image.Then the features are utilized as input variables.The next stage is classification employing SVM.This stage produces an accuracy of 74.37% with default parameters.The C and gamma parameter optimization in SVM was performed by employing the RFD algorithm and obtained an increase in accuracy to 87.56%.Research conducted by Vani et al. classified brain tumors employing SVM, producing an accuracy of 84%[3].Malarvizhi et al. employed SVM as the brain tumor classification model and obtained 80% accuracy[38].K.