Skip to content

Neural oscillatory state classification

Neural oscillations indicate various neural activities or neural states, such as, relaxation, emotions, cognitive processing and motor control. The following pipelines provide some essential tools to harness such neural oscillatory patterns for the purpose of predicting various kinds of cognitive state.

A basic pipeline used for neural oscillatory state classification is named OscillatoryClassificationExample.pyp and can be found in the examples\ folder:

image alt text

The main node of this pipeline is the Common Spatial Pattern (CSP) filter, which is used to retrieve the components or patterns in the signal that are most suitable to represent desired categories or classes. CSP and its various extensions (available through NeuroPype) provide a powerful tool for building applications based on neural oscillations. Some of the available CSP algorithms in NeuroPype are: CSP and Filterbank CSP, which are mostly used for classification tasks (discrete classes of cognitive state, such as alert versus sleepy), and Source Power Comodulation (SPoC) and Filterbank SPoC which are used for regression tasks (continuous-valued cognitive state).

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 a file (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, FIR filter 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 contains certain bad channels, you can manually remove them here. That is the case for our example here with data recorded with Cognionics headset that the last 5 channels are not used and are removed.

The FIR Filter node is used to remove the unwanted signals components outside the EEG signal frequencies, e.g. to keep the 8-28 Hz frequency window.

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

In 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

Includes: Filter Bank Common Spatial Patterns (FBCSP) node

As discussed above, the spectral and spatial patterns in the data can be extracted by the CSP filters and its extensions. In the FBCSP method, multiple frequency bands can be defined and then desired number of filters are designed for each frequency band. These filters are then applied to the data to extract the features corresponding to model patterns. You can define the frequency bands of interest for this node. Also, you can choose different windows for frequency calculation in order to avoid the boundary effect.

Classification

Includes: Variance, Logarithm, Logistic Regression and Measure Loss

The Logistic Regression node is used to perform the classification, where supervised learning methods is used to train the classifier. In this node you can also choose the type of regularization, the value of the regularization coefficient and the number of the folds for cross-validation.

The Measure Loss node is used to measure various performance criteria. For example, you can use the misclassification rate (MCR) or area under the curve (AUC).

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