Skip to content

ToyotaCRDL/EEGAffect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The source code implementing the deep brain–cardiorespiratory model, EEG feature extraction, and parameter identification procedures, together with scripts for reproducing the main figures and tables, 

Reproduce all figures and tables

Install dependencies
pip install -r requirements.txt


Procedure 1: Extract EEG power features
  EEG_power_total.py: 
   a python script that takes, as input, the EEG data of each AMIGOS participants
   (the measurement data .mat files for each participant are stored under /data_original; 
   however, the AMIGOS dataset must be downloaded from the website by users who have obtained a license) 
   and, for each specified participant (Nos. 9, 25, 26, 30, 31, 37, 38, 39, 40) and each stimulus condition 
   (the TrialNo differs by participant), outputs EEG power values.
   The script is run by selecting one of 11 EEG power features each time 
   (i.e., executed separately for each feature).
   Run -> # python EEG_power_total.py
   The resulting outputs should be manually stored in, for example, EEG_data_power.xlsx.

Procedure 2: Calculate NE, DA, 5-HT, pCO2, pO2, and SBP using deep-brain-cardiorespiratory model.
  main_mouq_acrl.py (with 11 files: molkovRespQ_acrl.py,O_Connor.py,Ursino98.py,baro98.py,acrl.py,hrvclass.py.
                      outputclass1_2.py,sHHB.py,sHHG.py,sHHV.py,params_Molkov.mat) 
   (Explained using participant No. 09 as an example.)
   The EEG power values are directly entered and saved into variables such as input_VTA, input_RN, etc., 
   in the file and the computation is executed. 
   Run -> # python main_mouq_acrl.py > out 2>&1 &
   The results are output to Result.csv, including respiratory information and neurotransmitter amounts, 
   among others. By editing these outputs, the mean and maximum values of NE, DA, 5-HT, pCO2, and pO2 
   are obtained (in case of Airplane of No09, Result_No09_Airplane.xlsx).
   rri.csv contains heart rate, and blood pressure is output in column H of couplehistory.csv, 
   from which the maximum value of MAX_SBP is obtained.
   The total execution time is approximately 31 hours. The runtime may vary depending on hardware.
   Tested on:
   Python 3.10. 12
   Ubuntu 22.04.5 LTS
   Intel 3.2GHz
   16 GB RAM

Option: Calculate five paremeters and regression analysis
  excel_calculation_five_parameters_and_regression_analysis_No09.xlsx
  This file summarizes the calculation results for Subject No. 09 and includes the following processing steps. 
 For 16 video stimuli, the NE, SR (5-HT), and DA values calculated in Procedure 2 are used as inputs, and x1 
 and x2 are identified using Excel’s Data → Solver function so that the results match the subjective evaluation
  scores. The EEG power values and the five parameters are then plotted. Furthermore, Excel’s Data → Data Analysis
  → Regression function is used to model arousal and valence using either 14 variables or 11 variables. 
  The experimental data (columns J, K, and L, rows 3 to 18) correspond to the subjective evaluation scores for 
  Subject No. 09 obtained from the AMIGOS dataset and have been masked. Please replace these values after obtaining
  the AMIGOS dataset.

Option: Calculate LMG and Pratt
  excel_variable_contributions_14vars_with_LMG_Pratt_No09.xlsm
   These calculations are performed using macros in excel_variable_contributions_14vars_with_LMG_Pratt_No09.xlsm.
   Paste the data for NE, DA, 5-HT, x1, x2, Arousal, and Valence into column Y of Data and DataZ, 
   then run the macro RecomputeLMGPrattForTarget.
   The LMG data sheet provides the graphs, and the Model_Z sheet provides the adjusted R².


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages