A Machine Learning Approach for Pornographic Website Content Detection Using an Optimised Naïve Bayes Classifier

(1) * Rahmalia Syahputri Mail (Institut Informatika dan Bisnis Darmajaya, Indonesia)
(2) Taufik Taufik Mail (Institut Bakti Nusantara, Indonesia)
(3) Aldwi Mandak Mail (Institut Informatika dan Bisnis Darmajaya)
(4) Prana Alfath Rais Mail (Institut Informatika dan Bisnis Darmajaya)
*corresponding author

Abstract


The rapid growth of internet usage has increased concerns about exposure to pornographic content, particularly among younger users. This study proposed and developed a machine learning approach for classifying Indonesian-language website content containing pornographic material using the Naïve Bayes (NB) algorithm. A dataset comprising 50,329 website entries collected between 2019 and 2026 was processed through several preprocessing steps, including text normalisation, tokenisation, case folding, stemming, and stopword removal, to enhance the quality of textual features. To address class imbalance between pornographic and non-pornographic categories, the Synthetic Minority Oversampling Technique (SMOTE) was applied during the training phase. Model performance was evaluated using a 5-fold cross-validation strategy and was compared across three Naïve Bayes variants: Multinomial Naïve Bayes (MNB), Bernoulli Naïve Bayes (BNB), and Gaussian Naïve Bayes (GNB). Experimental results showed that the Multinomial Naïve Bayes model achieved the best performance, with an accuracy of approximately 94%, a precision of 0.92, a recall of 0.94, and an F1-score of 0.93, along with an ROC-AUC of 0.986. These findings demonstrated that the proposed approach was effective in classifying pornographic website content and could support automated web content filtering systems to protect users from harmful material. Future work could explore real-time implementation and the integration of more advanced machine learning techniques to further improve classification performance.


Keywords


Bahasa Indonesia; Machine Learning; Naïve Bayes; Pornography Classification; Text Mining

   

DOI

https://doi.org/10.29099/ijair.v10i1.1698
      

Article metrics

10.29099/ijair.v10i1.1698 Abstract views : 133 | PDF views : 22

   

Cite

   

Full Text

Download

References


“Asosiasi Penyelenggara Jasa Internet Indonesia.” Accessed: May 15, 2024. [Online]. Available: https://apjii.or.id/berita/d/apjii-jumlah-pengguna-internet-indonesia-tembus-221-juta-orang

Liputan6.com, “Kominfo Blokir Hampir 6 Juta Konten Negatif di Media Sosial: Judi Online dan Pornografi Mendominasi,” liputan6.com. Accessed: Aug. 23, 2024. [Online]. Available: https://www.liputan6.com/tekno/read/5630411/kominfo-blokir-hampir-6-juta-konten-negatif-di-media-sosial-judi-online-dan-pornografi-mendominasi

F. Amahazion, “Exposure to pornography among young Eritreans: An exploratory study,” Journal of International Women’s Studies, vol. 22, no. 1, pp. 121–139, 2021.

I. Biota, M. Dosil-Santamaria, N. I. Mondragon, and N. Ozamiz-Etxebarria, “Analyzing University Students’ Perceptions Regarding Mainstream Pornography and Its Link to SDG5,” IJERPH, vol. 19, no. 13, pp. 8055–8068, Jun. 2022, doi: 10.3390/ijerph19138055.

T. Daglis, “The Increase in Addiction during COVID-19,” Encyclopedia, vol. 1, no. 4, pp. 1257–1266, Nov. 2021, doi: 10.3390/encyclopedia1040095.

X. Kang, D. O. D. Handayani, P. P. Chong, and U. R. Acharya, “Profiling of pornography addiction among children using EEG signals: A systematic literature review,” Computers in Biology and Medicine, vol. 125, p. 103970, Oct. 2020, doi: 10.1016/j.compbiomed.2020.103970.

M. Kirby, “Pornography and its impact on the sexual health of men,” Trends Urol & Men’s Health, vol. 12, no. 2, pp. 6–10, Mar. 2021, doi: 10.1002/tre.791.

J. Nurmi et al., “Investigating child sexual abuse material availability, searches, and users on the anonymous Tor network for a public health intervention strategy,” Sci Rep, vol. 14, no. 1, p. 7849, Apr. 2024, doi: 10.1038/s41598-024-58346-7.

Muhammad Zulqarnain et al., “Text Classification Using Deep Learning Models: A Comparative Review,” Cloud Computing and Data Science, pp. 80–96, Oct. 2023, doi: 10.37256/ccds.5120243528.

A. Chiwanza, F. D. Mukoko, and B. Mupini, “A Web Crawling and NLP-Powered Model for Filtering Inappropriate Content for Primary School Learners’ Online Research,” International Journal of Innovative Science and Research Technology (IJISRT), vol. 9, no. 7, pp. 3553–3557, Nov. 2024, doi: 10.38124/ijisrt/IJISRT24JUL1083.

A. Janavi?i?t?, A. Liutkevi?ius, and N. Morkevi?ius, “Toward the Implementation of Text-Based Web Page Classification and Filtering Solution for Low-Resource Home Routers Using a Machine Learning Approach,” Electronics, vol. 14, no. 16, p. 3280, Aug. 2025, doi: 10.3390/electronics14163280.

J. Bacha, F. Ullah, J. Khan, A. W. Sardar, and S. Lee, “A Deep Learning-Based Framework for Offensive Text Detection in Unstructured Data for Heterogeneous Social Media,” IEEE Access, vol. 11, pp. 124484–124498, 2023, doi: 10.1109/ACCESS.2023.3330081.

H. Han, M. Asif, E. M. Awwad, N. Sarhan, Y. Y. Ghadi, and B. Xu, “Innovative deep learning techniques for monitoring aggressive behavior in social media posts,” J Cloud Comp, vol. 13, no. 1, p. 19, Jan. 2024, doi: 10.1186/s13677-023-00577-6.

A. Marshan, F. N. M. Nizar, A. Ioannou, and K. Spanaki, “Comparing Machine Learning and Deep Learning Techniques for Text Analytics: Detecting the Severity of Hate Comments Online,” Inf Syst Front, vol. 27, no. 2, pp. 487–505, Apr. 2025, doi: 10.1007/s10796-023-10446-x.

M. Leiva-Bianchi, N. Castillo, C. A. Astudillo, and F. Ahumada-Méndez, “Effectiveness of machine learning methods in detecting grooming: a systematic meta-analytic review,” Sci Rep, vol. 15, no. 1, p. 9008, Mar. 2025, doi: 10.1038/s41598-024-83003-4.

B. Christopher, “Comparative Analysis of K-Nearest Neighbor and Naïve Bayes Classifier Methods Based on Randomized Search Optimization in Hoax News Classification,” JATISI (Jurnal Teknik Informatika dan Sistem Informasi), vol. 12, no. 2, pp. 272–283, Jun. 2025, doi: ttps://doi.org/10.35957/jatisi.v12i2.11371.

Q. Hayaza, E. D. Wahyuni, and A. Anjani, “KLASIFIKASI BERITA PADA AKUN TWITTER SUARA SURABAYA MENGGUNAKAN METODE NAÏVE BAYES,” Jurnal Informatika dan Sistem Informasi, vol. 1, no. 2, Art. no. 2, Jul. 2020, doi: 10.33005/jifosi.v1i2.112.

H. Mustofa and A. A. Mahfudh, “Klasifikasi berita hoax dengan menggunakan metode naive bayes,” Walisongo Journal of Information Technology, vol. 1, no. 1, pp. 1–12, 2019, doi: dx.doi.org/10.21580/wjit.2019.1.1.3915.

M. Padhy, U. M. Modibbo, R. Rautray, S. S. Tripathy, and S. Bebortta, “Application of Machine Learning Techniques to Classify Twitter Sentiments Using Vectorization Techniques,” Algorithms, vol. 17, no. 11, p. 486, Oct. 2024, doi: 10.3390/a17110486.

Y. Qi and Z. Shabrina, “Sentiment analysis using Twitter data: a comparative application of lexicon- and machine-learning-based approach,” Soc. Netw. Anal. Min., vol. 13, no. 1, p. 31, Feb. 2023, doi: 10.1007/s13278-023-01030-x.

H. A. Salman and T. H. Obaida, “BBC News Data Classification Using Naive Bayes Based on Bag of Word,” Journal of Hunan University(Natural Sciences), vol. 48, no. 9, pp. 150–164, 2021.

G. Singh, B. Kumar, L. Gaur, and A. Tyagi, “Comparison between Multinomial and Bernoulli Naïve Bayes for Text Classification,” in 2019 International Conference on Automation, Computational and Technology Management (ICACTM), London, United Kingdom: IEEE, Apr. 2019, pp. 593–596. doi: 10.1109/ICACTM.2019.8776800.

D. ’Ulhaq, N. Suarna, and G. Dwilestari, “Klasifikasi Berita Kriminal Menggunakan Algoritma Naïve Bayes Berbasis PSO,” Journal of Informatics, vol. 6, no. 2, p. 116, Jun. 2022, doi: 10.51211/itbi.v6i2.1701.

A. P. Wibowo and A. S. Darmawan, “Penerapan Algoritma Naïve Bayes Untuk Klasifikasi Konten Berita Olahraga,” IC Tech: Majalah Ilmiah, vol. 15, no. 1, pp. 15–20, Apr. 2020, doi: 10.47775/ictech.v15i1.85.

X. Luo, “Efficient English text classification using selected Machine Learning Techniques,” Alexandria Engineering Journal, vol. 60, no. 3, pp. 3401–3409, Jun. 2021, doi: 10.1016/j.aej.2021.02.009.

A. Abbasi, A. R. Javed, F. Iqbal, N. Kryvinska, and Z. Jalil, “Deep learning for religious and continent-based toxic content detection and classification,” Sci Rep, vol. 12, no. 1, p. 17478, Oct. 2022, doi: 10.1038/s41598-022-22523-3.

N. B. Putri and A. W. Wijayanto, “Analisis Komparasi Algoritma Klasifikasi Data Mining Dalam Klasifikasi Website Phishing,” Komputika, vol. 11, no. 1, pp. 59–66, Jan. 2022, doi: 10.34010/komputika.v11i1.4350.

F. E. Purwiantono and A. Aditya, “Klasifikasi Sentimen Sara, Hoaks Dan Radikal Pada Postingan Media Sosial Menggunakan Algoritma Naive Bayes Multinomial Text,” JTK, vol. 14, no. 2, p. 68, Aug. 2020, doi: 10.33365/jtk.v14i2.709.

L. Yance Nanlohy, E. Mulyanto Yuniarno, and S. Mardi Susiki Nugroho, “Classification of Public Complaint Data in SMS Complaint Using Naive Bayes Multinomial Method,” in 2020 4th International Conference on Vocational Education and Training (ICOVET), Malang, Indonesia: IEEE, Sep. 2020, pp. 241–246. doi: 10.1109/ICOVET50258.2020.9229941.

N. Nurdin, M. Suhendri, Y. Afrilia, and R. Rizal, “Klasifikasi Karya Ilmiah (Tugas Akhir) Mahasiswa Menggunakan Metode Naive Bayes Classifier (NBC),” SISTEMASI, vol. 10, no. 2, p. 268, May 2021, doi: 10.32520/stmsi.v10i2.1193.

L. Ristiari, A. E. Karyawati, I. P. G. H. Suputra, A. Muliantara, I. D. M. B. A. Darmawan, and I. M. Widiartha, “Klasifikasi Cerita Pendek Berbahasa Bali Berdasarkan Umur Pembaca dengan Metode Naive Bayes,” JLK, vol. 10, no. 4, p. 363, Jun. 2022, doi: 10.24843/JLK.2022.v10.i04.p06.

M. Yusup, M. I. Fadillah, R. A. Fauzanie, R. L. Pratiwi, R. I. Handayani, and E. Widanengsih, “Spam Message Classification Using the Naïve Bayes Algorithm Based on RapidMiner,” Journal of Artificial Intelligence and Engineering Applications, vol. 5, no. 2, pp. 2183–2186, 2026.

X. Zhou, H. Liu, F. Pourpanah, T. Zeng, and X. Wang, “A Survey on Epistemic (Model) Uncertainty in Supervised Learning: Recent Advances and Applications,” Neurocomputing, vol. 489, pp. 449–465, Jun. 2022, doi: 10.1016/j.neucom.2021.10.119.

M. Gärtler, V. Khaydarov, B. Klöpper, and L. Urbas, “The Machine Learning Life Cycle in Chemical Operations – Status and Open Challenges,” Chem. Ing. Tech., no. 12, p. 18, 2021.

S. E. Saad and J. Yang, “Twitter Sentiment Analysis Based on Ordinal Regression,” IEEE Access, vol. 7, pp. 163677–163685, 2019, doi: 10.1109/ACCESS.2019.2952127.

Y. Yan, R. Liu, Z. Ding, X. Du, J. Chen, and Y. Zhang, “A Parameter-Free Cleaning Method for SMOTE in Imbalanced Classification,” IEEE Access, vol. 7, pp. 23537–23548, 2019, doi: 10.1109/ACCESS.2019.2899467.

L. F. Gutierrez, F. Abri, M. Armstrong, A. S. Namin, and K. S. Jones, “Email Embeddings for Phishing Detection,” in 2020 IEEE International Conference on Big Data (Big Data), Atlanta, GA, USA: IEEE, Dec. 2020, pp. 2087–2092. doi: 10.1109/BigData50022.2020.9377821.

X. Liang, Social Computing with Artificial Intelligence. Singapore, SINGAPORE: Springer Singapore Pte. Limited, 2020. Accessed: May 01, 2023. [Online]. Available: http://ebookcentral.proquest.com/lib/pqopenlayer/detail.action?docID=6351768

A. F. Bahary, Y. Sibaroni, and M. S. Mubarok, “Sentiment analysis of student responses related to information system services using Multinomial Naïve Bayes (Case study: Telkom University),” J. Phys.: Conf. Ser., vol. 1192, p. 012046, Mar. 2019, doi: 10.1088/1742-6596/1192/1/012046.

B. H. Shekar and G. Dagnew, “Grid Search-Based Hyperparameter Tuning and Classification of Microarray Cancer Data,” in 2019 Second International Conference on Advanced Computational and Communication Paradigms (ICACCP), Gangtok, India: IEEE, Feb. 2019, pp. 1–8. doi: 10.1109/ICACCP.2019.8882943.

S. Amershi et al., “Software Engineering for Machine Learning: A Case Study,” in 2019 IEEE/ACM 41st International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP), Montreal, QC, Canada: IEEE, May 2019, pp. 291–300. doi: 10.1109/ICSE-SEIP.2019.00042.

H. Zhang, L. Zhang, and Y. Jiang, “Overfitting and Underfitting Analysis for Deep Learning Based End-to-end Communication Systems,” in The Institute of Electrical and Electronics Engineers, Inc. (IEEE) Conference Proceedings, Piscataway, United States: The Institute of Electrical and Electronics Engineers, Inc. (IEEE), 2019, pp. 1–6. doi: 10.1109/WCSP.2019.8927876.

T. Jiang, J. P. Li, A. U. Haq, A. Saboor, and A. Ali, “A Novel Stacking Approach for Accurate Detection of Fake News,” IEEE Access, vol. 9, pp. 22626–22639, 2021, doi: 10.1109/ACCESS.2021.3056079.

R. M. Dantas, R. Firdaus, F. Jaleel, P. Neves Mata, M. N. Mata, and G. Li, “Systemic Acquired Critique of Credit Card Deception Exposure through Machine Learning,” Journal of Open Innovation: Technology, Market, and Complexity, vol. 8, no. 4, pp. 192–211, Dec. 2022, doi: 10.3390/joitmc8040192.

K. Taunk, S. De, S. Verma, and A. Swetapadma, “A Brief Review of Nearest Neighbor Algorithm for Learning and Classification,” in The Institute of Electrical and Electronics Engineers, Inc. (IEEE) Conference Proceedings, Piscataway, United States: The Institute of Electrical and Electronics Engineers, Inc. (IEEE), 2019, pp. 1255–1260. doi: 10.1109/ICCS45141.2019.9065747.




Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

________________________________________________________

The International Journal of Artificial Intelligence Research

Organized by: Prodi Teknik Informatika Fakultas Teknologi Bisnis dan Sains
Published by: Universitas Dharma Wacana
Jl. Kenanga No. 03 Mulyojati 16C Metro Barat Kota Metro Lampung

Email: jurnal.ijair@gmail.com

View IJAIR Statcounter

Creative Commons License
This work is licensed under  Creative Commons Attribution-ShareAlike 4.0 International License.