## 4 Results and Discussion
### Practical Strategies for Implementing AI-Driven Techniques in Phishing Email Detection  
From the experiments we conducted, we provide actionable insights for researchers and developers who are adopting ML and DL models for phishing email detection. First, transformer-based models such as BERT and RoBERTa should be prioritized, as they consistently achieve high accuracy (e.g., 98-99% on the merged dataset). This is due to their advanced architecture, which understands context and semantics in text, making them highly effective for analyzing email content and recognizing phishing attempts. When  
\begin{table}
\begin{tabular}{l c c c c c c c c c c} \hline \hline
**Model** & **Enron** & **SpamAssasin** & **Ling** & **TREC\_05** & **TREC\_06** & **TREC\_07** & **CEAS\_08** & **Nazario\_5** & **Nigerian\_5** & **Merged** & **Merged** \\ \hline SGD Classifier & 69.60\% & 55.85\% & 64.90\% & 73.50\% & 77.75\% & 50.80\% & 69.55\% & 85.80\% & 50.00\% & 77.35\% & 77.15\% \\ \hline BERT & 82.45\% & 55.30\% & 71.90\% & _69.65\%_ & 90.65\% & 62.50\% & 75.90\% & 79.70\% & 61.60\% & 88.80\% & 81.30\% \\ \hline DistilBERT & 75.60\% & 60.90\% & 71.05\% & 70.90\% & 91.95\% & 51.90\% & 73.60\% & 75.70\% & 61.80\% & 85.75\% & 80.40\% \\ \hline RoBERTa & 88.80\% & 50.85\% & 74.85\% & 70.25\% & 92.10\% & 60.05\% & 75.15\% & 80.35\% & 65.00\% & **96.00\%** & **95.00\%** \\ \hline \hline \end{tabular}
\end{table}
Table 7: Testing Accuracy Results of SGD Classifier and Transformer Models on an External Dataset (Phishing Validation Emails Dataset [73]) When Trained Separately on Each Dataset.  
trained on large datasets, these models are exceptionally robust, as they can generalize well to diverse phishing tactics. Second, dataset preprocessing steps, such as balancing datasets, are essential to ensure optimal model performance. Specifically, datasets should be balanced and represent real-world email traffic to improve model performance and reduce bias. Third, updating models regularly with new phishing samples is crucial for the adaptability to evolving attack techniques and maintaining high detection accuracy. Fourth, integrating these models into real-world email security systems requires careful consideration of computational resources and deployment strategies, as transformer-based models can be resource-intensive. Developers should ensure that the AI detection system is scalable to handle large volumes of emails without compromising speed or accuracy. Secure Email Gateway (SEG) is a widely used email security defense solution to filter out malicious email traffic such as phishing and spam emails. Generally, SEGs detect emails with harmful content such as spam, phishing links, or malware using signature analysis, URL scanning, machine learning, custom policies, etc. Once identified, SEGs block malicious emails from reaching the recipient. Integrating deep learning (DL) models like BERT and RoBERTa into existing email security gateways (e.g., Microsoft Defender [74], Gmail security filters) is feasible. However, key factors such as detection accuracy, adaptability, latency, and robustness against adversarial attacks must be considered for successful integration. Our experimental results indicate that RoBERTa and BERT are strong candidates due to their high detection accuracy and extensive pretraining. Notably, RoBERTa's robust pretraining allows it to generalize better and requires less data for fine-tuning, making it an ideal choice for SEG integration. However, lightweight variants such as DistilBERT may be preferable for real-time detection due to their lower latency.  
By leveraging these insights, researchers and developers can build more accurate and reliable phishing detection systems, ultimately enhancing email security and reducing the risk of cyberattacks.