EEG-Based Stress Classification Using Random Forest on a Wearable Device

Authors

  • Putri Madona Caltex Riau Polytechnic image/svg+xml
  • Andhika Maharputra
    Competing Interests
    -

DOI:

https://doi.org/10.35143/dkeafw65

Abstract

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

Download data is not yet available.

Author Biography

  • Putri Madona, Caltex Riau Polytechnic
    Dosen Teknik Elektronika Politeknik Caltex Riau

Published

30-11-2026

How to Cite

Madona, P., & Andhika Maharputra. (2026). EEG-Based Stress Classification Using Random Forest on a Wearable Device. Jurnal Elektro Dan Mesin Terapan, 12(2), 160-168. https://doi.org/10.35143/dkeafw65

Most read articles by the same author(s)