Epileptic Seizure Detection by Cascading Isolation Forest-Based Anomaly Screening and EasyEnsemble

—The electroencephalogram (EEG), for measuring the electrophysiological activity of the brain, has been widely applied in automatic detection of epilepsy seizures. Various EEG-based seizure detection algorithms have already yielded high sensitivity, but training those algorithms requires a large amount of labelled data. Data labelling is often done with a lot of human efforts, which is very time-consuming. In this study, we propose a hybrid system integrating an unsupervised learning (UL) module and a supervised learning (SL) module, where the

UL module can significantly reduce the workload of data labelling.For preliminary seizure screening, UL synthesizes amplitude-integrated EEG (aEEG) extraction, isolation forest-based anomaly detection, adaptive segmentation, and silhouette coefficient-based anomaly detection evaluation.The UL module serves to quickly locate the determinate subjects (seizure segments and seizure-free segments) and the indeterminate subjects (potential seizure candidates).Afterwards, more robust seizure detection for the indeterminate subjects is performed by the SL using an EasyEnsemble algorithm.EasyEnsemble, as a class-imbalance learning method, can potentially decrease the generalization error of the seizure-free segments.The proposed method can significantly reduce the workload of data labelling while guaranteeing satisfactory performance.The proposed seizure detection system is evaluated using the Children's Hospital Boston-Massachusetts Institute of Technology (CHB-MIT) scalp EEG dataset, and it achieves a mean accuracy of 92.62%, a mean sensitivity of 95.55%, and a mean specificity of 92.57%.To the best of our knowledge, this is the first epilepsy seizure detection study employing the integration of both the UL and the SL modules, achieving a competitive performance superior or similar to that of the state-of-the-art methods.Index Terms-Seizure detection system, unsupervised learning, supervised learning, EEG, aEEG, anomaly detection.

I. INTRODUCTION
E PILEPSY, as one of the common neurological diseases, affects more than 50 million people of all ages worldwide and leads to a major international public health concern [1].It is characterized by irregular seizures, repeated seizures or severe convulsions, and may bring out deterioration of the physical condition, intellectual development and even become life-threatening.Electroencephalography (EEG), an electrophysiological monitoring method by recording the electrical activity of the brain using multi-channel sensors, is one of the primary methods for diagnosing and detecting epilepsy [2], [3].However, labelling the beginning and end time of seizures is time-consuming.Moreover, with the fatigue caused by long-duration work, manual inspection is prone to increase errors.Therefore, developing an effective automatic epileptic seizure detection method can considerably reduce the workload of medical staff, and greatly support the life of epileptic patients [4].
Nowadays, supervised learning (SL) is the mainstream machine learning approach for EEG-based automatic seizure detection [5].In recent years, many SL methods based on different classifiers have been developed for seizure detection, such as support vector machines (SVM) [6], convolutional neural networks (CNN) [7], and Takagi-Sugeno-Kang (TSK) fuzzy system [8]- [10].Bhattacharyya et al. [11] extracted discriminative features from different oscillatory levels using the multi-channel extension of empirical wavelet transform (EWT).Recently, deep learning-based seizure detection methods have predominantly attracted researchers' interest, mainly due to their superiority in automatic feature learning directly from the raw data, and due to the high performance and robustness in detecting seizures.Tian et al. [7] designed a multi-view deep feature extraction for seizure detection method based on fast Fourier transform (FFT), wavelet packet decomposition (WPD), CNN and TSK fuzzy system.These works are evaluated on CHB-MIT dataset and their results all exhibit the potential of machine learning and deep learning methods for seizure detection.
However, the above studies are all SL-based methods, where large amounts of labelled data are required, especially for deep learning methods requiring a large number of parameters to be optimized.With a small labelled dataset, the deep learning-based methods may have constrained generalizability due to the over-fitting problem.An effective approach to address these issues is to utilize an anomaly detection method based on unsupervised learning (UL), which does not require data labelling.Tsiouris et al. [12] designed a simple rule-based seizure detection method for detecting an anomaly seizure epoch.You et al. [13] utilized complex generative adversarial networks as an anomaly detection method to detect seizures automatically.However, the seizure detection rate (SDR) of the UL method adopted in these two studies was much worse than SL methods.In consideration of the trade-off between the requirement of the data labelling and the performance of seizure detection, a hybrid seizure detection method that combines the UL method and the SL method is proposed.It is dedicated to utilizing a small amount of labelled data for training while still aiming for favorable performance in seizure detection.In the UL module, a preliminary screening based on the amplitude-integrated EEG (aEEG), isolation forest and silhouette coefficient (SC) is performed to quickly distinguish between the determinate subjects (seizure segments and seizure-free segments) and indeterminate subjects.The subjects whose SC value higher than the threshold belong to determinate subjects (Group U) and these results of determinate subjects from UL modules contribute as the partial final results of our proposed system.For the subjects whose SC is lower than the threshold, they belong to indeterminate subjects (Group S).Afterwards, the indeterminate subjects are passed to the SL module for further detection of seizures, which is expected to perform better than the UL module.
This paper proposes a novel pipeline framework for automatic seizure detection combining UL and SL from a small labelled dataset.The main contributions are summarized as follows: First, this is the first work to integrate UL and SL methods in automatic seizure detection and this is also the first work that attempts to utilize the aEEG and isolation forest for the identification of seizure segments.Second, with the UL module, preliminary screening that can quickly assign subjects into determine subjects and indeterminate subjects.For these determined subjects, the seizure-free segments and seizure segments can be obtained using UL method.Third, as the time-compressed EEG on a semi-logarithmic scale, aEEG has been explored in the preliminary screening.The feasibility of the aEEG is investigated and verified in the identification of seizure segments and seizure-free segments.Fourth, the isolation forest method combined with the SC are proposed in the UL part.The impacts of SC on the performance and the optimal range of SC are investigated.
The remainder of the paper is organized as follows.Section II provides the details of our proposed method.Results are demonstrated in Section III and discussed in Section IV.Finally, we conclude the paper in Section V.

II. MATERIALS AND METHODOLOGY
An overview of our seizure detection system is stated in this section.The UL module includes aEEG extraction, anomaly detection, adaptive segmentation and anomaly detection evaluation.Once a recording is classified as a dubious recording, all data from the same subject will be fed to the SL module for further analysis.The SL module includes feature extraction and EasyEnsemble.The flowchart of our proposed method is shown in Fig. 1.

B. UL Module
The UL module performs preliminary screening on the input data, and distinguishes indeterminate subjects from the determinate subjects.
1) aEEG Extraction: aEEG, as a compressed transformation of EEG signals, provides a global overview of brain cerebral activity and has been widely applied in seizure detection [16], [17].Many commercial EEG devices, such as CerebraLogik, Brainz, and UniqueC, can export EEG and aEEG [18].As a type of time-domain feature of EEG, aEEG is far less time-consuming for visual inspection than traditional EEG features and is easy to interpret even for non-specialists.We employed aEEG in our work.
The procedure of aEEG extraction includes four steps: asymmetrical filtering, rectification, envelope detection, and time compression [18] c) Envelope detection: The envelope signal is acquired by squaring and utilizing the low-pass filtering-based envelope detection method with a first-order to produce an approximate smooth curve, representing the trend of the raw EEG data amplitude variations.A first-order Butterworth filter with a cut-off frequency of 0.375 Hz is applied.The envelope signal is shown as the red line in Fig. 2(d).
d) Time compression: To highlight the macro trend, time compression was achieved by compressing the tracing in the time axis.The sampling rate in the CHB-MIT dataset is 256 Hz, the compression rate is 256:1 on the time axis.Then, each epoch's maximum and minimum amplitudes (every 256 points) were extracted as the upper and the lower terminal points of the associated aEEG vertical line.To reduce the dynamic range of large fluctuations, amplitude integration is applied by performing logarithm operation on the values between 10 U V and 100 U V .After the whole transformation procedure, aEEG features can effectively enlarge the spike shape wave to identify epileptoid discharge.The signal after time compression is shown in Fig. 2(e).The upper margin of aEEG tracings (as shown in Fig. 2(f)) is used for further analysis.
2) Anomaly Detection: After extracting aEEG tracing, the next step is to detect the seizure epoch using anomaly detection.Anomaly detection, an effective method to solve two-class imbalanced classification tasks without any training process, has not been systematically investigated in the context of seizure detection yet [19].In our work, anomaly detection mainly includes isolation forest and adaptive segmentation.
The isolation forest, with linear computational complexity, is an efficient anomaly detector based on the concept that anomaly sample points are closer to the tree's root than normal ones [20].The isolation forest algorithm involves two stages: a) Modeling stage: An iTree is a complete binary tree, and its child nodes can only be 0 or 2.An iTree isolates each sample to a leaf node after building the iTree.Let X be the transformed aEEG after feature extraction.
The main modeling stage involves two steps: 1) To construct an iTree, each attribute q from X and a split value p generated between the maximum and minimum values of the attribute q in the data are randomly selected.If the data value in attribute p is less than q, it will be placed on the left child tree of the current tree node.Otherwise, it will be assigned to the right subtree.2) Repeating the previous step to construct the left and right subtree, until either: (a) the tree reaches an artificially designed height limit, (b) |X| = 1, or (c) all data in X have the same values.By repeating the above steps to produce n iTrees, we can construct the iForest anomaly detection model.
b) Evaluating stage: The path length h(x) is a metric of the degree of susceptibility to isolation.h(x) is measured by the number of edges M j traverses an iTree from the root node until the terminating node.The length of the path determines whether the data is an anomaly or not.A deep path length represents measurement sample is more likely to be classified as normal instances, whereas the shorter path means low susceptibility of isolation.
For any anomaly detection, an anomaly score is required for evaluating the degree of anomaly.The difficulty of obtaining an iTree score is that the complexities of the increase in the maximum feasible height and the average possible height are different.The former complexity is in the order of n, while the latter one is in the order of log(n).Therefore, the normalization of h(x) by any of the above terms cannot be directly compared.Due to the equivalent structure to Binary Search Tree (BST), the average h(x) estimation is the same as BST.Therefore, the estimation of the average path length method for BST is used in iTree.The average path length of unsuccessful search in BST is given in Equation (1): where the harmonic number H (i ) can be estimated by the sum of ln(i ) and Euler's constant ε (ε = 0.5772156649).The c(n), the average of h(x) given n, is used for normalizing h(x).The anomaly score s of sample x is calculated by: where E(h(x)) is the average of path length from a collection of iTrees.
3) Adaptive Segmentation: Because an epileptic seizure is continuous for dozens of seconds, and the number of seizure are not fixed for each recording, setting the anomaly proportion manually to determine abnormal point is not suited for seizure detection problems.Therefore, we design an adaptive segmentation used for abnormal segment detection problems with unfixed anomaly proportions.
After obtaining the anomaly score s, when multiple high s values (potential abnormal sample) appear continuously, the potential seizure can be detected.In addition, we divide the seizure sample into starting sample of seizure, the intermediate state of seizure and the terminal sample of seizure.For each recording, each anomaly score vector can be obtained.The main steps of adaptive segmentation are as follows.(1) The anomaly score of high-frequency noise (caused by, for example, swallowing, frown) is high but only lasts a few seconds.Therefore, a moving average filter is applied to prevent the classification of the segment with a high score but short length as seizure samples.(2) The six local maximum in anomaly score are searched and ranked by the amplitude.The onset for one recording is at most six times.The global maximum (the maximum in local maximum) is the first intermediate state sample.Because the seizures in the same patient often belong to the same type, their anomaly scores are likely similar.Accordingly, the rest global maximum higher than 90% of the global maximum will be recognized as intermediate state samples.(3) After recognizing the intermediate state samples, the starting and terminal samples of a seizure can be determined by identifying a vector's front and back valleys using a differential coefficient.Finally, the seizure samples and normal samples can be obtained as the UL module result.
4) Anomaly Detection Evaluation: Anomaly detection evaluation: The cluster results in seizure/normal samples can be obtained after adaptive segmentation.However, the cluster performance cannot be guaranteed because of missing the training procedure.Therefore, the anomaly detection evaluation indicator is adopted to select those indeterminate subjects for further analysis using the SL method.These indeterminate subjects have probably low performance.
The clustering evaluation index, SC, is widely applied to calculate the performance of a clustering technique [21].It is also used for clustering quality evaluation in anomaly detection.SC can be calculated by the average of intra-cluster distance a and the average of nearest-cluster distance b for each sample, as shown in Equation (3) [22].Usually, the SC value ranges from −1 to 1.An SC value closing to 1 represents an excellent clustering performance [23].An SC value closing to −1 represents an unreliable clustering performance [24].
After calculating the SC of each recording for all patients, the minimum of SC for each patient, denoted by Min(SC), is used for anomaly detection evaluation.Additionally, we set the threshold value of Min(SC), namely Thr(SC) (see Eq. ( 4)), as the mean of all Min(SC) values from all patients.When Min(SC) for a certain subject is higher than the threshold, the data were assigned into Group U (determinate subjects).The results using these data are more likely to show a high SDR.When the Min(SC) of a certain subject is lower than Thr(SC), data from this subject were assigned into Group S (indeterminate subjects), and a continuous data process using SL was implemented in this case to improve the sensitivity further.In addition, we implemented additional experiments by setting Thr(SC) from 0 to 0.5 to evaluate the rationality of setting Thr(SC).

C. SL Module
The SL module mainly includes data pre-processing, feature extraction (extracting nine types of features based on four subbands) and EasyEnsemble, as shown in Fig. 1.
1) Data Processing: The EEG data is filtered from 0.1-32 Hz using a 5-order Butterworth filter.Then, each EEG recording is divided into 5s EEG signals as segments for binary classification.
Then, nine various types of features, including absolute mean, skewness, kurtosis, line length, variance, energy, Teager-Kaiser, peak-to-peak amplitude and average power, were extracted in each sub-band.
3) Classification: EasyEnsemble is an effective method for the class imbalance problem, which focuses on minority class by generating T relative balanced subproblems [26].The procedures of EasyEnsemble are as follows: Firstly, it divides the whole seizure-free data into T equal parts.Afterwards, it combines the whole seizure data and each 1/T seizure-free data.The final decision is obtained by combining results obtained from AdaBoost.Compared with common methods used in the anomaly detection module (such as over-sampling and threshold moving), the EasyEnsemble demonstrates its benefit in decreasing information loss from random undersampling [26].The classification result is used for evaluating seizure epoch recognition ability.
4) Post-Processing: Because all epileptic seizures last at least six seconds, a seizure event typically consists of at least two seizure epochs.As a result, in order to minimize FAR, the SL module's post-processing is utilized, which considers more than two successive epochs as seizure epochs as a single seizure event.

D. Performance Evaluation
In this study, we employed five performance assessment indices: accuracy, sensitivity, specificity, SDR, and false alarm rate (FAR).The accuracy, sensitivity, and specificity are common segment-based level evaluation indicators.SDR and FAR are event-based performance indicators.SDR denotes the number of detected seizure events to the total number of seizure events.The signal from the onset of a seizure to the finish of a seizure is generally considered an event.Once two consecutive seizure epochs in one seizure event are correctly identified, we defined that this event is correctly identified both for UL and SL modules.FAR denotes the number of false alarms reported in an hour.
In our work, two-fold recording-independent crossvalidation is applied for performance estimation.Specifically, all recordings for the i th patient is divided into two sections.One is used for training, and the other is used for testing.The same procedure repeats with the training and testing roles of the two sections switching.The training rate for the SL module is 50%.The training rate (TR) is calculated according to the formula.
T R = N S T N P * 50% where N S presents the number of patients in Group S, and T N P is the total number of patients.
To evaluate the UL module and SL module, we perform the additional two experiments on these two single modules in all 24 patients and the Wilcoxon test is used to compare their performance.

III. RESULTS
The accuracy, sensitivity, specificity, SDR and FAR of each patient and the mean of the 24 patients for the whole system combining the UL module and the SL module are summarized in Table I.Here Thr(SC) is set to be 0.19 based on the calculation by Eq. ( 4).The patients in bold print in Table I are those Min(SC) values that are higher than 0.19 to be assigned to Group U (Group U: patient 1, 2, 3, 4, 5, 7, 8, 9, 11, 19,22,23).The results of Group U in Table I are obtained using the UL method.The remaining patients are those Min(SC) are lower than 0.19 to be assigned to Group S (Group S: patients 6, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 24).The result of Group S is obtained using the SL method.Due to 12 patients in Group U, the training rate of the overall system is 25%, according to Eq.( 5).We achieved an accuracy of 92.62% ± 1.17%, a sensitivity of 95.55% ± 1.06%, a specificity of 92.57% ± 1.21%, an SDR of 100% and an FAR of 1.38 (/h) with 25% of training rate.
To compare the performance of the UL method and the SL method, the UL and SL modules are applied on the 24 patients, and the accuracy, sensitivity, specificity, and SDR are shown in Fig. 3.The results of Group U indicate that the performance of the UL method is slightly better than the SL method, but the performance of these two methods have no statistical differences in term of accuracy (p>0.05),sensitivity (p>0.05) and specificity (p>0.05).The results of Group S in Figs.I (a), (c) and (d) show that using the SL method in Group S contributes to better performance than using the UL method, especially for accuracy (p<0.05),specificity (p<0.05) and SDR (p<0.05).
The Min(SC) score for each patient calculated by the detection results and the ground truth label are shown in Fig. 4. As shown in Fig. 4, the Min(SC) of patients 6, 12, 13, and 16 for the ground truth label are less than 0. Negative values in SC value generally indicate that a sample does not assign to the right cluster.Meanwhile, the SDRs of these four patients are the lowest among the 24 patients and all lower than 50%.In addition, the patients (e.g., patients 14, 17, 20, 21, and 24) have an SDR of 100%, but their Min(SC) obtained by isolation forest is lower than the Thr(SC).These five patients' specificity values are lower than 88%.Fig. 5 shows the accuracy, sensitivity, specificity, SDR and the number of selected patients (the number of patients in Group U) when the threshold value of Min(SC) increases  from 0 to 0.5.Because the specificity and accuracy have similar values in seizure detection tasks (imbalance problem), they are very close.Sensitivity and SDR are similar evaluation indices where specificity is for seizure segments detection and SDR is for seizure events detection.Therefore, they are very close to each other.There are four observations from Fig. 5: (1) When the threshold of Min(SC) increases from 0 to 0.5, the number of selected patients decreases from 20 to 1.
(2) The overall trend is firmly upwards for accuracy, sensitivity, specificity and SDR when the threshold increases from 0 to 0.06.(3) When the threshold increases from 0.06 to 0.5, the accuracy, sensitivity, specificity, and SDR have no evident changes.( 4) When the threshold of Min(SC) increases from 0.1 to 0.2, the accuracy, sensitivity, specificity, SDR and the number of the selected patients do not have any change.These findings indicate that when Thr(SC) ranges from 0.06 to 0.2, the present result and the number of patients in Group U can be maintained.

IV. DISCUSSION
In recent years, automatic seizure detection methods have been extensively studied.These methods can be generally divided into two categories: the SL-based and the UL-based methods.For the SL-based methods, most previous studies demonstrated superiority in terms of the sensitivity and specificity in patient-dependent evaluation with a high training rate.Although high performance can be achieved, these studies also bring out a significant that the practical use of these methods may be constrained with the requirement on a large training dataset.A few studies also adopted a relatively small training rate to verify their performance.However, the performance also sharply decreases, especially for the sensitivity [33].The UL-based method is an emerging method, and its superiority is without requiring labelling data.However, it has an intractable defect, where a high SDR (>90%) is difficult to obtain.Therefore, combining UL and SL methods is a novel and alternative idea in automatic seizure detection.However, there is a problem to be solved: how to combine UL and SL modules effectively.Fortunately, the internal evaluation index SC can effectively select indeterminate subjects, thereby combining the UL and SL modules.
Only a few studies have employed UL methods for seizure detection.Tsiouris et al. [12] designed a rule-based seizure detection logic method based on four conditions for identifying segments where the EEG signal energy is accumulated intensively among the delta (< 4 Hz), theta (4-7 Hz) and alpha (8-13 Hz) frequency bands, achieving an SDR of 88% with 5% inspection value [12].Compared with this work, our proposed UL method based on aEEG and isolation forest does not require predefined rules and parameters while achieving a higher performance (accuracy: 83.96%, sensitivity: 89.20%, specificity: 89.89%) using all recording data (13 recordings of patient 12 are excluded in [12]).However, the current performance still is lower than SL methods.As shown in Fig 3, the accuracy, specificity and SDR of the SL method are significantly better than the UL method for Group S, which shows that the UL module is difficult or impossible to use alone.
In addition, the rationality of the internal evaluation index SC needs to be further explored.We can observe from Fig. 3 that patients 6, 12, 13, and 16 have a poor SDR in the UL module.Many works proved that seizure segments of these four patients are very difficult to identify [12], [33], [34].The reason may concluded as follows: (1) The proportion of seizure-free segments with noise and artifact is very high compared with the other patients; (2) If seizure duration is too short, the training model will classify it as seizure-free epoch with noise.The average seizure length for patient 16 is just 8.4 seconds, with the lowest epoch lasting only 6 seconds.Furthermore, as shown in Fig. 4, the Min(SC) value derived by the ground truth label for these four patients (patients 6, 12, 13, and 16) is less than 0. Meanwhile, the performance of these four patients obtained by the UL module is also dissatisfactory.These findings suggest SC value for these four indeterminate subjects is significantly correlated with the classification result.In addition, the patients, including patients 14, 17, 20, 21, and 24 have an SDR of 100%, but their Min(SC) obtained by isolation forest is lower than the Thr(SC).These five patients' specificity values are lower than 88%.That is because a lot of seizure-free epochs were misdetected as seizures, decreasing the specificity and Min(SC) for this type of patient.Besides, calculating the difference between Min(SC) by predicted labels (Fig. 4) and Min(SC) by the ground truth label (Fig. 4) can judge whether the result is accurate.For example, the difference for patients 10, 14, 20, 21, 24 is more than 0.25, and their accuracy is lower than 90%.When the difference between Min(SC) obtained by detection results and the ground truth label is lower, the detection results are relatively accurate.These contents demonstrate that the SC in our system is an effective evaluation index in primary screening indistinguishable patients.Besides, the changing trend in Fig. 5 shows that when the threshold value changes between 0.06 and 2, the performance and selected patients only slightly change, which proves that the performance is not limited by Thr(SC).
To evaluate the performance of the SL method, 10-fold cross-validation was performed.The comparison of the results of our SL method and five comparative studies evaluated on the same CHB-MIT dataset using the 10-fold cross-validation published from 2019 to 2020 are presented in Table II [6], [27]- [29], [7].These works with a 90% training rate all are used 10-fold cross-validation.The sparse representation [27], artificial neural network (ANN) [28], SVM [6], [29], multiview TSK fuzzy system [7] were used or designed to improve the discriminant ability of the seizure detection system.However, the EasyEnsemble classifier differs from classifiers mentioned above, which can make full use of potential useful seizure-free epochs by randomly and repeatedly sampling majority classes to solve imbalance tasks.As a result, the proposed SL module can achieve the highest sensitivity (98.25%) compared with the other five works (< 97.5%).
To evaluate the performance of our overall seizure detection method, the results of state-of-the-art methods using leave-one-record-out cross-validation are shown in Table II for comparison [25], [31], [32].These three related works are based on leave-one-record-out cross-validation.These works applied different post-processing for reducing FAR.Li et al. used multi-channel integration, moving average filter, and collar technique to remove sporadic false detection, decreasing FAR.Tang et al. set the necessary time for continuous monitoring as three epochs.Although our FAR is lower than these three works, we can achieve an SDR of 100%.Actually, when we adjust the necessary time for continuous monitoring in post-processing as three epochs, the corresponding SDR and FAR will change as 97.5% and 0.91(/h).This finding indicates that post-processing can adjust the trade-off between SDR and FAR.
To evaluate the performance of our overall seizure detection method, the results of four state-of-the-art methods with a training rate of less than or equal to 50% are shown in Table II for comparison [5], [7], [11], [30].These studies designed different structures/models to reduce the performance degradation caused by the decrease of the training rate.Our system obtained much higher sensitivity than works using the same training rate [30].Although the work by Zabihi et al. [30] achieved a higher accuracy (95.11%) and specificity (95.16%), it excludes patient 15 and do not use cross-validation.In [5], [11] and [7], with a training rate of 50%, high accuracy and specificity were obtained, while lower sensitivity was presented as compared to our model evaluated with a training data of 25%.
Compared with these previous works, we use a different view in which the partial patients are fed into the SL module, and the remaining patients using the UL method have no training procedures, reducing the training rate of the entire database.The side effect of the previous view is that when training data are less for a patient-specific model, the sensitivity would have a high probability of drastic reduction.For example, patient 22 only has three times seizures.When only one seizure is fed into the classifier as training data, the final sensitivity is much lower than the case with two seizures as the training set [30].However, our results prove that adding an unsupervised learning method in an automatic seizure detection system is an effective and novel idea to obtain superior performance than the state-of-the-art methods and decrease the overall system's training data.
A lot of ensemble methods in epilepsy seizure detection tasks often use the same feature extraction strategy in various modules [35].Our system uses two different feature extraction methods for three reasons.Firstly, the function of the UL module in our system is designed for the preliminary screen, which can quickly determinate those determinate subjects whose seizure epoch can be clustered using isolation forest.We hope the feature extraction part of the UL module is relatively simple, highly efficient, and easy-to-understand.It means the features that can be easily exported or quickly extracted are the best choice.For aEEG, it meets all our requirements.aEEG can be quickly exported from a lot of EEG devices like CerebraLogik, Brainz, and UniqueC.aEEG also can be easily and quickly extracted, as demonstrated in our previous work [18].Meanwhile, physician are more knowledgeable about the relationships between the shifting trend of the aEEG and the seizure state.Thus, aEEG is served as an appropriate feature in the UL module.Secondly, we have also added an experiment to compare the performance of the UL module using aEEG and time-domain features.The results are listed in TABLE III.The time-frequency features indicated in TABLE III, including the absolute mean, skewness, kurtosis, line length, variance, energy, Teager-Kaiser, peak-to-peak amplitude, and average power, are also employed in the SL module.The results show that aEEG can obtain higher sensitivity in the UL module.Finally, although aEEG is already obtained by the UL module, aEEG is not suitable for the SL module.The reasons are shown as follows: asymmetrical filtering (an important step of obtaining aEEG) requires that the frequency of input data must cover 2-15 Hz.There are no sub-band (delta, theta, alpha, and beta) for the SL module that its frequency can cover 2-15Hz.Therefore, aEEG cannot be extracted in the SL module.The above reasons result in two different feature extraction methods used in our system.
However, the current system still has some limitations, which will be addressed in our future work.Firstly, due to the missing specific seizure type information in the CHB-MIT dataset, we cannot obtain the link of result of seizure type.In the future, more clinical data will be collected to further verify our proposed method.Based on these clinical data, the result of different seizure type data using UL and SL methods will be analyzed.Secondly, several subjects using UL method can obtain 100% of SDR, but they still were classified into Group S using SC.In addition, the highest SC calculated by the ground truth label is far below 1.All internal cluster validity indices, including SC, are mainly proposed for dealing with data-balanced tasks.Therefore, the internal cluster validity indices used for seizure detection problems will be designed in the future.

V. CONCLUSION
This paper proposes a hybrid method that utilizes a small amount of labelled data for model training while achieving satisfactory seizure detection performance.It combines both the UL and the SL methods, where the UL method is adopted as the preliminary screening to distinguish determinate subjects and indeterminate subjects, and the SL method is performed as the enhanced classification of the indeterminate subjects.To our best knowledge, it is the first work synthesizing UL and SL methods in seizure detection.Meanwhile, it is also the first work to utilize the aEEG and isolation forest for prescreening.The proposed method based on the UL and the SL is evaluated on 24 patients from CHB-MIT, achieving an accuracy of 92.62%, a sensitivity of 95.55% and a specificity of 92.57% with a training rate of 25%.Extensive experimental results demonstrate that the proposed method outperforms other state-of-the-art methods.The present study on seizure detection provides a practical option based on sEEG signals in clinical diagnosis.
. Details of each step are introduced as follows: a) Asymmetrical filtering: An asymmetric bandpass filter based on the Park-McClellan algorithm is designed.Within the passband (2-15 Hz), the amplification of signals increases with a slope of 12 dB per decade, while frequencies below 2 Hz and above 15 Hz are heavily attenuated.The signal after asymmetrical filtering is shown in Fig. 2(b).b) Rectification: The filtered signal is rectified by converting negative voltages to positive values.The rectified signal is shown in Fig. 2(c).

Fig. 3 .
Fig. 3.The accuracy, sensitivity, specificity and SDR of the 24 patients using UL and SL methods (MU: mean result of Group U, MA: mean result of the 24 patients).

Fig. 4 .
Fig. 4. The Min(SC) for the 24 patients obtained by detection results and ground truth label (The orange bar and the gray bar represent the Min(SC) value calculated by ground truth label and detection results, respectively; the green line around 0.2 are the Thr(SC)).

Fig. 5 .
Fig.5.The changing trend of accuracy, sensitivity, specificity, and SDR, the number of selected patients (the number of patients in Group U) when the Thr(SC) changes from 0 to 0.5.

TABLE I THE
PERFORMANCE OF THE PROPOSED ALGORITHM EVALUATED ON CHB-MIT (ACC: ACCURACY, SEN: SENSITIVITY, SPEC: SPECIFICITY.THE RESULT OF PATIENTS IN BOLD PRINT (GROUP U) ARE OBTAINED BY UL METHOD.THE PATIENTS MARKED WITH UNDERLINE (GROUP S) ARE OBTAINED BY SL METHOD)

TABLE II COMPARISON
OF EXISTING METHODS AND THE PROPOSED METHOD EVALUATED ON CHB-MIT DATASET (TR: TRAINING RATE; INTER-RECORDING (IR): THE TRAINING SET AND TESTING SET COME FROM DIFFERENT RECORDINGS; -: NO REPORTED VALUES OR NOT APPLICABLE)

TABLE III COMPARISON
OF DIFFERENT FEATURE EXTRACTION METHODS USING THE UL MODULE FOR 24 PATIENTS AND GROUP U PATIENTS