Git Product home page Git Product logo

bci-attention's Introduction

BCI-Attention

A repository including multiple attentional module designs for brain signal recognition tasks. Scripts should run with tensorflow>=2.8.0
Preprints associated with this repo:
* KAM -- a Kernel Attention Module for Emotion Classification with EEG Data
* A Monotonicity Constrained Attention Module for Emotion Classification with Limited EEG Data


File Briefs

Training

cv_exp.sh: Bash script for calling exp_5CV_SEED.py with data from different subjects in SEED dataset.
DEAP_benchmark.sh: Bash script for calling DEAP_test_gen.py specifying different subjects, experiment types and models with DEAP dataset.
exp_5CV_SEED.py: Main script for training with SEED dataset. One should manually change models used in the script.
DEAP_test_gen.py: Main script for training with DEAP dataset.

Explorations, Analysis and Visualizations

These are less organised scripts. They were written as our experiments goes. So you probably will not use all contents in a given script, but just some parts of it for your purpose.

DEAP_Plots.py: Gather metrics from trained models with DEAP for benchmarking, analysis and make some visualizations.
SEED_extra_plot.py: Gather metrics from trained models with SEED for benchmarking, analysis and make some visualizations.
sigma_effect.py: Scripts for exploring the Kernel Attention Module (KAM)'s effect on backbone network with SEED dataset.

Other supporting files

The folder scalp_map contains matlab files for making scalp maps.
Modules.py: Contains custom layers used for constructing network models.
Models.py: Contains different network models. Utils.py: Some utility functions Visual.py: Some function for general visualization purpose.


Demo Plots

Figures below are:

  • A simple demo of the idea of prediction transition curve on trinary classification tasks.
  • The prediction transition curve under different models given the same input samples from SEED dataset.
  • Track of accuracies when different frequencies are filtered out from input samples.
  • The map from deep gram matrix's element to attention matrix's element learned by MCAM module
  • Different scalp patterns (kernel weights of the first Depthwise convolutional layer) when various attention modules are inserted. First row: mean, second row: std, third row: top-5 correlated channel pairs (red: +, blue: -).
  • The effect of different $\alpha$ value on layer dense layer's output. Visualized via UMAP.

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.