close
close

Performance study of epilepsy detection from noisy EEG signals using the base-2 meta-stacking classifier

Data preparation and processing

In this study, we used the world’s largest publicly accessible EEG database, the so-called TUH EEG corpus database8th. The number of channels used for recording EEG signals is 32. Some channels are non-EEG channels, e.g. B. (EEG-KKG and EEG-RESP). We did not use these channels29. In this data set, 10-20 electrode placement systems are used. This dataset contains annotation files that help us gain insight into each channel’s event. Here we used data from 10 different patients (5 epileptics, 5 normal patients). More detailed patient information can be found in the additional information.

EEG can include muscle activity, eye movements, power line interference, and interference from other devices. These are called noise from EEG signals. The main purpose of EEG signals is to record the brain’s cerebral electrical activity. However, it can also record the electrical activity that is not generated by the brain region of the brain, which is known as artifact of EEG signals. This noise and artifacts do not contain essential information that could aid the analysis of EEG signals.

When analyzing EEG signals, a dilemma arises due to noise and artifacts. By removing noise and artifacts, the output of EEG signal analysis can be significantly positively increased. In the previous study, researchers only used filtering to remove the noise artifact. In this study, we also used manual noise reduction for better results.

Signal analysis and feature extraction

A bandpass filter is the most effective way to remove noise from the EEG signal. In our study, EEG signals were passed through a bandpass filter with a cutoff frequency between 0.1 and 44 Hz, resulting in high-frequency noise and separation of low-frequency redundant signals. MATLAB EEGLAB was used to visualize and filter the signal. EEG signals before and after filtering are presented in additional information.

After filtering the signal, noise and artifacts were manually removed from the signal using the annotation files. To detect the noise, we used the image shown in the annotation files. EEG signals before and after noise removal along with the artifact are presented in the supporting information.

Since the TUH EEG corpus data set includes a multi-channel EEG signal, it is necessary to select the corresponding channels. For channel selection, we used statistical features such as mean, median and standard deviation. First, we calculated statistical features for each channel of the EEG signal. We then created a correlation and calculated the p-value of the mean, median, and standard deviation for each channel of the EEG signal. We then selected two channels that had the highest correlation and p-value.

In this study, we segmented the normal EEG signal and the epileptic EEG signal into 5-s fragments. This 5-s EEG signal was then used for feature extraction. Other research studies have used different signal fragments, such as 0.1 s302s31.324s335s23.34and 60s25.

In the context of signal processing, features refer to specific properties of a signal. In addition, features provide more relevant information about the signal context. To extract features, various mathematical calculations and algorithms are applied to the raw signals. For example, EEG signals have numerous features. To extract these features, various techniques are used.

Based on the idea of ​​signal processing, a signal can have many properties. However, the meaning of the features is not the same. Different features have different meanings. The feature ranking shows the importance of the features of that particular signal.

Machine learning framework

A machine learning model is an algorithm that learns patterns from the given data to make predictions and decisions without being explicitly programmed. These models first process data, learn from data, and make decisions and predictions on unknown data.

Classification indices indicate the performance of machine learning models on classification tasks. These metrics indicate how well machine learning performs at classification. Therefore, we can identify which model can be used for our set classification task. In this study, we used four classification indices such as accuracy, precision, recall and F1 score.

To increase the robustness of our results, we also used cross-validation. The basic idea of ​​cross-validation is to divide the data set into multiple subsets, train and test the model on different subsets, and then aggregate the results to obtain a more robust assessment of model performance.

In this method, multiple base models are trained independently on the training data, each generating its own predictions or decisions. The main reason for this is that different models can capture different aspects of the data. All models use the same feature value and make their predictions individually. Then this prediction can be used for classification or prediction, which may outperform the single model.

A metaclassifier is a high-level model that combines the predictions or decisions of multiple base models to make a final prediction or classification. The purpose of the metaclassifier is to learn how best to combine the predictions of the base models to make a final prediction or classification. It takes into account the strengths and weaknesses of the basic models and attempts to exploit the complementary information they provide.

An important innovation in our methodology is the use of a batch classifier, which is a combination of a base model and a metaclassifier. The idea behind stacking is to increase prediction performance. In this study, we used two base models and then passed the output of the base models to the metaclassifier.

Suggested metrics

In this study, we proposed a metric to represent the importance of features. First, all feature ranks for different models are calculated based on permutation feature importance35,36,37,38. Different models resulted in different functional ranks. To solve this dilemma, we proposed a new metric called DF-A (Discriminant Feature Accuracy). In this metric, accuracy implies the marginal accuracy for the selected model. For example, DF-90 means that the models that gave an accuracy of 90 percent or more are taken into account. The cumulative order is then calculated for selected models for all functions. Cumulative feature order is the sum of the feature order for a given feature for the selected models. The most discriminative feature has the lowest feature order value. The features are then arranged in ascending order of the cumulative feature order. In this way, we calculated the value of DF-A, which shows the importance of features of a given signal for a given task.

Proposed model

In this study, we used two ensemble models to reduce computational complexity. The output prediction of the model is used to develop a new data set. This metaclassifier is then used with the new data set. In this way, our model shown in Fig. 1 outperformed all other models.

illustration 1
illustration 1

Batch classifier (combination of base model and metaclassifier).

Proposed methodology

Here, Fig. 2 shows the novel methodology used in this study for epilepsy detection along with the feature assessment.

Figure 2
Figure 2

Graphical representation of the proposed methodology of this study.