###### Abstract  
Automated labelling of epileptic seizures on electroencephalograms is an essential interdisciplinary task of diagnostics. Traditional machine learning approaches operate in a supervised fashion requiring complex pre-processing procedures that are usually labour intensive and time-consuming. The biggest issue with the analysis of electroencephalograms is the artefacts caused by head movements, eye blinks, and other non-physiological reasons. Similarly to epileptic seizures, artefacts produce rare high-amplitude spikes on electroencephalograms, complicating their separability. We suggest that artefacts and seizures are rare events; therefore, separating them from the rest data seriously reduces information for further processing. Based on the occasional nature of these events and their distinctive pattern, we propose using anomaly detection algorithms for their detection. These algorithms are unsupervised and require minimal pre-processing. In this work, we test the possibility of an anomaly (or outlier) detection algorithm to detect seizures. We compared the state-of-the-art outlier detection algorithms and showed how their performance varied depending on input data. Our results evidence that outlier detection methods can detect all seizures reaching 100% recall, while their precision barely exceeds 30%. However, the small number of seizures means that the algorithm outputs a set of few events that could be quickly classified by an expert. Thus, we believe that outlier detection algorithms could be used for the rapid analysis of electroencephalograms to save the time and effort of experts. epilepsy; electroencephalogram; machine learning; extreme events; anomaly detection; unsupervised +
Footnote †: journal: Medical and Surgical Center named after [PERSON], Ministry of Healthcare of the Russian Federation, 105203 Moscow, Russia 1  
of a few minutes in total. Usually, this EEG data becomes a subject of manual processing by epileptologists, who spend many hours inspecting EEG signals to label the fragments containing seizures [8]. Machine learning (ML) algorithms are often implemented in EEG data processing, which includes seizure detection [9; 10; 11; 12]. These algorithms can be used to reduce the routine work of experts, helping them label seizures faster, and decreasing the number of errors caused by the human factor. The application of the ML approach in seizure labelling commonly results in classifiers capable of detecting two classes: \"seizures\" and \"normal activity\" [13]. Each classifier falls into one of two broad categories: supervised and unsupervised [14]. The supervised ML algorithm undergoes training using the labelled data of some patients before labelling data from a new patient. Using EEG recordings with manually labelled seizures, these algorithms may learn the distinctive features of epileptiform patterns to detect them on unseen EEG signals [15]. A supervised approach to epilepsy detection has shown promising results and includes state-of-the-art techniques such as deep learning (DL) [16], recurrent neural networks (RNNs) [17], and its modified version--long short-term memory (LSTM) [18]. The majority of ML methods for seizure labelling are supervised [19]. However, some limitations of supervised ML algorithms are often overlooked. Firstly, supervised methods require a large amount of pre-labelled data. The acquisition of such a dataset can be a challenging task in itself. Epileptic patterns are known to be high variable, originating from physiological features of different types of epilepsy and further exacerbated by differences in experimental conditions, and hard- and software acquisition. Secondly, one of the most prominent problems in epileptic data is class imbalance: hour and day recordings usually only contain several epileptic episodes with a total length in minutes. In many cases, the class imbalance leads to overfitting.