*WearMask,KeepSanitizeYourHands*

**An investigation on detection and classification of EEG signals in Epilepsy using Complex-Valued Neural Networks based Machine learning and Deep learning models**

Dr. Seyedeh Haniyeh Mortazavi ^{*}, Dr. Abdul Khader zilani shaik^{1} Dr. Omid Zare Bezkabadi ^{2},

1. Dali university ,China

2. Shiraz University of Medical Sciences, Shiraz.

**Corresponding Author:** **Dr. Seyedeh Haniyeh Mortazavi, **Shiraz University of Medical Sciences, Shiraz, Iran

**Copy Right: **© 2021 Dr. Seyedeh Haniyeh Mortazavi. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

**Received Date: July 27, 2021**

**Published date: August 01, 2021**

*Abstract *

*Diagnosing epilepsy with the electrical properties of EEG signals obtained from the brains of test subjects is a challenging task for researchers and neuroscientists due to the unsteady and erratic nature of EEG signals. Because epileptic EEG signals contain a great deal of information about the functional behavior of the brain, it is difficult to distinguish the complex and core network of EEG signals without considering the strength between the nodes because they relate to each other based on these strengths. Previous research on natural vision has not addressed this issue in epileptic seizures, although having a visual representation of signals is a very important key point.*

**Keywords: **Mean weight, complex network, EEG, epilepsy, KNN, modularity, SVM, vision chart and weight vision chart.

**Introduction**

The whole process of the methods used for automatic detection can be divided into a number of separate processing modules: preprocessing, feature extraction, selection and classification.

Basic operations in the preprocessing phase include signal / image acquisition, artifact removal, averaging, thresholding, signal / image amplification, and edge detection. Because signal / image acquisition contributes significantly to the overall classification results, accuracy is very important. The properties extraction module processes the markers. The feature selection module is an optional step in which the feature vector is reduced in terms of classification only in terms of size, what may be considered as the most important feature needed for differentiation, the final step in the automatic detection of the classification module. The input property vector is examined by the classification module and generates a proposed hypothesis based on its algorithmic nature.

Epilepsy is the most common chronic neurological syndrome in the world after Alzheimer's disease and stroke. According to the World Wide Web, about 50 million people worldwide have epilepsy and suffer from recurrent and unpredictable seizures **[**1**]**. The main root of epileptic seizures is the proportional activity of large groups of nerve cells in the brain. Epilepsy syndrome leads to a range of short-term changes in cognition and behavior **[**2**]**. In addition, the epileptic patient always has stress and mental anxiety accompanied by unknown seizures. For anticonvulsant medication, the diagnosis of epilepsy syndrome is very valuable because it provides information about the root cause. EEG is one of the main biomarkers that can measure voltage fluctuations in the brain, and analyzing EEG data helps to evaluate a patient with epilepsy syndrome because epilepsy leaves its signature on EEG signals. Because EEG data are time series, most epilepsy diagnoses are performed using time series analysis methods rather than linear methods. Nonlinear methods are linear methods for analyzing time series data including analysis. And frequency analysis, for example from Fourier analysis to wavelet evolution **[**3**]** - **[**5**]**. Nonlinear methods include calculating Lyapunov symbols, entropy, and relationship dimensions **[**6**]** - **[**8**]**. However, these methods are not able to maintain all the characteristics of EEG time series data such as instability, chaos **[**10**]**. Hence, there is ongoing research into the development of new techniques that can detect the epileptic system while retaining important information and provide more information about epileptic EEG signals. Because EEG signals are nonlinear and turbulent in nature, traditional linear methods are not sufficient to display epileptic EEG data **[**9**]** - **[**11**]**. This motivates us to use a sophisticated networking technique to diagnose epilepsy.

In 2006, Zhang and Small introduced the concept of time series mapping to the complex network and discovered that the complex network is an alternative way to visualize hidden patterns in time subsets. The existence of different behaviors (chaotic or fractal) of time series can be detected using different network measurements, because the statistical features of the network can be used to obtain information in time series. Nowadays, the complex network and graph theory approach is becoming an emerging field for diagnosing various brain disorders **[**14**]**. The complex network approach introduces a new direction in the field of neuroscience to identify brain abnormalities by examining changes in the characteristic characteristics of the complex EEG network. The existence of multiple time series behaviors is distinguished by the use of different network features because different time series have different statistical properties.

In 2008, Lucas et al. **[**15**]**, a visual diagram for mapping time series data to a complex network, shows that the visual diagram can inherit several nonlinear features of time series. In 2010, the visual diagram algorithm was first applied by Ahmadlou et al. **[**16**]**, for the diagnosis of a brain disorder called Alzheimer's syndrome, and they achieved very promising results. Since then, many researchers and physicians have used this visual diagram algorithm to diagnose epilepsy **[**17**]**, **[**18**]** but their proposed methods have limitations because they do not take into account the important fact that in the network, links are points. They have different strengths and all network nodes are connected to each other based on this power. Zhu et al. **[**19**]** introduced the concept of weight in a complex network for the diagnosis of epilepsy, but they implemented this on a horizontal vision chart, which is a sub-chart of the vision chart. Also, they did not explicitly indicate in which criteria Edge weight function and how it helps to detect sudden fluctuations in epileptic EEG signals. Therefore, by addressing the limitations of existing methods, we develop an algorithm by considering the weight of the new edge for the natural vision diagram in a complex network.

**Method:**

In this study, we introduce a new method in epileptic EEG signal detection to determine the edge weight between two nodes using radian function. After converting EEG signals into a weighted graph, two important features of a network: modularity and average weight are extracted from the weighted graph as a feature. The reason for considering these two features is very prominent in order to obtain valuable information about time series obtained by analyzing the structural pattern of complex networks. Finally, the feature set extracted by two popular machine learning methods is tested: SVM and KNN. In previous research **[**20**]**, we developed different edge weight methods in the complex network to diagnose epilepsy syndrome. In that method, we considered the nature of the observations as an edge weight for the visual diagram in a complex network. We extracted only one feature: the weighted average degree of complex network weighted graph in that method **[**20**]**, which may sometimes not convey all the important information of the complex network. Experimental evaluation of that method is only a case study: set A versus set E of the data of the University of Bonn. Addressing the issues, this study examines an advanced method for the method of diagnosing epileptic seizures that is evaluated by four case studies. Be. Experimental results prove the compatibility of the proposed method in this paper. To our knowledge, the concept of edge weight in vision charts with modularity and average weight in the diagnosis of epilepsy is completely new and has not been used before.

Epileptic EEG data are nonlinear in nature and show this nonlinear nature of multi-fractal behavior **[**21**]**. Diagnosis of epilepsy abnormalities from the complex network of EEG signals is possible by retrieving comprehensive information from their structure. The most promising method of decomposing EEG networks is into a group of highly interconnected nodes called clusters, which use a suitable function, which helps to distinguish different types of EEG signals. Modularity and average weight are the most promising features for this purpose. In this study, we introduce a new method for diagnosing epilepsy by mapping the EEG signal in a weighted network called the WVG weight vision chart. Then two statistical features of the network called modularity and the average weight of the network as a feature are extracted and the classification test is performed on different EEG datasets using the two most famous machine learning classifications called SVM and KNN. Experimental results with 100% accuracy in classifying EEG signals The set of epileptic activities of epilepsy E and a healthy person with open eyes A are quite promising. In addition, the results of other classification tests suggest that our proposed method is suitable for distinguishing between different types of EEG signals.

The structure of this study is as follows: Section 2 provides a complete description of the data set used in the experimental section along with the proposed method. Section 3 includes a detailed discussion of the experimental method and the results. Conclusions with future work are presented in Section 4.

**Section 2**

**Data settings**

The complete EEG database consists of five sets identified by A, B, C, D and E. Each set contains 100 single-channel EEG signals with 23.6 seconds from five separate classes. An electrode 10-20 placement system is used to record EEG signals. All EEG recordings were performed with the same 128-channel amplifier system using a common intermediate reference. The recorded data were digitized using 12-bit resolution at 173.61 samples per second. The bandwidth filter setting is 0.53Hz to 85Hz. In this research study, we used all five datasets to evaluate the performance of our proposed method. Detailed descriptions of this database are available from Andrezejak et al. **[**22**]** Each channel EEG signal has 4097 data point samples. However, in order to reduce the computation time, we divided each channel with 1024 data samples in each section.

Figure 2 shows an example of EEG signals from each of the five-channel A to E channels. A brief description of the dataset is described below:

Setting A: The level EEG of five healthy and open-eyed volunteers was recorded.

Set B: Superficial EEG of five healthy volunteers with closed eyes was recorded.

Set C: Intracranial recording of seizure intervals during formation of the opposite hemisphere of the patient's brain.

Set D: Intracranial recording of the epileptic area of the epileptic patient at the time interval of the seizure.

Set E: The data set is recorded during seizure activity, ie in the ictal period.

In this research study, we used the above data set to evaluate the performance of the proposed method by defining four different groups of problems (experimental cases), which are described in Table III and the discussion section.

B) Transmission of time series of EEG signals to a complex network

Complex network theory is a branch of complexity science that deals with graph theory, statistical physics, and data analysis. Today it is becoming an emerging technique in the field of quantitative analysis of long-term dependence and failure of time series data. Because this branch provides several methods for studying the underlying dynamics of time series data. Vision chart is one of the methods available. The Visibility Graph (VG) technique is characteristic of describing time series in terms of graph theory because it can characterize the dynamic properties of data.

Inherit the time series from which it was created. The resulting network can be used to obtain valuable information about time series. According to Liu et al. **[**23**]** VG is resistant to noise and is not stimulated by selecting certain parameters (threshold values of ε such as TSCN **[**24**]** and lattice. The EEG series is essential, so the detection of various dynamic structures is essential in the EEG recording of a healthy patient with epilepsy, which is the main motivation for using natural vision charts in EEG signal analysis.

Figure (1-2)

Sample single channel EEG time series data of five subsets and (A, B, C, D E).

In this paper, EEG time series data are converted to weighted graphs to identify the edge. We used the following steps to create a weight vision chart with the help of a natural vision chart.

1) The first step (each of the TIME DATA serial data samples is considered as graph nodes). To create a weighted view (WVG) graph from the EEG time series data, graph G (N, E) Consider that N {ni, i 1, 2, . . . . . . N are nodes and E are ei, 2, 3, N are the edges of the graph. i is a time series x (ti), i 1, 2, . . . . . . N of the sampling points N and node ni correspond to the sample data sample xi.

2) The second stage (edges) (link) between the nodes of the visual weight chart on which they are made) Equation of natural vision diagram)

In order to find the links between the different nodes of the weight vision chart, we used the natural vision chart algorithm developed by L. La Caesar et al., In 2008 **[**15**]**. The graph is based on the concept of the Euclidean plane, in which each vertex represents the position of a point, and links between related nodes are only possible if there is a view between them., Where xa x (ta) and xb x (ta) are sample data points, and ta and tb are both arbitrary time events, and tc is any event that exists between them, ie ta

3) Step 3) (Determine the weight of the edge between two nodes)

Studies in network theory have shown that by maintaining the weight information in it **[**25**]** compared to the binary network (where only the information about the links that exist between two nodes or not, a stronger result can be obtained in a complex network Brought).

In this paper, all the edges of the graph are directionally oriented because a link between node na xa and node nb xb is considered, which is the direction from na to nb nb, which is a

wab represents the weight of the edge between node n and node nb, and in this paper we have considered the entire amount of edge weight in the radian function. It is an arc tangent element that is an inverse trigonometric function and helps to detect sudden changes in EEG signals.

4) Fourth step (making a vision chart with weight )(WVG)

Finally, the weight vision diagram is made using the amount of edge weight calculated in the last step.

**Feature extraction**

Feature extraction is an important part of classifying EEG signal data. Technically, a feature represents a distinctive property and an identifiable measurement obtained from part of a pattern. The feature extraction process converts large volumes of EEG data to the feature vector at minimal cost of data loss. Condenses important and important. Therefore, it helps the analysis (classification) process with more ease and speed in computational speed. In this paper, we have extracted two statistical features of the network called modularity and the average degree of weight of the network as features from the weighted view diagram, because these features can be analyzed on how to obtain valuable time series information. Focus. Structural pattern of complex networks. We have introduced the modularity feature in the weight vision diagram to help identify different types of EEG signals by identifying communities in their complex network.

**Classification**

The classification method helps to distinguish the set of unknown observational experiments into their appropriate classes based on the known set of observations. A classification technique uses a mathematical property as a classifier to predict the appropriate class of unknown unknown experimental data sets. In this paper, we use two known methods of supervised machine learning classification called SVM support vector machine classifier and KNN classification to evaluate the performance of the proposed method using the features obtained from the feature extraction technique.

**1. SVM support vector machine**

SVM is currently a powerful classifier in the biomedical sciences for detecting anomalies in biomedical signals. SVM is an efficient classifier for classifying two different sets of observations in the respective class. It has excellent ability to manage dimensional and nonlinear data - where, K (x, y is referred to as the kernel function, which is fixed on the point x and y.

**2. Nearest Neighbor K (KNN)**

The second classification used to classify the various test cases of EEG signals is the K-Nearest Neighbor (KNN) classification because it is a set of simple, robust, and even noisy and large training. It is also adaptive in nature due to the use of local information to predict unknown data. It performs the classification based on the repeated class of its nearest neighbors in the feature space **[**30**]**. Different criteria for defining distances E exists in the KNN algorithm, but in this paper, we have used the Euclidean distance. If s is a training set and y is an unknown test data, the KNN method obtains K from s using the following Euclidean distance between s and y, i.e. the nearest neighbors. Slowly predicts the properties based on the structure of the training data set. Important unknown test data helps. As in this paper, to evaluate the performance of the proposed method, we have four test cases with two different sets of classes, so we prefer this classification for more accurate classification. The SVM mechanism is based on finding the best case that separates data from two different classes of this group. This feature has different sets of kernel functions for classifying different types of data. The SVM classification job description and additional information on the various core functions are discussed in detail in **[**29**]**. In this paper, we use three different core SVM classifier functions to analyze the performance of different test problems.

**3. Performance evaluation measurements**

In this paper, sets A, B, C and D are considered as positive class and set E as negative class, respectively. In order to evaluate the classification performance for different test cases in this paper, we have used the following measurement parameters in (10) - (12), as shown at the bottom of the next page, True Positive stands for the correct expression. Is a non-convulsive activity, True Negative is a convulsive activity that is correctly identified, False Positive is a false seizure of non-convulsive activity and False Negative is a false convulsive activity. Comparative analysis of the accuracy of the proposed work with the existing work that used the same data set for its experiment.

**Discussion**

**Another Methodology (working method)**

In this paper, we propose a new method for detecting epileptic seizure activity from brain EEG signals with respect to the modulation and characteristics of the mean weight with edge weight in the normal vision diagram. In the proposed method, the EEG time series data are first converted to WVG weighted graphs. Modularity and average weight are then extracted from WVG as attributes, and then the attributes are tested using two popular machine learning methods: SVM and KNN classification. In this study, the SVM classification was evaluated with three kernel functions (eg linear kernel, RBF kernel and polynomial kernel) and the optimal parameter value for k was obtained after experimental evaluation. Then, the classification performance of the proposed method was measured in several groups of EEG signals, such as set A versus set E, set B versus set E, set C versus set E, and set D versus set E, with promising results. got. In addition, the results of classification performance (eg sensitivity, specificity and accuracy) for ECTAL (set E) and healthy individual EEG (set A) 100%) are obtained.

This study finds that because the nodes interact with each other with different strengths, EEG signals are best described by the weight network for the diagnosis of epilepsy. It has also been investigated that due to the chaos of octal EEG data, it is difficult to divide them into different modules. Therefore, the results were compared with other EEG signals in small values of modularity and high values for medium weight characteristics. An experimental study in this paper has investigated whether the proposed method is suitable for distinguishing between two different EEG signals. This can be enhanced by the immediate diagnosis of epilepsy. We are currently planning to expand this proposed method for identifying other brain disorders through EEG, such as Alzheimer's disease, autism, dementia, as well as in the field of motion pictures of EEG data and mental imaging of EEG data.

One of the most common sources of information used to study brain abnormalities is the EEG electroencephalogram, which is a very complex signal. EEG monitoring systems generate a lot of data for electroencephalographic changes, so complete visual analysis is not normally possible. Computers have long been proposed to solve this problem, and therefore, automated systems for detecting electroencephalographic changes have been studied for several years. The development of such automated devices is essential due to the extensive use of long-term and long-term video EEG recordings to properly assess and treat neurological diseases such as epilepsy and to prevent the possibility of analyst (or misreading) information loss **[**30, 31**]**

NN neural networks are structures made up of many nodes, each of which mimics the behavior of biological neurons (in a very simple way). Neuron behavior is governed by very simple rules but leads to a classification tool. NN plays an important role in a variety of programs such as identifying patterns and classification tasks **[**23**]**.

**Vision chart networks**

**Horizontal view chart**

The VG algorithm can plot time series into complex networks. For an EEG signal fx (t) gN t = 1

With N data samples, each sample can be represented as a node of the graph shown in the histogram. The height of the histogram shows the corresponding data value.

Node If the top of the two bars is visible, there is a connection between the two nodes. For both nodes (ti, xi) and (tj, xj), the edge between ti and tj if given a node (tk,

(xk) are connected between (ti, xi) and (tj, xj) meets the following criterion for convexity **[**33**]**:

HVG is a modification of the VG algorithm. In HVG, two data nodes are ti, xi and tj, xj

If Equation (2) **[**43**]** is performed, they will have a horizontal view

Where (tk, xk) is a data node between (ti, xi) and (tj, (xj).

A complex network can be expressed by an adjacent matrix A =: N N.

If ti and tj are connected as shown in Figure 2, aij = 1, otherwise aij = 0.

(A) FWHVG angle measurement;

(B) FWHVG related to time series.

The HVG algorithm is directionless, but the weight of the edge is related to the direction in our method.

For a series of time, when the graph is transferred to a weighted horizontal view, as shown, the weighted horizontal forward view (FWHVG) chart can be named.

In Figure 3. When we draw it on a weighted horizontal view chart, it can be a weighted back horizontal view chart as shown in Figure 4 and is named (BWHVG).

A random time series given by x = 7.0, 4, 8, 8, 5, 5, 7, 7, 6, 9, 9, HVG can be found in Figure 2,

And the graphic image of FWHVG and BWHVG can be found in Figures 3 and 4.

Figures 3a and 4a show the FWHVG and BWHVG angle measurements between nodes. Figures 3b and 4b show the networks mapped by FWHVG and BWHVG. Margin, decentralized weight varies on different weighted horizontal vision charts.

**Results**

** Evaluation criteria**

Three classification criteria including 1 Acc accuracy, 2 Sen sensitivity, 3 Spe attributes are used in this study **[**41**]**

(1) Accuracy

(2) Sensitivity

(3) Features

Note:__ To read the complete article please go through the PDF__

**Figure 1**

**Figure 2**

**Figure 3**

**Figure 4**

**Figure 5**

**Figure 6**

**Figure 7**

**Figure 8**