diff --git a/text/thesis/02MaterialsAndMethods.tex b/text/thesis/02MaterialsAndMethods.tex index e9026be..7dbb32a 100644 --- a/text/thesis/02MaterialsAndMethods.tex +++ b/text/thesis/02MaterialsAndMethods.tex @@ -119,14 +119,50 @@ \caption{Autoencoder (6-3-6)} \label{fig:autoenc} \end{figure} + \subsection{Support-vector Machines} + Support-vector machines (SVMs) are used for classification of data. This is done by separating data in feature space by a hyperplane. Additional data is classified with respect to the site of the hyperplane it is located in feature space.\\ + This hyperplane is considered optimal if the margins on both sides (distance to the nearest data point) are maximal to allow for the maximal possible noise. This means the separating hyperplane can be constructed out of the nearest points (3 in 2-D) from both classes. This points however may be different for different attempts as an different angle in some dimension may make different points the nearest (cf. Figure~\ref{fig:hyperplanes}).\\ + \begin{figure} + \centering + \includegraphics[width=0.6\textwidth]{pictures/hyperplanes.png} + \caption{Two possible hyperplanes while the orange one has larger margins} + \label{fig:hyperplanes} + \end{figure} + The hyperplane is defined as $\vec{w}\cdot \vec{x}-b=0$ while the hyperplanes tangent to the classes are $\vec{w}\cdot \vec{x}-b=1$ or $\vec{w}\cdot \vec{x}-b=-1$ respectively (see Figure~\ref{fig:svm}). The margin is $\frac{2}{||\vec{w}||}$. The margins have to be maximized while all data is classified correctly, so the problem can be formulated as: + $$\min \frac{2}{||\vec{w}||}\ s.t.\ y_i(\vec{w}\cdot\vec{x_i}-b)\geq 1,\ i=1,\dots,n,$$ + where $y_i$ is the class (+1 or -1) of the corresponding data. + \begin{figure} + \centering + \includegraphics[width=0.8\textwidth]{pictures/svm.png} + \caption{Margins and hyperplane (Figure by Cyc and Peter Buch)} + \label{fig:svm} + \end{figure} + This prototype of a SVM is only able to separate two classes of linear separable data. For other data some improvements were necessary. + \subsubsection{Multiclass SVM} + If there are more than two classes to separate it can be done with SVMs in different ways. One approach is \emph{one-vs-one} meaning all classes are compared with the according SVM and the SVM votes for one or the other class. This is done for all pairs and the class with most votes is picked.\\ + Another approach is \emph{one-vs-all} where every class is compared against the remaining. Here scores are used to determine which class matches best, i.e. in which class the data is farthest from the separating hyperplane. + \subsubsection{Soft-margin SVM} + If data is not separable soft-margin SVMs have to be used. They allow wrong classification but try to minimize them. The problem can be formulated as + $$\text{Minimize }\frac{1}{N}\sum\limits_{i=1}^N\max\{0,1-y_i(\vec{w}\cdot\vec{x_i}-b)\}+\lambda ||\vec{w}||^2,$$ + where $\lambda$ is the parameter that adjusts the trade-off between large margins and wrong classifications (if $\lambda$ has an higher value, there is more weight on large margins). + \subsubsection{Kernel trick} + Data like in Figure~\ref{fig:kernel} are not \emph{linear} separable. The idea here is to apply the \emph{kernel trick} meaning to transform the data in a different space where they are linear separable. In the example this is accomplished by using the distance from origin as feature and separating in that space. + \begin{figure} + \input{pictures/kernel.tikz} + \caption{Data separable with the kernel trick} + \label{fig:kernel} + \end{figure} + Common kernels are polynomial, Gaussian and hyperbolic kernels. + \subsection{Regression} + Regression is the idea of finding $A$ so that $$Ax=y,$$ where x is the input and y the output of a system. Having this $A$ from any given input the output can be predicted. %TODO + \subsubsection{RIDGE-Regression} \section{Experimental 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.\\ - There were 9 right-handed subjects%TODO - All the tasks were performed with the right hand.\\ + There were 9 right-handed subjects with an average age of 25 (variance 6.67, minimum 20, maximum 28). Three female and 6 male subjects were tested. All the tasks were performed with the dominant right hand.\\ To perform was a center-out reaching task to one of four targets (see \ref{fig:experimentalDesign}) while 32 channel EEG, at least% \footnote{\texttt{'AbdPolLo', 'Biceps', 'Triceps', 'FrontDelt', 'MidDelt'} and \texttt{'BackDelt'} were recorded for every subject, others only in some. Only the 6 channels tracked in every session were used} % 6 channel surface EMG and 7 DOF kinematics were tracked. - \begin{figure}[b] + \begin{figure} \centering \includegraphics{experimentalDesign.jpg} \caption{Center-out reaching task with four color-coded targets} @@ -136,4 +172,4 @@ Only complete sessions were used in our analysis to ensure better comparability.\\ One session consists of 5 runs with 40 trials each. The trials were separated by resting phases of varying length (2-3s, randomly assigned). Each trial began with an auditory cue specifying the random but equally distributed target for this trial. This leads to 50 reaches to the same target each session. After the cue the participants should \qq{perform the movement and return to the starting position at a comfortable pace but within 4 seconds}\footnote{\cite{Shiman15}}\\ - For each subject there were 4 to 6 sessions, each recorded on a different day. All in all there were 255 runs in 51 sessions. Each session was analyzed independently as one continuous task. + For each subject there were 4 to 6 sessions, each recorded on a different day. All in all there were 255 runs in 51 sessions. Each session was analyzed independently as one continuous trial. diff --git a/text/thesis/mylit.bib b/text/thesis/mylit.bib index 5567de5..653cf17 100755 --- a/text/thesis/mylit.bib +++ b/text/thesis/mylit.bib @@ -1,15 +1,3 @@ -@article{Morasso92, - author = "P. Morasso", - title = "{Neural mechanisms of synergy formation}", - journal = "Human Movement Science", - year = "1992", -} -@article{Tresch06, - author = "M. Tresch and V. Cheoung and A. d'Avella", - title = "{Matrix Factorisation Algorithms for the Identification of Muscle Synergies: Evaluated on Simulated and Experimental Data Sets}", - journal = "Journal of Neurophysiology", - year = "2006", -} @proceedings{Gomez11, editor = "M. Gomez-Rodriguez and M. Grosse-Wentrup and J. Hill and A. Gharabaghi and B.Schölkopf and J. Peters", title = "Towards Brain-Robot Interfaces in Stroke Rehabilitation", @@ -215,7 +203,19 @@ volume = "2" } - +%not cited +@article{Morasso92, + author = "P. Morasso", + title = "{Neural mechanisms of synergy formation}", + journal = "Human Movement Science", + year = "1992", +} +@article{Tresch06, + author = "M. Tresch and V. Cheoung and A. d'Avella", + title = "{Matrix Factorisation Algorithms for the Identification of Muscle Synergies: Evaluated on Simulated and Experimental Data Sets}", + journal = "Journal of Neurophysiology", + year = "2006", +} @article{Ting07, author = "Lena H. Ting and J Lucas McKay", title = "Neuromechanics of muscle synergies for posture and movement", diff --git a/text/thesis/outline.txt b/text/thesis/outline.txt index 5191ee1..a2ea06f 100644 --- a/text/thesis/outline.txt +++ b/text/thesis/outline.txt @@ -1,12 +1,6 @@ # Movement Prediction from EEG based on Synergies ## Introduction - Motivation -- Techniques - - BCI - - EEG - - LF - - Synergies - - NN, esp. Autoencoders - We'll see... ## Materials and Methods diff --git a/text/thesis/pictures/hyperplanes.png b/text/thesis/pictures/hyperplanes.png new file mode 100644 index 0000000..73d2d2d --- /dev/null +++ b/text/thesis/pictures/hyperplanes.png Binary files differ diff --git a/text/thesis/pictures/hyperplanes.xcf b/text/thesis/pictures/hyperplanes.xcf new file mode 100644 index 0000000..6146797 --- /dev/null +++ b/text/thesis/pictures/hyperplanes.xcf Binary files differ diff --git a/text/thesis/pictures/kernel.tikz b/text/thesis/pictures/kernel.tikz new file mode 100644 index 0000000..30c973a --- /dev/null +++ b/text/thesis/pictures/kernel.tikz @@ -0,0 +1,20 @@ +%kernel.tikz +\begin{tikzpicture}[scale=2] + \node[left] (O) at (0,0) {$O$}; + %Draw the Circle around it all + \draw[semithick] (0,0) circle (1); + \draw[dotted,red] (0,0) circle (1.5); + \draw[dotted,blue] (0,0) circle (0.5); + %Draw grid + \draw[->] (-1.6,0) -- (1.6,0); + \draw[->] (0,-1.6) -- (0,1.6); + + + \node[below] (O) at (3,0) {$O$}; + %Draw the Circle around it all + \draw (4,-0.1) -- (4,0.1); + \draw[dotted,red] (4.5,-0.1) -- (4.5,0.1); + \draw[dotted,blue] (3.5,-0.1) -- (3.5,0.1); + %Draw grid + \draw[->] (2.75,0) -- (5,0); +\end{tikzpicture} diff --git a/text/thesis/pictures/svm.png b/text/thesis/pictures/svm.png new file mode 100644 index 0000000..af1810b --- /dev/null +++ b/text/thesis/pictures/svm.png Binary files differ diff --git a/text/thesis/thesis.tex b/text/thesis/thesis.tex index 6d5f87a..3ec0844 100644 --- a/text/thesis/thesis.tex +++ b/text/thesis/thesis.tex @@ -6,7 +6,7 @@ %%% allgemeine Einstellungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass[twoside,12pt,a4paper]{report} +\documentclass[twoside,12pt,a4paper]{book} %\usepackage{reportpage} \usepackage{epsf} \usepackage{graphics, graphicx} @@ -106,7 +106,7 @@ \section*{Abstract} -Write here your abstract.\cite{Morasso92}\cite{Tresch06} +Write here your abstract.%\cite{Morasso92}\cite{Tresch06} \newpage \section*{Acknowledgements} @@ -252,7 +252,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Erklaerung %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\thispagestyle{empty} +\pagestyle{empty} \section*{Selbständigkeitserklärung} Hiermit versichere ich, dass ich die vorliegende Masterarbeit @@ -265,6 +265,7 @@ \vskip 3cm Tübingen, 30.10.2016 \hfill \author \hfill +\cleardoublepage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Ende %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%