Sleep EEG Classification Using Fuzzy Logic

— The computerized detection of multi stage system of EEG signals using fuzzy logic has been developed and tested on prerecorded data of the EEG of rats .The multistage detection system consists of three major stages: Awake, SWS (Slow wave sleep), REM (Rapid eye movement) which has been recorded and can be detected by the fuzzy classification and fuzzy rule base. The proposed work approaches to identify the stage of 3-channel signal on the basis of frequency distribution of EEG, standard deviation of EOG and EMG, variance of EOG and EMG. Based on feature extracted data, fuzzy logic rule base model was evaluated accurately in terms of 3 stages (Awake, SWS, and REM) and the result confirmed that the proposed model has potential in classifying the EEG signals


I. INTRODUCTION
The electroencephalogram (EEG) is widely used clinically to investigate brain disorders. The study of the brain electrical activity, through the electroencephalographic records, is one of the most important tools for the diagnosis of neurological diseases. Large amount of data are generated by EEG monitoring systems for electroencephalographic changes, and complete visual analysis is not routinely possible [7]. Fuzzy logic provides a suitable basis for the ability to summarise and extract from the masses of data impinging upon the human brain those facts that are related to the performance of the task at hand. In practice, precise model may not exist for biological systems or it may be too difficult to model. In these cases fuzzy logic is considered as an appropriate tool for modelling and control, since our knowledge and experience are directly contained and presented in control strategies without explicit model [5].
In the tradition of neuroscience, sleep plays a vital position. Due to familiarity of sleep disorder in universe, this is a very important subject [21]. At least 41% of all considered subjects have one syndrome of disrupted sleep [21]. During daytime sleepiness, one out of 5 adults is distressed as narrated by Young in 2004 [22]. Due to extreme daylight sleep, two problems are Sleep apnea [21] and narcolepsy . Due to these two disorders, confusing or some time vital effect happens on regular activities.
Sleep apnea [22], a sleep-related breathing disorder caused by the disturbances in sleep gives rise to many concise and long duration dreadful effects. Impaired attention, impact on quality of life, less potency and chances of mishap increasing are the short living effects of sleep disorders and the long-term effects are increment in morbidity and mortality rate from the increasing mishaps, cardiovascular diseases, high blood pressure, bulkiness and learning disability along with discouragement [20]. The physical, psychological, cognitive and motor functioning hampering are caused by sleep disorders. Snoring, sleep apnea, insomnia, parasomnia, are the few disorders that we normally do not give any attention on it. Thus, the main task is to find the sleep disorder. Earlier, the traditional approach used by researchers was in the form of questionnaire for detecting various sleep disorders but this method lacks of accuracy as the whole questionnaire survey depends on total number of participants as well as questions designed for the survey. So, various intelligent approaches have been found out or are in research by researchers to treat this problem.
"For the improvement of epoch-based methodologies which depends on low temporal resolution, the automatic study of the sleep macrostructure in continuum approach has introduced by Diego Álvarez-Estévez, José M. Fernández-Pastoriza in 2013. Classifications based on categorisation can be removed and soft transitions can be exploited by using neuro fuzzy systems as these properties permit us to approximate the constant growth to investigate the sleep EEG with its various states." [22]. Genetic algorithm was introduced in 2013 and used to examine for the weight alteration for both "sensitivity and specificity" [22] in order to improve the diagnostic rate from 85.99 to 94.2% [22].
"In 2014, Drowsy Driving Detection by EEG analysis using Wavelet Transform and K-Means Clustering [15] aimed to develop an automatic system for drowsy driving identification or detection by analyzing EEG signals of the driver. The wavelet transform is an effective tool to study the time as well as frequency components hidden in such non-stationary signals" [15].
Many Algorithms have been proposed by researchers for the feature extraction and classification of vigilance states for EEG which was based on pattern recognition system. For the experimental purpose rates have been used as specimen as human beings have restrict researchers to perform additional experiments such as heat exposure at different temperatures for analysis of different stress conditions of human beings.
The current study also implements fuzzy logic methods to develop an automatic classifier to categorize the vigilance states of rats. "The typical signals of one channel EEG recording in three different states were labeled in advance. With the proposed method, three types of vigilance state can be categorized automatically without human interpolation.
The proposed method has two advantages which lead to reduce the amount of effort required to refrain classifier parameters. In Fuzzy qualitative approach, the classifier itself learns the parameters to attain the best categorization of the EEG signals [20]. Second, previous classification procedures involve high dimensional mathematical computations that may not be spontaneous.

II. MATERIALS AND METHODS
The experiments were carried out with male Charles Foster rats of age 12-14 weeks and weight around 180-200 grams at the beginning of the experiment. The rats were individually housed in polypropylene cages (30 cm × 20 cm × 15 cm) with drinking water and food (Hindustan Liver Limited, India) ad libitum]. For continuous EEG monitoring, recording electrodes were chronically implanted on the skull of the rat. The continuous four hours of recordings of EEG, EOG and EMG were per-formed from 12.00 hour to 16.00 hours IST on the re-cording day through the 8 channels Electroencephalogram-graph (EEG-8, Recorders & Medicare Systems, and India). The paper recordings were performed with standard amplifier setup (Sinha, 2004) and at the chart speed of 7.5 mm/sec. The digitized data was collected, stored and processed with the help of data acquisition system (AD-Link, 8112HG, NuDAQ, Taiwan) and processing soft-ware (Visual Lab.-M, Version 2.0c, Blue Pearl Laboratory, USA). The recordings were done with the sampling frequency of 256 Hz and selected data were stored in hard disk in small segments (approximately 2 minutes) in separate data files.
For the common grounding, midline Frontal stainless steel screw electrode, 1 mm in diameter, and two other similar screw electrodes were used for cortical EEG. Four stainless steel loop electrodes, insulated, except at the tip (two for electrooculogram (EOG) and two for EMG), were also used [20].

III. THE PROPOSED CLASSIFICATION METHOD
The proposed classification method consists of two processes: (1) feature extraction processes which convert the patterns in the EEG signal into a series of variables for classification, and (2) Fuzzy classification processes which can categorize the vigilance states of EEG signals with the help of different features. Fig. 1 illustrates this process.

A. EEG
The brain activity monitoring consists of signal acquisition and signal processing. Firstly, the brain signals are acquired by EEG electrodes on a headband and then sent to the analog signal conditioning circuits. The circuit will carry out the preliminary amplification, analog filtering, and impedance testing functions. Secondly, the multi-channel signals can be multiplexed and further amplified for modulation and sent out by RF transmitter. Finally, the RF receiver receives the signal, then demodulates and digitizes it, and sends it to the Digital Signal processing unit. The DSP unit performs the brain signal processing with the interface of the display, flash card storage and USB computer connection port.
The potentials recorded at the surface vary in polarity in a rhythmical fashion.

Figure 2: Block diagram of EEG system
"It is considered that EEG records occur over a wide range, which have been divided into a number of recognized bands, namely, 0.5-4 Hz (delta or ∂), 4 -8 Hz (theta or θ), 8 -13 Hz (alpha or α) and 13 -35 Hz (beta or β). EEG responses are relatively short duration, nonperiodic signals produced randomly as a response to stimulus.

B. Feature Extraction
This study computes the features of EEG spectrum using the Fuzzy Logic analysis. Features are extracted from the three channel data which includes EEG, EMG, EOG .Frequency of EEG, Standard deviation of EMG, Variance of EMG, Standard deviation of EOG, Variance of EOG are the input features which is used to investigate the three stages of EEG signal. The frequency of EEG is computed with FFT analysis and classification of stages has been done by using fuzzy quantitative analysis.

C. S ta n da rd Deviation
Standard Deviation is defined as the how much difference or "dispersion" exists from the average (mean, or expected value). A low standard deviation specifies the data points tend to be very close to the mean; high standard deviation indicates that the data points are spread out over a large range of values.

S.D (σ) =√ )
Where, σ = Symbol of Standard Deviation µ = mean of all the values in the data set N = Total Number of values in data set x x = each value in the data set

D. Variance
Variance is defined as the square of standard deviation or the variance of a random variable or distribution is the probability, or mean, of the squared deviation of that variable from its estimated value or mean.
Thus the variance is a degree of measure of the amount of variation in values of that variable, taking account of all probable values and their probabilities.

IV. FUZZY RULE BASED MODEL
The Extracted parameters Frequency, Standard Deviation and Variance is considered as input variables to the Fuzzy rule based selection process block. Inference System (FIS) maps an input features to output classes using FL. Fuzzy logic are easy to modify a FIS just by including or excluding rules. The fuzzy rules have written for Extracting Features to get results as AWAKE, REM and SWS sample values. Fuzzy Rule Based selection for five inputs and one output model is shown in Fig.2.

A. Fu zzy Rules
Fuzzy IF-THEN Rule: "IF -THEN rule statements are used to create the conditional statements that consist of fuzzy logic. IF -THEN rule assumes the form where A and B are atomic terms explained by fuzzy sets on the ranges (universe of discourse) X and Y, respectively. The premise of the rule 'X is A' is called antecedent, while the conclusion portion of the rule 'Y is B' is called the consequent which makes one rule i.e. 'If X is A then Y is B'. These rules are based on natural language representation and models, which themselves based on fuzzy sets and fuzzy logic" [15].
Fuzzy logic as a tool will be applied to analyze the different stages of EEG classification and check the percentage of correct recognition rate by comparing them with manual readings.

Fig.3. Fuzzy Rule Based Model
Fuzzy Rule for five input variables and one output variable is defined as few example rules a) If (EEG frequency is low) or (EOG standard deviation is high) or (EOG variance is high) or (EMG standard deviation is low) or (EMG variance is low) then (signal is REM) b) If (EEG frequency is high) or (EOG standard deviation is low) or (EOG variance is low) or (EMG standard deviation is med) or (EMG variance is med) then (signal is SWS) c) If (EEG frequency is med) or (EOG standard deviation is med) or (EOG variance is med) or (EMG standard deviation is high) or (EMG variance is high) then (signal is AWAKE) If any one of the Fuzzy Classifier output variable (AWAKE, REM and SWS) is present more number of times in Feature Extracted parameters rule, the Classifier will assign that Fuzzy Classifier output variable to be the final output in the Fuzzy System. The Fuzzy Rule Design is shown in Fig.7

And Method Minimum
Or Method Maximum

Agg Method Maximum
Defuzzification Method Centroid

B. Membership Functions (MF)
A Membership function is a curve that defines how each point in the input space is mapped to a embership value or degree of membership between 0 and 1. The only condition a membership function must really satisfy is that it must vary between 0 and 1.
The Fuzzy Logic Toolbox includes several built in membership function types. The list of membership function types are linear function, Gaussian distribution function, sigmoid curve, straight lines, triangular, trapezoidal and quadratic and cubic polynomial curves. All membership functions have the letters mf at the end of their names.
The selected membership function types are: a) Triangle: The Triangular membership function name is trimf. It collects more than three points to form a triangle. b) Trapezoidal: The Trapezoidal membership function name is trapmf. It has a flat top and a truncated triangle curve. c) Sigmoid: The Sigmoid membership function name is sigmf. It provides asymmetric membership functions. d) Gaussian: The Gaussian membership function name is gaussmf. It provides smooth and nonzero curve at all points. Fig 6,7,8,9,10 is the input membership functions whereas Fig.11shows the output membership.

V. FUZZY SCORE
The output will be in the form of Fuzzy Score, for all the Inputs individual score will be generated by FIS. Fuzzy Score is the value that is calculated by FIS considering all fuzzy constraints and membership functions. Fuzzy Score is decided by fuzzy rules and input variables. The Fuzzy Score for this FIS is shown in Fig 9.

A. Classification
Classifier assigns a class to the feature extracted signal as AWAKE, REM and SWS using fuzzy rules. The Fuzzy Classification result is shown in Fig.10. The interval between 0 to 4 is classified as AWAKE, interval between3.5 to 7 is classified as SWS and the interval between 6.5 to 10 is classified as REM. These results have plotted in Membership Function as shown in Fig.10. The Fuzzy rule based Classification was evaluated for the Feature Extracted data Set. FIS generates score for each input signal based on the fuzzy Constraints and Fuzzy Rules. Finally, the obtained Fuzzy Score is classified as definitely awake interval between 0 and 3.5, probably awake interval between 3.5 and 4.5,definitely SWS interval between 4.5 and 6.5, probably SWS interval between 6.5 and 7,definitely REM interval 7 and 9.5and probably REM 9.5 and 10 by using algorithm.