EEG-Based Stress Classification Using Random Forest on a Wearable Device
DOI:
https://doi.org/10.35143/dkeafw65Abstract
Stress can affect a person's physical and mental health, making objective stress monitoring methods increasingly important. This study develops a stress classification system based on electroencephalography (EEG) signals using the NeuroSky MindWave Mobile 2 sensor and the Random Forest algorithm. The system is designed as a wearable device using two ESP32 microcontrollers: an ESP32-CAM for Bluetooth data communication and an ESP32-S3 for signal processing and stress classification. The EEG signals are processed through filtering, z-score normalization, and segmentation into 4-second epochs. A total of 11 power spectral density (PSD)-based features are then extracted as inputs to the classification model. The Random Forest model is trained using the EEGMAT dataset, with SMOTE applied to address class imbalance. The system is tested on 9 subjects across 90 sessions under normal and stress conditions. The test results show an accuracy of 88.89%, precision of 92.68%, recall of 84.44%, and F1-score of 88.37%. These results indicate that the system can perform stress classification independently and in real time on a wearable device, with potential applications in personal stress monitoring.Downloads
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Putri Madona, Andhika Maharputra

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
a. Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
b. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
c. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work.

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