Giter VIP home page Giter VIP logo

pll-emotion-eeg's Introduction

Partial Label Learning for Emotion Recognition from EEG

This is the implementation of Partial Label Learning for Emotion Recognition from EEG in PyTorch (Version 1.11.0).

Install

pip install eeg-pll==1.10.0

This repository contains the source code of our paper, using a large publicly avaiable dataset, SEED-V. 16 participants were involved in experiments with videos as emotion stimuli (five emotions: happy/sad/disgust/neutral/fear). 62 EEG recordings were collected with a sampling frequency of 1000Hz.

Prerequisites

Please follow the steps below in order to be able to train our models:

1 - Install Requirements

pip3 install -r ./requirements.txt

2 - Download the extracted differential entropy features and labels provided by the dataset. Follow the data loader code while strictly following the official dataset description.

3 - Usage: In order to have a user-friendly interface, we provide bash file for runing all the partial label learning experiments under various settings. Run the command to excute the bash file:

bash ./run.sh

Enter the values specified in the terminal hint. These may include integers, strings, or boolean values. For the method name, choose one of 'DNPL', 'PRODEN', 'CAVL', 'CR', 'LW', or 'PiCO'. For label disambiguation, enter 'true' or 'false'. For partial label type, enter 'uniform' or 'emotion'. For loss name, enter 'sigmoid' or 'cross_entropy'. For beta values in the LW method, enter '0.0', '1.0', or '2.0'. For the PiCO method, enter 'true' or 'false' to determine whether contrastive learning should be used. An example is shown in the screenshot.

In the bash script, decide whether to use the 'wait' command after each python execution command based on your available CPU and GPU resources. If you have multiple GPUs and many CPU cores, you can omit 'wait' and assign a GPU device ID to the environment variable 'CUDA_VISIBLE_DEVICES' for more efficient computation. If you have limited computational resources, leave the bash file as is.

Document Description

  • \parsing: includes argument specifications for all partial label learning methods.
  • \backbone_model: includes the backbone model for all the methods.
  • \train_func: includes the training steps for all partial label learning methods, including DNPL, PRODEN, CAVL, LW, CR, and PiCO, for EEG representation learning in emotion recognition tasks.
  • \main: includes implementation of experiments for several state-of-the-art partial label learning methods: DNPL, PRODEN, CAVL, LW, CR, and PiCO. In the paper, we conducted experiments with and without label disambiguation for most of these methods. To make the code easier to understand, the label disambiguation process is placed in the 'confidence_update' function within the class of each method. To enable label disambiguation in an experiment, simply add the '--use-confidence' flag to the command line. The DNPL method is the only exception and does not use label disambiguation.
  • \polar_coordinate: inlcudes generation of simlarities among five emotions based on the emotion wheel.
  • \utils: includes model paramter initialization, methods for generating candidate labels based on classical (uniform distribution) and real-world (emotion similarity) settings, a custom PyTorch data loader, as well as contrastive learning loss functions.

If you find this material useful, please cite the following article:

Citation

@article{zhang2023partial,
  title={Partial Label Learning for Emotion Recognition from EEG},
  author={Zhang, Guangyi and Etemad, Ali},
  journal={arXiv preprint arXiv:2302.13170},
  year={2023}
}

Contact

The sources of randomness are controlled, ensuring that all results presented in the paper can be replicated using the codes provided in this repository. Should you have any questions, please feel free to contact me at [email protected].

pll-emotion-eeg's People

Contributors

guangyizhangbci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.