xdawn

Module: missions.nodes.spatial_filtering.xdawn

xDAWN and variants for enhancing event-related potentials

Inheritance diagram for pySPACE.missions.nodes.spatial_filtering.xdawn:

Inheritance diagram of pySPACE.missions.nodes.spatial_filtering.xdawn

Class Summary

XDAWNNode([erp_class_label, ...]) xDAWN spatial filter for enhancing event-related potentials.
SparseXDAWNNode(lambda_[, erp_class_label, ...]) Sparse xDAWN spatial filter for enhancing event-related potentials.
AXDAWNNode([comp_type, lambda_signal, ...]) Adaptive xDAWN spatial filter for enhancing event-related potentials.

Classes

XDAWNNode

class pySPACE.missions.nodes.spatial_filtering.xdawn.XDAWNNode(erp_class_label=None, retained_channels=None, load_filter_path=None, visualize_pattern=False, **kwargs)[source]

Bases: pySPACE.missions.nodes.spatial_filtering.spatial_filtering.SpatialFilteringNode

xDAWN spatial filter for enhancing event-related potentials.

xDAWN tries to construct spatial filters such that the signal-to-signal plus noise ratio is maximized. This spatial filter is particularly suited for paradigms where classification is based on event-related potentials.

For more details on xDAWN, please refer to http://www.icp.inpg.fr/~rivetber/Publications/references/Rivet2009a.pdf

References

main source: xDAWN
author Rivet, B. and Souloumiac, A. and Attina, V. and Gibert, G.
journal Biomedical Engineering, IEEE Transactions on
title xDAWN Algorithm to Enhance Evoked Potentials: Application to Brain-Computer Interface
year 2009
month aug.
volume 56
number 8
pages 2035 -2043
doi 10.1109/TBME.2009.2012869
ISSN 0018-9294
minor source: adaptive xDAWN
author Woehrle, H. and Krell, M. M. and Straube, S. and Kim, S. U., Kirchner, E. A. and Kirchner, F.
title An Adaptive Spatial Filter for User-Independent Single Trial Detection of Event-Related Potentials
journal IEEE Transactions on Biomedical Engineering
publisher IEEE
doi 10.1109/TBME.2015.2402252
volume 62
issue 7
pages 1696 - 1705
year 2015
Parameters
erp_class_label:
 

Label of the class for which an ERP should be evoked. For instance “Target” for a P300 oddball paradigm.

(recommended, default: ‘Target’)

retained_channels:
 

Determines how many of the pseudo channels are retained. Default is None which means “all channels”.

(optional, default: None)

load_filter_path:
 

An absolute path from which the spatial filters can be loaded. If not specified, these filters are learned from the training data.

(optional, default: None)

visualize_pattern:
 

If value is true, a visualization of the learned spatial filters is stored.

The visualisation is divided into two components. First of all each transformation is visualized separately. Since the visualization itself may not be so meaningful, there exists another combined visualization, which shows the filter (u_i) with the underlying spatial distribution (w_i, parameter names taken from paper). The number of filters equals the number of original channels. Normally only the first channels matter and the rest corresponds to different noise components.

To avoid storing to many pictures, the retained_channels parameter is used to restrict the number.

(optional, default: False)

Exemplary Call

-
    node : xDAWN
    parameters:
        erp_class_label : "Target"
        retained_channels : 32
        store : True
Author:

Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)

Created:

2011/07/05

POSSIBLE NODE NAMES:
 
  • XDAWN
  • XDAWNNode
  • xDAWN
POSSIBLE INPUT TYPES:
 
  • TimeSeries

Class Components Summary

_execute(data) Apply the learned spatial filters to the given data point
_plotTimeSeriesInEC(values[, vmin, vmax, ...])
_stop_training([debug])
_train(data, label) Train node on given example data for class label.
is_supervised() Returns whether this node requires supervised training
is_trainable() Returns whether this node is trainable.
store_state(result_dir[, index]) Stores this node in the given directory result_dir
__init__(erp_class_label=None, retained_channels=None, load_filter_path=None, visualize_pattern=False, **kwargs)[source]
is_trainable()[source]

Returns whether this node is trainable.

is_supervised()[source]

Returns whether this node requires supervised training

_train(data, label)[source]

Train node on given example data for class label.

_stop_training(debug=False)[source]
_execute(data)[source]

Apply the learned spatial filters to the given data point

store_state(result_dir, index=None)[source]

Stores this node in the given directory result_dir

_plotTimeSeriesInEC(values, vmin=None, vmax=None, bb=(0.0, 1.0, 0.0, 1.0), file_name=None)[source]

SparseXDAWNNode

class pySPACE.missions.nodes.spatial_filtering.xdawn.SparseXDAWNNode(lambda_, erp_class_label='Target', num_selected_electrodes=None, **kwargs)[source]

Bases: pySPACE.missions.nodes.spatial_filtering.xdawn.XDAWNNode

Sparse xDAWN spatial filter for enhancing event-related potentials.

xDAWN tries to construct spatial filters such that the signal-to-signal plus noise ratio (SSNR) is maximized. This spatial filter is particularly suited for paradigms where classification is based on event-related potentials. In contrast to the standard xDAWN algorithm, this node tries to minimize the electrodes that have non-zero weights in the spatial filters while at the same time trying to maximize the signal-to-signal plus noise ratio. This property is used for electrode selection, i.e. only those electrodes need to be set that obtained non-zero weights.

For more details on Sparse xDAWN, please refer to http://www.gipsa-lab.inpg.fr/~bertrand.rivet/references/RivetEMBC10.pdf

Parameters

lambda_:

Determines the relative influence of the two objectives (maximization of SSNR and minimization of electrodes with non-zero weights). If lambda_ is 0, only the SSNR is relevant (like in standard xDAWN). The larger lambda_, the weaker is the influence of the SSNR.

erp_class_label:
 

Label of the class for which an ERP should be evoked. For instance “Target” for a P300 oddball paradigm.

(recommended, default:’Target’)

num_selected_electrodes:
 

Determines how many electrodes keep a non-zero weight.

Exemplary Call

-
    node : Sparse_xDAWN
    parameters :
        lambda_ : 0.1
        erp_class_label : "Target"
        num_selected_electrodes : 2
        store : True
Author:

Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)

Created:

2011/08/22

POSSIBLE NODE NAMES:
 
  • SparseXDAWN
  • Sparse_xDAWN
  • SparseXDAWNNode
POSSIBLE INPUT TYPES:
 
  • TimeSeries

Class Components Summary

_execute(data) Project the data onto the selected channels.
_gradient_optimization(objective_function, ...)
_stop_training([debug])
get_filters()
store_state(result_dir[, index]) Stores this node in the given directory result_dir
__init__(lambda_, erp_class_label='Target', num_selected_electrodes=None, **kwargs)[source]
_stop_training(debug=False)[source]
_gradient_optimization(objective_function, sigma_1, sigma_X, max_evals=25000)[source]
_execute(data)[source]

Project the data onto the selected channels.

store_state(result_dir, index=None)[source]

Stores this node in the given directory result_dir

get_filters()[source]

AXDAWNNode

class pySPACE.missions.nodes.spatial_filtering.xdawn.AXDAWNNode(comp_type='rls', lambda_signal=1.0, lambda_noise=1.0, delta=0.25, w_ini=0.01, regularization=False, lambda_reg=100, **kwargs)[source]

Bases: pySPACE.missions.nodes.spatial_filtering.xdawn.XDAWNNode

Adaptive xDAWN spatial filter for enhancing event-related potentials.

In general, the adaptive xDAWN algorithm works as the conventional xDAWN algorithm, but is adapted to be able to evolve over time.

Therefore, instead of using the QR and SV decomposition, this node uses the generalized Eigendecomposition to find the optimal filters.

The methods are based on iteratively computing the generalized eigendecomposition (GED) with the algorithm from “Fast RLS-like algorithm for generalized eigendecomposition and its applications” (2004) by Yadunandana N. Rao , Jose , C. Principe , Tan F. Wong

In general, this works as follows:

  • The noise and signal autocorrelation matrices are adapted with more incoming samples.
  • The inverse noise autocorrelation is updated.
  • The weight vectors (i.e. general eigenvectors) are updated.
  • These are used to get the actual filters.

Optionally, update coefficients can be used for adapting the filter estimate.

For using regularization techniques, the noise autocorrelation is initialized with the regularization matrix instead of using zeros.

References

main source: axDAWN
author Woehrle, H. and Krell, M. M. and Straube, S. and Kim, S. U. and Kirchner, E. A. and Kirchner, F.
title An Adaptive Spatial Filter for User-Independent Single Trial Detection of Event-Related Potentials
journal IEEE Transactions on Biomedical Engineering
publisher IEEE
doi 10.1109/TBME.2015.2402252
volume 62
issue 7
pages 1696 - 1705
year 2015
main source: raxDAWN
author Krell, M. M. and Seeland, A. and Woehrle, H.
title raxDAWN: Circumventing Overfitting of the Adaptive xDAWN
book Proceedings of the International Congress on Neurotechnology, Electronics and Informatics
publisher SciTePress
doi 10.5220/0005657500680075
year 2015
Parameters
lambda_signal:
update coefficient for weighting

old samples of the signal.

(optional, default: 1.0)

lambda_noise:

forgetting factor for weighting old samples of the noise.

(optional, default: 1.0)

comp_type:

Type of computation

Either use iterative GED (rls) or the eigh function from scipy (eig). eig will not enable an iterative procedure and is just integrated for comparison with the original method and for testing the incremental approach. Depending on the scipy version, the scipy.linalg.eigh() function might raise an error or deliver unexpected results.

(optional, default: rls)

delta:

Factor for identity matrix in initialization of inverse correlation matrix.

(optional, default: 0.25)

w_ini:

Factor for random filter initialization

(optional, default: 0.01)

regularization:

Currently only Tikhonov regularization is implemented. By default no regularization is active using False. For the regularization, the lambda_reg parameter should be optimized.

(optional, default: False)

lambda_reg:

Positive regularization constant to weight between signal-plus-noise energy and chosen regularization term (see also the regularization parameter). Values between 100 and 1000 seem to be appropriate. Values below 1 won’t have a real effect. This parameter should be roughly optimized, when used.

(optional, default: 100)

Exemplary Call

-
    node : axDAWN
    parameters:
        erp_class_label : "Target"
        retained_channels : 32
        store : True
        lambda_signal : 0.99
        lambda_noise : 0.99
        lambda_reg : 100
Author:

Hendrik Woehrle (hendrik.woehrle@dfki.de)

Created:

2012/05/25

POSSIBLE NODE NAMES:
 
  • axDAWN
  • AXDAWNNode
  • AXDAWN
POSSIBLE INPUT TYPES:
 
  • TimeSeries

Class Components Summary

_execute(data) Apply the learned spatial filters to the given data point
_inc_train(data, label)
_stop_training([debug])
_train(data, class_label) Incremental update procedure
adapt_inverse_noise_correlation(data)
initialize_filters(data) Filter initialization which requires the first data sample
store_state(result_dir[, index]) Stores this node in the given directory result_dir
__init__(comp_type='rls', lambda_signal=1.0, lambda_noise=1.0, delta=0.25, w_ini=0.01, regularization=False, lambda_reg=100, **kwargs)[source]
initialize_filters(data)[source]

Filter initialization which requires the first data sample

_train(data, class_label)[source]

Incremental update procedure

This method is used for initial training and incremental training

adapt_inverse_noise_correlation(data)[source]
store_state(result_dir, index=None)[source]

Stores this node in the given directory result_dir

_stop_training(debug=False)[source]
_inc_train(data, label)[source]
_execute(data)[source]

Apply the learned spatial filters to the given data point