Enhancing Epileptic Seizure Prediction with Machine Learning and EEG Analysis

– Prediction of epileptic seizures in accurate manner and on time prediction can help in improving the lifestyle of the affected people. Many computational intelligence methods have been developed for EEG signal analysis. Since they can only handle the algorithm's complexity, new strategies have been developed to obtain the desired outcome. The goal of this work is to create an innovative method that provides the highest classification performance with the least computational expenses. This work concentrates on analyzing various deep learning models and machine learning classifiers like decision tree (C4.5), Naïve Bayes (NB), Support Vector Machine (SVM), logistic regression (LR), k-nearest neighbour (k-NN) and adaboosting model. By considering the results obtained from various classifiers, it is noted that C4.5 works well compared to other approaches. By examining the results obtained from various classifiers, this research provides valuable insights into the ensemble machine learning approaches for enhancing the accuracy and efficiency of epileptic seizure prediction from EEG signals

categorize the epileptic seizure database to regulate if the person has the seizure by using various classification approaches, as well as to examine the behaviour of the binary classifier about modifications to the classification factors.
The work is organized as follows: In section 2, various existing approaches are discussed, followed by the analysis of various existing classifiers in section 3. The numerical outcomes are discussed, and the significance of those classifiers is discussed in section 4. The solutions based on the prediction outcomes are given in section 5.
II. BACKGROUND RESEARCH Prediction of epileptic seizures is a measure in order to prevent patients from epilepsy. The most important works related to this domain are discussed below.
During the analysis, it is predominantly noted that deep learning model has been used in most of the works related to seizure prediction. This is made possible by the use of neural networks which helps in handling complex data and thereby identifies the inherent features.
Deep Learning Techniques has been used to predict the Epileptic Seizures. It uses CHB-MIT dataset. It uses Short Time Fourier Transform for noise removal. Feature extraction has been carried out using Convolutional Neural Network. Support Vector Machine (SVM) has been for classification purpose. In [28] analyses EEG signals of scalp data and acquired 92.7% sensitivity rate and specificity of 90.8%.
To predict the seizure on the signals, Convolutional Neural Network and Common Spatial Pattern has been used. The [34] uses dataset belongs to Boston Children's Hospital-MIT for processing. Band pass filter has been used to remove noises. It uses SVM classifier and analyses scalp EEG dataset and acquires 92.2% as rate of sensitivity and False Prediction Rate (FPR) of 0.12/h. Independent components are classified based on novel deep learning neural network combining time-series to improve classification, power spectrum densities and topoplots. Transfer learning approaches has been considered by [33] while producing new deep learning models. BASE dataset and EPILEPSIAE data sets are used for analysis.
Ensemble learning method based on deep learning was proposed by [35] for predicting the epileptic seizures. It uses empirical mode of decomposition for pre-processing and for noise removal, it uses bandpass filtering. During the generation of preictal segments, the class imbalance problem had been raised. Features had been extracted automatically from preprocessed data using a three-layered convolutional neural network. The output of SVM, CNN and LSTM models has been combined with the help of ensemble classifier using Model agnostic meta learning. It uses CHB-MIT dataset and an average rate of sensitivity as 96.28% and rate of specificity as 95.65% has been obtained, Kaggle seizure prediction dataset obtained by American epilepsy society has been used and an average sensitivity rate of 94.2% and specificity rate of 95.8% has been achieved on all subjects.
Epileptic seizures are predicted using Deep Learning model. It works on CHB-MIT database uses convolutional neural network. While classifying the preictal and ictal states, an accuracy of 99.47 % has been achieved. In [30] says seizure can be predicted using this method with a rate of sensitivity as 97.83 % and a specificity rate of 92.36 % before 10 min. FPR is calculated as 0.0764.
In [23] uses gated recurrent neural network and convolutional neural network along with cascading deep learning model to predict epileptic seizures. It uses CHB-MIT dataset and acquired an accuracy of 71.91% and a sensitivity rate of 74%. The model predicts seizures based on a patient specific approach.
Semi-dilated convolutional network (SDCN) has been proposed by Ramy Hussein et al., to predict the seizures and it uses continuous wavelet transform for pre-processing. Sensitivity rate of 98.80% was obtained as Seizure prediction when EEG signals of scalp data were analysed and 88.45-89.52% was obtained while analysing EEG signals of invasive data. It uses CHB-MIT dataset, challenge dataset of The American Epilepsy Society (AES) Seizure Prediction and challenge dataset of Melbourne University AES/MathWorks/NIH Seizure Prediction.
Numerous academics have studied various aspects of epileptic convulsions. A strategy to permit the thorough characterization of EEG time series signals was put out by the investigators in [10] to enhance signal categorization. The [11] proposed a neural network-based system for epilepsy identification was suggested to identify epileptic episodes from EEG data. The categorization of EEG signals using wavelet decomposition was addressed in [12]. They coupled a neural network's adaptation strategies with fuzzy logic and consistent transformations of the distribution function; assessed EEG sub-bands in terms of δ, θ, alpha, beta, and γ; and used multi-resolution decomposed and a multi-layer perceptron.
Recurrent neural networks of a certain kind were suggested for automatically detecting epileptic seizures. In [13] suggested EEG correlation measures using real data. Several entropy estimation techniques were used to analyze the EEG signals of epilepsy and control patients to identify epileptic seizures [14], [15]. The author implemented an eigenvector feature extraction approach employing computer algorithms for EEG signal detection. The [16] provided a novel hybrid computerized authentication protocol for EEG signal categorization. EEG signal categorization in [17] was accomplished using a feed-forward approach that made use of a back-propagation neural network (NN), while epileptic fit detection in [18] was performed with principal component (P-C.A.). The authors suggested a multi-layer perceptron neural networkbased classification technique for epilepsy therapies for the identification of seizure-like activity in EEG data, and then basis-based discrete wavelet entropy was published to extract features from EEGs for a seizure-detection method by the authors.
The [19] employed an AI approach for automated epileptic seizure identification using EEG signals, and the author offered sub-band non-linear parameters for seizure detection using EEGs. The DWT and K-NN classifiers [20] were recently suggested for use to identify epilepsy. The author conducted computerized epileptic fit recognition & forecast using the wavelet transformation and packet segmentation, while [21] suggested a technique for classifying EEG data to identify epileptic seizures. Hybrid machine learning approaches to identify epileptic seizures were given by [22], robust data augmentation classification models using diverse extraction of features strategies were provided, and convolutional layers for epileptic fit forecasting were examined.
Machine learning utilizes mathematical and statistical techniques to analyze data samples, enabling computers to learn and make inferences without the need for explicit scripting or programming instructions. In [23] introduced computer vision in games and analytical thinking techniques to learn which the first time this substantial improvement was acknowledged was. The fundamental idea of machine learning is to gain insight from big to foresee or make judgments based on a given goal [24]. Machine learning technology makes many time-consuming processes easier and faster. More computational capabilities and data make it easier to train machine learning models to predict events with near-perfect reliability. Various machine learning techniques are presented in several works [25]. Machine learning algorithms are often divided into supervised, unsupervised, and adequate institutional. Learning techniques like SVM may separate machine learning algorithms, Random Forest algorithm (RF), and naves Bayes (NB) are a few of the well-known machine learning) methods [25].  Table 1. depict the outcomes based on the evaluation with various deep learning and models upon comparing the techniques, a common disadvantage identified while using such model is of there is an increase in computational complexity. Because of this, real time implementation of most of the models is not possible. Patient specific analysis is a bit complex as it requires high level of computing resources.
Based on the analysis conducted, it has been identified that feature extraction and EEG signal classification pose significant challenges due to the variations in brain signals. These variations are influenced by factors such as the number of channels, brain location, and the diverse signal patterns observed across different samples. These challenges complicate the accurate extraction of relevant features and the classification of EEG signals.
Another prominent challenge faced by researchers in this field is the prediction and detection of EEG signals to achieve reliable and effective epileptic seizure outcomes using learning approaches, particularly in real-time applications. Realtime prediction requires quick and accurate identification of seizure patterns in the EEG signals, which can be challenging due to the complexities and dynamics of the brain's electrical activity during a seizure event.
Addressing these challenges is crucial for future advancements in epileptic seizure prediction. Researchers need to develop robust techniques that can handle the variations in EEG signals, optimize feature extraction methods, and design efficient algorithms for real-time prediction and detection. Additionally, collaboration and data sharing among researchers can contribute to the development of more accurate and reliable models for epileptic seizure prediction and improve the overall understanding of this complex condition.
III. DATA ACQUISITION The Epileptic Seizure Recognition Data Set utilized in this research work [18] consists of 11,500 samples, with each sample containing 178 characteristics. The dataset is well-structured, and the samples are evenly distributed. These samples are categorized into five groups, denoted as Y = 1, 2, 3, and 4, based on predefined standards.
 Class 5 -eyes open during recompilation of EEG data; this study is called EYEO.  Class 4 -eyelids closed while receiving EEG signal; in this work, this condition is referred to as E. YEC.  Class 3 -Brain tumour was confirmed after EEG from the healthy brain region was recorded; it is referred to as an HSTU. MOR.  Class 2 -EEG signal obtained where brain tumour existed, labelled TUMOR.  Class 1 -Seizure event monitoring, ES.
Every sample has 178 characteristics representing brainwave measurements/second for the various instances. Fig 1 displays the epileptic seizure database sample and each class's waveform. Since only samples belonging to class 1 had an ES, our work will be divided into ES and non-ES instances, including classes 2, 3, and 4 in Table 2. Decision Tree (C4. 5) In [9] proposed the ID3 algorithm who uses information gain to construct the DTs. The extended form of the ID3 algorithm is C4.5, a classifier where the information gain ratio is adopted for classification. It is designed using divide and conquers concept and expressed as in Eq. (1) & Eq. (2) Here, ′ ′ is dataset partitioning, ( ) is sub-set before splitting, ′ ′ dataset values and is the ℎ target value proportion. The fitness function is evaluated and the flag bit is allocated for feature characterization. From the ′ ′ population, the attribute with 1 is a feature and 0 is unselected feature as in Eq. (3): The error prediction rate is utilized as fitness function for feature selection as depicted in Eq. (4) & Eq. (5): A = number of properly predicted samples total samples Here,′ A′ represents accuracy, LS specifies feature subset length, is total features and ′ represents weighted parameter and feature selection quality, = [0, 1] and ′ = 1 − . The model provides better results while handling unimodal and multi-modal dimensionality functions. The target is to offer the optimal solutions.

Support Vector Machine (SVM)
It is a supervised learning approach for classifying data into positive and negative classes as in Eq. (6) & (7): . + ≥ +1∀ = ±1 (6) . + ≤ −1∀ = −1 Here, represents vectors, and ′ ′ represents bias, the hyperplane is expressed as . = 0 which is given based on the distance among margins to improve the margin among hyperplanes. It is reduced with || || as in Eq.
The non-linear data is not classified properly. To validate the error rate, the stacking variable has to be included where = 1,2,3, . . , , and it is related to ′ ′ as expressed in Eq. (9): During kernel computation, SVM needs to determine marginal width among hyperplanes. There are diverse methods to enhance SVM algorithm-based prediction accuracy.

k-Nearest Neighbor (k-NN)
It is a supervised learning algorithm adopted for prediction problems. It measures the feature similarity to predict the new data points based on how nearer the points fit with the training set. It works superiorly for non-linear data when there is no consideration towards the data. It is used to categorize new objects with distances to labelled samples where the values represent the number of neighbourhood. It is known as the deciding factor as is decide how many neighbours can stimulate the process. When the value is set as 1, new data objects are allocated to the class on the nearest neighbour. Neighbourhoods are considered from a set of training data objects where correct classification is known already.

Naïve Bayes
NB is the statistical model that relies on the record or data point, it predicts class membership. The class with the best odds has been the most likely. The NB algorithm projects probability rather than making predictions. It is based on the Bayes theorem, where all the features are independent conditionally. NB is appropriate for categorizing high-dimensional datasets. The model considers an attribute value independent of others (class). Consider, as training data corresponding class labels. The tuple is specified as = { 1 , 2 , … , } and classes are represented as 1 , 2 , … , . The classifier predicts from the class with a high probability for the given tuple X and it predicts the tuple to iff Therefore, ( | ) is improved, class as ( | ) is improved, and it is known as the maximal posteriori hypothesis.
The attribute values are independent conditionally on one another, then.
Where specifies attribute value for tuple . When is classified, then ( | ) represents several tuples with in with value for partitioned by | , |, total tuples of class in D. The classifier identifies the class labels with class iff: The classifier is efficient that may show minimal error for classification.

Logistic Regression
Logistic regression (LR) is a machine learning technique used for classification, specifically in predicting the probability of disease occurrence by considering risk factors and categorizing each classification accordingly. It is adapted generally to categorize and specifies the probability occurrence of every classification event as in Eq. (14): Here, specifies binary dependent variables ( = 1 ℎ = 0 ), ′ ′ specifies the natural logarithms and − specifies = 0 + 1 1 + 2 2 + ⋯ + with coefficients , constant 0 , and predictors for predictors ′ ′ ( = 1,2,3 … . , ).

AdaBoost
A classifier called AdaBoost combines many weak classifiers into a single classifier. AdaBoost works by providing more weight to information that is challenging to identify and less emphasis on those who are already correctly classified. Both regression analysis and classification are possible uses [20]. Adaboost is also a machine learning-based Meta algorithm that sequentially integrates independent individual hypotheses to improve accuracy. Also, it is known adaptive boosting. The target is to convert weak learners to stronger and helps to resolve the bias issues. Step 9:Normalize hypothesis with ( ) = (∑ ∝ ℎ ( )) −1 Step 10: Generate class labels for ( , ) Step 11: Return ensemble hypothesis ( , ) V. PERFORMANCE EVALUATION A unified performance evaluation methodology for seizure detection is absent, and NSD system results are reported using different measures. Consequently, it is difficult to compare the suggested methodologies. Main seizure detection system measures are epoch-based and event-based.
The fragmentation of the signals into distinct periods, or "epochs," is the foundation of epoch-based metrics. This method is a common pre-processing phase. The collected epochs are split into two classes: historical seizure periods, often referred to as positive and non-seizure epochs typically refers to negative. As a result, seizure diagnosis is the binary issue. The classifiers designed for automatic detection typically indicate that a certain epoch falls into the favourable or unfavourable category. The effectiveness of the systems is determined by comparing the classification choices made by the classification to the manual choices made with each session through one or more EEG specialists. The classifier's conclusion is captured by the binary classification with four types: true positives (TP), epochs properly identified as seizures; false positives (FP), epochs wrongly tagged as seizures; true negatives (TN), successfully identified non-seizure epochs; and false negatives (FN).

Accuracy (Acc).
It is the number of occurrences accurately identified. The formulae given below are to determine accuracy: Precision (Pn). Precision is calculated as the ratio of accurately forecasted to all anticipated positive observations.
Recall (Rc). The percentage of total useful content that the good stuff identifies is known as recall.
Sensitivity (Sn). Sensitivities is the only positive metric considering all situations.
Specificity (Sp). It measures the number of correctly detected true negatives and is computed as follows: F-measure. The F1 score is a harmonic average of memory and accuracy. The highest possible F grade is 1, which denotes faultless accuracy and recall.
As determined by professionals, a seizure's "event" is often defined as the period between its onset and termination. Some of the metrics are.
• Good Detection Rate (GDR) measures the system's power accuracy in identifying seizure occurrences. If the system recognizes at least one epoch during seizures, it has successfully detected the event. • False Discovery Rate (FDR) gives the fraction of falsely recognized seizure occurrences.
• False Detection per Hour (FDH) expresses how many seizure episodes the system detects in one hour that does not coincide with the events assigned labels by the expert.   Table 3 and Table 4 depict the outcomes based on the evaluation with various classifier models. The accuracy of C4.5 is 97.09% which is 1.89%, 1.39%, 2.29%, 15.15% and 5.11% higher than k-NN, NB, SVM, LR and Adaboosting. The recall of SVM is 89% which is 7%, 4%, 2%, 3% and 5% higher than k-NN, NB, C4.5, LR and AdaBoost. The F1 measure of SVM is 89% that is 7%, 4%, 2%, 3% and 5% superior to k-NN, NB, C4.5, LR and AdaBoost. The precision of SVM is 96% which is 2% higher than k-NN and NB, 1.8%, 17.09% and 6% higher than LR and AdaBoost. The ROC of C4.5 is 99.6% which is 11.3%, 3.7%, 9.5%, 46.7% and 7.4% higher than other approaches. The MAE of NB is 4.2, which is comparatively lesser than k-NN, SVM, C4.5, LR and adaboosting. The execution time of k-NN is 0.02s which is extremely lesser than NB, SVM, C4.5, LR and AdaBoost. Based on these analyses, it is proven that the provided classifier models show potential in their way. In this analysis, it is known that C4.5 shows a better prediction rate compared to other approaches. Apart from C4.5, NB shows a prediction accuracy of 95.7%. Similarly, k-NN shows lesser execution time, and NB shows a lesser error rate (See Fig 2 to Fig 6).
The major advantages of C4.5 are its functionality for both discrete and continuous data. Also, it deals the issues with incomplete data. The C4.5 naturally adopts a pruning process to deal with over-fitting issues. However, this DT model is relatively expensive because of its computational complexity and time. While dealing with k-NN, the model is extremely easier to implement. Also, new data can be included seamlessly before the prediction process. The major disadvantage encountered during the epileptic seizure prediction is its inability to handle high-dimensional data as it is sensitive toward outliers, missing values and noisy data. In the case of NB, the model is best suited for handling multi-class prediction with independent feature consideration. It works well compared to other features and needs lesser training data. The drawback is its independency towards the traits, which is not best suited for real-time application. While in the case of SVM, the model comparatively works well even in the case of understandable dissociation margin among the classes. The accuracy is more productive with high-dimensional data.
The model is efficient when dimensionality exceeds the number of samples. However, the model is inappropriate for larger datasets and fails to work well in noisy data. When the number of features at every point exceeds the total training samples, then SVM may fail. Logistic regression is a learning model which is easier to interpret, implement and efficient for training purposes. When the number of observations is lesser than the number of extracted features, LR should not be used for experimentation as it leads to over-fitting issues. Also, it does not have a common assumption about class feature space. The accuracy of some weak classifiers can be enhanced with Adaboost. It works well for binary classification and needs a quality dataset. With these practical implications, it is seen that C4.5 gives a better outcome than the provided epileptic seizure dataset. But the computational complexity encountered in these abovementioned models paves the way to adopt a novel ensemble approach or hybridized approach in the future.

VI. CONCLUSION
This work provides an extensive work on epileptic seizure prediction using learning approaches with the online available EEG dataset. Here, various existing classifiers like DT (C4.5), SVM, k-NN, NB, LR and adaboosting classifiers are used for prediction. The accuracy of C4.5 is 97.09%, the recall of SVM is 89%, F1 measure of SVM is 89%, precision of SVM is 96%, ROC of C4.5 is 99.6%. The MAE of NB is 4.2, execution time of k-NN is 0.02s. Based on the analysis with the provided learning classifiers, it is observed that there are some research issues which need to be addressed. In the future, an ensemble classifier will be proposed to classify EEG signals for epileptic seizure prediction. Ensemble classifiers have the ability to provide higher prediction accuracy compared to various individual models. It is extremely useful when both non-linear and linear data are considered for analysis. Also, it can reduce the prediction dispersion and model performance.

Data Availability
No data was used to support this study.

Conflicts of Interests
The author(s) declare(s) that they have no conflicts of interest.

Funding
No funding was received to assist with the preparation of this manuscript.

Ethics Approval and Consent to Participate
The research has consent for Ethical Approval and Consent to participate.