support vector machine classification – basic …...a support vector machine finds a hyperplane wt...

19
Support Vector Machine Classification Basic Principles and Application Juergen Dukart SPM Course Lausanne, April 2012

Upload: others

Post on 14-Jun-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Support Vector

Machine

Classification –

Basic Principles

and Application

Juergen Dukart

SPM Course

Lausanne, April 2012

Page 2: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Outline

• Basic principles

• What do we get from SVM?

• SVM Modifications

• Applications in Neuroimaging

• Available software packages

Page 3: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Idea behind

• To recognize multivariate patterns

• Supervised learning

• Providing predictions for new data

Page 4: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

Page 5: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

Decision boundary

Training data

Testing data

Page 6: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

N-dimensional space

In Neuroimaging up to

several million features

Page 7: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

For N = 2

Page 8: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

Support vectors

Page 9: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

Φ: implicit embedding function

(xi, yi): training data from 2 classes such that yi = ± 1

A Support Vector Machine finds a hyperplanewT Φ(x) + b = 0 that best separates the two classes.

maximises the margin while minimising some measure of loss on the training data.

Page 10: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Basic principles

Primal problem:

Dual problem:

User defined penalty

Diagonal matrix with

labels on the diagonal

w = Σi yi αiΦ(xi)Perpendicular to

the hyperplane

Page 11: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

What do we get from SVM?

*Feature weights for each feature = Support vectors * support vector coefficients

• We get a model allowing us to classify new data

• We get the importance of each feature for

separation (weights*)

• We get support vectors (Subjects – information

close to the boundary)

• We get not only a binary decision but also a

probability/certainty for a specific decision

Page 12: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

SVM Modifications

• Relevance Vector Machines uses a sparse feature set

extracted from SVM

• Combination with Markov random fields using

neighborhood information as features

• Multi-class SVM

• Support vector regression predicts continuos variables

Page 13: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Applications in Neuroimaging

Page 14: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Applications in Neuroimaging

Page 15: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Applications in Neuroimaging

Page 16: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Applications in Neuroimaging

Page 17: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Applications in Neuroimaging

Classification problem: Alzheimer’s disease vs healthy aging

Page 18: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Available software packages

• www.shogun-toolbox.org (Shogun (toolbox) contains about 20 different

implementations of SVMs)

• libsvm libsvm is a library of SVMs which is actively patched

• liblinear liblinear is a library for large linear classification including some SVMs

• flssvm flssvm is a least squares svm implementation written in fortran

• Shark Shark is a C++ machine learning library implementing various types of SVMs

• dlib dlib is a C++ library for working with kernel methods and SVMs

• SVM light is a collection of open-source software tools for learning and classification

using SVM.

Page 19: Support Vector Machine Classification – Basic …...A Support Vector Machine finds a hyperplane wT Φ(x) + b = 0 that best separates the two classes. maximises the margin while minimising

Thank you for attention!