4
SLEEP STAGE CLASSIFICATION
Sleep is necessary for physical health and good quality of life, and
clinicians and researchers have been long debated till now as how to understand it
best. Manual approaches to sleep classification have been in use for over 40 years,
and in 2007, the American Academy of Sleep Medicine (AASM) published a new
sleep scoring manual. Over the years, many attempts have been initiated to
introduce and validate the machine learning and automated classification
techniques in the sleep related research fields, with the goals of improving
consistency and reliability.
The complexity of biological systems makes the traditional
quantitative approaches of analysis insufficient. There is an unavoidable
substantial degree of fuzziness or imprecision in the description of the behavior of
biological systems as well as their characteristics. The fuzziness in the description
of such systems is due to the lack of precise mathematical techniques for dealing
with systems comprising a very large number of interacting elements or involving
a large number of variables in their decision tree. Fuzzy sets are known for their
ability to introduce notions of continuity into deductive thinking.
Practically, it means that fuzzy sets allow the usage of conventional
symbolic systems in continuous form. This is essential as medicine is a continuous
domain. Many practical applications of fuzzy logic in medicine use its continuous
subset feature such as: fuzzy scoring, continuous version of conventional scoring
systems, and fuzzy alarms. The best developed approaches are for fuzzy control,
providing the most successful application to date in which a linguistic rule base
mapping from input to output variables effectively implements a continuous
control law.
Sleep staging is very important, as it is typically used to assess and
diagnose patients with sleeping disorders such as sleep apnea or hypersomnia, as
well as in more generalized studies to learn more about the physiology of human
sleep. The sleep stages of “normal” (non-disordered) adults typically cycle
through a basic sequence over the course of the night, and that sequence is often
1
referred to as “sleep architecture”. It has been shown that disruptions of one’s
sleep architecture can have a detrimental effect on cognitive functioning and that
certain sleep disorders show distinct patterns that differ from the sleep architecture
of the “normal” population. Therefore, to both aid in identification and diagnosis
of disordered sleep as well as expand the understanding of regular sleep and its
function, it is important that the outcome of these sleep studies be based on an
accurate view of a patient’s sleeping patterns
The dominant internationally accepted theory on sleep is that different
levels and combinations of EEG wave patterns characterize the different stages of
sleep. According to the standard sleep manual by editors Rechtschaffen and Kales
(usually denoted “R&K”), A Manual of Standardized Terminology, Techniques
and Scoring System for Sleep Stages of Human Subjects, there are six possible
sleep stages: Wake (for periods when the subject is awake), Stage 1 (light sleep),
Stage 2 (the most prevalent stage), Stage 3, Stage 4 (both stage 3 and 4 are known
as deep or slow-wave sleep stages), and rapid eye movement (abbreviated REM,
this stage is also known as dream sleep or paralysis sleep). Each stage has its own
set of identifiable traits (or features) that can be observed in an EEG recording.
2
4.1 Rules for Manual Classification
A wide range of frequencies are present in the EEG signals. They are classified
into four frequency band: - Alpha (8-12 Hz), Beta (12-45 Hz), Theta (4-8 Hz) and
Delta (0.5-4 Hz).After the signal is filtered and base line removed the power
spectrum of the signal is evaluated which is also shown in figure 4.1. Rules for
manual scoring were first laid down by R&K in 1968 [18] which were later
renewed by American Academy of Sleep Medicine (AASM). As per the rules laid
down by AASM, R&K scoring manual [1] [18], table 1 determines the various
conditions required for classification of signals into different sleep stages.
3
Table 1:- Fuzzy rules for sleep classification
The high and low forms the fuzzy sets to which the input can belong to and X
represent the input that is redundant [1]. Table 1 represents the fuzzy rules that
have been incorporated in the Neuro-Fuzzy system (NFS) to handle the fuzziness
of the system. The rules are laid down for the three stages only as per which the
classification is done.
4
The study of the different frequency bands of the EEG reflects changes which
are further reinforced by the sleep stages rules as discussed in section 4.1. The
frequency of various bands lies between 0- 32 Hz and are predominantly present
throughput the EEG. Fig 4.1, 4.2, 4.3 and 4.4 shows the band power comparison for
Alpha, Beta, Theta and Delta bands respectively.
Fig 4.1:- Alpha Band Power comparison for AWA, SWS and REM sleep stages
5
Fig 4.1:- Beta Band Power comparison for AWA, SWS and REM sleep stages
Fig 4.3:- Theta Band Power comparison for AWA, SWS and REM sleep stages
6
Fig 4.4:- Delta Band Power comparison for AWA, SWS and REM sleep stages
Fig 4.1 shows that Alpha band power of AWA and REM stages are higher
predominantly as compared to SWS stage. Fig 4.2 shows the Beta band power for
AWA and REM is relatively higher predominantly while SWS stage band power
varies randomly that’s why no fuzzy variable is assigned to it while Beta band
power is assigned High for Awake and REM stages. Fig 4.3 shows that Band
power of AWA and REM is predominantly lower than 0.2 dB , hence , Fuzzy
variable LOW is assigned to these stages .while Theta band power of SWS varies
from 0.12 dB to 0.36 dB thus no fuzzy variable is assigned to this stage. Similarly,
for delta band power, SWS stage has band power lying around 0.5, which is
assigned the fuzzy variable high while that of AWA and REM shows random
changes and are assigned no variable.
7
4.3 Variation in EMG and EOG activity for different sleep stages
Variations in the EMG and EOG waves also reflects certain stages and can
reinforce the result from the EEG information. EOG activity is plotted in figure
4.5 and EMG activity is plotted in figure 4.6.
Fig 4.5:- EOG comparison for REM, SWS and AWAKE state
8
Fig 4.6:- EMG comparison for REM, SWS and AWAKE state
Fig 4.5 shows that REM-EOG activity is much higher in comparison to AWA-
EOG and SWS-EOG. Thus, for REM-EOG fuzzy variable high is assigned to this
stage. Similarly for EMG, from fig 4.6, AWA-EMG is higher compared to REM-
EMG and SWS-EMG, and HIGH fuzzy state is assigned to that stage.
9
Fuzzy Logic Limitations:
1. Highly abstract and Heuristic
2. Need experts for rule discovery
3. Lack of self-organizing & self-tuning mechanisms of NN
10
A sugeno type fuzzy object is created and all the six features (Four relative
band powers, Mean EOG, Mean EMG) are added to the fuzzy object. Two
fuzzy sets high and low of the nature ‘gbellmf’ are added to each feature (Fig
4.7). The generalized bell function has the advantage of being continuous and
adaptive to the variation in its parameters. Fuzzy rules as depicted in the Table
1 are added to the system. Fig 4.8 shows the added rules in the fuzzy system.
The range of the membership function is decided by calculating the minimum
and the maximum value of the respective input.
The final fuzzy system as designed is shown in Fig. 4.10. First layer represents
the six inputs, second layer shows the corresponding membership functions
(High or Low) .Each input is linked to two membership functions which will
give the output in the range of 0-1 representing how high or low the input is or
how likely is for the input to be present in the given membership functions
high or low. The third layer represents the fuzzy rules framed as per the AASM
journal and R&K manual [1] [16]. The third layer is responsible for
determining the firing strength of the rules. Fourth layer weighs the three rules
relatively and these are summed in the fifth layer to get the output.
Then the fuzzy system is trained for the input datasets, which consist of
extracted features along with their labels. During labelling the output is
represented as following: - 0 for AWA stage, 0.5 for slow wave sleep (SWS)
and 1 for Rapid Eye Movement (REM).The output of the system varies from 0
to 1.so, in order to assess the classes varies rules are created which is given in
the Table 2 .70% of the dataset, is used for training and rest 30% is used for
testing and evaluation purpose. The fuzzy system is trained for 1000 Epochs
and the error of the system decreases rapidly or the learning algorithm saturates
at about 200 epochs as can be seen in fig. 4.9 which implies that the system is
now trained and further epochs won’t make much change in the weights of the
network.
11
0.66-1 Rapid Eye Movement(REM)
In the Table 2 Range for AWA is chosen less than 0.33 because in a span of 0-1,
inputs belonging to this range will be closer to its label i.e. 0.Similar logic is
applied for selecting the range for SWS and REM stage. The output obtained is
compared to the hypnogram achieved from the visual inspection of the datasets
and the accuracy of the algorithm is determined. Since most of the time visual
inspection of the datasets is not possible the fuzzy system proposed here can be
used to classify sleep stages.
Fig 4.7:- Fuzzy stes low and high for various inputs
12
Fig 4.8:- Rule Viewer ANFIS
13
Fig 4.9:- Training error at different epoch
14