Skip to content

A project exploring the relation between gaze dynamics and empathy

Notifications You must be signed in to change notification settings

aleceress/empathy_gaze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Predicting empathy from gaze dynamics

This project explores a possible correlation between gaze dynamics and empathy. The analysis is conducted by adapting gaze feature extraction described in D’Amelio et al., 2023 to predict a level of empathy for subjects in the EyeT4Empathy Dataset. A detailed description of the project can be found in report.pdf.

Installation

Required libraries can be installed with Anaconda using the following commands:

conda env create --name gazeID --file environment.yml
conda activate gazeID

Gaze feature extraction

Ornstein-Uhlenbeck features can be extracted from the dataset launching the module extract_OU_params_empathy.py. The dataset can be downloaded from here (gaze raw data) ad here (questionnaire data). The dataset folder must be set by adding the path to a config.py file, following the example of config.example.py. Participants raw data must be placed in a DATASET_PATH/raw_participants/ folder, while the questionnaires can be directly inserted in DATASET_PATH/. First part of the script will create a cleaned version of data, which will be saved in DATASET_PATH/participant_cleaned/ for future usage.

Script results will be saved in OUTPUT_PATH/features/EyeT_OU_posterior_VI/.

The script requires a lot of time and memory to be executed. For this reason, a serialized and smaller version of the features can be already found in this repository under the path output/aggregated features/. Those can be derived from the computed features using the script get_OU_aggregated_features.py. All classification and regression code can be executed with them.

Regression, Classification and Results

Results are visualized in notebooks, with a clear distinction made between free-viewing and task-oriented experiments, as well as subcategories within each empathy type (general, cognitive and affective empathy). Inside each subcategory, single fixation, saccade and aggregated predictions are shown, along with sampling diagnostics and posterior predictive checks.

  • classification_visualizations.ipynb contains Logistic Regression experiments.
  • classification_eda.ipynb contains a preliminary analysis for classification, based on correlation and class imbalance.
  • neg_bin_regression_visualizations.ipynb contains Negative Binomial Regression experiments.
  • mix_gauss_regression_visualizations.ipynb contains Gaussian Mixture Regression experiments.

About

A project exploring the relation between gaze dynamics and empathy

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published