Skip to content

Commit fead8cb

Browse files
committed
putting things together
1 parent af3f424 commit fead8cb

File tree

4 files changed

+90
-52
lines changed

4 files changed

+90
-52
lines changed

report/discussion.tex

+21-3
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ \subsection{Quality of the raw data}
148148
When training a model, this uncertainty can be included, for instance, as a weight.
149149

150150
\subsection{Final result}
151-
The predictions of the classifier presented in this research agreed with ground truth for 92\% of epochs (table~/ref{tab:confus}).
151+
The predictions of the classifier presented in this research agreed with ground truth for 92\% of epochs (table~\ref{tab:confus}).
152152
Although the limitation of the ground truth annotation make it is hard to put this result into perspective,
153-
this score is satisfactory.
154-
In addition, prediction did not result significant difference in prevalences.
153+
this score is very promissing.
154+
In addition, prediction did not result in significant difference in prevalences.
155155
However, there were, on average, much less \gls{rem} episodes in the predicted time series.
156156
The duration of \gls{rem} episodes was also over-estimated by prediction (though this is only marginally significant).
157157
Altogether, this indicates that \gls{rem} state is less fragmented in the predicted data.
@@ -166,3 +166,21 @@ \subsection{Final result}
166166
Data from difernet intrument/ animals/ labs will be needed to generate a ubicuitous predictor.
167167
It is expected that non linear interaction araise, so RF will help ;)
168168
RF feature discovery
169+
170+
171+
\section{Conclusion}
172+
The aim of the study herein was to build a classifier that could accuratlty predict vigilance states from \gls{eeg} and \gls{emg} data.
173+
In a first place, \pr{}, a new python package was designed to efficiently extract a large number of features from electrophysiological recordings.
174+
Then, a random forest approach was used to eliminate irrelevant variables.
175+
Importantly, this study shows that prediction accuracy can then be improved by including features derived from restricted local avarages.
176+
The overall achieved accuracy was as high as 92\%, and although some significant stuctural differences were induced by prediction,
177+
the classifier was overall satisfying.
178+
In addition, the presented classifier can generate confidence values that can be used to moderate each prediction, and ultimately decide whether to trust them.
179+
Before considering implementation of this promissing classifier is a ubicuitous software tool,
180+
it would be necessary to generalise its results by the inclusion of different sources of data.
181+
182+
\section{Availability}
183+
The source code of \pr{} is available at \href{https://github.com/gilestrolab/pyrem}{https://github.com/gilestrolab/pyrem}
184+
and the package will be released shortly, as an open-source software, in the official python repositories.
185+
186+

report/intro.tex

+56-45
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,74 @@
11
\section{Introduction} \label{intro}
22

3-
Sleep is considered to be ubicuitous and necessary in so far as it was observed in most animal models.
3+
Sleep is considered to be a ubiquitous and necessary behaviour amongst animals.
4+
However, its real physiological functions remain debated.
5+
In vertebrate, electrophysiological recordings, in particular, \gls{eeg},
6+
but also \gls{emg} and \gls{eog} have extensively used to study the structure of sleep during the last century.
7+
They have the advantage of being non-invasive an relatively high throughput.
8+
Today, \gls{eeg} remains one of the main assess in the study sleep physiology.
49

5-
In vertebrate, electrophysiological recordings, in particular, \gls{eeg}, but also \gls{emg}
6-
Classically, activity has been classified in several discrete \emph{vigilance states}...
7-
8-
In rodents, three vigilance states are usually defined on the basis of \gls{eeg} and \gls{emg} (fig.~\ref{fig:sleep_description}).
9-
When awake (WAKE), an animal tends to have a high muscular activity which translates as a high amplitude in the \gls{emg} and a relatively low amplitude
10-
\gls{eeg} domitated by oscilations of frequency between six and ten hertz often refered as theta waves.
11-
In contrast, \gls{nrem} sleep, also called slow wave sleep is a period of muscular inactivity (low \gls{emg}) dominated by slow oscilations (below 4Hz) of high amplitude named delta waves.
12-
Finally, \gls{rem} sleep is characterised by a complete lack of muscular activity (atony) and an \gls{eeg} activity very similar to the awake state.
13-
\gls{rem} sleep is the least prevalent of all three stages, and generally represents less that 20\% of all sleeping time.
10+
Rodents models, in particular mice and rats, have proved very successful model for understanding of the mechanisms of sleep in mammals.
11+
Classically, three main types of sleep related behaviours are defined and referred as \emph{vigilance states}.
12+
Vigilance states are usually defined on the basis of \gls{eeg} and \gls{emg} (fig.~\ref{fig:sleep_description}).
13+
When awake (WAKE), an animal tends to have a high muscular activity which translates as a high amplitude voltage changes in the \gls{emg}.
14+
During wakefulness, \gls{eeg} is dominated by a relatively low amplitude oscillations of frequency
15+
between six and ten hertz often referred as theta waves.
16+
In contrast, \gls{nrem} sleep, also called slow wave sleep, is a period of muscular inactivity (low \gls{emg})
17+
dominated by slow oscillations (below 4Hz) of high amplitude named delta waves.
18+
The third state, \gls{rem} sleep, is characterised by a complete lack of muscular activity (atony) and an \gls{eeg} activity very similar to the awake state.
19+
\gls{rem} sleep is the least prevalent of all three stages, and generally represents generally 20\% of all sleeping time.
20+
The prevalence of these three states as well as there structural succession are extremely important observations in sleep research
1421

1522
\input{./figures/sleep_description}
1623

1724

18-
Although this definitions appear straigthforward, in practice, many cases are ambigous.
25+
Although definitions of sleep stages appear straightforward, in practice, many cases are ambiguous.
1926
For instance, it is difficult to characterise transitions between two states.
20-
In addition, there are many sources of variability including how surgery was performed by the experimenter,
21-
the type of recorder used and inter-animal variability.
22-
The quality of the aquisition can also be made considerably worst by noisy signals or when the presence of artefacts.
23-
For these reasons, sleep scoring, the attribution of discrete vigilence states to electrophysiological time series, is traditionnally performed by trained human experts.
24-
This task is very time consuming; several hours of work have been reported in order to score 24h of recording.
25-
This severely limits data throughput and human subjectivity is likely to introduce systematic bias.
26-
Indeed, it is expected that scoring will be perfomred differently by each expert, making result difficult to reproduce independently.
27-
Often, two experts score the same time data, in order to ensure satifying aggreement. In general, the inter-human aggrement is important \citationneeded{}.
28-
It can however be argued that experts most likely work in the same laboratory and trained one another, or were trained by the same third person.
29-
In this context, aggremment between experts does not account for the variability between communities of researchers, and cannot be used to assess reproducibility.
27+
In addition, there are many sources of variability including how surgery was performed by the experimenter, the type of recorder used and inter-animal variability.
28+
The quality of the acquisition can also be made considerably worst by noisy signals or by the presence of artefacts.
29+
For these reasons, sleep scoring, the attribution of discrete vigilance states to electrophysiological time series,
30+
is traditionally performed by trained human experts.
31+
Such manual annotation is very time consuming; several hours of work have been reported in order to score 24h of recording.
32+
This severely limits data throughput and human subjectivity is likely to introduce systematic bias.
33+
Indeed, it is expected that scoring will be performed differently by each expert, making result difficult to reproduce independently.
34+
Often, two experts score the same time data, in order to ensure satisfying agreement.
35+
Although, manual scorers are generally reported as being very consensual\citationneeded{},
36+
it can be argued that experts most likely work in the same laboratory and trained one another, or were trained by the same third person.
37+
In this context, agreement between experts does not account for the variability between communities of researchers, and cannot be used to assess reproducibility.
3038

3139
In order to overcome both speed and subjectivity limitations, efforts have been directed towards automation of sleep scoring.
32-
However, there is little addoption of automatic method and very few available implementations in the form of software that biologists could use.
33-
Typically, two different approches have been followed: unsupervided or supervided learning.
34-
35-
Unsupervised learning has the advantage of making no assumption about the nature of the different vigilence states.
36-
Therefore, this approach can lead to the discovery of truely new states.
37-
One issue is that the choice of the variables used for clustering will be critical.
38-
Often, variables such as frequency domain variables chosen in order to generate clusters that will match human defined clusters.
39-
In addition, unsupervided methods may lack robustness in so far as the cannot easily include covariates explaining, for instance, variability between recording equipments.
40+
However, there is little adoption has occurred and very few available implementations in the form of software that biologists could use have been developed.
41+
Typically, two different approaches to classification have been followed: unsupervised or supervised learning.
4042

43+
Unsupervised learning has the advantage of making no assumption about the nature of the different vigilance states, and how they should be defined.
44+
Therefore, this approach can lead to the discovery of truly new states.
45+
One issue is that the choice of the variables used for clustering is very critical.
46+
Often, variables such as frequency domain variables are in fact chosen in order to generate clusters that will match human defined clusters.
47+
In addition, unsupervised methods may lack robustness in so far as the cannot easily include covariates explaining, for instance, variability between recording equipments.
4148

42-
Another approach is to assume human annotations are in general biologically relevant and consistant, and to use supervided learning teachniques.
43-
Of course, if human decisions were baised, such a method may reproduce this biais.
44-
However, a vast corpus of experimental work has provided hypothesis about function of these states.
45-
Building a classifier that would produce a consensual prediction of vigilence states could be seen as an attempt to formalised and rationnalise the definition of such states.
46-
This could improving future research without denying decades of sleep neurobiology.
49+
Another approach is to assume human annotations are, although imperfect, biologically relevant and generally consistent,
50+
and therefore to use supervised learning techniques.
51+
Of course, if human decisions were biased, such a method may reproduce this bias.
52+
However, a vast corpus of experimental work has provided hypothesis about function of these states which tends to validate the actual `existence' of these discrete vigilance states.
53+
Building a classifier that would produce a consensual prediction of vigilance states could be seen as an attempt to formalised and rationalise the definition of such states.
54+
This would improve future research without denying decades of sleep neurobiology.
4755

4856
Many supervised learning techniques ranging from SVM, ANNs, to HMMs have been investigated.
49-
In general, the first step is to compute features on subsequent segments, know as epochs, of annotated electrophysiological signals.
50-
Then, the relation between the response variable(annotation) and the independent variables (features) can be modeled.
51-
Either epochs are considered to be independent from one another or time-dependent structures are explicitely modeled (\eg{} HMMs).
57+
In general, the first step is to compute features on consecutive segments of annotated electrophysiological signals know as epochs.
58+
Then, the relation between the response variable(annotation) and the independent variables (features) can be modelled.
59+
Either epochs are considered to be independent from one another or time-dependent structures are explicitly modelled (\eg{} using HMMs).
60+
Time aware modelling has the advantage of accounting for the interdependence of consecutive epochs (see fig.~\ref{fig:sleep_description}B).
61+
However, it generally does not perform as well as classical classifiers when modelling non-linear relationships between large numbers of predictors.
5262

53-
Recently, promissing results were obtained for scoring human sleep stages by performing an exhaustive feature extraction including variables resulting from discrete wavelet decomposition.
54-
Then, the authors compared several classifiers and found that random forest were the most accurate.
63+
Recently, promising results were obtained for scoring human sleep stages by performing an exhaustive
64+
feature extraction including variables resulting from discrete wavelet decomposition.
65+
Then, the authors compared several classifiers and found that random forest were, overall, the most accurate predictors.
5566

56-
The study herein bases itself on these promissing results by computing an even larger number of features.
67+
The study herein bases itself on these promising results by computing an even larger number of features.
5768
An important addition is the computation of time-aware features which significantly improved accuracy.
58-
In addition, rigourous startified cross-validation procedure and comparisons of sleep structure were performed.
59-
60-
In order to pave the way to an implementation of an ubicuitous sleep scoring software.
61-
\pr, a new \py{} package was also build to facilitate efficient feature extraction.
62-
This new package is here demonstated to be significantly more performant than preexisting implementation.
69+
Furthermore, rigorous stratified cross-validation procedure and comparisons of sleep structure were performed.
70+
These improvement altogether contributed to achieve a very satisfying overall accuracy of 92\%.
71+
In order to pave the way to an implementation of an ubiquitous sleep scoring software.
72+
\pr, a new \py{} package was also build to facilitate efficient feature extraction.
73+
This new package is here demonstrated to be significantly more performance than alternative implementation.
6374

report/report.tex

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
\usepackage{standalone}
66

77
\usepackage{geometry} % Used to adjust the document margins
8-
\geometry{bindingoffset=1cm}
8+
%~ \geometry{bindingoffset=1cm}
99
\usepackage{fullpage}
1010
\usepackage{multirow}
11-
11+
\usepackage{setspace}
12+
\doublespacing
1213

1314
\usepackage{graphicx}
1415
\usepackage[font=footnotesize]{caption}
@@ -92,6 +93,11 @@
9293
\newacronym{nrem}{NREM}{Non-Rapid Eye Movement (slow wave sleep)}
9394
\newacronym{eeg}{EEG}{ElectroEncephaloGram}
9495
\newacronym{emg}{EMG}{ElectroMyoGram}
96+
\newacronym{eog}{EOG}{ElectroOculoGram}
97+
\newacronym{svm}{SVM}{Support Vector Machine}
98+
\newacronym{ann}{ANN}{Artificial Neural Network}
99+
\newacronym{hmm}{HMM}{Hidden Markov Model}
100+
95101
%~
96102
%~ \newglossaryentry{epoch}
97103
%~ {
@@ -112,7 +118,10 @@
112118

113119

114120
\begin{abstract}
115-
\TODO{write the abstract}
121+
122+
123+
124+
116125
\end{abstract}
117126

118127

report/tables/importances.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
\caption{\ctit{Relative variable importance of the 21 selected features.}
44
Random forest algorithm can produce a value to quantify variable importance.
55
Variable importance quantify how much, statistically, a variable contributes to predictive accuracy.
6-
Starting from 164 variables, the least imporatn variables were recursively eliminated.
6+
Starting from 164 variables, the least important variables were recursively eliminated.
77
This table represents the 21 most important remaining features.
88
Features from both \gls{eeg} and \gls{emg} are important for accurate prediction.
99
\label{tab:importances}}

0 commit comments

Comments
 (0)