Perbandingan Metode KNN dan Naïve Bayes dalam Deteksi Tingkat Stres Berdasarkan Ekspresi Wajah

Malik Fajar Alamsyah, Ardi Wijaya

Abstract


Stress is a feeling in which a person feels under pressure, overwhelmed, and has difficulty in dealing with a problem. Stress can be caused by various factors, such as academic pressure, work, personal problems, or social environment. If not addressed immediately, stress can have adverse effects on an individual's health, such as causing high blood pressure, heart disease, sleep disturbances, and a decreased immune system, which makes a person more vulnerable to various diseases. Therefore, monitoring stress levels is very important to prevent more serious negative impacts. Generally, stress detection is done through consultation with a psychologist, but this method has a subjective nature and requires a lot of time and money. Therefore, this research develops a computer vision-based stress detection system using OpenCV and Dlib, with K-Nearest Neighbors and Naïve Bayes algorithms. The data of 500 samples is divided into 80% training data and 20% test data. Features were extracted, and stress was classified into three levels: low, medium and high. Evaluation using k-fold cross-validation (n_split=10, random_state=42) based on accuracy, precision, recall, and F1-score. The results showed that K-Nearest Neighbors with k=5 excelled with 74% accuracy, 73% precision, 73% recall, and 73% F1-score. Meanwhile, Naïve Bayes only achieved 52% accuracy, 51% precision, 48% recall, and 41% F1-score. This shows that KNN is more effective in stress level classification. However, the accuracy of the model is still limited due to the small amount of training data. Parameter optimization and dataset addition are required to improve the overall system performance.


Keywords


OpenCV; Dlib; KNN; Naïve Bayes; Image Processing.

Full Text:

References


gloriabarus, “Hasil Survei I-NAMHS: Satu dari Tiga Remaja Indonesia Memiliki Masalah Kesehatan Mental.”

Sulis Winurini, “PEMERIKSAAN KESEHATAN MENTAL GRATIS BAGI REMAJA,” Feb. 2025.

F. Vancheri, G. Longo, E. Vancheri, and M. Y. Henein, “Mental Stress and Cardiovascular Health—Part I,” Jun. 01, 2022, MDPI. doi: 10.3390/jcm11123353.

R. T. H. Hasan and A. B. Sallow, “Face Detection and Recognition Using OpenCV,” Journal of Soft Computing and Data Mining, vol. 2, no. 2, pp. 86–97, Oct. 2021, doi: 10.30880/jscdm.2021.02.02.008.

W. A. M. Sari, B. Suhardi, and I. W. Suletra, “Pengaruh Kondisi Sistem Kerja Terhadap Stress Kerja dengan Menggunakan Macroergonomic Organizational Questionnare Survey (MOQS),” Jurnal INTECH Teknik Industri Universitas Serang Raya, vol. 7, no. 1, pp. 30–38, Apr. 2021, doi: 10.30656/intech.v7i1.2822.

Naufal Fathirachman Mahing, Alifi Lazuardi Gunawan, Ahmad Foresta Azhar Zen, Fitra Abdurrachman Bachtiar, and Satrio Agung Wicaksono, “KLASIFIKASI TINGKAT STRES DARI DATA BERBENTUK TEKS DENGAN MENGGUNAKAN ALGORITMA SUPPORT VECTOR MACHINE (SVM) DAN RANDOM FOREST,” Jurnal Teknologi Informasi dan Ilmu Komputer (JTIIK), 2024, doi: 10.25126/jtiik2024118010.

Syefrida Yuliana and Warnia Nengsih, “DETEKSI WAJAH MENGGUNAKAN HAAR CASCADE DAN FEATURE DESCRIPTOR HOG MELALUI KAMERA IP CCTV DIRUANG KELAS,” Jurnal Kecerdasan Buatan dan Teknologi Informasi, vol. 3, no. 2, 2024.

M Abdy Mulya, Zaenul Arif, and Syefudin, “Tinjauan Pustaka Sistematis : Penerapan Metode Gabor Wavelet Pada Computer Vision,” Journal Of Computer Science And Technology (JOCSTEC), vol. 1, no. 2, pp. 83–88, May 2023, doi: 10.59435/jocstec.v1i2.78.

Andri Nugraha Ramdhon and Fadly Febriya, “Penerapan Face Recognition Pada Sistem Presensi,” Journal of Applied Computer Science and Technology, vol. 2, no. 1, pp. 12–17, Jun. 2021, doi: 10.52158/jacost.v2i1.121.

Sugeng and Agus Mulyana, “Sistem Absensi Menggunakan Pengenalan Wajah (Face Recognition) Berbasis Web LAN,” Jurnal Sisfokom (Sistem Informasi dan Komputer), vol. 11, no. 1, pp. 127–135, Apr. 2022, doi: 10.32736/sisfokom.v11i1.1371.

Fitra A. Bachtiar, Muhammad Wafi, and P. Korespondensi, “COMPARISON OF CLASSIFICATION METHODS FOR FACIAL EXPRESSION RECOGNITION USING FACIAL LANDMARK FEATURE,” Jurnal Teknologi Informasi dan Ilmu Komputer (JTIIK), 2021, doi: 10.25126/jtiik.202184434.

Rifki Kosasih, “Classification of Banana Ripe Level Based on Texture Features and KNN Algorithms,” 2021.

Berliana Wahyu Nurlita et al., “COMPARISON OF ARCFACE AND DLIB PERFORMANCE IN FACE RECOGNITION WITH DETECTION USING YOLOV8 PERBANDINGAN KINERJA ARCFACE DAN DLIB DALAM PENGENALAN WAJAH DENGAN DETEKSI MENGGUNAKAN YOLOV8,” JURNAL INOVTEK POLBENG, vol. 9, no. 2, p. 2024, 2024.

Andi Hakim Arif and Achmad Solichin, “Hyperparameter Optimization on Ensemble Regression Tree for Lip Coloring Simulation,” Jurnal Teknik Informatika dan Sistem Informasi, vol. 8, no. 2, Aug. 2022, doi: 10.28932/jutisi.v8i2.4611.

Chandra I. Zamorano, Kiki Prawiroredjo, E. Shintadewi Julian, and Endang Djuana, “Rancang Bangun Sistem Kamera Pengawas dengan Pengenalan Wajah untuk Keamanan Berbasis Blynk Legacy,” 2023.

Rifki Kosasih, “Classification of Banana Ripe Level Based on Texture Features and KNN Algorithms,” 2021.

Nurul A’ayunnisa, Yulita Salim, and Huzain Azis, “Analisis performa metode Gaussian Naïve Bayes untuk klasifikasi citra tulisan tangan karakter arab,” Indonesian Journal of Data and Science (IJODAS), vol. 3, no. 3, pp. 115–121, 2022.

Wijiyanto, Afu Ichsan Pradana, Sopingi, and Vihi Athina, “Teknik K-Fold Cross Validation untuk Mengevaluasi Kinerja Mahasiswa,” Jurnal Algoritma, vol. 21, no. 1, May 2024, doi: 10.33364/algoritma/v.21-1.1618.

Siti Raysyah, Veri Arinal, and Dadang Iskandar Mulyana, “KLASIFIKASI TINGKAT KEMATANGAN BUAH KOPI BERDASARKAN DETEKSI WARNA MENGGUNAKAN METODE KNN DAN PCA,” Sistem Informasi |, vol. 8, no. 2, pp. 88–95, 2021.

Jacquline M.S. Waworundeng and Raycle Raynold Inzaghi Suwu, “Implementation of Face Recognition in People Monitoring Access In-and-Out of Crystal Dormitory Universitas Klabat Penerapan Face Recognition Pada Pemantauan Orang Dalam Akses Masuk Dan Keluar Asrama Crystal Universitas Klabat,” Cogito Smart Journal |, vol. 9, no. 1, 2023.

Nurul A’ayunnisa, Yulita Salim, and Huzain Azis, “Analisis performa metode Gaussian Naïve Bayes untuk klasifikasi citra tulisan tangan karakter arab,” Indonesian Journal of Data and Science (IJODAS), vol. 3, no. 3, pp. 115–121, 2022.

Isman, Andani Ahmad, and Abdul Latief, “Perbandingan Metode KNN Dan LBPH Pada Klasifikasi Daun Herbal,” Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), vol. 5, no. 3, pp. 557–564, Jun. 2021, doi: 10.29207/resti.v5i3.3006.




DOI: https://doi.org/10.30591/jpit.v10i2.8513

Refbacks

  • There are currently no refbacks.


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

JPIT INDEXED BY

  
  

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