polito.it
Politecnico di Torino (logo)

Development and Validation of a Python Algorithm for EEG-Based Emotion Recognition: A Comparison Study with Specifically Designed MATLAB Toolboxes

Roberto Lombardino

Development and Validation of a Python Algorithm for EEG-Based Emotion Recognition: A Comparison Study with Specifically Designed MATLAB Toolboxes.

Rel. Federica Marcolin, Elena Carlotta Olivetti. Politecnico di Torino, Corso di laurea magistrale in Ingegneria Biomedica, 2025

Abstract:

Emotion recognition based on electroencephalography (EEG) is a field that has attracted significant attention in recent years since this technique can directly reflect emotional states with relatively low cost and simplicity, and it is suitable for either real-time or offline applications. This research aims to obtain and validate a Python-based method for extracting five emotion-related indicators from an EEG data stream. For this purpose, several different Python libraries are used, one of which is specifically developed for EEG and MEG signal analysis (mne-Python). The pipeline of code proposed by this study consists of the following steps: data import, pre-processing of the raw EEG signal, signal’s representation, band power computing, extraction of the chosen indicators, and indicators' representation. The dataset utilized was sourced from an experiment at the 3D Lab of Politecnico di Torino. In this study, 39 participants navigated two distinct virtual reality (VR) environments using a desktop monitor while wearing the Emotiv EPOC X headset to collect EEG data. The two VR environments were set in an office building, where the participant was required to attend a job interview. One of the environments was specifically developed to elicit a stronger stress response in the subject than the other one; the indicators provided by the developed Python code can also be helpful in the revelation of this response, specifically the one labeled as “Stress”. The validity of the developed code is assessed in terms of performance, computational costs, usability, and graphic rendering. The script's performance is obtained by comparing the values obtained by the code with the data from the Emotiv software, which were considered as reference. This evaluation is also compared to a similar study that conducted the same tasks using three different MATLAB toolboxes: EEGLAB, BRAINSTORM and LETSWAVE. The results of the code’s analysis underline how the code is able to obtain an adequate outcome in all the assessed categories. Furthermore, the comparison reveals that using Python instead of MATLAB for emotion recognition is a valid choice as it can help to develop a code whose execution is more stable, faster, and allocates less memory at an equal amount of data processed compared to the toolboxes examined, maintaining a good level of accuracy. The study, therefore, proposes a simple method that is fast, based on an open-source environment, and as automated as possible in order to make the data analysis phase of any project dealing with the analysis of emotions simpler and more effective.

Relatori: Federica Marcolin, Elena Carlotta Olivetti
Anno accademico: 2024/25
Tipo di pubblicazione: Elettronica
Numero di pagine: 75
Informazioni aggiuntive: Tesi secretata. Fulltext non presente
Soggetti:
Corso di laurea: Corso di laurea magistrale in Ingegneria Biomedica
Classe di laurea: Nuovo ordinamento > Laurea magistrale > LM-21 - INGEGNERIA BIOMEDICA
Aziende collaboratrici: NON SPECIFICATO
URI: http://webthesis.biblio.polito.it/id/eprint/34883
Modifica (riservato agli operatori) Modifica (riservato agli operatori)