EEG Preprocessing Overview

Organize Data

Cleanse the imported data into the required structure. Select data types (such as cell types in MATLAB, multidimensional matrix types, structure types, etc., in Python including tuples, lists, dictionaries, np.array, MNE data structures, etc.)

Understand the fundamental aspects of the dataset: the number of channels, patients, the stored content in each dataset, the size of the dataset, etc.

Re-reference

Data obtained from online sources or EEG machines are typically reference-free, requiring re-referencing. However, hardware-level referencing might have been performed by the EEG machine during output.

Hardware-level referencing methods

The term EEG Montage commonly referred to in papers refers to how EEG electrical signals are re-referenced. Common referencing methods include:

  1. Unipolar Reference: Each electrode is measured concerning a reference electrode. This Montage is often used to study the activity of specific electrodes or event-related potentials (ERPs). Common reference electrode positions include mastoid bilaterally (bottom left of the figure below), Cz (bottom right of the figure below), Infinity/Zero Reference (no reference), neck, etc.
  2. Bipolar Reference: Difference between adjacent electrodes. This Montage can be used to study local potential differences, such as observing synchrony between brain areas. The first row in the figure below shows common bipolar montage maps.
    1
    EEG_ref = -diff(EEG)
    1
    EEG_ref = -np.diff(EEG, axis=0)
  3. Average Reference: The average signal of all electrodes serves as a reference. This Montage is used to study overall brain electrical activity but may be influenced by the number and positions of electrodes. Particularly useful when the number of electrodes exceeds 100.
    1
    EEG_ref = EEG-repmat(mean(EEG,1),size(EEG,1),1)
    1
    EG_ref = EEG - np.tile(np.mean(EEG, axis=0), (EEG.shape[0], 1))
  4. Region-of-Interest Montage: Connecting specific brain area electrodes to focus on the activity of particular brain regions.

Montage maps and polarity of EEG. Spectral peaks montage maps

Note:

  1. MEG is reference-free.
  2. Surface Laplacian is reference-independent.

Epoch Extraction

Select Length: Dividing long EEG data into segments. Considerations include where to segment, how long, etc. Key points to consider:

  1. Where to choose t=0? For example, at the beginning of stimulation, when an event occurs, or at the time of interest (e.g., button press, etc.).
  2. How much time to keep before t=0?
  3. How much time to keep after t=0?

Consider overlaps between different epochs as the epoch length increases.

Retain Buffer: If time-frequency analysis or filters are applied to epochs, a boundary margin buffer needs to be maintained. For example, 3 times the length corresponding to the lowest frequency of interest. For 2Hz activity, reserve 1500ms. Leaving a buffer is crucial due to the “edge effect” when using time-domain filters. Intuitive manifestations include data distortion at the beginning and end of epochs.

Select Quantity: Strive to ensure an equal number of trials under different conditions. Otherwise, differences might arise during power or phase calculations. If trial numbers vary, randomly select N trials or take N trials under similar conditions.

Remove Artifacts

By broadly examining the available data, determine how to remove artifacts. Common methods include using filters or ICA. Partial data deletion might also be considered (entire epoch or affected parts, all channels or only affected channels).

MNE provides artifact detection code: Preprocessing Overview

Tutorial: ERP Artifacts

Eye Blinking

Eye Blinking: Identified by large negative waves in bifrontal regions (Fp). Can be removed using ICA.

Eye Movement (Oculomotor)

Eye Movement: Indicated by a positive spike in F7, a negative spike in F8, and relative fluctuations in other electrode areas like F3 and F4. Can be addressed using fixation points, EOG electrodes, eye trackers, or spatial filtering (Surface Laplacian).

Electrical Artifact

Electrical Artifact: Usually 50 or 60Hz frequencies, filtered out using a notch filter. Presents stable high-frequency fluctuations.

Electrode Movement

Electrode Pop: Often caused by a loose electrode, characterized by a steep rise and slow fall.

Myogenic Artifact

Myogenic Artifact: High-frequency (20-40Hz) high-amplitude movements, common in frontal or lateral temporal regions, can be removed using ICA.

Sweat Artifact

Sweat Artifact: Characterized by low-frequency wavy motion.

Chewing or Jaw Movement Artifacts

Chewing Artifacts

Hypoglossal Artifacts

Cardiac Artifact

ECG Artifact: Often aligns with the ECG, but due to different read-in speeds, they might not fully match. More prevalent in left-side electrodes.

Cardioballistic Artifact: Resulting from electrodes placed directly above an artery.

Chest Movement

Chest Movement

Hand Movement

Hand Movement


Disclaimer: This blog content serves as class notes, shared for educational purposes. Some images and content are sourced from textbooks, lecture materials, and the internet. If there are any copyright concerns, please contact aursus.blog@gmail.com for removal.