This is pyEDA v.2.0.
This package includes all you need for Electrodermal Activity analysis also known as GSR. It contains preprocessing of the EDA signal and its feature extraction. Features are extracted using statistical and automatic methods.
Convolutional autoencoder is used to extract the automatic featues.
All the plots and the data collected for this package are collected from Shimmer GSR+ wearable sensor with 128 Hz frequency sampling rate.
After cloning the repository to your local directory use the following command to import the library in your code:
from pyEDA.main import *
Use the following command in your code to analysis the data:
m, wd, eda_clean = process_statistical(eda, use_scipy=True, sample_rate=128, new_sample_rate=40, segment_width=600, segment_overlap=0)
inputs::
eda: the GSR signal
use_scipy: set true to use scipy for peak extraction from phasic gsr (recommended)
sample_rate: sample rate which the data is collected at
new_sample_rate: new sample rate to downsample the data to
segment_width: segmentation of signal in seconds
segment_overlap: overlap of segments in seconds
returns::
m: all the measurements of the signals for each of the segment indices (number of peaks, mean of EDA, maximum value of the peaks)
wd: filtered phasic gsr, phasic gsr, tonic gsr, and peacklist for each of the segment indices
eda_clean: preprocessed gsr data
Use the following command in your code to train the autoencoder:
prepare_automatic(eda_signals, sample_rate=128, new_sample_rate=40, k=32, epochs=100, batch_size=10)
inputs::
eda_signals: All eda signals (must be normalized to 0-1 range since the activation function of last layer is sigmoid.) targeted for feature extraction (2d list: nxm, n=number of signals, m=length of each signal)
sample_rate: sample rate which the data is collected at
new_sample_rate: new sample rate to downsample the data to
epochs: the number of epochs to train the autoencoder
k: the number of automatic features to extract
batch_size: the batch size to train the autoencoder
After the autoencoder is trained and saved, use the following command in your code to extract the automatic features:
automatic_features = process_automatic(eda)
inputs::
eda: the GSR signal
returns::
automatic_features: extracted automatic features
Here you can find the link to different notebooks about all the aspects of analysis of the GSR signal. These documentations include information about preprocessing and feature extraction of EDA signal.
These show how to handle various analysis tasks with pyEDA, from a random generated GSR data.
Here you can find the list of notebooks for feature extraction of EDA signal:
-
Statistical Feature Extraction, a notebook explaining statistical feature extraction of GSR signal.
-
Automatic Feature Extraction, a notebook explaining automatic feature extraction of GSR using an autoencoder.
pyEDA: An Open-Source Python Toolkit for Pre-processing and Feature Extraction of Electrodermal Activity
Full bibtex reference:
@article{aqajari2021pyeda,
title={pyEDA: An Open-Source Python Toolkit for Pre-processing and Feature Extraction of Electrodermal Activity},
author={Aqajari, Seyed Amir Hossein and Naeini, Emad Kasaeyan and Mehrabadi, Milad Asgari and Labbaf, Sina and Dutt, Nikil and Rahmani, Amir M},
journal={Procedia Computer Science},
volume={184},
pages={99--106},
year={2021},
publisher={Elsevier}
}