diff --git a/text/thesis/02MaterialsAndMethods.tex b/text/thesis/02MaterialsAndMethods.tex index 611d699..6d8861e 100644 --- a/text/thesis/02MaterialsAndMethods.tex +++ b/text/thesis/02MaterialsAndMethods.tex @@ -200,6 +200,8 @@ \caption{Nested 10-fold Cross Validation with parameter optimization} \label{alg:cv} \end{algorithm} + \subsection{ANOVA} + %TODO \section{Experimental design} \label{mm:design} The data used for this work were mainly recorded by Farid Shiman, Nerea Irastorza-Landa, and Andrea Sarasola-Sanz for their work (\cite{Shiman15},\cite{Sarasola15}). We were allowed to use them for further analysis.\\ @@ -330,7 +332,7 @@ Very bad results when classifying EMG into Move/Rest made us further inspect the data. The actual movement came quite a while after the stimulus.\\ To address this problem we did a re-classification of the data according to actual movements (cf. Appendix~\ref{code:classify}). To decide whether the subject is moving or not we compare the mean EMG activity (from Waveform Length) to a threshold (10,000 by default).\\ If there is movement we define the class occurring most in the second before as the current task. If there is movement but the stimulus tells to rest, we assign the last active stimulus.\\ - In addition we take the second before movement onset out of the data (classified as -1) and (optionally) half a second before movement onset as belonging to the following stimulus.\\ + In addition we take the second before movement onset out of the data (classified as -1) and (optionally) half a second before movement onset as belonging to the following stimulus (cf. \ref{mat:pause}).\\ Finally we do some smoothening by taking the most occurring class one second before to one second after the current time step as its class.\\ As last step we adjust the length of the stimulus-vector to the length of the EEG data.\\ According to this classification we take only data in the further analysis which are classified different than -1 meaning they are either clear rest or clear movement. @@ -370,8 +372,11 @@ When predicting EMG data we use the sum of the waveform length in the time corresponding to the EEG data. As the EMG data was summed to gain the data for our use this is a reasonable approach.\\ The remaining steps are the same as for kinematics and Synergies. \subsection{EEG offset} + \label{mat:offset} Since it takes some time for commands to go from brain to the muscles, we introduced an variable offset between EEG and other data. The offset has to be given in a number of shifts, so in default is a multiple of 200ms.\\ Results are given in Section~\ref{res:offset}. + \subsection{Pause} + \label{mat:pause} \subsection{Prediction with interim step} All these analyses only show the accuracy of one step. To get a measure for the over-all performance we predict synergies from EEG and use them to predict EMG or kinematics respectively.\\ The resulting correlation is the mean of the correlations of a 10-fold cross validation where the same unknown synergies are predicted from EEG and used to predict EMG or kinematics. So there is no correction step between the steps and EMG or kinematics are predicted from EEG via the Synergies. Here also different methods to determine Synergies are compared (see Section~\ref{res:differentSynergiesVia}). @@ -379,5 +384,9 @@ We analyze each session (cf. Section~\ref{mm:design}) independently meaning there are 51 independent results for each analysis. These are used for the statistical evaluation in Chapter~\ref{chp:results}.\\ Some analyses are only done on one session - if so it will be clearly stated. %TODO: check, out if not necessary \subsection{Evaluation} - + \subsubsection{Default values} + \label{mat:default} + \subsubsection{Boxplot} + \subsubsection{ANOVA} + %ANOVA %TODO: evaluation diff --git a/text/thesis/03Results.tex b/text/thesis/03Results.tex index 9a90c37..24db644 100644 --- a/text/thesis/03Results.tex +++ b/text/thesis/03Results.tex @@ -1,2 +1,64 @@ \chapter{Results} \label{chp:results} +\section{Classification} + \subsection{Comparison of methods of recording} + The different methods of recording (EEG, EMG and Low frequencies) also differ in the results. An ANOVA gives a $p$-Value of $2.09\cdot 10^{-8}$ ($F=108.29$) for all classifications done on 4 different movements and rest. + \begin{figure} + \centering + \includegraphics[width=0.9\textwidth]{pictures/results/classEEGemgLF.png} + \caption{EEG, EMG and LF compared based on classification accuracy with 5 classes} + \label{fig:classEEGemgLF} + \end{figure} + The mean classification accuracys for the default run are are given in Table~\ref{tab:accs}. + \begin{table} + \centering + \begin{math} + \begin{array} + {r||c|c|c|c} + &\text{EMG}&\text{EEG}&\text{LF}&\text{chance}\\\hline + mean&60.4&40.4&32.7&25\\ + std&7.97&2.27&3.35\\ + max&71.9&46.7&43.4\\ + min&35.7&37.2&26.2 + \end{array} + \end{math} + \caption{Accuracys for the different methods of recording in default configuration} + \label{tab:accs} + \end{table} + % \begin{itemize} + % \item[EMG:] $60.4\%$ + % \item[EEG:] $40.4\%$ + % \item[LF:] $32.7\%$ + % \item[chance:] $25\%$ + % \end{itemize} + \subsection{EMG} + In figure~\ref{fig:overviewEMG} the different settings for classification based on EMG-data are shown. Default has values as in \ref{mat:default}. The runs with pause leave out the data 1 second before the movement begins (cf. \ref{mat:pause}). + \begin{figure} + \centering + \includegraphics[width=\textwidth]{pictures/results/overviewEMG.png} + \caption{Classification with EMG-data} + \label{fig:overviewEMG} + \end{figure} + % \begin{figure} + % \centering + % \includegraphics[width=\textwidth]{pictures/results/pauseEMG.png} + % \caption{EMG-data without and with pause} + % \label{fig:pauseEMG} + % \end{figure} + When calculating an ANOVA on the data with and without pause we get a $p$-Value of $3.9\cdot 10^{-9}$ ($F=41.68$). + \subsection{EEG} + In figure~\ref{fig:overviewEEG} the different settings for classification based on EEG-data are shown. Default has values as in \ref{mat:default}. The runs with pause leave out the data 1 second before the movement begins (cf. \ref{mat:pause}). Runs with offset have an offset of 1 or 2 (cf. \ref{mat:offset}). + \begin{figure} + \centering + \includegraphics[width=\textwidth]{pictures/results/overviewEEG.png} + \caption{Classification with EEG-data} + \label{fig:overviewEEG} + \end{figure} + \subsection{Low Frequencies} + In figure~\ref{fig:overviewLF} the different settings for classification based on LowFrequency(LF)-data are shown. Default has values as in \ref{mat:default}. The runs with pause leave out the data 1 second before the movement begins (cf. \ref{mat:pause}). Runs with offset have an offset of 1 or 2 (cf. \ref{mat:offset}). + \begin{figure} + \centering + \includegraphics[width=\textwidth]{pictures/results/overviewLF.png} + \caption{Classification with LF-data} + \label{fig:overviewLF} + \end{figure} diff --git a/text/thesis/pictures/results/classEEGemgLF.png b/text/thesis/pictures/results/classEEGemgLF.png new file mode 100644 index 0000000..31a9450 --- /dev/null +++ b/text/thesis/pictures/results/classEEGemgLF.png Binary files differ diff --git a/text/thesis/pictures/results/noSynergiesWithMean.png b/text/thesis/pictures/results/noSynergiesWithMean.png new file mode 100644 index 0000000..4cf6903 --- /dev/null +++ b/text/thesis/pictures/results/noSynergiesWithMean.png Binary files differ diff --git a/text/thesis/pictures/results/overviewEEG.png b/text/thesis/pictures/results/overviewEEG.png new file mode 100644 index 0000000..d580dfb --- /dev/null +++ b/text/thesis/pictures/results/overviewEEG.png Binary files differ diff --git a/text/thesis/pictures/results/overviewEMG.png b/text/thesis/pictures/results/overviewEMG.png new file mode 100644 index 0000000..88db318 --- /dev/null +++ b/text/thesis/pictures/results/overviewEMG.png Binary files differ diff --git a/text/thesis/pictures/results/overviewLF.png b/text/thesis/pictures/results/overviewLF.png new file mode 100644 index 0000000..9475979 --- /dev/null +++ b/text/thesis/pictures/results/overviewLF.png Binary files differ diff --git a/text/thesis/pictures/results/pauseEMG.png b/text/thesis/pictures/results/pauseEMG.png new file mode 100644 index 0000000..6bd6855 --- /dev/null +++ b/text/thesis/pictures/results/pauseEMG.png Binary files differ diff --git a/text/thesis/thesis.tex b/text/thesis/thesis.tex index 5dbc23a..a4bb5a8 100644 --- a/text/thesis/thesis.tex +++ b/text/thesis/thesis.tex @@ -184,9 +184,9 @@ \chapter*{List of Abbreviations\markboth{LIST OF ABBREVIATIONS}{LIST OF ABBREVIATIONS}} \begin{tabbing} -\textbf{EEG}\hspace{1cm}\=Electroencephalography\\ -\textbf{EMG}\hspace{1cm}\=Electromyography\\ -\textbf{LF}\hspace{1cm}\=Low Frequency\\ +\textbf{EEG}\hspace{2cm}\=Electroencephalography\\ +\textbf{EMG}\>Electromyography\\ +\textbf{LF}\>Low Frequency\\ \textbf{BCI}\> Brain-Computer-Interface \\ \textbf{SVM}\> Support-Vector-Machine \\ \textbf{ECoG}\> Electrocorticography \\ diff --git a/usedMcode/evaluationAccuracys.m b/usedMcode/evaluationAccuracys.m index 8209421..9fe64c7 100644 --- a/usedMcode/evaluationAccuracys.m +++ b/usedMcode/evaluationAccuracys.m @@ -1,5 +1,15 @@ load('/home/jph/Uni/masterarbeit/evaluation.mat') +%compare forms of recording +eegAcc=struct2array(accuracys.EEG); +emgAcc=struct2array(accuracys.EMG); +LFAcc=struct2array(accuracys.LF); + +anova1([eegAcc(1:5),emgAcc(1:5),LFAcc(1:5)],[0,0,0,0,0,1,1,1,1,1,2,2,2,2,2]) +xlabel('EEG - EMG - LF') +ylabel('% classified correctly') +title('ANOVA for EEG, EMG and LF') + input=accuracys.LF; sizeY=2; limits_y=[100,0];