Artifact cleaning with SSP

It is common to have portions of recordings contaminated by events coming from the subject (eye blinks, movements, heartbeats, teeth clenching, implanted stimulators...) or from the environment (stimulation equipment, elevators, cars, trains, building vibrations...). Some of them are well defined, reproducible and can be removed efficiently using Signal Space Projections (SSP). The purpose of this tutorial is to introduce this technique to correct for the cardiac and ocular artifacts.

For this tutorial, we are going to use the protocol created in the previous tutorial ?Review continuous recordings and edit markers. If you have not followed this tutorial yet, please do it now.

Signal Space Projection

The Signal-Space Projection (SSP) is one approach to rejection of external disturbances. Here is a short description of the method by Matti Hämäläinen, from the MNE 2.7 reference manual, section 4.16.

Unlike many other noise-cancellation approaches, SSP does not require additional reference sensors to record the disturbance fields. Instead, SSP relies on the fact that the magnetic field distributions generated by the sources in the brain have spatial distributions sufficiently different from those generated by external noise sources. Furthermore, it is implicitly assumed that the linear space spanned by the significant external noise patterns has a low dimension.

Without loss of generality we can always decompose any n-channel measurement b(t) into its signal and noise components as:

Further, if we know that bn(t) is well characterized by a few field patterns b1...bm, we can express the disturbance as

where the columns of U constitute an orthonormal basis for b1...bm, cn(t) is an m-component column vector, and the error term e(t) is small and does not exhibit any consistent spatial distributions over time, i.e., Ce = E{eeT} = I. Subsequently, we will call the column space of U the noise subspace. The basic idea of SSP is that we can actually find a small basis set b1...bm such that the conditions described above are satisfied. We can now construct the orthogonal complement operator

and apply it to b(t) yielding

since P⊥bn(t) = P⊥Ucn(t) ≈ 0. The projection operator P⊥ is called the signal-space projection operator and generally provides considerable rejection of noise, suppressing external disturbances by a factor of 10 or more. The effectiveness of SSP depends on two factors:

  1. The basis set b1...bm should be able to characterize the disturbance field patterns completely and

  2. The angles between the noise subspace space spanned by b1...bm and the signal vectors bs(t) should be as close to π/2 as possible.

If the first requirement is not satisfied, some noise will leak through because P⊥bn(t) ≠ 0. If the any of the brain signal vectors bs(t) is close to the noise subspace not only the noise but also the signal will be attenuated by the application of P⊥ and, consequently, there might by little gain in signal-to-noise ratio.

Since the signal-space projection modifies the signal vectors originating in the brain, it is necessary to apply the projection to the forward solution in the course of inverse computations.

For more information on the SSP method, please consult the following publications:

Identify the artifact

The first step is to identify several repetitions of the artifact (the vectors b1...bm). We need to set markers in the recordings that indicate when the events that we want to correct for occur. To help with this task, it is recommended to always record with bipolar electrodes the activity of the eyes (electro-oculogram or EOG), the heart (electro-cardiogram or ECG), and possibly other sources of muscular contaminations (electromyogramor EMG). In this example, we are going to use the ECG and EOG traces to mark the cardiac activity and the eye blinks. Two methods can be used, manual or automatic.

EOG/ECG channels

Manual marking

Create a new category of markers "blink_manual", using the menu Events > Add group. Select this new group. Review the file, and mark the peaks you observe on the EOG trace, using the Ctrl+E keyboard shortcut. Do that for a few eye blinks.

tsMisc.gif

You could repeat the same operation for all the blinks, then for all the ECG peaks and jump to the next chapter of the tutorial and compute the SSP. It would be uselessly time consuming, as there is a process that does it for you automatically. However, it is good to remember how to do it manually because you may face some cases where you don't have clean ECG/EOG, or if you want to correct for another type of artifact.

Automatic detection: ECG

In the event tab, select the menu: SSP > Detect heartbeats. It opens automatically the pipeline editor, with the process "Detect heartbeats" selected:

tsMisc.gif tsMisc.gif

Click on Run. After the process stops, you can see a new event category "cardiac" in the events tab, with 346 occurrences. You can check a few of them, to make sure that the "cardiac" markers really indicate the ECG peaks, and that there are not too many peaks that are skipped. In the event tab, click on the "cardiac" event category, then on a time occurrence to jump to it in the MEG and Misc time series figures.

tsMisc.gif

Automatic detection: EOG

Now do the same thing for the eye blinks. In the event tab, select the menu "SSP > Detect eye blinks". Configure the process to use the channel EEG058 (name of the EOG channel), and leave the other options to the default values.

tsMisc.gif

The result of this process is slightly different from the heartbeat detection: it created two event groups instead of one, "blink" and "blink2". Indeed, this algorithm not only detects specific events in a signal, it also classifies them by shape. If you go through all the events that were detected in the two categories, you would see that the "blink" are all round bumps, typical of the eye blinks, while the "blink2" are ramps followed by sharp drops, a shape that indicates an eye saccade.

tsMisc.gif

Automatic detection: Custom

Those two previous processes are shortcuts for a generic process "Detect custom events". We are not going to use it here, but it is interesting to introduce it to understand how the blinks and heartbeats detection work. The logic is the following:

tsMisc.gif

Calculate the projector

Methodology

We have now 346 examples of heartbeats, 18 examples of blinks, and 12 examples of saccades. Those are sufficient numbers of repetitions to calculate reliable signal-space projections. The logic of the computation is the following:

  1. Take a small time window around each marker to capture the full effect of the artifact, plus some clean brain signals before and after.
  2. Filter the MEG or EEG signals in a frequency band of interest, in which the artifact is the most visible.
  3. Concatenate all those time blocks into a big matrix A = [b1, ..., bm]

  4. Compute the eigenvalue decomposition of this matrix A: [U,S,V] = svd(A, 'econ')

  5. The eigenvectors Ui with the highest eigenvalues Si are an orthonormal basis of the artifact subspace that we want to subtract from the recordings. The software selects by default the vectors with eighvalues above a certain threshold: Si > 12% * sum(Si)
    Then it is possible to redefine interactively the selected components.

  6. Calculate the projection operator: P⊥ = I - UUT

  7. Apply this projection on the MEG or EEG recordings F: F = P⊥F

  8. The process has to be repeated separately several times:
    • for each sensor type (EEG, MEG magnetometers, MEG gradiometers) and
    • for each artifact, starting with the one that leads to the strongest contamination in amplitude on the sensors (in the case: the eye blinks)
    • If you have difficulties removing one artifact or the other, you may try to process them in a different order. You may also try removing some of the artifact markers in the case of co-occurring artifacts. If a lot of the blinks happen at the same time as heartbeats, you may end up calculating projectors that mix both effects, but that do not remove efficiently one or the other. In this case, remove all the markers that happen in the segments contaminated by multiple artifacts.

Steps #1 to #5 are done automatically by the processes "SSP > Compute SSP" in the event tab: the results, the vectors Ui, are saved in the database link ("Link to raw file") and in the channel file.

Steps #6 and #7 are calculated on the fly when reading a block of recordings from the continuous file: when using the raw viewer, running a process a process on the continuous file, or importing epochs in the database.

Step #8 is the manual control of the process. Take some time to understand what you are trying to remove and how to do it. Never trust blindly any fully automated artifact cleaning algorithm, always check manually what is removed from the recordings, and do not give up if the first results are not satisfying.

Let's start with the correction of the eye blinks, as they create much stronger artifacts on the MEG recordings.

Tutorials/TutRawSsp (last edited 2013-01-08 16:46:40 by wpa068226)