Skip to content

Event Related Potential (ERP) classification

A basic pipeline used for event related potential (ERP) classification is named EventRelatedPotentialExample.pyp and can be found in the examples\ folder:

The event related potential (ERP) experiments measure the brain response to a stimulus or an event. Since the brain response to a single stimulus is usually not very visible in a single EEG trial, multiple trails have to be performed and the signal averaged in order to increase the signal-to-noise ratio.

The example pipeline used for ERP classification is shown below:

image alt text

The following pipeline is designed to predict the brain response in the presence of certain stimulus. This pipeline can be divided into 4 main parts, which we discuss in the following:

Data Acquisition

Includes : Import Data, LSL Input and Inject Calibration Data nodes

In general, the data is communicated in and out of the pipeline through LSL Input and LSL Output nodes. This is mostly the case when you are running a pipeline on the streamed data online. However. for testing and developing purposes you may want to run the process offline using a prerecorded file. The Import Data nodes (here titled Import Test Data and Import Calibration Data) are used to connect the pipeline to a file.

As discussed in getting started notes, the recorded data can also be streamed and sent via a combination of LSL Output and LSL Input nodes into the pipeline. This can be achieved by the following combination of nodes:

image alt text

If you are sending markers make sure to check the send marker option in LSL output node.

image alt text

The Inject Calibration Data node is used to pass the initial calibration data into the pipeline before the actual data is processed. The calibration data, Calib Data, is used by adaptive and machine learning algorithms to train and set their parameters initially. The main data is connected to the Streaming Data port.

In case you would like to train and test your pipeline using files (without using streaming node), you need to set the Delay streaming packets in the Inject Calibration Data node. This enables this node to buffer the test data that is pushed into it for one cycle and transfer it to the output port in the next cycle. It should be noted that the first cycle is used to push the calibration data through the pipeline.

image alt text

Data Preprocessing

Includes: Assign Targets, Select Range and Segmentation nodes

The Assign Target node is mostly useful for the supervised learning algorithms, where target values are assigned to specific markers present in the EEG signal. In order for this node to operate correctly you need to know the label for the markers in the data.

The Select Range node is used to specify certain parts of the data stream. For example if we have a headset that contain certain bad channels, you can manually remove them here. In this case we decrease the complexity of the system by choosing the first 19 channels of data from high density EEG recording.

The Segmentation node performs the epoching process, where the streamed data is divided into segments of the pre-defined window-length around markers on the EEG data.

In the Segmentation node, the epoching process can be either done relative to the marker or the time window. When Processing a big data buffer, you should set the epoching relative to markers and while processing the streaming data, you should set it to sliding which chooses a single window at the end of the data.

Feature Extraction

The FIR Filter and Decimate nodes are used together to perform the downsampling of the EEG data, to reduce the dimensionality of the signal. Note that in order to avoid adding aliasing effect to your signal the bandwidth of the lowpass FIR filter should chosen based on the initial sampling rate of the signal and the decimation rate. For example if the initial sampling rate of the signal is 10kHz and decimating by 5, the signal must be filtered to less than 1kHz.

Decimate node only accepts integer values.

The Spectral Selection node is used to implement spectral filtering of the data. In this case, it is used to isolate slow cortical potentials for ERP from higher-frequency signal content.

Component Analysis

Includes: Hierarchical Discriminant Component Analysis and Measure Loss

The Hierarchical Discriminant Component Analysis node (HDCA) is a two stage hierarchical classifier, which is based on a group of logistic regression classifiers. The basic idea is that features are partitioned into blocks of a given size, and a classifier is trained for each block, followed by a classifier that acts on the linearly mapped output of the per-block classifiers. You can set two regularization coefficient for each of the classifiers.

The Measure Loss node is used to measure various performance criteria. For example, you can use the MCR (miss-classification ratio).

Copyright (c) Syntrogi Inc. dba Intheon. All Rights Reserved.