You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: report/discussion.tex
+12-11
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
\section{Discussion} \label{discussion}
2
2
3
-
\subsection{python package}
3
+
\subsection{Software package for feature computation}
4
4
5
5
In order to train statistical learning methods to classify vigilance states,
6
6
it was necessary to compute an exhaustive set of features for all consecutive five second epochs
@@ -23,13 +23,13 @@ \subsection{python package}
23
23
24
24
Several \texttt{PyEEG} functions were also found to be inconsistent with mathematical
25
25
definitions (see \pr{} documentation, appendix).
26
-
This unfortunatly apperas to be a common issue for accademic software.
27
-
The general status of the peer-review process and the reproducibility of programs and algorithms have
26
+
This unfortunatly apperas to be a common issue for academic software.
27
+
The general status of the peer-review process and the reproducibility of programs and algorithms have
28
28
recently drawn attention (see \citationneeded{Black-box; Can I reproduce your algo} for discussions about this issue).
29
29
30
-
\subsection{Originality of feature extraction}
30
+
\subsection{Exhaustive feature extraction}
31
31
32
-
Feature exctraction in the present study contrasts with previous work in two respects.
32
+
Feature extraction in the present study contrasts with previous work in two respects.
33
33
First of all, features were exhaustively computed not only on raw signals,
34
34
but also on all wavelet frequency sub-bands.
35
35
Then, new variables were created to account for temporal consistency of vigilance state episodes.
@@ -61,7 +61,7 @@ \subsection{Originality of feature extraction}
61
61
The convolution approach (eq.\ref{eq:window}) appeared to provide better results.
62
62
Instead of averaging feature after calculation, it may be advantageous to compute features over epochs of different length in a first place.
63
63
Thus, the accuracy of local of non additive features, such as median, will be improved. In addition to local mean of feature, other variables, such as local
64
-
slope and local variance of each feature may improve classification \citationneeded(Deng 2013).
64
+
slope and local variance of each feature may improve classification \citationneeded{(Deng 2013).}
65
65
66
66
Although addition of time-dependent variables improved accuracy over a time-unaware model, their use can be seen as controversial.
67
67
Indeed, including prior information about sleep structure will cause problems if the aim is to find differences in sleep structure.
@@ -77,7 +77,7 @@ \subsection{Originality of feature extraction}
77
77
78
78
79
79
80
-
\subsection{Random forest}
80
+
\subsection{Random forest classification}
81
81
82
82
In this study, random forest\citationneeded{} classifiers were exclusively used.
83
83
In addition to their capacity to model non-linearity, they are very efficient at handling very large number of variables.
@@ -95,7 +95,7 @@ \subsection{Random forest}
95
95
96
96
97
97
98
-
\subsection{Rigorous model evaluation}
98
+
\subsection{Rigorous and comprehensive model evaluation}
99
99
100
100
Previous research, using classical statistical learning framework,
101
101
have often assessed their classifier through cross-validation.
@@ -110,7 +110,7 @@ \subsection{Rigorous model evaluation}
110
110
with all the even hours (from start of the experiment) and testing it with all the odd ones.
111
111
There are several way to reduce overfitting including limiting the maximal number of splits when growing classification trees, or pruning trees.
112
112
However, it never possible to unsure a model will not overfit \emph{a priori}.
113
-
Thus it remain necessary toassess the model fairly.
113
+
Thus it remain necessary to assess the model fairly.
114
114
In this study, systematic stratified cross-validation was performed.
115
115
As a result, all predictions made on any 24h time series are generated by models
116
116
that did not use any point originating from this same time series. This precaution simulate the the behaviour of the predictor with new recordings.
@@ -140,10 +140,10 @@ \subsection{Quality of the raw data}
140
140
For instance, if, for a given epoch, there is strong disagreement between experts, the confidence will be low.
141
141
When training a model, this uncertainty can be included, for instance, as a weight.
142
142
143
-
\subsection{Final result}
143
+
\subsection{Overall results}
144
144
The predictions of the classifier presented in this research agreed with ground truth for 92\% of epochs (table~\ref{tab:confus}).
145
145
Although the limitation of the ground truth annotation make it is hard to put this result into perspective,
146
-
this score is very promissing.
146
+
this score is very promising.
147
147
In addition, prediction did not result in significant difference in prevalences.
148
148
However, there were, on average, much less \gls{rem} episodes in the predicted time series.
149
149
The duration of \gls{rem} episodes was also over-estimated by prediction (though this is only marginally significant).
@@ -174,3 +174,4 @@ \section*{Availability}
174
174
and the package will be released shortly, as an open-source software, in the official python repositories.
Copy file name to clipboardexpand all lines: report/matmet.tex
+25-33
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,35 @@
1
1
\section{Material and Methods} \label{matmet}
2
2
3
-
\subsection{Data}
4
-
5
-
\subsection{Preprocessing}
3
+
\subsection{Data acquisition}
4
+
%~
5
+
In this study, 12 male mice (Tg(Gal-cre)KI87Gsat/Mmucd, FVB/N-Crl:CD1(ICR) hybrid strain),
6
+
between 8 and 12 week old were used.
7
+
Animal were housed under a 12h light/dark light cycle.
8
+
Small (diam. = 1mm) holes were drilled in the scull of anaesthetised animals.
9
+
For the \gls{eeg}, the reference-ground electrode was placed into the parietal bone (Bregma -1.5, mediolateral (ML) +1.5) and
10
+
the other electrode was placed into the frontal bone (Bregma +1.5, ML -1.5).
11
+
For \gls{emg} acquisition, three polytetrafluoroethylene-insulated stainless steel electrodes were placed into the neck muscles.
12
+
13
+
Both signals were recorded by a miniature `neurologger' \citationneeded{ Vyssotski et al.,2006}.
14
+
The recording device applies band-pass analogue filtering between 1 and 70Hz and converts both analogue signals to digital time series at a sampling rate of approximately 200.0Hz.
15
+
All 12 animals were monitored for approximately 24h.
16
+
17
+
Sleep scoring was performed in a semi-automatic fashion by a trained expert.
18
+
A first, human assisted, pass was applied to generate preliminary annotations on the basis of logical rules \citationneeded{}.
19
+
Then, the expert visually inspected and, when required, corrected the annotations.
20
+
Annotation were generated for consecutive epochs of approximately 5.0s.
21
+
%~
22
+
\subsection{Data preprocessing}
6
23
7
24
\gls{eeg} and \gls{emg} signals were resampled from approximately 200.0Hz to 256.0Hz using
A sampling frequency of $f_s = 256.0Hz$ is convenient since is implies that discrete wavelet decomposition (see subsection~\ref{sub:features} and fig.~\ref{fig:dwd}) will separate
26
+
A sampling frequency of $f_s = 256.0$Hz is convenient since is implies that discrete wavelet decomposition (see subsection~\ref{sub:features} and fig.~\ref{fig:dwd}) will separate
10
27
frequencies above 4.0Hz from those below 4.0Hz (since $4 = 256.0/{2^6} $).
11
28
This frequency is typically uses as a cut-off value between theta and delta waves \citationneeded{}.
12
29
In addition, \gls{eeg} and \gls{emg} signals were standardised ($E[x] = 0, Var[x] = 1$) to account for the variability in baseline amplitude due to acquisition.
13
30
Vigilance state anotations were resampled at exactly 0.20Hz using nearest neighbour interpolation.
14
31
15
-
\subsection{Feature extraction}
32
+
\subsection{Feature extraction from time series}
16
33
\label{sub:features}
17
34
18
35
A wavelet transform based feature extraction strategy was adopted.
@@ -61,31 +78,6 @@ \subsection{Addition of temporal features}
61
78
62
79
63
80
\subsection{Stratified Cross Validation and sampling}
64
-
%~ Generally, success of classification of vigilance stages is assessed by cross-validation.
65
-
%~ In many studies\citationneeded{}, it is implied that cross-validation was performed by making $k$ random training subsets
66
-
%~ of the whole data and assessing the model fitted on the remaining subsets (\ie{} k-fold cross-validation).
67
-
%~ In this context, since features are calculated for every epoch
68
-
%~ Therefore, epochs are the statistical individuals.
69
-
%~
70
-
%~ When working with dense time series (or, for instance, spatial data), it can be suspected that within a statistical block (group),
71
-
%~ both features and response variables are very correlated with neighbouring data points.
72
-
%~ For instance, the features and label at $t_n$ are expected to be largely similar to the features, and labels at $t_{n+1}$ and $t_{n-1}$.
73
-
%~ In statistical terms, $t_{n+1}$ is not independent of $t_{n}$.
74
-
%~
75
-
%~ If the training sets are drawn completely at random, from a dataset containing multiple long recordings,
76
-
%~ the underlying time series would only be made marginally sparser, and the data points missing from
77
-
%~ a time series could simply be inferred from the neighbouring points which remain in the training set.
78
-
%~ This temporal pseudo-replication may result in model overfitting and give the false impression
79
-
%~ that a model has a very strong predictive power.
80
-
%~
81
-
%~ The goal of cross-validation is to assess how well a predictive model would perform on \emph{new data}.
82
-
%~ This study, and most similar studies, aims at providing a tool to automatically annotate \emph{new recordings}.
83
-
%~ Therefore, it is fairer to perform \emph{stratified cross-validation}, using the different recordings as the stratum levels.
84
-
%~ In this study, all cross-validation were performed by training the model with epochs originating from all but one recordings,
85
-
%~ and testing it on the recording kept out. This was repeated by successively leaving each recording out.
86
-
87
-
%~ As shown in figure~\ref{fig:sleep_description}, the prevalence of different states is not balanced. Noticeably, \gls{rem} sleep represents only $10\%$ of all epochs.
88
-
%~ This implies that $90\%$ accuracy could be achieved even if all \gls{rem} epoch were misclassified.
89
81
90
82
91
83
Stratified cross-validation was systematically applied to generate vigilance state predictions.
@@ -96,7 +88,7 @@ \subsection{Stratified Cross Validation and sampling}
96
88
Class unbalancedness was accounted for by fitting predictors on balanced subsamples (750 epochs of each class per tree).
97
89
98
90
99
-
\subsection{Random forests}
91
+
\subsection{Random forests analysis}
100
92
Unless specified otherwise, random forests \citationneeded{} were trained with balanced samples of 1000 epochs per class.
101
93
In order to select variables and define new features, forests with 50 classification trees were built.
Copy file name to clipboardexpand all lines: report/tables/benchmark.tex
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
\begin {table}[!h]
2
2
\begin{center}
3
3
\caption{\ctit{Performance improvements over \texttt{PyEEG}.}
4
-
In order to improve performance, modifications of the algorithms implemented in \texttt{PyEEG} were carried out.
5
-
In addition, several mathematical inconsistencies were also discovered and corrected.
6
-
The table compares how long, on average, each algorithm would take, for a random sequence of length $1280$ (\ie{} $5s$ at $256Hz$).
4
+
In order to improve performance, modifications of the algorithms implemented in \texttt{PyEEG} were carried out.
5
+
This table compares how long, on average, each algorithm would take, for a random sequence of length $1280$ (\ie{} $5s$ at $256$Hz).
7
6
It also represents how many added points would lead to a tenfold runtime increase.
8
7
For the tested range ($n \in [1280;7680] $), all algorithms add approximately an
9
-
exponential time complexity ($10^{O(n)}$), $R^2 > 0.95$, for all.
10
-
\textbf{1}: whether the original implementation was corrected in order to match mathematical definition.
8
+
exponential time complexity ($10^{O(n)}$, $R^2 > 0.95$, for all).
9
+
Several mathematical inconsistencies were also discovered and corrected.
10
+
The rightmost column (\textbf{\textdagger}) indicates whether the original implementation was
11
+
corrected in order to match mathematical definition. Each alteration is mathematically justified in the section \texttt{pyrem.univariate} of the \pr{} documentation (see appendix).
11
12
\textbf{(-)}: indicates a worse performance of \pr{} over \pyeeg{}.
12
-
Each alteration is mathematically justified in the section \texttt{pyrem.univariate} of the \pr{} documentation (see appendix).
13
13
Significance levels: $^{***}$, $p-value < 10^{-3}$; $^{**}$, $p-value < 10^{-2}$, see Material and Methods for detail about statistical analysis.
14
14
\label{tab:benchmark}
15
15
}
@@ -20,7 +20,7 @@
20
20
\hline
21
21
\hline
22
22
23
-
algorithm & function & \specialcell{$t$(ms) for \\$n = 1280$} & \specialcell{$n$ for $\times10$\\increase} & \specialcell{$t$(ms) for \\$n = 1280$} & \specialcell{$n$ for $\times10$\\ increase} & fix$^1$\\
23
+
algorithm & function & \specialcell{$t$(ms) for \\$n = 1280$} & \specialcell{$n$ for $\times10$\\increase} & \specialcell{$t$(ms) for \\$n = 1280$} & \specialcell{$n$ for $\times10$\\ increase} & fix\textsuperscript{\textdagger}\\
Copy file name to clipboardexpand all lines: report/tables/importances.tex
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
\begin{center}
3
3
\caption{\ctit{Relative variable importance of the 21 selected features.}
4
4
Random forest algorithm can produce a value to quantify variable importance.
5
-
Variable importance quantify how much, statistically, a variable contributes to predictive accuracy.
5
+
Variable importance corresponds to how much, statistically, a variable contributes to reducing the prediction inacuracy (or, to be more precise, the Gini impurity).
6
6
Starting from 164 variables, the least important variables were recursively eliminated.
7
7
This table represents the 21 most important remaining features.
8
8
Features from both \gls{eeg} and \gls{emg} are important for accurate prediction.
0 commit comments