Artifact Detection in Chronically Recorded Local Field Potentials using Long-Short Term Memory Neural Network Marcos Fabietti ∗§ , Mufti Mahmud ∗¶ , Ahmad Lotfi ∗‖ , Alberto Averna †∗∗ , David Guggenmos ‡‡‡ , Randolph Nudo ‡ x and Michela Chiappalone ††† ∗ Dept of Computing & Technology, Nottingham Trent University, Clifton, NG11 8NS – Nottingham, UK. § ORCID: 0000-0003-3093-5985 ¶ ORCID: 0000-0002-2037-8348 (Corresponding Author, Email: mufti.mahmud@ntu.ac.uk) ‖ Email: ahmad.lotfi@ntu.ac.uk † Rehab Technologies, Istituto Italiano di Tecnologia, Genova, Italy. ∗∗ ORCID: 0000-0001-9738-1281 †† ORCID: 0000-0003-1427-5147 ‡ Department of Physical Medicine and Rehabilitation, University of Kansas Medical Center, Kansas City, KS USA ‡‡ Email: dguggenmos@kumc.edu x Email: rnudo@kumc.edu Abstract—The process of recording local fields potentials can be contaminated by different internal and external sources of noise. To successfully use these recordings, noise must be removed, for which an automatic detection tool is needed to speed up the detection process. This work presents the use of a specific configuration of the recurrent neural network based machine learning approach, known as the long-short term memory, in two different settings to identify artifacts and compares the obtained results to a feed forward neural network both in terms of classification performance and computational time. Index Terms—Computational neuroscience, machine learning, neurophysiological signals, neuronal signals, spontaneous neu- ronal activity. I. I NTRODUCTION Neural signals are recordings of the brain’s electrical ac- tivity. These signals are indexed in time order, thus are time series by definition. Local Field Potentials (LFP) are neural signals recorded from the extracellular region surrounding the neurons, recorded from within the cortical tissue. The presence of noise in brain signals may cause misdiagnosis, the incorrect functioning of Brain-Computer Interfaces (BCI) device or mislead in the study of the brain’s behaviour [1]. These noise contamination, known as artifacts, have both internal and external sources. The internal sources denote contamination done by other physiological means, including eye blinks, muscle movement, heart beat, etc., whereas the external sources denote contamination introduced during the signal acquisition by the environment, such as the presence of power lines, cellphone signals, or faulty instrumental handling [2], [3]. Thus, it is imperative to detect and remove the said artifacts for a successful research or application. Given the nuisance of manual reviewing process of these artifacts, the job becomes very cumbersome and tedious and therefore automatic detection tools are needed to aid researchers in obtaining artifact free signals for further application. The identification of which sub-populations a new sample belong to, given a set of labelled observations, is referred to as a classification problem. In recent years machine learning (ML) has attracted much attention and has been successfully applied to various classification and prediction tasks in diverse fields, such as biological data mining [4], [5], image analysis [6], financial forecasting [7], anomaly detection [8], disease detection [9], [10], natural language processing [11], [12] and strategic game playing [13]. The most commonly employed approach for the classification task is k-nearest neighbour classifier with k=1 and dynamic time warping as a distance measurement, the method is known as 1-nearest neighbour with dynamic time warping (1-NN DTW) [14]. There has also been models suitable for time series analysis and the popular one is the recurrent neural networks (RNN). These networks have the characteristic that they contain feed-back connections, that allows them to store information about the past states and process variable length sequences of inputs. Therefore, they are applied in cases such as temporal processing and learning sequences. Despite the popularity, RNN models are hard to train as they suffer the vanishing gradient problem, caused by the re-application of the hidden layer’s weight to themselves during back-propagation. Long-Short Term Memory (LSTM) is a subtype of RNN that can overcome this problem. The aim of this research is to develop an automatic artifact detection tool for raw LFP recordings based on LSTM neural network architecture. Different combinations of architecture configurations and hyperparameters have been explored during this development process, and a comparative study between this model and a previously reported feed forward neural network have been communicated.