Automated Detection of Epileptic EEG Signals using Recurrence Plots based Feature Extraction with Transfer Learning

- “Epilepsy” is the common neurological brain disorder that is affects the human being at any stage of life. About 1- 2% of the world’s population affected by this major chronic disorder. Electroencephalogram (EEG) signal is the most important tool for the early detection of the epileptic seizure in several applications of epilepsy diagnosis. Electroencephalogram (EEG) signals can be categorized in Epileptic and Non epileptic as per epilepsy seizures. Recent research has carried out various ppossibilities of predicting & analyzing epileptic seizures by mainly using two approaches: Conventional methods using signal processing and Deep learning based methods. So, there is a requirement to find a suitable and reliable method to detect and classify the epileptic seizures in EEG signals. As EEG signals are very random and non linear in nature so we need a non linear technique to examine the EEG signals and hence able to categorise different EEG signals i.e. the Epileptic and Non Epileptic signals. In our paper, we are proposing a non linear technique using the Recurrence Quantification Analysis method abbreviated as RQA, to extract the features of EEG signal whose parameters derived from the Recurrence Plot (RP). While

neurological disorder which with above 65 million people suffering from it globally. Epilepsy is a condition of release of electrical charge in a portion of brain cells in excess to the normal condition which results to sudden recurrent and transient disturbances in the brain [2,3]. Due to the social stigma related to epileptic seizures, patients hesitate to discuss it and thus get deprived of proper treatment. During the seizure, the patient is unknown of his/her physical as well as mental condition and hence might go into a condition causing physical injury to oneself or others. Epileptic seizures are categorized to be Focal (localized), Non Focal (generalized) or unknown onset, primarily based on the source of the seizure within the brain [4]. The further classification of epileptic seizures is given in fig. 1 which is based on three parametersonset of the seizure, awareness of the patient about its occurrence and movements involved.

Fig. 1: Classification of epileptic seizure
There are some common tools that are used to diagnose the brain disorders like such as Electroencephalography, Magneto-encephalography, Computed Tomography, and Positron Emission Tomography, and Magnetic Resonance Imaging [5]. Electroencephalogram (EEG) is the most utilized physiological signal to record and analyze the electrical activity of the brain. It utilizes a set of electrodes placed on the scalp to capture electrical impulses generated within the brain. These pulses are recorded for diagnostic study and printed, if required, on paper using an electroencephalograph. Several neurological and psychological treatments use EEG signals during diagnosis and treatment of the patients. Due to the direct dependence of epileptic seizures on electric signals of brain, EEG is preferred or perhaps most suitable signal for detection and analysis of epileptic seizures [7].
Epileptologists or clinical experts are analyzing the EEG recordings of the person with epilepsy i.e. affected individuals to diagnose the complexity of the seizures. Visual inspection of recorded EEG signals to detect an epileptic seizure is a tedious process and requires availability of clinical expert with several years of experience. Although this is a complex task and leads to the conclusions which depends on the clinical expert means subjective. It is a very time consuming and repetitious task to inspect large volume of EEG data which is recorded from the patient's scalp. So, there is a need to develop and smart and efficient tool for automating the process of seizure detection from the EEG signal. To encounter the automatic detection of epilepsy, an automated epilepsy seizure detection system is widely investigated [8,9]. The increase in number of epilepsy patients and shortfall of clinical experts has demanded for an automatic diagnosis system to detect the presence of an epileptic activity. Seizure detection based on Brain Computer Interface (BCI) is the emerging technology which uses the power of brain to overcome the human body limitation [1]. In any automatic seizure detection mechanism, the most difficult task is identification and implementation of efficient signal processing algorithms for the specific task by doing the various comparisons on different parameters.
As EEG time series are very random in nature, so we use recurrence plot transformation technique which is a non-linear analysis technique. Recurrence analysis is the dynamic tool which is applied to EEG time series to identify the imperceptible dependencies in the time series signal. The time series recurrence analysis is works upon repetition of states method which is built on the famous property of the trajectories of dissipative systems. The display of x(n) which is the representation of repetition of states in phase space, is done by Recurrence Plot (RP) . By using the recurrence plots, we can visualize 2D or 3D spaces in upper dimension phase space. An RP is just an image pixels array of size N × N. Whenever x(m) is very close to x(n), the image pixel is located at (n, m) [19,26,40].Quantification of Recurrence plot is done by investigating the dynamical system using a non linear data analysis techniques which is known as recurrence quantification analysis i.e. RQA. It is determined by the number and length of recurrences in the system. This gives us a measure about the complexity of the EEG Data and provides the essential features of the non stationary EEG data. The RP based features i.e. RQA feature were extracted from the EEG data and classified using different machine learning classifiers like ANN [41].
For Automated epilepsy detection there are various Machine Learning techniques for the classification of the EEG Signal such as Support-Vector-Machine, Decision-Tree, k-NN, and Random Forest are widely used that works on extracted features i.e. EEG can be classified as normal or focal (epileptic) based on temporal or frequency features of the EEG signal. Radial Basis-Function (RBF) based SVM binary classifier gives good results in epilepsy diagnosis from the EEG signal [28][29][30]. However, the classifier accuracy depends on the type of the feature used for classifying EEG. There are various works have been done in past which suggested to select appropriate features to improve the classifier's efficiency. Many previous studies have recommended appropriate feature selection mechanism to improve classifier's classification performance. Thus, conventional methods for analyzing and classifying the EEG signal needs enough manual supervision to select appropriate feature for epilepsy detection [44]. This paper proceeds in following manner: Section 2 enlighten the work which has been done in EEG classification and comparison between the different studies. Section 3 presents the proposed methodology used to classify the EEG signal as epileptic or Nonepileptic, including EEG dataset, obtained Recurrence plot using RQA, transfer learning models, and machine learning classifier. In Section 4, experimental setups and evaluation metrics results are shown. In the last section, we give conclusions and future scope of our proposed work in paper.

Related Work
Anand Shankar et.al. suggested an approach for automatic seizure detection using recurrence plot and convolutional neural network. In this work, he suggested to convert EEG signals into 2D input images by using a technique named recurrence plot by preserving the nonlinearity and non stationarity characteristics of EEG and classify it using a well-known model convolution neural network which is Deep Learning method [14]. The classification accuracy which is received using this model is 93%. The suggested method has a limitation to use the time series signals to automate the process of epilepsy detection. In our proposed methodology, we have used the transformed image from the EEG signal to automatically detect the epilepsy.
A.Narin, suggested a method for the automated detection of affected epileptic area in the brain. He proposes a new technique for categorisation of Focal EEG and Non-Focal EEG with method of continuous wavelet transform and two-dimensional convolutional neural networks. He employed pre-trained deep learning models for the classification of scalogram images such as Inception-ResNetV2, AlexNet, InceptionV3, VGG16, and ResNet50 [13]. The performance of these methods was examined and compared using scalogram images. The best classification accuracy is achieved as 92.27% using InceptionV3 model with respect to others. In this method the author classified the EEG data using transfer learning models while in our proposed method we are classifying the EEG data by using machine learning classifier and hence receive the best accuracy.
K. Palani Thanaraj et.al. proposed a method by imagining the time series data like EEG to classify the epileptic EEG signals by Deep Leaning Network. In this method EEG signal is converted to RGB images using Gramian Angular Summation Field methodology. These images were sent to Deep Neural Network for the extraction of the textual features from these 2D images [38]. They have used the concept of transfer learning by using three different pre-trained DNN such as the VGG16, AlexNet, and VGG19 for the validation of epilepsy detection. In last, a custom CNN model is used for the categorisation of the epileptic EEG signals as focal and non focal. The accuracy was received using custom CNN is the highest among all other pre trained DNN as 92%. They have used similar kind of technique to convert time into RGB by creating a matrix of temporal correlations for each pair of time points. In our proposed methodology, we used RecurrencePlot which extracts trajectories from time series and computes the pairwise distances between these trajectories. Along with we are using using transfer learning only to extract the features while using machine learning to classify the EEG signal in place of transfer learning classification used by author.
C. E. Elger et. al. explains the behaviour of EEG signals as non linear and irregular. Chaos theory of non linear dynamics provides a powerful tool to analyze the non stationary signals like EEG. Extraction of nonlinear features from the recorded EEG signal is very important for the clinical analysis. This paper suggested some measures to be enable in the long lasting time series of EEG signals: (a) Focal Epileptic region which shows interictal state (b) Antiepileptic drug results and effects, (c) analysis of spatiotemporal connection between the affected zone and normal zone of the brain, and (d) Feature extraction for seizure prediction [16]. So we are able to find the affected zone by using nonlinear time series analyses to improve pre surgical requirement. Here in our proposed methodology we are proposing deep learning model ResNet 50 to extract the feature in spite of Statistical features used by the author in literature. So we have more features in our proposed method to train the network so can predict a better model for survivability.
Sharma R et. al. [31] suggested a statistical method to quantify the EEG signal. As a feature, they employed average sample entropies and average variances of intrinsic mode functions produced using empirical mode decomposition. For the classification of EEG signals as Focal or Non Focal, least square support vector machine classifier is employed with input feature set. The accuracy was achieved using above method is 85%.Author has automate the process by predicting epilepsy directly from the time series while in our proposed method we are transforming time series into image and then predicting the Focal and non Focal EEG signal. Nima Hatami, Yann Gavet and Johan Debayle suggested a method by converting time series in to image using recurrence plot and classify it by using Convolutional Neural Networks (CNN) [15]. In 1D time series signals, various feature are not available to classify in comparison to texture image, therefore it can be recognized as texture image recognition task. Author has used the same method to transform the time series data to image by using the recurrence plot and has describe the advantages of using these images. But we are proposing a hybrid technique by implementing deep learning and machine learning for the same data set. We are extracting features using deep learning approach and classification using machine learning classifier in place of CNN to enhance the accuracy. M Srirangan et.al., proposed synchrosqueezing transform based method for feature extraction and classify the focal EEG signal and non focal EEG signals with the help of convolutional neural network. They have used both Fourier SST and wavelet SST for calculating time-frequency matrices of EEG signal [17]. They have achieved 99% accuracy, sensitivity, and specificity by using the above method for the classification of focal and nonfocal EEG signals. Author has already gives the better accuracy by using statistical features and classification using the CNN. But there is less number of features extracted by using any kind of statistical method. This limitation has been overcome in our proposed method by automating the process of feature extraction using deep learning network also. After that we are classifying the EEG signal as epileptic and non Epileptic by using different machine learning classifiers. U Rajendra Acharya, et. al. Reviewed various automated system for detection of F-EEG signals. The performance of various systems was compared using non-linear features in terms of its ability to differentiate between F and NF EEG signals [33,37]. It was observed that nonlinear features were sufficiently capable of capturing signals and patterns present within an EEG signals. Before the extraction of features from the signal, most of the system decomposed the EEG data. Therefore, F and NF EEG signals have been successfully and efficiently classified using a mixture of decomposition approaches and nonlinear characteristics. But the statistical analysis requires more computation resources, less features extraction, and hence less power to predict and classify the EEG signals.
Pritish Ranjan Pal, Niladri Prasad Mohanty & Tapan Gandhi suggested a simple method for EEG classification using SVM selecting various entropy features such as Escort Tsallis Entropy, Tsallis Entropy, Renyi Entropy and Shannon Entropy [18]. These parameters were used to distinguish various categories of EEG signals resulting from actions such as eye open and close. Seizure and EEG from hippocampal and opposite of epileptogenic zone. After using the SVM for the above discussed signals, Shannon entropy was found to be most suitable for classification of various EEG signal.

Proposed Methodology 3.1. Dataset:
In this paper we use publicly available EEG dataset from Bonn University which is named as set A, set B, set C, set D, & set E [31 , 32]. In this data, EEG recordings were taken using the 10-20 system of Electrode Placement. This data set is comprised with five types of different dataset Set A marked as Z, set B marked as O, set C marked as N, set D marked as F and set E which is denoted as S in the database. EEG recordings of set A which was taken in open eyes & set B was taken in closed eyes from the healthy patient's surface in conscious mental state. The set C, set D and set E are taken from the patients with epilepsy (PwE) in which Set C and D are taken from seizure free interval. Set C was taken from the opposite of the hippocampus formation of hemisphere, while set D was taken from the affected i.e focal zone. Only set E was recorded during the epileptic seizure. Each recording cluster comprises of single channel recording of 23.6 seconds for 100 patients. A band pass filter is used to filter these signals with frequency 0.53-40 Hz with sampling rate of 173.61Hz. No pre processing on data set is required so not done. This data set is shown in fig 3.1.

Data Splitting & Selection:
Our data set is having 23.6 sec EEG recording for each of the set. We are splitting our data set in to 23 chunks of 1s duration each. So we are selecting 4094 data points into 23 chunks i.e. each of the chunks contains only with 178 data points. This data formation increases the number of samples from 500 to 11500 for training of our proposed model. Therefore for each chunk, now we have 2300 EEG samples with 178 data points.

Transforming time series signal to Recurrence Plot:
A Recurrence Plot abbreviated as RP is a nonlinear data analysis method that is sophisticated. It is represented by a matrix of 2× 2, in which matrix elements corresponding to the times when the dynamic system states repeat it. The Recurrence plot, in turn, indicates all the occasions that the dynamical system's phase space trajectory passes through nearly the same area in the phase space [19,25,33]. Eckmann et al. (1987) developed a method for visualising state recurrence in phase space. A phase space representation is one in which fewest dimensions may be represented as an image. Only by projecting higher-dimensional phase spaces onto two-or three-dimensional subspaces can they be viewed. On the other hand, this technique enables us to study the mdimensional phase space trajectory by looking at its recurrences in two dimensions. A twodimensional squared matrix in which ones marked as black dots and zeros as white dots in the plot, shows the recurrence of a state at different time interval i and j where both axes are time axes. This representation is called recurrence plot.
Recurrence Quantification Analysis is one of the graphical method by which to get some deep insight of linear and non linear signals without knowing the data linearity or stationarity. So due to the non linear features of EEG signals, it is the best method which can quantify the dynamics of EEG signals. RQA is having various parameters but Recurrence plot is the best parameter to extract the features from EEG signal to quantify cortical function [40,45]. Following steps are used to analyze the Recurrence plot approach summarized in the next paragraph: (i) Transforming time series into 2D phase space representation: The first step to convert a time series in to a recurrence plot is to represent the signal as a trajectory in a multidimensional space. A phase space, in general, can be defined as a space that displays all potential states of a system. In multidimensional phase space, each potential state or combination of states of the system has its own unique point.RQA measures are found different during the Epileptic activity characterization in form of Pre-ictal, inter-ictal & ictal stages [46, 47, 52,]. A strong connection is observed in recurrence plot and RQA measures while seizure occurred. A phase space trajectory is dependent on the dimension of phase space and time delay. If m represents phase space dimension and τ denotes the time delay, then s (t) which is phase space trajectory for the signal can be defined as: where e k ⃗⃗⃗ denotes the phase space axis versors. Therefore the trajectory time evolution will be the same for all axis i.e. m except for the multiples of τ i.e. delay.
(ii) Recurrence Plot Computation: A recurrence between two places in phase space i and j at different points along the trajectory can be considered as: where is representing the heaviside step function, ( ( ), ⃗⃗⃗⃗⃗⃗⃗⃗ ( ) ⃗⃗⃗⃗⃗⃗⃗ represents the distance between two points i and j on the trajectory. When the distance or space between two points of the phase space i and j is smaller than the threshold ( ), than it is known as recurrence radius. The distance D is calculated using the by using the Euclidean metric. Sometimes is considered as a mean of distance between two consecutive points of the trajectory [51,52]. Graphical Representation of the distance plot D is also useful for considering the recurrence plot.
(iii) Recurrence plot quantification: It is used to perform some computation on the analyzed signal to get some measures that is helpful to see deep insight into the signal. The RP of the EEG signals was used to obtain RQA parameters [23,24]. Some important measures are described below: (a) Recurrence Rate (RR): It's the ratio of the recurrence plot's total area occupied by recurrence points to the overall area of the recurrence plot. In other words, in a recurrence plot, it displays the density of recurrence points. It is given by The processes for computing RP for a basic time-series signal are shown step by step in Figure 3.3.1. The given time-series is first used to generate a 2D phase space trajectory (m=2) [25,31]. The R-matrix is then computed using the phase space closeness of the states. It's worth mentioning that the R-matrix produced by equation (2) only has 0 and 1 value, which is due to the thresholding parameter ɛ. This research ignores the information loss due to R-matrix binarization by skipping the thresholding stage and uses gray-level texture images. This proposed work uses the deep neural network (DNN) model to extract the features from the distinct texture images obtained by R-matrices. We have drawn below the recurrence plots for one training sample data from each of the category of epilepsy signal. Set A to D is considered as non effected EEG signals as these signals are not recorded during the seizure while Set E is considered as effected EEG signals due to it was recorded during the seizure.

Transfer learning using ResNet 50:
It is evident from the figure 3.3.1 of recurrence plot for different EEG data that it is a useful quantification analysis based on RQA. Now, we are implementing pre trained deep neural network Res Net 50 to extract the features from that recurrence plot information [20,21]. Deep learning Network models were considered as imaginary of the functioning of human nervous system. It has been proved that we can enhance the performance of our model by using deep learning network. Transfer learning is the process to train a pre existing and pretrained deep learning network for a new task (Szegedy, et al., 2015). In this approach a basic network is trained on some sample dataset and the feature that are learned during this training are used or transferred to a second neural network for some other data set [33,34,37]. This model will only work when features are suitable for both the networks not only for the basic network on which it gets trained.
ResNet-50 is a kind of convolutional neural network having 50 layers. This network is designed for reducing the problem of degradation of gradients occurred during back propagation training [54,56]. This can be possible by inserting the shortcut connections between the plain CNN networks. The input image dimension of ResNet50 is 224×224×3, so we have to resize this input layer to 178×178×3.

Fig3.3.3: Features Plot after ResNet50
The detailed architecture for feature extraction using ResNet50 can be found in fig 3.3.4. Transfer learning using ResNet50 was performed by using the following steps in our proposed methodology shown in fig:  1

Classification using machine Learning Classifier:
A mathematical model containing a number of parameters that must be learned from data is referred to as a Machine Learning model. There are, however, some factors known as Hyperparameters that cannot be learned directly. Before the actual training begins, humans frequently choose them based on intuition or trial and error. These factors, such as complexity and learning rate, demonstrate their worth by improving the model's performance. Models can include a large number of hyperparameters, making determining the best combination of parameters a search problem. The task to assign a different label to a set of problems in that domain by using machine learning algorithm is known as Classification. In classification, initial corpus is the number of previously classified examples in problem domain [51,52]. Consider Ω = d1, d2 ..., d |Ω| as initial corpus which is to be classified under the categories C = c1, c2,…,cc. This indicates that for each pair 〈 , 〉 ∈ Ω × C , the total function which is defined as × C → τ, γ are known. The corpus Ω is separated into two groups for evaluation purposes: There exist different types of task for classification using machine learning such as below:  Predictive modeling in classification assigns a class label to the set of input example in problem domain.  To predict the output of the example in one of two classes is known as the Binary Classification.  Predicting the output of an example in more than one class is known as multi-class classification.  When the distribution of the examples in problem domain across the class is not equal than it is known as the Multi-label classification. As per our dataset available, we are divided our data into only two classes: one is affected with epilepsy and other one is Non-effected with epilepsy. Set A-D data is considered as Non-effected and set E data is only considered as effected. So we need only Binary Classification in this manner. Binary Classification: The task to assign a label to our dataset as effected and noneffected can be done by Binary Classification. The class label 0 is allocated to the class of problem examples for the non-effected state, while the class label 1 is assigned to the other class for the effected state. It means we are assigning Label 0 to the class of dataset A-D and Label 1 to the class of dataset E.
Binary classification can be done by using following popular machine learning classifiers:  k-Nearest Neighbors  Logistic Regression  Support Vector Machine  Decision Trees  Naive Bayes Our proposed method gives the best result with support vector machine classifier among above listed classifiers due to its performance. Support Vector Machine: in past studies we have seen that Support vector machine (SVM) gives the high performance while classifying EEG signals as time series for neurological disorders such as epilepsy. Due to its convex optimization problem, it has been shown to be a good generalisation performer for high dimensional data. Therefore we are implementing the SVM for the image classification as well for the features received from the transfer learning. The main objective of Structural Risk Minimization is to find a hypothesis h for which can ensure the lowest error. Basically h is the probability of error on unseen and random test data and it has to be minimize [44,48]. Some hyper-parameters in SVM, such as C and gamma values, have a direct impact on the training process. If we have a low C, it implies we have a low error and vice versa (we generally choose the value of C like [0.1, 1, 10, 100, 1000]). When we implement the Gaussian RBF kernel, we employ gamma. Gamma is a hyperparameter that must be specified prior to training the model. Gamma determines the amount of curvature in a decision boundary. More curvature equals a higher gamma, and vice versa. (For Gamma, we usually choose the values [1, 0.1, 0.01, 0.001, 0.0001]). It is very hard to determine the optimal hyperparameter but it can be tried by using a combination of all and check on what parameters it gives the best result. We have ignored these hyperparameters in our proposed model just taken kernel parameter as Radial Basis Function (RBF) kernel. SVM is trying to draw a widest possible margin between the positive and negative training examples in N dimensional space such as problem of linear separability in which there are N-1 hyperplanes. In a generic h-dimensional space, we define a generic hyperplane as 0 + 1 1 + … … . + = 0 …………………….. (11) Where 0 is the intercept, 1 defining the first axis and so defining the n th axis. Each is a parameter for one of the many dimensions we have in our space. This indicates that if the equation has a value smaller than zero, than the point is below the hyperplane.
And if the points are on the plain's upper side, the equation is as follows: Assume that if we can design a hyperplane based on the training data that can completely able to segregate all training observations according to the classes specified, than the hyperplane equations will be like below: Each testing observation is classified according to which side of the hyperplane it is located. If the value of the above equation is less than zero, the observation belongs to the -1 class, and for others it belongs to class 1.

Fig 3.3.3: Linear SVM Classifier
That is, we may classify any testing observation x θ (theta) depending on the sign of the equation below. If the sign is negative, it is assigned to class -1, and if it is positive, it is assigned to class 1. (x θ ) = 0 + 1 1 + … … . + ……………... (16) This method choose the middle line among the all possible separation line for the optimum decision surface is defined by a small collection of training examples known as support vectors. The term maximum margin hyperplane is only used in the context of classification through SVM [49,50]. When the problem are not linearly separable than some Kernels functions are used to map the problem to a high dimensional space. The kernel trick is a useful computational technique for increasing the size of the feature space by using inner product of two vectors. The inner product of two n-vectors a and b is defining as Where a and b are nothing but two different observations. The advantage of this kernel is that the optimization problem's complexity is only determined by the dimensionality of input features. When the new test samples features have to be tested, the dot product of each of the training observations will be computed, and the result will behave as if it were a higher dimensional feature space.

Experimental Results & Discussion
Automatic epilepsy seizure detection is a kind of pattern recognition task in which we automate the process of seizure detection by acquisition of data from the patients, processing the EEG signal, extracting the features from those EEG signals and finally detecting the seizure. A novel approach for automated epilepsy detection is proposed in our paper that is different from the traditional approaches of feature extraction from the time series. The proposed method can be summarized in following points. 1. EEG data is acquired from the open source data base, preprocessed and data is selected for feature extraction. 2. All EEG data set of size 11500×178 are converted into recurrence plot images by using RQA. 3. Feature extraction is done by ResNet 50, a convolutional neural network from the recurrence plot images. 4. The Classification process for automated seizure detection is done by using various binary classifiers and found the best result by using SVM. As we know that we are classifying the epilepsy data into effected one and normal or Non effected, so Sensitivity and Specificity are the two measures to check the performance of the classifier. In order to analyse the performance on the test data sample, the confusion matrix is utilised to calculate sensitivity (true positive ratio) and specificity (true negative ratio).Sensitivity, also called the true positive ratio, is calculated by the formula = = + × 100 Specificity value known as true negative can be computed by dividing the total number of negative diagnosis by the total number of diagnosis reported by expert neurologists.

= = + × 100
We have used only ResNet 50 for feature extraction but used multiple binary classifiers to classify the epileptic EEG signals.  We have drawn a comparison plot for the accuracy given by the different classifier for the training data and the test data both. From the figure 4.1, it is clear that the SVM classifier gives the best accuracy, sensitivity and specificity in average for the training and test data.  Although prior research has demonstrated good performance in the classification of EEG signals, there are still certain issues to be resolved. First issue is the dataset quantity and availability for classifier training. Therefore, the classifier's generalization capability is not proven for the online epileptic detection in EEG signals. On the other hand, the classifiers used in the previous works, did not minimize the generalization error bound for unseen EEG patterns i.e testing data. In our paper, we have used the SVM classifier for this implicitly imbalanced data set so that the drawback can be minimized. If one of the minority classes is considerably under-represented in compared to the majority class, a binary class data set is implicitly imbalanced. This observation is especially important in real-world scenario where misclassifying examples from the minority class can't be ignore, such as detecting fraudulent phone calls, diagnosing complex diseases, retrieving data, text classification, and filtering tasks. SVM removes this barrier by suggesting a new under sampling method to compress and balance the training set for the traditional SVM classifier with the least amount of information thrashing. It can build a trade-off between training set size and information loss by carefully defining a similarity measure between data samples. In our paper, result shows that using the compressing and balancing strategy improves the overall performance of the SVM classifier. Second, in prior studies, every method directly sent all of the extracted features into the machine learning classifiers. However, there is a mixed distribution between classes in general due to a large variance in EEG pattern distribution. In our paper, image transformation and feature extraction mechanism is implemented in the system that minimises within-class distribution while maximising between-class distribution. As a result, the size of the between-class overlap zone should be drastically decreased, and classification performance should increase dramatically.

Conclusion & Future Scope
Epilepsy diagnosis is a challenging undertaking that needs patient observation, an EEG, and the collection of huge amount of clinical data. Any soft computing tool that identifies people as affected or not affected by epileptic seizure is a useful tool for neurologists who are treating the cases of suspected epilepsy. In epileptic seizure detection, network input parameters and classifier performance are very important. Experiment results can be used to explain the effectiveness of this proposed method. Our method for detecting epileptic seizures is clearly demonstrated in this paper. The approach has the advantages of being simple to use and requiring little computational resources. The approach can be employed on its own or as part of automated diagnosing system for epilepsy diagnosis.
In this paper, we have used a novel technique to detect the epileptic seizure automatically rather than the traditional approaches which used the statistical methods to extract the features. The approach is unique because of the conversion of the time series into the image by using the recurrence plots. With the help of recurrence plots, we are able to apply the features of transfer learning in to the received recurrence plot images of the EEG signals. As we are using the transfer learning, it means we are using the pre trained Deep learning models to extract the features from the received image. While we are using any statistical method than the numbers of features extracted are limited [28,29,30]. Therefore, we have the few choices to train our model by using these features. This limitation has been overcome by using our proposed method in this paper as the number of features received from the ResNet50 is sufficient enough to train the model. It increases the efficiency of the classifiers because it was trained on a large number of features.

Declarations: Ethics approval: Not Applicable
Funding Details: Not Applicable Conflicts of interest: All the authors declare that we do not have any conflict of interest Consent to participate: Not Applicable Consent for publication: All the authors agreed for publication Data Availability: Authors can confirm that all relevant data are available in online repository of University of Bonn and can provide on demand Authorship Contribution: Sachin Goel: Conceptualization, Methodology and Implementation & Manuscript writing Rajeev Agarwal: Conceptualization and Review R.P. Bharti : Validation and Data Analysis