Implementing Random Forest for Eye State Detection in an EEG-Based Brain-Computer Interface System
DOI:
10.33395/sinkron.v10i3.16054Keywords:
Brain-Computer Interface, Classification, EEG Eye State, Feature Importance, Random ForestAbstract
Eye state detection using Electroencephalogram (EEG) signals is a growing research area in Brain-Computer Interface (BCI) systems, with practical implications for drowsiness monitoring and assistive technologies. However, EEG signals are highly susceptible to extreme outliers caused by muscle artifacts and electrode interference, which significantly degrade model performance when left unaddressed. Previous studies have largely overlooked explicit outlier handling strategies and often rely solely on accuracy as the evaluation metric, which is insufficient for imbalanced class distributions. This study aims to implement the Interquartile Range (IQR) Clipping method for outlier handling on EEG signals and develop a Random Forest classification model to distinguish open-eye and closed-eye states, evaluated through seven comprehensive metrics. The EEG-Eye-State dataset from the UCI Machine Learning Repository, consisting of 14,980 samples across 14 EEG sensor features, was used. IQR Clipping with bounds [Q1 − 1.5×IQR, Q3 + 1.5×IQR] was applied to all sensors, followed by StandardScaler normalization and an 80:20 Stratified Train-Test Split. A Random Forest model with 100 estimators and balanced class weights was trained and validated using Stratified 10-Fold Cross-Validation. IQR Clipping successfully handled 12,737 outlier instances across all sensors without discarding any samples. The model achieved an accuracy of 92.49%, Balanced Accuracy of 92.14%, ROC-AUC of 0.9791, PR-AUC of 0.9759, F1-Score Macro of 0.9236, Matthews Correlation Coefficient (MCC) of 0.8486, and Cohen Kappa of 0.8474. Cross-validation confirmed model stability with a mean accuracy of 92.86% ± 0.36% and ROC-AUC of 0.9809 ± 0.0020. Feature importance analysis identified sensors O1 (11.81%), P7 (10.59%), and F7 (10.15%) as the most dominant contributors. These results confirm that combining IQR Clipping with Random Forest produces a stable, accurate, and neuroanatomically interpretable model for EEG-based eye state classification, offering a strong foundation for real-world BCI and driver drowsiness detection systems.
Downloads
References
Ahmadi, N., Pebrianti, D., Bayu, A. P., & Ludin, G. A. (2022). Eye state identification utilizing EEG signals: A combined method using self-organizing map and deep belief network. Scientific Programming, 2022, Article 4439189. https://doi.org/10.1155/2022/4439189
Ardi, L., Setiawan, N. A., & Wibirama, S. (2021). Eye blink classification for assisting disability to communicate using bagging and boosting. IJITEE (International Journal of Information Technology and Electrical Engineering), 5(4), 117–123. https://doi.org/10.22146/ijitee.63515
Arisa, A., Kurniawan, R., & Hayati, U. (2025). Algoritma Random Forest untuk peningkatan model klasifikasi pada data diagnosa pasien Puskesmas Pekalangan Kota Cirebon. JATI (Jurnal Mahasiswa Teknik Informatika), 9(1), 1224–1231. https://doi.org/10.36040/jati.v9i1.12676
Barry, R. J., Clarke, A. R., Johnstone, S. J., Magee, C. A., & Rushby, J. A. (2007). EEG differences between eyes-closed and eyes-open resting conditions. Clinical Neurophysiology, 118(12), 2765–2773. https://doi.org/10.1016/j.clinph.2007.07.028
Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324
Chicco, D., & Jurman, G. (2020). The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genomics, 21(1), Article 6. https://doi.org/10.1186/s12864-019-6413-7
Dharmendra, K. R., Verma, D. K., & Vats, S. (2025). Hybrid EEG-based eye state classification using LSTM, neural networks, and multivariate analysis. Journal of Information Technology Management, 17(Special Issue), 16–31. https://doi.org/10.22059/jitm.2025.102919
Hasanah, S. N. A. (2018). Ekstraksi ciri sinyal EEG untuk gangguan penyakit epilepsi menggunakan teknik sampling. Jurnal Informatika Polinema, 5(1), 1–6. https://doi.org/10.33795/jip.v5i1.127
Kuswanto, H., Salamah, M., & Fachruddin, M. I. (2017). Random Forest classification and Support Vector Machine for detecting epilepsy using electroencephalograph records. American Journal of Applied Sciences, 14(5), 533–539. https://doi.org/10.3844/ajassp.2017.533.539
Mondal, S., & Nag, A. (2025). A computational eye state classification model using EEG signal based on data mining techniques. Physical and Engineering Sciences in Medicine. https://doi.org/10.1007/s13246-025-01619-w
Nadyah, I., Syaja'ah, K. N., & Sunaryo, M. S. W. (2023). Early study in automatic identification of epilepsy in neonatal using EEGLAB and one dimensional convolutional neural network through the EEG signal. Jurnal Penelitian Fisika dan Aplikasinya (JPFA), 13(1), 1–15. https://doi.org/10.26740/jpfa.v13n1.p1-15
Nurdiawan, O., Fathurrohman, F., & Faqih, A. (2024). Optimisasi model backpropagation untuk meningkatkan deteksi kejang epilepsi pada sinyal electroencephalogram. Information System for Educators and Professionals: Journal of Information System, 9(2), 151–160. https://doi.org/10.51211/isbi.v9i2.3187
Pribadi, M. A. (2021). Classification of enchepalo graph (EEG) signals for epilepsy using discrete wavelet transform and K-nearest neighbor methods. Procedia of Engineering and Life Science, 1(1). https://doi.org/10.21070/pels.v1i1.750
Rachmatullah, M. I. C., Wicaksono, A., & Putratama, V. (2023). Perbandingan metoda K-NN, Random Forest dan 1D CNN untuk mengklasifikasi data EEG eye state. Journal of Information System Research (JOSH), 4(2), 669–675. https://doi.org/10.47065/josh.v4i2.2998
Rösler, O., & Suendermann, D. (2013). A first step towards eye state prediction using EEG. Dalam Proceedings of the International Conference on Applied Informatics for Health and Life Sciences (AIHLS 2013).
Sabilla, N. N., Fatchan, M., & Aguswin, A. (2025). Mengoptimalkan klasifikasi sinyal electroencephalogram untuk mendeteksi kejang epilepsi dengan backpropagation neural network. JATI (Jurnal Mahasiswa Teknik Informatika), 9(2), 3501–3509. https://doi.org/10.36040/jati.v9i2.13428
Vijay Anand, S., & Shantha Selva Kumari, R. (2015). Epileptic seizure detection of EEG signals based on Support Vector Machine and DB4. International Journal of Applied Engineering Research, 10(20), 41561–41566.
Zulianto, W. E., Djamal, E. C., & Komarudin, A. (2016). Deteksi epilepsi dari sinyal EEG menggunakan autoregressive dan adaptive backpropagation. Prosiding Sains Nasional dan Teknologi, 1(1), 120–125. https://doi.org/10.36499/psnst.v1i1.1520
Downloads
How to Cite
Issue
Section
License
Copyright (c) 2026 Muhammad Alfathan, Tri Sugihartono

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






















Moraref
PKP Index
Indonesia OneSearch
OCLC Worldcat
Index Copernicus
Scilit
