Automated Artifact Detection in BrainStream An Evaluation of An Online Eye and Muscle Artifact Detection Method Danny Oude Bos Human Media Interaction, EEMCS Faculty, University of Twente P.O. Box 217, 7500 AE, Enschede, The Netherlands d.oudebos@student.utwente.nl ABSTRACT Electroencephalography (EEG) is often used to acquire brain signals for input for brain-computer interaction (BCI) sys- tems. Unfortunately, EEG is very susceptible to artifacts. In 2007, an automated artifact detection method was im- plemented at the Music Mind Machine (MMM) group of the Radboud University in Nijmegen for use in their online system. This article describes a formal evaluation of this artifact detection method based on the expertise of two profession- als who work with EEG. The result is a 1.00 AUC for eye artifacts and 0.99 AUC for muscle artifacts, with accuracies of 97% and 93% respectively. Whether the statistical parameters used by the algorithm were personal or based on a grouped average did not signif- icantly influence the performance results. Neither did using a special artifact session instead of a normal experiment ses- sion for determining these parameters. Using bipolar EOG may provide a slight advantage for detecting eye artifacts. In a comparison with the offline artefact detection method from the Fieldtrip toolkit, the online version obtained both higher AUCs and higher accuracies. Keywords Electroencephalography (EEG), brain-computer interfacing (BCI), machine learning, artefact detection, physiological artefacts, eye artefacts (EA), muscle artefacts (MA) 1. INTRODUCTION Brain activity can be analyzed by a computer so it can be used to control robots or software applications. This tech- nology is called brain-computer interfacing or BCI [13]. For paralyzed patients, BCI can provide new means of interact- ing with the outside world [3, 8, 15], but BCI is also proven useful to treat patients via neurofeedback and to evaluate neurological diseases [9]. Besides, this technology may be interesting for healthy people where it can be used for ex- ample as a novel way of interacting with a game [10, 11]. At the moment the most-used method to obtain input for a BCI is EEG. Electrodes are mounted on the head to record the voltage differences that arise because of brain activity. EEG has a number of advantages over other methods: it is non-invasive (no implants are necessary), fast (reaction time), has a high temporal resolution (sample frequency), and is relatively cheap. It does not require big machines in a laboratory setting, and it is even possible to create wire- less EEG head-sets. Unfortunately EEG has one important drawback: its susceptibility to noise. Noise coming from sources other than neuronal activity from the brain, create disturbances called artifacts in the recorded electrical activity. The recordings are obscured by these artifacts, which can influence the results of signal anal- ysis and classification. According to Fatourechi et al “phys- iological artifacts, especially those generated by eye or body movements, remain a significant problem in the design of BCI systems” [4]. One way of dealing with artifacts is trying to avoid them. During experiments, the test subject is instructed to refrain from blinking, eye movement, and to stay relaxed in order to avoid muscle tension. Test subject instruction however is not without its drawbacks. The reflex tendency (e.g. in the case of eye blinking) and the following inhibition can be detected from the EEG. Secondly it presents an additional mental task for the subject which can influence the test re- sults. Another issue is that these instructions can or will not always be adhered to, for example in the case of children or with very intensive tasks. Besides, some artifacts are caused by sources that cannot be controlled, like heart beats [4]. Therefore this practice cannot eliminate all the influence of artifacts. What is left is some method of dealing with the artifacts that cannot be avoided. A common practice is visual screen- ing: the researcher analyzes all the records visually for ar- tifacts. This manual process is very labor intensive, and because of its subjectivity (the decision when the data is considered clean enough) it cannot yield consistent results [4]. This issue makes quantitative research impossible. Be- sides, in online systems, where time is of the essence, this method is just not practical. 1.1 Motivation With the advance of BCI, the need for fast, automated artifact detection or removal has only grown. It can be used to remove contaminated brain activity from the data that is fed to the analysis and classification algorithms, or to inform the subject of the occurrence of certain artifacts which they can then try to avoid. To address the problem of artifacts, an online detection function has been designed and implemented for BrainStream, the online system used by the MMM group of the Radboud University in Nijmegen [12]. The current algorithm focuses on eye artifacts (EA) and muscle artifacts (MA) specifically. Although the system has been tested both offline (the pro- cessing happens after the experiment) and online (the pro- cessing takes place during the experiment), these tests were quite informal. A formal evaluation of the artifact detec-