A Novel Approach for Computer Assisted Sleep Scoring Mechanism using ANN

Sleep analysis and its categories in sleep scoring system is considered to be helpful in an area of sleep research and sleep medicine. The scheduled study employs novel approach for computer assisted automated sleep scoring system using physiological signals and Artificial neural network. The data collected were recorded for seven hour, 30 second epoch for each subject. The data procured from the physiological signal was controlled and prepared to expel degenerated signals in order to extract essential data or features used for the study. As, it is known human body distributes its own electrical signals which is needed to be eliminated and these are known as artifacts and they are needed to be filtered out. In this study, signal filtering is achieved by using Butterworth Low-Pass filter. The features extracted were trained and classified using an Artificial Neural Network classifier. Even though, it is a highly complicated concept, using same in biomedical field when engaged with electrical signals which is obtained from body is novel. The accuracy estimated for the system was found to be good and thus the procedure can be very helpful in clinics, particularly useful for neurologist for diagnosing the sleep disorders. Keywords—Sleep scoring stages; EEG; EMG; EOG; artificial neural network


A. Sleep Scoring System and its Classification
Sleep is the emotional, mental and physical condition of body which is naturally recurring, distinguished by altered consciousness, comparatively inhibited of nearly sensor activities, inhibition of all voluntary muscles, and reduced interactions with surroundings [1]. Sleep is a highly conserved behavior across animal evolution. It is that condition in which a person goes from conscious to sub conscious state. Sleep is considered to be an essential element in many physiological processes which includes consolidation of memories and the processing of experiences. The significance of sleep is emphasized by the indications experienced by those who suffer from the disorders of sleep. Individuals suffering from disorders of sleep like insomnia, narcolepsy, nocturnal breathing etc. do not get adequate sleep and thus need to be treated [2].
Scoring mechanism procedure is done by the inspection and examination of polysomnography (PSG test) which can be obtained in the presence of sleep specialist. It is considerably essential feature in the area of sleep medicine and research which is going on sleep scoring. On the other hand, PSG (Polysomnography) is a test which involves transmission of records of various biological signals like EOG (Electrooculogram), EEG (Electroencephalogram), EMG (Electromyogram). All of recorded signals collected known as epoch which are obtained for short span of time are inspected carefully which designates different sleep classification [3].
Normally, sleep scoring system categorizes sleep into different types of classification such as Waking, Rapid Eye Movement (REM), Non-Rapid Eye movement (NREM). Waking is the stage when the individual prepares for sleep. In this stage, person is at leisure and in a calm position, also Electromyography of a person conceivably is elevated or in average mode. NREM are further divided into four stages i.e., stage 1 which occurs after little time is spent in waking stage and Electromyography is diminished, stage 2 in which subject is in the condition of sleep and EMG value decreases, stage 3 in which EMG gets reduced due to relaxed muscles, stage 4 which records the moderate EMG and subject is termed asleep. REM is the stage in which EMG demonstrates muscle tones called as twitches and is distinguished by random or rapid movements of eye [4].

B. Artificial Neural Network (ANN)
(ANN) Artificial Neural Network is significantly engaged computing approach. Artificial Neural Network are being used for a different kind of purposes like recognition of image, pattern recognition, analyze and classification. It has become popular for the widely array of fields in the world of computing. The designing ease of balanced equation, execution of time and good accuracy has made (ANN) artificial neural network extremely functional classifier in terms of calculating the large amount of data [5] [14].
The modeling and design of (ANN) artificial neural networks is influenced from human neural network. The human brain consists of cells known as neuron whose main purpose is processing, assembling and distribution of electrical signals while an artificial neuron is information processing unit that is similar in operation of biological neural network. Arithmetically, it can be stated as operation performed by an activation function which receives input x and weight w. It can be written as: Where is the input to neuron and is weight related to input. An activation function is applied to net giving as a *Corresponding Author result the output of neuron O and amplitude of neuron in output is limited by this function [6].
The basic characteristics of neural networks when acquired for computational cause are its capability to adapt as well as characteristics of parallel-distributed memory and nonalgorithm. It comprises of three operational layers i.e. input, output and hidden layers respectively as shown in Fig. 1. Also, it has been seen that here can be possibility of additional middle layers which performs an assemblage of various tasks. The middle layers made up of cells whose main function is to perform summing which is a product of preceding layer given out by output [7]. The resolution of hidden layers is the censorious work in terms of figuring and outlining the neural networks. The calculation of middle layers and its activation function are done moderately by artificial neural network by employing hit and trial method. This phase of procedure is known as training phase and the trained function of artificial neural network is required as per computation.

II. MATERIAL METHODS
The implementation is based on Artificial Neural Network classifier using MATLAB software. Fig. 2 shows the approach to carry out the work using ANN. The research evaluates the following performance metrics to verify the superiority of the scheduled work employing Artificial Neural Network (ANN).

III. RESULTS
The standard data base of physiological signals was collected from different hospitals especially from the sleep laboratories in front of sleep specialists. The real-time Electroencephalograph signals were acquired using electrodes on surface of skin which are standard. Electromyography signals were acquired by utilizing electrodes kept below the persons chin which are in two in number. The Electrooculography signals were obtained by utilizing electrodes placed either below or above the eye or to the right or left of the eye. By analyzing the biomedical signals different stages of sleep was understood. The different steps of the research are as follows:

A. Signal Processing
The initial signal procured from EMG must be controlled which is needed for the utilization of ANN. The signs are prepared to expel degenerated signals, extract important data and to foresee values. Biomedical signs are frequently undermined by different waves which are not related in the slightest degree. Biological or specialized issues are the purpose behind these waves. A human body delivers its own electrical exercises and it can be seen utilizing the accompanying gadgets.
• ECG artifacts causes spike in the QRS complex stage.
• EOG artifacts appears by movements of eye and blinking.
• EMG are the high-frequency artifacts.
The most well-known technique to eliminate these artifacts is the technique of filtering utilizing high-pass channels, bandpass channels, and low-pass channels, contingent upon the artifact itself. The motivation behind preprocessing the signal is to enhance the signals of EMG by normalizing. EMG flag is fragmented into epoch of 30 seconds each with every epoch corresponding to various rest stages. In this, the signal filtering is achieved using Butterworth Low-pass channel (LPF) having 4 Hz to 4000 Hz of cut-off frequencies so that artifacts and noises are eradicated from the EMG signals.

B. Feature Extraction: Time Domain Analysis Entropy
Histogram of each epoch is used for computing the corresponding entropy.
(2) y(i) is measured for the signal which is y inside each epoch and n is the sample numbers.
In order to calculate the histogram, bin number is termed as N.
y(i) samples whose values are in the ℎ bin range so that the number of values is denoted by .

The 75th percentile
Signal Acquisition

Stages of Sleep
Signal Processing

Feature Extraction
The extracted features are to be trained and classified using ANN (Artificial Neural Network). 639 | P a g e www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 8, 2020 The 75% of the values which lies below it are the onethird quartile or upper quartile.
y(i) is measured for the signal which is y inside each epoch.
And the card is referred as the number of elements in set.

Skewness
Skewness is defined as distribution of random variable having asymmetry probability with reference to its mean value. The skewness ranges between positive, negative or not defined values. It is seen if the values of left side are further distant than that of the values of right side, then skewness value will be negative, likewise if the right side values are further remote than that on the left side values then skewness value is positive and if the value is zero then the distribution is symmetric.
Mean is denoted by M3 and standard deviation by M2

Kurtosis
Likewise to skewness, kurtosis communicates the state of likelihood conveyance. It quantifies the commitment of remote qualities. Kurtosis of an ordinary distribution is equivalent to 3. At the point, it is seen that when the values of kurtosis is lesser than 3, it is termed as platykurtic distribution because outliers contribution becomes lesser than in normal distribution. Then again, when its is higher than 3, the outliers contribution is greater than ordinary dispersion and circulation is termed as leptokurtic distribution.
Where; Mean is denoted by M4 and standard deviation by M2

Hjorth Parameters
The three distinct parameters which are calculated from epochs having long 1s or longer, utilizing the variance as a parameter for measuring the signal activity are Hjorth parameters.
• Activity • Mobility where ′ stands for the first derivative of .
• Complexity (Form Factor) where ′′ is the second derivative of .

Variance
It is a number which indicates group variability of an individuals are wide. If the observation of each individual greatly varies, then variance becomes large and otherwise low with reference to its mean group. In a sample it is essential to differentiate population variance. Mathematically, variance population is the distribution from each data point to the square of mean in the population. It is given by: where population variance denoted by σ 2 , population mean denoted by X, ith element from the population denoted by X i and number of elements in the population by N.

Root Mean Square (RMS)
The Root Mean Square is defined as the square root of squares of set of quantities or numbers. The Root Mean Square value of a continuous -time waveform is described as the square root of the arithmetic mean of the squares of the values. For a set of n values� 1, 2 , … �, the RMS values can be computed using the formula:

Mean Absolute Deviation (MAD)
The quantitative data of sample is univariate and is measured using the mean absolute deviation. It is also referred as calculation of sample estimated by Mean Absolute Deviation featured as population parameter. The Mean Absolute Deviation computed for a univariate data set � 1 , 2,…. � is the median of absolute deviations from the median of the data. Mathematically it is represented as.

The Standard Deviation
It is a parameter which measures the dataset dispersion relative to its mean. It is computed as the square of variance by deciding the variation amid each data point analogous to its mean. If the data points are far from the mean value then the deviation will be higher in the dataset hence higher the range of dataset higher is the deviation.
Where n, the number of samples x(i) for the signal which is measured which is x within the epoch, the mean value of the signal x is represented by : 640 | P a g e www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 8, 2020 C. Frequency Domain Analysis Analyzing the spectrum of the signal is useful for describing the signal with the help of its components of frequency. The time shift and magnitude of the frequency components will provide the characteristics of the signal and hence allowing further classification of the signals.

Fourier Transform
Fourier transforms (FT) are commonly used in expressing the spectrum of a continuous signal. But it can be used only in case of continuous signals and not for discrete signals.
where ( ) is the signal's spectrum, ( ( )) is Fourier Transform of the function ( ), and is frequency.

D. Estimation of Power Spectrum
EEG being randomly distributed signal, its procedure can't be anticipated. Despite the fact that the signal itself must be accessible for its investigation, diverse strategies for examination are utilized. Randomly distributed signal procedure creating the flag is vital to investigate. Well-known characteristics of various recognition that are anticipated with definite likelihood enable us to foresee the subsequent recognitions of the randomly distributed signal procedure and different techniques can be made to additionally function with signals created by this kind of procedure. Power spectrum parametric and non-parametric strategies can be used for forecasting.

E. Nonparametric Methods
The use of the received data is sufficient for defining the non-parametric methods, and there is no need for setting up the models to generate the signals. The techniques of periodogram and correlogram are the most common nonparametric methods. Thus, the most commonly used nonparametric method is periodogram and is defined as: where number of realizations is M and number of samples in N. The power spectrum can be estimated from a single realization itself.

F. Parametric Methods
Parametric methods generally involve the creation of models for the starting of the signal. The model will later characterize the both its signal as well as its spectrum. Reduction of the data for representing the spectrum more realistically is done by the models. But choosing these models along with its order is a difficult task.

G. Artificial Neural Network
NNs, by and large, are designated from biological neural networks, however with significantly more straightforward structures which have learning and responding qualities. Some different attributes, are realized with designing methodologies rather than neuropsychological ones. The central qualities of NNs presently set in motion are versatile, parallel disseminated memory and non-algorithmic. ANN are as of now, utilized in investigation, order, pattern recognition, classification and examination of functionality of systems and signals. They additionally have been very fruitful in analyzing the bio signals to a vast degree, as well as the investigation and elucidation of Electroencephalograph amid subjective interest, sleep or rest. An Artificial Neural Network comprises of input and output layer that are one in number and hidden layer/s including which are one or more than one in number. The hidden layer includes cell that sum up the former layer multiplied with a weighting vector in the output through neurons. Every node or cell will then produce an output with transfer function as non-linear function which is referred to as the activation function.
The ANN can be utilized as classifier, with respect to the positive after effects of different investigations on this matter of subject. For classification, Artificial Neural Network classification was done by software called as Matrix Laboratory (MATLAB). Sleep epochs range used differs, based on the different stages of sleep combination being classified, training and testing of data were always used. The data obtained was segmented into training set, validating set and the testing set which constitutes 60%, 20%, 20% of total data respectively. There were three kinds of data classification seen by using this approach. The first approach of categorization varies only between the Wakeful stage, N1 stage, and REM stage, while the second alternative categorizes W, N1, N2, and REM sleep stage, and the third categorization scores all the stages of sleep. Input and target matrix are the most important representation of neural network.
The training set used in training of Artificial Neural Network is the input matrix and for adjusting the neural network depending on the differences amidst the target and output of the neural network is the target set. The obtained data were segmented into three sets, namely, training, validating and testing set using the function divider and are in the ratios of 60 % for training set and remaining 40 % of the testing set respectively. The sleep experts marked the correct stage of column representing zeroes and ones as one in the target matrix.
For creating the Artificial Neural Network, the function tool is opened in the generator in MATLAB software. The variables for the input as well as the target are chosen along with distributing the testing as well as training sets. The Levenberg-Marquardt algorithm optimizes the weights and bias update is chosen due to its high speed for the function of training the network. For creating the structure of ANN, the selected hidden neurons are required and the output is the variable net within all the network parameters. Fig. 3 show the structure of ANN.
The output represents the adjusted network (net), number of the learning epochs and momentary performance (perf). The performance of the network is set with the help of minimum square error method. For statistical evaluation of performance and accuracy of the confusion matrix for the ANN a comparison of the results and the targets is illustrated in Table I. The actual class is represented by the row and predicted class by the columns.  The confusion matrix in MATLAB can be plotted using the plotconfusion function. The number of appropriate classifications into class 1 is represented by true positive, classification number incorrectly assigned to class 1 is the false positive, the case numbers where the sleep epoch is incorrectly anticipated belongs to class 0, is false negative and the times number where the sleep epoch is not correctly assigned to class 1 is true negative. Table II presents the explanation of a confusion matrix.  This total confusion matrix plot shows 100% correct classification for the proposed system. The representation of error histogram plot shows the error of this proposed system is very close to zero. At the beginning of training, cross entropy error and the plot performance is maximum. For the scheduled system, epoch 11 has shown best validation performance, and the cross-entropy error is very close to zero. Table III presents the results of statistical parameters while the comparative analysis of different methods is shown in Table IV. 642 | P a g e www.ijacsa.thesai.org       Vol. 11, No. 8, 2020 The research evaluates the following performance metrics to verify the superiority of the scheduled work using Artificial Neural Network (ANN).
The following table gives the results of Variance, Root mean square, Mean absolute deviation and standard deviation.
The following table gives the comparative analysis of the proposed method and the existing research.

IV. DISCUSSION
Using physiological signals through the classifier Artificial Neural Network has proved an effective approach of determining different stages of sleep with good accuracy. Non-invasive biological measurement method [13] that defines relationship between sleep stages and physiological signal through a developed classifier via mathematical tool has been achieved effectively. The accuracy obtained by Tagluk et al. [12] on scoring capability was obtained to be 74.7% which was considered good enough when contrasted to that acquired by Hanaoka et al. [15]. However, the motive of present study is to determine sleep stages using physiological signals (EEG, EMG, EOG) recorded simultaneously and fed to Artificial Neural Network.

V. CONCLUSION
The motive of the research was not to look at the outcomes obtained by comparison techniques, however to present a strategy that utilizes EEG, EMG, EOG signals to be given to a pre-prepared Artificial Neural Network classifier with a high precision. The current study proposes computer assisted sleep scoring system using ANN. The data base was obtained from different hospitals in presence of sleep analyst. The signals obtained were pre processed in order to EMG signals by the process of normalization. The extracted features were classified using ANN and the accuracy evaluated by performance metrics is 83.33%.