## 4 Results and Discussion
### Comparison with Machine Learning Methods  
There are many machine learning approaches used to classify various data. SVM, KNN, DT, NB, RF and CatBoost are the most commonly used methods. These methods classify data using different parameters, and these values directly affect the classification success. Therefore, the hyperparameter values were optimized with GridSearchCV and the best values are given in the Table 6. A more generalizable SVM model was obtained by using a linear kernel and a low C value. In the classification with KNN, the algorithm automatically selects the most appropriate method with three neighbors and the Minkowski distance metric. For DT, the risk of overfitting was reduced by selecting information gain-based division (entropy) and a maximum depth of 20. For RF, 50 trees were used without being restricted by the maximum depth. The CatBoost model was configured with a small learning rate (0.01) and 100 iterations, providing a balanced learning process. To improve the models' accuracy and generalization performance, these parameters were chosen through GridSearchCV optimization. \begin{table}
\begin{tabular}{c c} \hline \hline
**Method** & **Parameters** \\ \hline DT & min\_samples\_split: 2, criterion: entropy, \\  & min\_samples\_leaf: 1, max\_depth: 20 \\ KNN & algorithm: auto, metric: minkowski, n\_neighbors: 3 \\ SVM & gamma: scale, C: 0.1, kernel: linear \\ RF & max\_depth: None, n\_estimators: 50 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Parameters used for machine learning methods. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Tumor Class** & **Precision** & **Recall** & **F1 Score** \\ \hline Glioma & 0.997 & 0.982 & 0.990 \\ Meningioma & 0.970 & 0.988 & 0.979 \\ Notumor & 0.994 & 1.0 & 0.997 \\ Pituitary & 0.994 & 0.986 & 0.990 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: CNN + XGBoost model classification results for the external dataset. Figure 7: Confusion matrix of proposed model for external dataset. To assess the consistency and robustness of the proposed CNN + ML hybrid models, the standard deviations of classification accuracy over 10 independent runs were calculated for each model. In each run, the dataset remained constant, while the training and test data were resplit by 80-20% with different random selections. During these processes, the features extracted from the CNN model for each run were classified with machine learning methods and the accuracy value was calculated. The standard deviation was calculated over the 10 accuracy scores obtained. In Table 7, the results indicate that the CNN + XGBoost model not only achieved the highest mean accuracy but also exhibited the lowest standard deviation, with 0.0025, demonstrating superior stability across different runs. In contrast, the CNN + RF model showed the highest standard deviation, with 0.0262, suggesting a higher sensitivity to data partitioning or initialization. Table 8 compares the proposed CNN + XGBoost model's performance values with machine learning techniques for the glioma (G), meningioma (M), tumor (N), and pituitary (P) classes. According to the results, the use of different ML algorithms together with CNN causes different performance results in brain tumor classification. The CNN + XGBoost model has the highest accuracy rate with 99.77% and very high precision, recall and F1 score values were obtained in all classes. All of the samples in two classes were classified correctly. The CNN + DT model ranked second with 99.16% accuracy rate, while other models exhibited similar performance in the range of 97.8-98.0% accuracy. The CNN + RF model has the lowest accuracy rate with 95.66%. These results demonstrate that the features extracted by CNN are processed most effectively thanks to the powerful classification capabilities of XGBoost. The proposed model classified multiple brain tumors more successfully when compared with other machine learning methods.