# Brain Tumor Detection with Deep Learning Methods' Classifier Optimization Using Medical Images
## 4 Experimental Results
### Results of CNN Models before-after Parameter Optimization  
Parameter optimization is a process used to improve the performance of a machine learning model. In this process, selecting or tuning specific parameter values is critical to ensure that the model achieves the best performance. In this section, the accuracy rates of CNN algorithms after optimization with the most appropriate parameter values are calculated. While making these calculations, many trials were performed for each CNN algorithm. During these experiments, the number of rounds, learning rate, number of layers and functions were tried many times. In addition, while performing parameter optimization, all data regarding model overfitting and misfitting, cross-validation and training times were meticulously tested and applied. Figures 15-18 show the confusion matrices of the CNN algorithms before parameter optimization. These four models were trained with the Imagenet dataset by adding a classification layer to each model. Each model was trained for 30 rounds. For the selection of the model, the accuracy rates in the evaluation set during training were followed, and the model in the tour that gave the highest evaluation accuracy rate during the training was selected. Figure 10: SqueezeNet + DenseNet + ResNet + VGG. Figure 9: DenseNet + SVM. Figure 11: SqueezeNet and machine learning classifiers performance metrics. Figure 12: ResNet and machine learning classifiers performance metrics. Figure 14: VGG and machine learning classifiers performance metrics. Figure 13: DenseNet and machine learning classifiers performance metrics. Figure 16: VGG architecture before optimization. Figure 17: SqueezeNet architecture before optimization. Figure 15: Resnet architecture before optimization. Section 3.9 provides some information on parameter optimization. Here, Tables 4 and 5 shows the parameter values and some optimization functions common to all calculations. Our experiments show that the adaptive moment estimation (Adam) and stochastic gradient descent (SGD) functions give the best results. The Adam optimization algorithm is a widely used optimization algorithm, especially in deep learning models. This algorithm is among the gradient-based optimization methods and is designed to speed up the learning process and make it more efficient. The parameter update rule of the Adam function is as follows:  
1. First, the first and second moments of the gradient are calculated. These are the first moment: the moving average of the gradient (momentum) and moving average of the square of the gradient (RMSprop). 2. The calculated moments are corrected with correction terms. 3. Update the parameters. Here, Table 4 shows the parameter values that are used. Here, Table 5 shows which CNN algorithm uses which optimization function and their accuracy rates. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Number of Rounds & 30 \\ Mini-Batch Size & 16 \\ Learning Rate Timer & Reduce LR on Plateau \\ Learning Rate Timer Mode & Min \\ Learning Rate Timer Factor & 0.1 \\ Learning Speed Timer Patience Coefficient & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Common parameter values. Figure 18: DenseNet architecture before optimization. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**CNN** & **Learning Speed** & **Optimization Function** & **Accuracy** & **Test Accuracy** \\ \hline SqueezeNet & 0.0001 & Adam & 0.980 & 0.975 \\ DenseNet & 0.001 & SGD & 0.996 & 0.997 \\ ResNet & 0.01 & SGD & 0.996 & 1.0 \\ VGG & 0.1 & SGD & 0.990 & 0.996 \\ Ensemble & - & - & - & 0.998 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Parameter optimization values. Another parameter function used in the experiment, SGD, is used to improve the performance of the models, just like the Adam function. The most important feature of grid search optimization is that it systematically tries all combinations within a given set of hyperparameters to obtain the best performance.