Getting Started with the Emotion Recognition Pipeline
Welcome to the Emotion Recognition Pipeline! This guide will help you install, configure, and use the pipeline to analyze movement data and recognize emotions efficiently.
1. Installation
Prerequisites
- Python: Version 3.10 or higher.
- Environment: It is recommended to create a virtual environment for managing dependencies.
Steps
-
Clone the repository:
-
Install dependencies:
2. Understanding Movement Data
Movement data refers to the information captured about how a body moves through space. It is typically recorded using sensors like accelerometers and gyroscopes, which measure changes in velocity and angular rotation. For example, smartwatches and fitness trackers collect movement data in three axes with a sampling rate:
-
X-axis: Forward and backward movement
-
Y-axis: Side-to-side movement
-
Z-axis: Up and down movement
-
Sampling Rate: Devices record data at a specific frequency, like 25Hz (25 data points per second), to ensure smooth and continuous tracking.
The recorded data is stored in raw formats, often as time-series data with timestamps and helps us understand physical activity patterns, postures, and even subtle gestures.
3. Understanding Emotions
Emotions are psychological and physiological responses that can be categorized using different models. A widespread model is the 2D Valence-Arousal Model by Russell with these axes:
- Arousal: Refers to the intensity of the emotion, ranging from calm (low arousal) to excited (high arousal).
- Valence: Refers to the positivity or negativity of the emotion, ranging from unpleasant (negative valence) to pleasant (positive valence).
There are also other emotion models:
-
Ekman's six fundamental types of emotions
-
The Positive and Negative Affect Schedule (PANAS) Model
The Emotions can be reported in a csv like this:
4. Movement Data Processing
Movement Data can be processed in these 4 steps:
Data Acquisition, Data Preprocessing, Feature Extraction, and Model Training & Evaluation.
5. The User-Friendly Pipeline to Recognize Emotions with Movement Data
A pipeline was developed to make this process more efficient, reusable, consistent and automated.
5.1 What is a Pipeline in general?
In data processing and machine learning, a pipeline is a structured sequence of steps to transform raw input data into meaningful outputs, for example classifications. Each step in a pipeline performs a specific function, and the output of one step serves as the input for the next.
5.2 Structure of the Emotion Recognition Pipeline
This Pipeline consists out of multiple smaller pipelines which can be used seperately for different purposes and work as checkpoints in your experimental workflow.
6.General Workflow using the Gradio User Interface
6.1 How to use Gradio Interface
Note: If you want to read more on each setting then click here.
6.2. How to combine Dataframes
- Import Accelerometer Data & SelfReports Data
- Set the time window that you want to filter (in minutes before and after a report)
- Set the emotion labels that exist in your data (e.g. valence, arousal)
- Execute Pipeline
- Download combined dataset
6.3. How to extract Features
- Import the combined dataset
- Add cutoff frequency and order for low pass filter
- Set desired scaler
- Set window length and overlapping step size (in seconds) for sliding window technique
- Set frequency in which data was recorded
- Set magnitude
- Set the emotion labels that exist in your data (e.g. valence, arousal)
- Execute Pipeline
- Download features dataset
6.4 How to train a Model
- Import the features dataset
- Select if PCA is being applied and the PCA variance
- Select classifier
- Set the emotion labels that exist in your data (e.g. valence, arousal)
- Select which label should be the target for the model to classify
- Execute Pipeline
- Download model.pkl file and report.json file
6.5 How to classify Movement Data
- Import accelerometer data and model
- Add cutoff frequency and order for lowpassfilter
- Set desired scaling type
- Set period for classifying movement data
- Set frequency in which data was recorded
- Set magnitude (measure of the overall strength or intensity of a signal, calculated by combining the contributions of all three accelerometer axes (x, y, z))
- Set the emotion labels that exist in your data (e.g. valence, arousal)