-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path04-01-ACA-Inference-Classification.tex
263 lines (252 loc) · 12.4 KB
/
04-01-ACA-Inference-Classification.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
% move all configuration stuff into includes file so we can focus on the content
\input{include}
\subtitle{module 4.1: classification}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% generate title page
\input{include/titlepage}
\section[overview]{lecture overview}
\begin{frame}{introduction}{overview}
\begin{block}{corresponding textbook section}
%\href{http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6331125}{Chapter 8: Musical Genre, Similarity, and Mood} (pp.~155)
section~4.1
\end{block}
\begin{itemize}
\item \textbf{lecture content}
\begin{itemize}
\item intuitive intro to machine learning
\item classifier examples
\end{itemize}
\bigskip
\item<2-> \textbf{learning objectives}
\begin{itemize}
\item describe the basic principles of data-driven machine learning approaches
\item implement a kNN classifier in Python
\end{itemize}
\end{itemize}
\inserticon{directions}
\end{frame}
\section[intro]{introduction}
\begin{frame}{classification}{introduction}
remember the flow chart of a general ACA system:
\vspace{-3mm}
\begin{figure}
\input{pict/introduction_ACASystem_3}
\end{figure}
\begin{itemize}
\item<2-> \color<3->{highlight}{\textit{classification}}:
\begin{itemize}
\item assign class labels to data
\end{itemize}
\item<2-> \textit{regression}:
\begin{itemize}
\item estimate numerical labels for data
\end{itemize}
\item<2-> \textit{clustering}:
\begin{itemize}
\item find grouping patterns in data
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{classification}{basic example}
%\vspace{-3mm}
\begin{columns}
\column{.4\linewidth}
hypothetical system:
\begin{itemize}
\item one feature (envelope)
\item predefined threshold
\begin{itemize}
\item higher than threshold\\ $\Rightarrow$ class 1 (onset)
\item lower than threshold\\ $\Rightarrow$ class 0 (no onset)
\end{itemize}
\end{itemize}
\column{.6\linewidth}
\vspace{-10mm}
\figwithmatlab{ThresholdClassification}
\end{columns}
\end{frame}
\begin{frame}{classification}{data-driven}
\vspace{-3mm}
\begin{columns}
\column{.4\linewidth}
\begin{itemize}
\item derive classification parameters from data, e.g.,
\smallskip
\item[$\Rightarrow$] learn common feature distributions per class
\item[$\Rightarrow$] learn separation metrics per class
\end{itemize}
\column{.6\linewidth}
%\vspace{-10mm}
\figwithmatlab{FeatureSpace}
\end{columns}
\end{frame}
%\begin{frame}{classification}{general steps}
%\begin{enumerate}
%\item \textbf{define training set}: annotated results
%\smallskip
%\item<2-> \textbf{normalize} training set
%\smallskip
%\item<3-> \textbf{train} classifier
%\smallskip
%\item<4-> \textbf{evaluate} classifier with test (or validation) set
%\smallskip
%\item<5-> (\textbf{adjust} classifier settings, return to 4.)
%\end{enumerate}
%\end{frame}
%
%\section{classification}
%\begin{frame}{classification}{rules of thumb}
%\vspace{-3mm}
%\begin{itemize}
%\item \textbf{training set}
%\begin{itemize}
%\item training set size vs.\ number of features
%\begin{itemize}
%\item training set too small,% $\Rightarrow$ \textit{overfitting}
%feature number too large $\Rightarrow$ \textit{overfitting}
%\end{itemize}
%\item<1-> training set \textbf{too noisy} $\Rightarrow$ \textit{underfitting}
%\item<1-> training set \textbf{not representative} $\Rightarrow$ \textit{bad classification performance}
%\end{itemize}
%\smallskip
%\item<2-> \textbf{classifier}
%\begin{itemize}
%\item<2-> classifier too complex $\Rightarrow$ \textit{overfitting}
%\item<2-> \textbf{poor classifier} $\Rightarrow$ \textit{bad classification performance}
%\begin{itemize}
%\item[$\rightarrow$] different classifier
%\end{itemize}
%\end{itemize}
%\smallskip
%\item<3-> \textbf{features}
%\begin{itemize}
%\item<3-> \textbf{poor features} $\Rightarrow$ \textit{bad classification performance}
%\begin{itemize}
%\item[$\rightarrow$] new, better features
%\end{itemize}
%\item<3-> features \textbf{not normalized} $\Rightarrow$ possibly \textit{bad classification performance}
%\begin{itemize}
%\item feature distribution (range, mean, symmetry)
%\end{itemize}
%\end{itemize}
%\end{itemize}
%\end{frame}
%\begin{frame}{classification}{evaluation}
%\begin{itemize}
%\item define \textbf{test set} for evaluation
%\begin{itemize}
%\item test set \textit{different} from training set
%\item otherwise, same requirements
%\end{itemize}
%
%\bigskip
%\item<2-> example: \textbf{$N$-fold cross validation}
%\begin{enumerate}
%\item<2-> split training set into $N$ parts (randomly, but preferably identical number per class)
%\item<3-> select one part as test set
%\item<4-> train the classifier with all observations from remaining $N-1$ parts
%\item<5-> compute the classification rate for the test set
%\item<6-> repeat until all $N$ parts have been tested
%\item<7-> overall result: \textit{average} classification rate
%\end{enumerate}
%\end{itemize}
%\end{frame}
%
\section[examples]{classifier examples}
\begin{frame}{classifier examples}{k-Nearest Neighbor (kNN)}
\vspace{-5mm}
\begin{columns}
\column{.6\linewidth}
\begin{itemize}
\item \textbf{training}: extract reference vectors from training set
\begin{itemize}
\item store coordinates and class labels
\end{itemize}
\bigskip
\item<2-> \textbf{classification}: extract query vector and set class to majority of $k$ nearest reference vectors
\begin{enumerate}
\item compute distance between query and all training vectors
\item sort distances to find closest vectors
\item choose majority class out of the $k$ closest vectors
\end{enumerate}
\bigskip
\item<3-> \textbf{classifier model}: all training vectors
\end{itemize}
\column{.4\linewidth}
%\only<1,6>{\begin{figure}\includegraphics[width=\columnwidth]{Knn-0}\end{figure}}
%\setcounter{i}{1}
%\setcounter{j}{2}
%\whiledo{\value{i}<5}
%{
%\only<\value{j}>{\begin{figure}\includegraphics[width=\columnwidth]{Knn-\arabic{i}}\end{figure}}
%\stepcounter{i}
%\stepcounter{j}
%}
\figwithmatlab{Knn}
\only<4>{$k = 3 \Rightarrow$ blue majority}
\only<5>{$k = 5 \Rightarrow$ black majority}
\only<6>{$k = 7 \Rightarrow$ black majority}
\end{columns}
\end{frame}
\begin{frame}{classifier examples}{Gaussian Mixture Model (GMM)}
\vspace{-5mm}
\begin{columns}
\column{.4\linewidth}
\begin{itemize}
\item \textbf{training}:\\ model each class distribution as superposition of Gaussian distributions
\bigskip
\item<2-> \textbf{classification}:\\ compute output of each Gaussian and select class with highest probability
\bigskip
\item<3-> \textbf{classifier data}:\\ per class per Gaussian: $\mu$ and covariance, mixture weight
\end{itemize}
\column{.6\linewidth}
\vspace{-11mm}
\figwithmatlab{Gmm}
\end{columns}
\end{frame}
\begin{frame}{classifier examples}{Support Vector Machine (SVM)}
\begin{itemize}
\item \textbf{training}:
\begin{itemize}
\item map features to high dimensional space
\figwithref{graph/SVM}{\href{https://en.wikipedia.org/wiki/Support\_vector\_machine}{https://en.wikipedia.org/wiki/Support\_vector\_machine}}
\item find separating hyperplane through maximum distance of support vectors (data points)
\end{itemize}
\item<2-> \textbf{classification}: apply feature transform and proceed with 'linear' classification
\item<3-> \textbf{classifier data}: support vectors, kernel, kernel parameters
\end{itemize}
\end{frame}
\section{summary}
\begin{frame}{summary}{lecture content}
\begin{itemize}
\item \textbf{data-driven approach}
\begin{itemize}
\item 'general' system learns parameters/behavior from data
\item human interaction through
\begin{itemize}
\item parametrization and procedures
\item data selection
\end{itemize}
\end{itemize}
\bigskip
\item \textbf{many classifiers with different levels of complexity}
\begin{enumerate}
\item kNN
\item GMM
\item SVM
\item RandomForest
\item DNN
\item \ldots
\end{enumerate}
%\bigskip
%\item \textbf{fine balance of inputs}
%\begin{enumerate}
%\item number of features
%\item classifier complexity
%\item amount and variability of data
%\end{enumerate}
\end{itemize}
\inserticon{summary}
\end{frame}
\end{document}