# Spam Email Detection Using Long Short-Term Memory and Gated Recurrent Unit
## 5 Model Results
The training updates will be more volatile because of the small batch size (8) that introduces additional training noise. Better generalization occurs on the validation set because its content tends to be simpler. Data augmentation techniques for training purposes create complexity that reduces the training accuracy. Batch normalization, along with early stopping, seems to enhance the validation performance more than the actual training performance. The F1-score is the weighted average of precision and recall. \[F1 Score=2.\frac{Precision.Recall}{Precision+Recall} \tag{4}\]  
The F1-scores in (Figure 12) from the model analysis reveal 83% precision for training data alongside 84% accuracy for validation data. The F1-score function unifies precision and recall. Figure 11: Loss graph. Figure 10: Recall metrics. sion with recall measurements to provide an equilibrium assessment of model adaptive capabilities for binary category assignments. The strong match between training and validation F1-scores signifies how the model can apply its performance across new and unidentified datasets, consistently handling false positive and false negative classifications. This visualization demonstrates how effectively the model predicts decisions in binary classification tasks. The reported improvement in the Area Under the Curve (AUC) metric, from 98% to 99% on validation data (Figure 13), represents a marginal but potentially significant enhancement in model performance. The model demonstrates superior discrimination power to identify positive instances from negatives because these high AUC values show consistent performance between training and validation data. Analysis of the validation AUC at 99% shows outstanding discrimination potential alongside widespread applicability to new data instances that allow for effective classification of instances between correct categories. The model exhibits reliable performance in binary classification tasks because the high AUC results indicate its strong ability to distinguish between positive and negative instances. Our designed hybrid LSTM-GRU system conducted evaluations following previous research literature procedures utilizing established machine learning and deep learning methods for spam detection in emails (Table 3). Two research projects analyzed by [PERSON] et al. [20] and [PERSON] et al. [18] assessed Naive Bayes and k-NN classifiers; both approaches failed to detect sophisticated spam patterns effectively. Support Vector Machines produced more superior results than Random Forest on Spambase data according to [PERSON] et al. [26] and [PERSON] et al. [8]. The combination of BERT features and Logistic Regression reported successful outcomes according to [PERSON] et al. in their study [25]. Two successful deep learning models that involve GRU and LSTM have been developed by [PERSON] et al. [3] and [PERSON] et al. [22]. Spam detection performances improved significantly  
Figure 12: F1-score. when LSTM-GRU systems merged together since this combination united short-term and long-term sequence-analyzing capabilities. The proposed spam email detection system that uses Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) models shows promising results, though researchers need to handle various limitations for better performance. The operational success of LSTM and GRU networks relies completely on the amount of training data used. The dense training process for these models extends into several weeks because they require extensive datasets, yet their accuracy reduces when the provided data lack sufficient variety. Future research needs to center on improving computational performance as well as explainability algorithms while adding robustness against adversarial attacks and the ability to handle changing spam methods.