EEG Analysis
Sleep Pattern detection
@kaggle.jbouv27_eeg
Sleep Pattern detection
@kaggle.jbouv27_eeg
The goal of this dataset is to detect a certain type of pattern (called “spindle”) inside Electroencephalogram (EEG) waves.
Data come from Garches Hospital Sleep Studies Lab (France, Paris area)
They are extracted from a single EEG, mostly from C3-A1 and C4-A1 electrodes
We have used 2 kinds of inputs to read these waves :
raw Difference in potential -> FFT -> periodogram -> frequencies and power spectral densities
The use of frequencies and densities gives much better results.
We know that the spindles must occur in the middle of a certain type of waves (theta waves), so we take as a training set a mixture of spindles and theta waves, and associate the outcome value 1 (as factor) for spindles and value 0 for theta waves.
The 1st part of the algorithm already identified the “spindle candidates” from windows of 1 second in the EEG raw waves and sent these candidates to the “authentication” program, which is the one described. So I used R neural networks (nnet) and Kernel Support Vector Machine (KSVM) for the authentication.
Here is the program with neural net.
In version 2, I added raw EEg data of 30 mn of sleep (extrait_wSleepPage01.csv) and expected patterns (spindles.csv) manually extracted.
If one of you guys has a method to more directly identify spindles from the sleep page, you are welcome !
CREATE TABLE extrait_wsleeppage01 (
"date" TIMESTAMP,
"hh" BIGINT,
"mm" BIGINT,
"ss" BIGINT,
"eog_left" DOUBLE,
"eeg_c3_a1" DOUBLE,
"eeg_o1_a1" DOUBLE,
"eeg_c4_a1" DOUBLE,
"eeg_o2_a1" DOUBLE
);CREATE TABLE spindles (
"date" VARCHAR,
"hh" BIGINT,
"mm" BIGINT,
"ss" BIGINT,
"eog_left_uv" DOUBLE -- EOG Left[uV],
"eeg_c3_a1_uv" DOUBLE -- EEG C3-A1[uV],
"eeg_o1_a1_uv" DOUBLE -- EEG O1-A1[uV],
"eeg_c4_a1_uv" DOUBLE -- EEG C4-A1[uV],
"eeg_o2_a1_uv" DOUBLE -- EEG O2-A1[uV]
);Anyone who has the link will be able to view this.