progress of how the pipeline changes and how logistic regression can be used to detect spindles in EEG channel data
Pipelines for analyzing EEG data and detect spindls, sleeping stages, and k-complex.
- Threshold detection algorithm
- ASI capturing alpha,beta,spindle activity in terms of power density
- lowpass 200 Hz (however, literature suggests also highpass at 1 Hz to advoid overfitting ICA)
- apply notch filter at 60 Hz
- MNE ICA: iterration = 3000, fixed random state
- artifact dectection is based on channles "LOC" and "ROC", and run automatically
- rejection parameters: EEG: 80 - 160 depending on subjects; tstep: 2 seconds; EOG criteria: 0.4; skewness: 2; kurt: 2; variance:2
- bandpass 0.1-50 Hz
- bandpass slow/fast spindle range (10-12Hz/12-14Hz) (Begmann et al., 2012)
- select channels: F3, F4, C3, C4, O1, O2
- use a moving window to compute root-mean-square (RMS): Gaussian window, standard deviation = windown length / .68 / 2, window length = 2000 samples, convolution using central part of convolution of the same size
- compute the harmonic mean of the RMSs of the 6 channels and call it the mean channel
- compute RMS for the mean channel
- compute trimmed mean and trimmed standard deviation (5%) on the data after the first 100 seconds and before the last 30 seconds for both the individual channels and the mean channel
- lower_threshold = mean + lower_threshold * standard deviation (Begmann et al., 2012)
- higher_threshold = mean + higher_threshold * standard deviation
- post threshold parameter: segments that is above the threshold and duration of the segments is in between 0.5 - 2 secs
- determining spindles: find spindles in AT LEAST (>=) 3 channels AND find spindle in average channel at the similar time stamp (deviate < 1 second)
- delta 1: 0-2 Hz
- delta 2: 2-4 Hz
- theta: 4-8 Hz
- alpha: 8-12 Hz
- beta: 12-20 Hz
- slow spindle: 10-12 Hz
- fast spindle: 12.5-14.5 Hz
compute power spectral density of all these frequency bands using a moving window with lenght of 10 seconds and overlapping half of the window size. power spectral density is rescaled by 10*log10
- alpha drop == awake to stage 1 sleep
- alpha drop and beta drop == stage 1 to stage 2 sleep
- alpha drop and beta drop, and slow/fast spindle increase == generating spindles