## 4 Experimental Results
### Spam Detection Models and Results
GridSearch determines the parameters that give the best results by systematically trying the specified hyperparameter combinations. This \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model Names** & **Model** & **Max Accuracy** & **Feature Count** \\ \hline
**EGMA** & **Ensemble GRU-MLP-Autoencoder** & **0.9928** & 39, 8459, 8440 \\ GRU39 * & GRU & 0.9899 & 39 \\ GRU58 & GRU & 0.9899 & 39 + 19 \\ TFMLP59 * & MLP & 0.9899 & 8440 + 19 \\ GRU48 & GRU & 0.9892 & 39 + 9 \\ MLP59 & MLP & 0.9892 & 8440 + 19 \\ MLP49 & MLP & 0.9871 & 8440 + 9 \\ AX40 * & Autoencoder + XGBoost & 0.9870 & 8440 \\ AX59 & Autoencoder + XGBoost & 0.9856 & 8440 + 19 \\ MLP40 & MLP & 0.9856 & 8440 \\ AR49 & Autoencoder + XGBoost & 0.9742 & 8440 + 9 \\ TFAX40 & TF-IDF + Autoencoder + XGBoost & 0.9139 & 8440 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Proposed models and classification accuracies on the SMS Spam Collection dataset. (* Models that give the highest accuracy value used in the ensemble learning algorithm). process optimized critical parameters such as the number of layers, neurons in each layer, the learning rate, and activation functions. In the training phase, the MLP classifier was configured with an architecture consisting of three hidden layers. Each hidden layer used the ReLU activation function, which is widely used in deep learning models and helps to model non-linear features. Adam was used as the optimization algorithm. Thanks to its adaptive learning speed, the Adam algorithm enabled the model to converge faster and more efficiently. Nine or nineteen statistical features were added to the text vectors in the models with additional features. These statistical features allowed for a more in-depth analysis of the texts and allowed the model to access more information, aiming to improve the model's classification performance. As a result, Figure 4 and Algorithm 2 show the overall structure and operation of the MLP model used in detail. These diagrams visually represent the layers of the model, the data flow, and the operations performed. The MLP's effectiveness in spam classification, combined with proper preprocessing and hyperparameter optimization, makes it a powerful tool for spam detection. The best result among the proposed MLP models was obtained with the TFMLP59 approach. In this approach, 8440 features were first extracted from the dataset using TFIDF for word vectorization. Then, 19 statistical features were added to the dataset for classification. The best classification accuracy results obtained with MLP approaches on the SMS Spam Collection dataset are presented in Table 3.  
```
Input: Text message \(x\), Additional statistical features\(f_{1}=0\),\(f_{2}=9\),\(f_{3}=19\) Output: Predicted message class (0 or 1) \(x^{l}\leftarrow\) text_preprocessing(\(x\)); \(f\leftarrow\) calculate_statistical_features(\(x^{l}\), \(n=[0,\,9,\,19]\)); \(v\leftarrow\) TFIDFVectorizer(\(x^{l}\), \(n\)); for\(i\gets 1\)to\(3\)do  predicted \(\leftarrow\) MLP(\(v\)+\(f_{i}\));

Figure 4: The MLP model. Autoencoder models offer significant advantages thanks to their ability to reduce the data size and extract important features. Especially in high-dimensional and noisy datasets, autoencoders learn the hidden structure of the data and extract the features needed for more effective classification. This results in a higher accuracy and performance in spam detection. In the hybrid autoencoder models, word vectors extracted from the messages are used together with statistical features. The word vectors are obtained using CountVectorizer or TF-IDF methods as in MLP models. These methods convert the text data into a numerical format that the model can process. In addition, statistical features contained in the messages are also included in the model to create a richer and more informative dataset. The hybrid Autoencoder models used in this study consisted of two main parts. The first part, shown in Figure 5a, use the training set as input and output.