# Implementation of Tools for Lessening the Influence of Artifacts in EEG Signal Analysis
## 1 Introduction  
In most electroencephalogram (EEG) signal recordings, artifacts related to eye movement, eye blinks, muscle movements, heartbeat, or other noises can be found. These produce voltage levels that, together with the desired signals, are picked up by the electrodes, thus contaminating the brain signals. In many analysis contexts, it is desirable to identify these artifacts in order to either eliminate, reduce, or correct them. Methods for the correction of eye blinks and artifacts such as those based on time or frequency domain regression [1; 2] or Kalman filtering [3] can be found in the literature. However, artifacts are mingled with EEG signals in both dimensions: time and frequency. This causes the decontamination or cleaning of EEG signals with regression-based methods to produce loss of relevant information. Some more recent methods are based on mixing algorithms such as principal component analysis (PCA) or independent component analysis (ICA), which are able to separate signals in multichannel EEG recordings [4]. [PERSON] et al. provide, in [5], a review of artifact removal techniques, which includes regression methods, the use of wavelet transform (WT), and blind source separation schemes, including PCA, ICA, canonical correlation analysis (CCA), empirical mode decomposition schemes, filtering methods, and other hybrid techniques. Among them, ICA, which is our selected analysis tool, seems to have attracted the most attention in the past years, even in other related contexts, such as electrocardiogram signal analyses [6]. In spite of the many existent proposals, the authors still observe artifact removal as an open problem. Similarly, [PERSON] et al., in [7], review a wide number of research papers of the same topic, finding a similar set of types of methods to address the artifact removal process, where the electro-oculogram (EOG) artifact is considered the most dominant one. [PERSON] et al. [8] categorize artifact removal methods into those based on filtering, those based on blind source separation, and those based on artifact subspace reconstruction (ASR), which performs PCA decomposition on EEG data windows for artifact componentidentification and removal. Combined schemes are also observed, which often consider ICA plus signal transforms, such as WT [9]. The utilization of WT is another topic that has attracted some attention for the treatment of artifacts in EEG signals, especially in the specific context of single channel EEG signals [10; 11; 12]. From a different perspective, [PERSON], [PERSON], and [PERSON] [13] analyze the availability and usability of artifact removal methods from EEG signals, identifying diverse issues that slow the progress of artifact removal techniques; among them, the following were found: lack of open-source EEG artifact datasets, and source implementations. Looking at the literature reviewed, it is clear that the use of ICA, either solely or in combination with other techniques or modifications, constitutes a solid and interesting base for the development of methods to deal with artifacts in EEG signals. In addition, ICA is seen as one of the reference methods in several stages of our processing context, which makes it of great interest to provide open source code, data, and examples that allow simple interaction with ICA methods, and it also benefits the development of further artifact removal techniques. These are all aspects addressed by this manuscript. Specifically, in our case, the proposed implementations for artifact pre-processing are linked to the methods that appeared in [14], which perform complete or partial removal of ICA components or excerpts similar to the simultaneous EOG signals responsible for certain artifacts. Nevertheless, the ideas and implementations are extensible to other detectable artifacts. The elimination of independent components is performed, either completely or partially, with the help of a membership function (MSF) employed to identify artifact events: a vector that identifies samples where an ocular artifact is detected.