DETERMINATION OF SLEEP STAGES FROM EEG DATA USING HYPNOGRAM PLOT

Road accidents are a major factor for deaths world wide and recent studies show that driver fatigue is a key factor for road accidents. Drivers tend to drive vehicles even if they are extremely tired and due to this, there is chance of them falling asleep at the wheel which results in accidents causing m a j o r loss to precious human life & property. This implies there is a need for a driver alert system which monitors the driver’s wakefulness and gives an alarm. This paper proposes a novel technique to determine sleep stages by considering the available EEG Signals of the subject, calculate its FFT and determine the power spectrum. Using this we then plot the hypnogram from which the wakefulness and sleep stages can be determined and if the driver is found to move from a state of wakefulness to sleep stage, immediately an alarm is provided. This concept can be enhanced for real time application with hardware realization and thus helps to reduce road accidents to a great extent.


I. INTRODUCTION
Despite increased automation, many critical aspects of our lives depend on operator control. As we drive more comfortable cars longer distances and run systems with 3 shifts, operator alertness becomes an increasing safety issue. A number of researchers have described the characteristics of alertness exhibited in the EEG signal [1] and have applied neural networks to estimating these alertness levels. Almost everyone knows that driving a motor vehicle under the i n f l u e n c e of alcohol or other drugs is a deadly combination. However, few people seem to realize the danger associated with driving while fatigued. In fact, drivers who become drowsy or fall asleep at the wheel contribute to thousands of crashes each year. Fatigue is a condition that affects everyone. Although typically associated with long-distance driving, fatigue can set in after a long day at work, an outing at the beach, or virtually any activity. Circadian rhythm, the body's natural rhythm associated with the earth's rotation, causes nearly everyone to be less alert or even drowsy between 1 and 5 p.m. We need to design a system which constantly monitors & analyzes the wakefulness of the driver and gives an alarm to the driver whenever he is about to go a state of drowsiness, thereby indicating that he is fatigued and needs to take a break and then resume the journey, thereby reducing the danger (Fig 1) not only to himself, but also to the other motorists on road. Electroencephalogram are recordings of the small electrical potentials (generally less than 300μV) produced by the brain. The frequencies (table 1) of these brain produced signals range from 0.5 to 100Hz, and their characteristics are highly dependent on the degree of activity of the cerebral cortex [2]. International Journal of Machine Intelligence ISSN: 0975-2927 & E-ISSN: 0975-9166, Volume 3, Issue 3, 2011 Table. 1-Spectrum of EEG signals

II. DETECTION OF SLEEP STAGES FROM EEG DATA USING HYPNOGRAM PLOT
A. Comparison with FFT Common practice in EEG power spectral analysis is to calculate an individual Discrete Fourier Transform for a short section of EEG signal data [8]. This approach is based on calculating Fourier coefficients after all analog samples over the section of the signal are digitized by A/D converter.

B. Linear and nonlinear measures
Spectral theory is conventional and the most used Linear tool in the analysis of bio signals. Spectral analysis [11] is used to investigate the signal's power in the various frequency bands and also the mutual relationships between more signals. It is based on Fourier transform which displays signal in the frequency domain [9].
is the amplitude corresponding to the frequency and N is the number of values. The power of particular frequency band is computed as the sum of modulus-square amplitudes belonging to this band. Here is an example of the power in alpha band (8Hz-12Hz): ∑ Where 8 Hz is the lower limit of alpha band and 12Hz is the upper limit of alpha band. Another often computed index is coherence that reflects the degree of synchrony between signals from different derivations (brain areas). It is calculated as the ratio between cross spectrum of two signals and a product of their auto spectra: Where PAB is the cross-spectral density, PA and PB is the auto spectral density of signals A and B respectively.
. Hypnograms were developed to summarize the voluminous chart recordings of electrical activities (EEG, EOG, and EMG) collected during a night's sleep. Hypnograms provide a simple way to display information originally collected on many feet of chart paper or stored as large file on a computer.

III. ALGORITHM
The EEG frequencies in the frontal lobe of the brain are for the detection of the activity which detects the sleep stage of a person. Carefully analyzing the frequency we can determine the sleep stage. The signal is compared with a predetermined threshold value and if found to be below the required threshold, the device notifies the user by an alarm signal. The various Bioinfo Publications samples are collected from different persons by placing the electrode on different positions of head. The EEG data in time domain is not sufficient to analyze, which has to be transformed to frequency domain to get the required frequency spectrum. The power analysis has to be done to determine the strength of the signal. This signal is subjected to hypnogram analysis to indicate the sleep stage which leads to an alarm. The algorithm was simulated using MATLAB 7.

Fig.4 Stages of EEG Analysis
As shown in the figure above EE G data is collected from the subject and the subsequent process can be divided into 3 stages.
i. In the first stage we convert the EEG data which is in time domain to frequency domain using power spectrum analysis.
ii In the next stage the result of power spectrum analysis is classified as wakefulness or sleep stage1.
iii. In the final stage we use hypnogram to plot the classified stages and give an alert whenever there is a transition from wakefulness to sleep stage1.

IV.RESULTS AND O BSERVATION TESTING FOR SIMULATED INPUT
The figures show the results we have obtained for simulated signals used in our program. The first plot in each figure represents the test signals which have implemented in our program for testing it. The second plot represents the power spectrum for above mentioned test signals. The power spectrum shows the spike at particular frequency whereas in all other frequencies it will plot the value 0. This is the output of the test signal passed to our program. We are sending 2hz sine wave and 8hz Cos wave, the spikes in the power spectrum on right side represents the 2Hz and 8Hz component of the wave. Hence the power spectrum perfectly determines the frequency components. The third plot is that of the hypnogram which plotted sleep stages versus time is. According to the program the sleep stage representing 2Hz and 8Hz is sleep stage 1 and it is perfectly showing it in the output screen of the hypnogram and hence the program is verified by passing test signals and hence it can be used for determining the sleep stages

V.CONCLUSION & FUTUREWORK
To conclude, the determination of sleep stages using the concept of hypnogram plot provides a solution to driver fatigue which is one of the major causes of road accidents. Technical devices to detect when drivers are feeling sleepy and provide warnings to them is the need of the hour & thus hardware implementation for real time as an extension must be done and this facility must be inbuilt & made mandatory for all vehicles. However, it may be that technological advancements in the long term would enable motor vehicles (with a few exemptions) to have some form of system that records and maintains a record of an individual's driving hours, no matter what vehicle they are driving. Secondly, as shown during the implementation of the program, this concept can have multiple applications such as recording & monitoring of sleep pattern of patients.