**3. Artifact handling methods**

A typical EEG recording system is shown in **Figure 1**. At the heart of a recording setup is the biopotential amplifier. It should have high common mode rejection ratios, however it should not have high gains, this can saturate the signal due to large halfcell potentials at the electrodes. Unequal electrode impedances are major sources of common mode artifacts such as powerline.

**Figure 1.** *EEG recording system and experiment setup.*

Environmental artifacts can be eliminated by bringing the electrodes leads closer together, moving the electrodes and subject away from the noise sources, using single isolated earth for the whole setup, and shielding the cables, machines and artifact sources with a metal tape connected to the common earth. Moreover, the environmental conditions should satisfy the following requirements for proper recordings. These can be listed as, quiet atmosphere, comfortable temperature and humidity, controlled proper lighting, using a comfortable bed or chair, and separating the powerline of the EEG system from the other machines in the lab.

### **3.1 Averaging methods to suppress ERP artifacts**

Event Related Potentials (ERP) are electrical signals generated in response to internal or external events and they are recorded by EEG [16]. In evoked potentials, each stimulus produces an evoked potential embedded in EEG. However, since the ERP or evoked potential signals are generally subtle in EEG, averaging of many epochs are needed to make them distinguishable. An ensemble averaging method to enhance the ERPs was defined by [17]. This relies on the assumption that by synchronous averaging of each epoch, signal ERP amplitude adds constructively and EEG background noise diminishes destructively.

In ERP and evoked potential research, artifacts contaminate the final ensemble average signal of interest. One method to overcome this adverse effect is to benefit from a weighted averaging [18]. In weighted averaging technique each epoch is weighted inversely with the non-stationary noise maximum amplitude in the epoch. In [19], each trial's contribution to ensemble average is multiplied by a weight according to its correlation with the rest of the data. This factor is inversely related to its probability of being an artifact. For example, a large amplitude EEG is likely to be an artifact and the contribution factor for the trial involving large amplitudes will be low whereas the factor for a small amplitude EEG is high (**Figure 2**). Davila and Mobin [20] showed that weighted averaging of auditory EP has higher SNR than conventional ensemble averaging. John et al. [21] studied the effects of such techniques as sample-weighted averaging, noise-weighted averaging, amplitude based artifact rejection, percentage based artifact rejection, and normal averaging on the steady state auditory evoked potentials. It concluded in favor of weighted averaging for better SNR of steady state responses. On the other hand, according to [22], weighted averaging underestimates the ERP signal amplitude. Determination of the optimal weighting factor is not straightforward and this limits the performance of

*A Brief Summary of EEG Artifact Handling DOI: http://dx.doi.org/10.5772/intechopen.99127*

**Figure 2.** *Various EEG artifacts are shown.*

the weighting averaging method. Mühler and Specht [23] developed a method called 'sorted averaging'. In sorted averaging, epochs are sorted with RMS values from small to large, since noisy artifactual epochs have large RMS values compared to low noise signals. The signal averaging is performed by addition of epochs from the low noise RMS to large RMS sorted order until a maximum peak of SNR2 is obtained [24]. This eliminates the high RMS noisy epochs and yields a better ERP waveform. Compared to weighted averaging, sorted averaging had significantly higher SNR2 [23].

Median averaging is another approach to ERP artifact handling and it is based on taking the median points of all the epochs and adding them to form a median average instead of classic mean average [25]. Some advantages of the median averaging are that; it elicits hidden signals more clearly and it is not affected by infrequent large artifacts that much compared to mean averaging [25]. Özdamar and Kalayci [26] supported the advantages of median averaging over the conventional mean averaging in a study on the ABR signals. Median averaging is an efficient way to remove adverse effects of the outliers on the final averaged signal, yet it also removes the valuable data in the outliers causing significant loss of information [27, 28].

#### **3.2 Artifact handling methods for EEG**

Artifact avoidance, artifact rejection, manual rejection, automatic rejection, and artifact removal are the common methods to deal with artifacts [29]. Although it seems a simple solution to cancel EOG and EMG artifacts by instructing subject to avoid blinking or movement, it can result in change of amplitudes in evoked potentials as well as the additional cognitive load [29–31]. On the other hand, artifact rejection or manual rejection may require a person dedicated to this purpose of eliminating artifacts visually one by one in an EEG. Moreover, the artifact detection by an expert may be subjective, tedious, and time consuming. In addition, it can not be applicable to online removal [3]. However, automatic rejection can automate this artifact rejection procedure but it can eliminate non-artifact signals if not properly tuned. The automatic rejection of artifact containing EEG can depend on artifact amplitude based or EEG segment RMS based artifact detection and rejection. An example of a

simple blink artifact removal is depicted in **Figure 3**. Since blinks have low frequency content compared to EEG, by low pass filtering, EEG can be reduced while blink artifact still remains at a high voltage level. Thus, an amplitude threshold based artifact rejection can be applied. As seen from **Figure 3**, red traces are the EEG and blue are the low pass filtered EEG signal. While a simple artifact rejection (without low pass filtering) using a threshold of 20 μV will produce false positives (red traces over 20 μV), in the low pass filtered EEG these false positives are prevented.

Usually one or two channels are dedicated to detect EOG artifacts. There are two widely used procedures for EOG artifacts, first EOG rejection where EEG trials with EOG artifacts having VEOG greater than a preset threshold are omitted, and second EOG correction where the effect of eye movement is tried to be removed from EEG [6].

Artifacts can distort the EEG in a way that the electrophysiologists or physicians can be misled in their clinical interpretation [32]. This makes artifact removal critical in the pre-processing phase prior to analysis. There are many methods to remove artifacts such as Artifactual Segment Rejection, Filtering, Wiener filtering, Adaptive Filtering, Time-Frequency Representation, Wavelet Transform, Discrete Wavelet Transform (DWT), Adaptive Noise Cancelation (ANC), Wavelet Packet Transform (WPT), Kalman Filtering, Linear Regression, Blind Source Separation (Principal Component Analysis (PCA), Independent Component Analysis (ICA), Canonical Correlation Analysis (CCA), Minor Components Analysis (MCA)), Source Decomposition, Empirical Mode Decomposition (EMD), Support Vector Machine (SVM), and hybrid methods [3, 4, 29, 33–38]. A functional dedicated artifact channel which provides complementary aid to identify ECG/EOG is required to remove ocular or cardiac artifacts in the most of the available methods [4].

Regression is a common and well established technique in artifact removal, yet it cannot be used to remove muscle noise or line noise, since these type of artifacts have no reference channels [39]. Having a good regressor (e.g., an EOG) is critical in both time and frequency domain regression methods. It is an inherent weakness that eye movements and EEG signals are bidirectional. When unacceptable amount of data are lost in artifact rejection, delicate artifact removal methods which will preserve

#### **Figure 3.**

*Low pass filtering based EEG blink rejection. Red is raw EEG, blue is low pass filered EEG with 6th order Butteworth low pass filter at 8 Hz cut off. The detected artifact containing EEG epochs are shown in dashed rectangles.*

#### *A Brief Summary of EEG Artifact Handling DOI: http://dx.doi.org/10.5772/intechopen.99127*

the essential EEG signals while removing artifacts are necessary [39]. One of the most important artifacts is EOG. EEG regions infected with EOG can be rejected from overall EEG signal with simplest artifact rejection where these portions are detected by EOG channels, however these regions still carry brain signals in addition to ocular artifacts and total rejection or subtraction of EOG from them results in loss of brain data [40–42].

Blind Source Separation (BSS) algorithms utilize multiple channels in an unsupervised learning algorithm to extract brain related activity from the ensemble EEG signal which can be assumed a linear superposition of brain signals, noise and artifacts [38]. Three common BSS algorithms are Independent Component Analysis (ICA), Principal Component Analysis (PCA) and Canonical Correlation Analysis (CCA).

ICA, a BSS method, is often used to remove EEG artifacts based on statistical approach of spatial filtering and separation of multiple channel EEG data into spatially fixed and temporally independent components [39, 43, 44]. Since the EEG sources and artifacts are usually of different origins, they can be assumed to be linear summation of each independent components. ICA method finds these statistically independent components and enable us to eliminate artifactual ones from the desired EEG [45]. On the other hand, ICA provides extraction of the eye related signals present in the EOG, and removal of this information or artifact, rather than the complete EOG which still has some brain activity [40], is possible. However, detection and removal of transient artifacts such as head and neck muscle contractions and movement are difficult with ICA [46]. Moreover, adapting ICA as an online method requires high computational power [46]. On the other hand, an advantage of ICA is that it does not rely on a reference channel [39]. However, many artifact removal algorithms are compared in [3], and Revised Aligned-Artifact Average (RAAA) and Second Order Blind Identification (SOBI) and Adaptive Mixture of Independent Component Analyzers (AMICA) are the preferred artifact removal methods for EOG, EMG and ECG artifacts.

PCA uses orthogonal transform of correlated time domain signal into linearly uncorrelated principal components (PCs) [47]. These principal components possess as much as variance of the EEG as possible. Artifact containing PCs can be eliminated if they are uncorrelated with the brain EEG. Application of PCA into ocular artifacts was provided in [48].

CCA is also another method utilized in removing artifacts. In CCA second order statistics are employed, correlation between two multivariate datasets are maximized by canonical variables. CCA offers shorter computational time compared to ICA [38].

Another method is filtering in frequency domain. Usually a high-pass filter starting from 0.5-1 Hz is applied for baseline drift removal. Notch filters are used to remove powerline-noise. Another one, EMG activity of contracting scalp sites can hinder the signals of interest in the EEG recordings during an epileptic seizure [49]. It was possible to remove this high frequency content EMG activity from EEG spectra by filtering out signals over 25 Hz. Adaptive Filters, Wiener Filtering and Bayesian Filters are three filtering methods applied in EEG signal preprocessing. Adaptive Filters are the most commonly used for artifact removal [47]. In Adaptive Filtering a reference channel for artifacts is subtracted from the EEG recursively. This reference is multiplied by a weight factor obtained from the output of the filter by a learning algorithm and this weighted reference is subtracted from the recorded EEG yielding output artifact free EEG changing adaptively [50].

In wavelet transform, many scaled and time shifted wavelets are used to produce coefficients for the particular signal and wavelet type by convolution of the signal and wavelets. These coefficients indicate similarity between the corresponding wavelet and the signal. In artifact removal via wavelet transform, the main idea is that the signal which can be highly correlated with a basis mother wavelet and can be separated from artifacts which might have no correlation to the principal mother wavelet [50]. Some examples of Wavelet Transform in artifact removal are for ocular artifact removal as in [51, 52].

### **3.3 EEG pre-processing pipelines available**

Recently many preprocessing pipelines have been introduced in order to reduce the burden of artifact handling by an expert one by one visual inspection. This laborious task can be fastened by using existing automatized preprocessing methods in order. An efficient pre-processing pipeline not only helps the artifact management time but also provides objective evaluation with predefined criteria compared to highly subjective artifact handling by a human expert. The preprocessing pipelines usually consist of the combination of the following stages; filtering, re-referencing, bad channel identification (and interpolation), bad channel and epoch removal, artifact detection using ICA, artifact correction and removal [53], see **Figure 4**.

Fully Automated Statistical Thresholding for EEG artifact Rejection (FASTER) [54] algorithm is a state of the art method which is available in EEGLAB toolbox [55]. FASTER has filtering, line noise removal, bad channel detection and interpolation, segmentation, and artifact rejection on segments by identifying bad channels, blinks, eye movements and muscular artifacts using combination of statistical thresholding and ICA [56]. It requires an extra EOG channel. The Automatic Pre-processing Pipeline (APP) removes powerline noise, bad channels, eye movements, blinks and muscular artifacts using ICA to identify artifactual components [53], see **Figure 4**. However, it also requires extra EOG channels. Da Cruz et al. [53] has found that APP performs better than FASTER yielding higher amplitude in ERP study. Another pipeline is Tool for Automated Processing of EEG data (TAPEEG) [57]. It uses automated routines of FASTER and Fieldtrip for artifact identification and performed similar to visually analysis by an expert [58]. TAPEEG handles the resting state EEG data as well. Both FASTER and TAPEEG are based on z- scores and have difficulty in handling outliers, this leads to loss of signal content due to false positive artifact detection and rejections [53]. Another standardized preprocessing method for large EEG datasets, PREP pipeline, handles line noise removal, bad channel detection, and referencing to standardize and normalize the data before processing [58]. It is also available as plug-in in EEGLAB toolbox.

Automagic is a toolbox developed for standardized handling of large growing EEG/ERP datasets by time [56]. The power of Automagic comes from the fact that it exploits many existing pipelines and methods, such as PREP pipeline for bad channel identification and for average referencing, Cleanline [59] to remove power line noise, EOG regression [60], Multiple Artifact Rejection Algorithm (MARA), ICA or robust PCA for artifact correction [61]. MARA is a plug-in available in EEGLAB which automatically identifies artifacts not only ocular or muscular but also any general artifactual source component in ICA [61]. Pedroni et al. [59] showed that combination of a preprocessing pipeline to identify bad channels and MARA method is efficient to remove most of the artifacts.

None of the methods offers a perfect robust and high accurate management of all types of artifacts. In general, they are all limited with the training dataset and fail to achieve high success with new type of artifactual data.

*A Brief Summary of EEG Artifact Handling DOI: http://dx.doi.org/10.5772/intechopen.99127*

**Figure 4.** *APP artifact management flow diagram from [53].*
