Deteksi Email Phishing Menggunakan Machine Learning Dengan Algoritma Random Forest Classifier dan Random Search Cross-Validation

Authors

  • Andi Muhammad Isa Universitas Pamulang
  • Deanna Durbin Hutagalung Universitas Pamulang

DOI:

https://doi.org/10.69693/jesa.v3i2.120

Keywords:

Phishing, Deteksi Email, Machine Learning, Random Forest

Abstract

Email is widely used in educational institutions, but its operational convenience is accompanied by phishing threats that can lead to credential theft, data leakage, and other security incidents. This study develops a machine learning-based system for classifying email text into Safe Email and Phishing Email categories using Random Forest optimized with Random Search Cross-Validation (RSCV). The research uses historical email data from SDN Limo 1 Kota Depok. The processing stages include text cleaning, case folding, masking of email addresses and URLs, stopword removal, stemming, outlier handling, and TF-IDF feature extraction. The dataset is divided into 80% training and 20% testing data. Random Forest is evaluated in a standard configuration and after hyperparameter optimization using five-fold cross-validation and ten random iterations. The optimized model achieves 96.99% accuracy, 97% macro precision, 97% macro recall, and 97% macro F1-score, improving accuracy by 2.51 percentage points over the standard model. The model is implemented in a Streamlit web application to support practical preliminary email screening in educational environments. The application also provides prediction probabilities, an explainable analysis of influential terms, testing history, role-based access, and data export for authorized users. The results indicate that hyperparameter optimization can improve classification performance while the integrated application can support faster initial screening before further security verification is performed.

Downloads

Download data is not yet available.

References

[1] W. Hidayat M., N. Musdira, N. Rasyid, M. K. S., and M. Juharman, “Analisis ancaman terhadap keamanan data pribadi pada email,” J. Pendidikan Terapan, vol. 1, pp. 7–12, 2023, doi: 10.61255/jupiter.v1i2.73.

[2] R. Aditya, A. Ramdhani, D. D. Nugraha, and M. F. Ari, “Analisis masalah serangan phishing pada penggunaan email,” 2025.

[3] K. Subandi, D. M. Ahmad, V. I. Sugara, and A. S. Aryani, “Awareness cybercrime phishing email menggunakan Secure Socket Layer sebagai interpretasi information security,” vol. 9, pp. 56–66, 2024, doi: 10.33751/komputasi.v19i2.5260.

[4] Y. R. Purnamadewi and A. Zahra, “Enhancing detection of zero-day phishing email attacks in the Indonesian language using deep learning algorithms,” Bull. Electr. Eng. Informatics, vol. 14, no. 1, pp. 505–512, 2025, doi: 10.11591/eei.v14i1.8759.

[5] C. Herdian, M. Quinn, D. Revaldo, and S. Margareta, “Perbandingan algoritma Naive Bayes di dalam Scikit-Learn Python Library dengan murni algoritma Naive Bayes: Studi kasus klasifikasi email berbahaya,” Techno Xplore, vol. 9, no. 1, pp. 1–10, 2024.

[6] R. Nurcahyo, F. Tanjung, and S. Rahman, “Meningkatkan deteksi email phishing melalui pendekatan SVM yang dioptimalkan NLP,” 2025.

[7] U. Kurniati, M. A. S. Arifin, and N. K. Daulay, “Penerapan Random Forest dan Naive Bayes untuk deteksi phishing dan serangan social engineering pada email,” pp. 891–898, 2025.

[8] D. Septiani and I. Isabela, “Analisis Term Frequency Inverse Document Frequency (TF-IDF) dalam temu kembali informasi pada dokumen teks,” SINTESIA J. Sist. dan Teknol. Inf. Indones., vol. 1, no. 2, pp. 81–88, 2022.

[9] I. R. Dwianti, D. R. Cahyani, T. Khawa, A. Rahman, and M. Faisal, “Phishing email classification using TF-IDF method and Random Forest algorithm,” vol. 3, no. 2, pp. 125–135, 2025, doi: 10.25181/rt.v3i2.4310.

[10] M. A. Nivedha and S. Raja, “Detection of email spam using Natural Language Processing based Random Forest approach,” Int. J. Comput. Sci. Mob. Comput., vol. 11, no. 2, pp. 7–22, 2022, doi: 10.47760/ijcsmc.2022.v11i02.002.

[11] M. Adipa, A. T. Zy, and M. M. Effendi, “Klasifikasi email phishing menggunakan algoritma K-Nearest Neighbor,” J. RESTIKOM, vol. 5, no. 2, pp. 148–157, 2023, doi: 10.52005/restikom.v5i2.152.

[12] M. H. Z. Ubaidillah and Z. Fatah, “Klasifikasi email spam menggunakan algoritma Naive Bayes,” vol. 2, pp. 129–132, 2024.

[13] M. Fajri and A. Primajaya, “Komparasi teknik hyperparameter optimization pada SVM untuk permasalahan klasifikasi dengan menggunakan Grid Search dan Random Search,” J. Appl. Informatics Comput., vol. 7, no. 1, pp. 14–19, 2023, doi: 10.30871/jaic.v7i1.5004.

[14] W. Wijiyanto, A. I. Pradana, S. Sopingi, and V. Atina, “Teknik K-Fold Cross Validation untuk mengevaluasi kinerja mahasiswa,” J. Algoritm., vol. 21, no. 1, pp. 239–248, 2024, doi: 10.33364/algoritma/v.21-1.1618.

[15] R. Tuntun, K. Kusrini, and K. Kusnawi, “Analisis perbandingan kinerja algoritma klasifikasi dengan menggunakan metode K-Fold Cross Validation,” J. Media Inform. Budidarma, vol. 6, no. 4, p. 2111, 2022, doi: 10.30865/mib.v6i4.4681.

[16] H. Tantyoko, D. K. Sari, and A. R. Wijaya, “Prediksi potensial gempa bumi Indonesia menggunakan metode Random Forest dan feature selection,” IDEALIS, vol. 6, no. 2, pp. 83–89, 2023, doi: 10.36080/idealis.v6i2.3036.

[17] A. A. Tawil, L. Almazaydeh, D. Qawasmeh, B. Qawasmeh, M. Alshinwan, and K. Elleithy, “Comparative analysis of machine learning algorithms for email phishing detection using TF-IDF, Word2Vec, and BERT,” Comput. Mater. Contin., vol. 81, no. 2, pp. 3395–3412, 2024, doi: 10.32604/cmc.2024.057279.

[18] “Machine learning approach for email phishing detection,” Procedia Comput. Sci., vol. 251, pp. 746–751, 2024, doi: 10.1016/j.procs.2024.11.179.

[19] C. Umam, L. B. Handoko, and F. O. Isinkaye, “Performance analysis of Support Vector Classification and Random Forest in phishing email classification,” Sci. J. Informatics, vol. 11, no. 2, pp. 367–374, 2024, doi: 10.15294/sji.v11i2.3301.

[20] H. Fares, N. Mouakkal, Y. Baddi, and N. Hajraoui, “Robust email phishing detection using machine learning and deep learning approach,” Int. J. Commun. Netw. Inf. Secur., vol. 16, no. 3, 2024, doi: 10.17762/ijcnis.v16i3.6700.

[21] R. Jayaprakash, K. Natarajan, J. A. Daniel, C. V. Chinnappan, J. Giri, H. Qin, and S. Mallik, “Heuristic machine learning approaches for identifying phishing threats across web and email platforms,” Front. Artif. Intell., vol. 7, 2024, doi: 10.3389/frai.2024.1414122.

[22] A. Al-Subaiey, M. Al-Thani, N. A. Alam, K. F. Antora, A. Khandakar, S. M. A. U. Zaman, “Novel interpretable and robust web-based AI platform for phishing email detection,” Comput. Electr. Eng., vol. 120, p. 109625, 2024, doi: 10.1016/j.compeleceng.2024.109625.

[23] R. A. Fahim, M. S. Arman, I. Sultana, N. Tasnim, K. R. Ahmed, and I. Mahmud, “PhishGuard: Leveraging NLP and machine learning for email phishing detection,” in Proc. 2024 Int. Conf. Big Data Analytics in Bioinformatics (DABCon), 2024, pp. 1–6, doi: 10.1109/DABCon63472.2024.10919349.

[24] M. A. Mubarok, N. Anwar, A. Ichwani, and R. T. Iswahyudi, “Studi simulasi deteksi email phishing berbasis NLP menggunakan TF-IDF dengan Support Vector Machine dan Random Forest,” IKRA-ITH Informatika, vol. 10, no. 3, pp. 38–44, 2026.

[25] D. Sugianto, R. A. Putawa, C. Izumi, and S. A. Ghaffar, “Uncovering the efficiency of phishing detection: An in-depth comparative examination of classification algorithms,” Int. J. Appl. Inf. Manag., vol. 4, no. 1, pp. 22–29, 2024, doi: 10.47738/ijaim.v4i1.72.

Downloads

Published

30-10-2026

How to Cite

Isa, A. M., & Hutagalung, D. D. (2026). Deteksi Email Phishing Menggunakan Machine Learning Dengan Algoritma Random Forest Classifier dan Random Search Cross-Validation. Journal of Engineering and Science Application, 3(2), 580–589. https://doi.org/10.69693/jesa.v3i2.120

Issue

Section

Articles