521495a: artificial intelligence - noppa.oulu.fi · pdf file521495a: artificial intelligence...

72
521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, CMVS, University of Oulu Slides adopted from http://ai.berkeley.edu Classification, Perceptron, Clustering

Upload: phungnhu

Post on 16-Mar-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

521495A: Artificial Intelligence

Lectured by

Abdenour Hadid

Associate Professor, CMVS, University of Oulu

Slides adopted from http://ai.berkeley.edu

Classification, Perceptron, Clustering

Page 2: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Q-Learning

Page 3: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Non-Deterministic Search

Page 4: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Solving MDPs

Page 5: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification
Page 6: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Q-Learning

Page 7: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Q-Learning

Q-Learning: sample-based Q-value iteration

Learn Q(s,a) values as you go

Receive a sample (s,a,s’,r)

Consider your old estimate:

Consider your new sample estimate:

Incorporate the new estimate into a running average:

Page 8: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Q-Learning

Page 9: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Q-Learning

Q(s,a)=0 Sample α = 0.4

8

9

10

9

13

12

6

7

9

Page 10: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

521495A: Artificial Intelligence

Lectured by

Abdenour Hadid

Associate Professor, CMVS, University of Oulu

Slides adopted from http://ai.berkeley.edu

Classification, Perceptron, Clustering

Page 11: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Machine Learning

Up until now: how use a model to make optimal decisions

Machine learning: how to acquire a model from data / experience

Today: Classification, Perceptron and Clustering

Page 12: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Concepts that we will study today!!!

Page 13: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Classification

Assignment of a label to a given input value

Page 14: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Classification

ClassifierInputs Label

Page 15: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Classification

ClassifierDear Sir.

First, I must solicit your confidencein this transaction, this is byvirture of its nature as beingutterly confidencial and topsecret. …

Page 16: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Classification

Classifier

Page 17: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Classification

Classifier 2

Page 18: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Example: Spam Filter

Input: an email Output: spam/ham

unsolicited bulk messages, especially in advertising

Setup: Get a large collection of example emails, each labeled

“spam” or “ham” Note: someone has to hand label all this data! Want to learn to predict labels of new, future emails

Features: The attributes used to make the ham / spam decision Words: FREE! Text Patterns: $dd, CAPS Non-text: SenderInContacts …

Dear Sir.

First, I must solicit your confidence in this transaction, this is by virture of its nature as being utterly confidencial and top secret. …

TO BE REMOVED FROM FUTURE MAILINGS, SIMPLY REPLY TO THIS MESSAGE AND PUT "REMOVE" IN THE SUBJECT.

99 MILLION EMAIL ADDRESSESFOR ONLY $99

Ok, Iknow this is blatantly OT but I'm beginning to go insane. Had an old Dell Dimension XPS sitting in the corner and decided to put it to use, I know it was working pre being stuck in the corner, but when I plugged it in, hit the power nothing happened.

Page 19: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Example: Emotion Recognition

Input: face images/ videos

Output: an expression (happy, sad, angry, etc..)

Setup: Get a collection of example images, each labeled with an expression Note: someone has to hand label all this data! Want to learn to predict labels of new, future face images

Features: The attributes used to make the digit decision Mouth Open: =ON Facial Musles= Eyebrows are squeezed=

Page 20: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Example: Digit Recognition

Input: images / pixel grids

Output: a digit 0-9

Setup: Get a large collection of example images, each labeled with a digit Note: someone has to hand label all this data! Want to learn to predict labels of new, future digit images

Features: The attributes used to make the digit decision Pixels: (6,8)=ON Shape Patterns: NumComponents, AspectRatio, NumLoops …

0

1

2

1

??

Page 21: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Classification

ClassifierInputs Label

Think about some examples of classification problems

Page 22: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Other Classification Tasks

Classification: given inputs x, predict labels (classes) y

Examples: Spam detection (input: document,

classes: spam / ham) OCR (input: images, classes: characters) Medical diagnosis (input: symptoms,

classes: diseases) Automatic essay grading (input: document,

classes: grades) Fraud detection (input: account activity,

classes: fraud / no fraud) Customer service email routing … many more

Classification is an important commercial technology!

Page 23: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Training and Testing

Page 24: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Important Concepts

Data: labeled instances, e.g. emails marked spam/ham Training set Held out set (development) Test set

Features: attribute-value pairs which characterize each x

Experimentation cycle Learn parameters (e.g. model probabilities) on training set (Tune hyperparameters on held-out set) Compute accuracy of test set Very important: never “peek” at the test set!

Evaluation Accuracy: fraction of instances predicted correctly

Overfitting and generalization Want a classifier which does well on test data Overfitting: fitting the training data very closely, but not

generalizing well

TrainingData

Held-OutData

TestData

Page 25: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Generalization and Overfitting

Page 26: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Overfitting

Page 27: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Features

Page 28: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Errors, and What to Do

Examples of errors

Dear GlobalSCAPE Customer,

GlobalSCAPE has partnered with ScanSoft to offer you the

latest version of OmniPage Pro, for just $99.99* - the regular

list price is $499! The most common question we've received

about this offer is - Is this genuine? We would like to assure

you that this offer is authorized by ScanSoft, is genuine and

valid. You can get the . . .

. . . To receive your $30 Amazon.com promotional certificate,

click through to

http://www.amazon.com/apparel

and see the prominent link for the $30 offer. All details are

there. We hope you enjoyed receiving this message. However, if

you'd rather not receive future e-mails announcing new store

launches, please click . . .

Page 29: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

What to Do About Errors?

Need more features– words aren’t enough! Have you emailed the sender before? Have 1K other people just gotten the same email? Is the sending information consistent? Is the email in ALL CAPS? Do URLs point where they say they point? Does the email address you by (your) name?

Can add these information sources as new variables

Page 30: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Baselines

First step: get a baseline Baselines are very simple “straw man” procedures

Help determine how hard the task is Help know what a “good” accuracy is

Weak baseline: most frequent label classifier Gives all test instances whatever label was most common in the training set

E.g. for spam filtering, might label everything as ham Accuracy might be very high if the problem is skewed

E.g. calling everything “ham” gets 66%, so a classifier that gets 70% isn’t very good…

For real research, usually use previous work as a (strong) baseline

Page 31: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Confidences from a Classifier

The confidence of a probabilistic classifier: Posterior over the top label

Represents how sure the classifier is of the classification

Any probabilistic model will have confidences No guarantee confidence is correct

Calibration Weak calibration: higher confidences mean

higher accuracy Strong calibration: confidence predicts accuracy

rate

Page 32: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Precision vs. Recall

Let’s say we want to classify web pages ashomepages or not In a test set of 1K pages, there are 3 homepages Our classifier says they are all non-homepages 99.7 accuracy! Need new measures for rare positive events

Precision: fraction of guessed positives which were actually positive“fraction of retrieved instances that are relevant”

Recall: fraction of actual positives which were guessed as positive (sensitivity)“fraction of relevant instances that are retrieved”

Say we guess 5 homepages, of which 2 were actually homepages Precision: 2 correct / 5 guessed = 0.4 Recall: 2 correct / 3 true = 0.67

Which is more important in airport face recognition (Criminals)?

-

guessed +

actual +

Page 33: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Precision vs. Recall

Precision/recall tradeoff Often, you can trade off

precision and recall

Only works well with weakly calibrated classifiers

To summarize the tradeoff: Break-even point: precision

value when p = r

F-measure: harmonic mean of p and r:

Page 34: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

False Positive versus False Negative

Page 35: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

521495A: Artificial Intelligence

Lectured by

Abdenour Hadid

Associate Professor, CMVS, University of Oulu

Slides adopted from http://ai.berkeley.edu

Perceptron

Page 36: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification
Page 37: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification
Page 38: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Linear Classifiers

Page 39: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Feature Vectors

Hello,

Do you want free printr

cartriges? Why pay more

when you can get them

ABSOLUTELY FREE! Just

# free : 2

YOUR_NAME : 0

MISSPELLED : 2

FROM_FRIEND : 0

...

SPAMor+

PIXEL-7,12 : 1

PIXEL-7,13 : 0

...

NUM_LOOPS : 1

...

“2”

Page 40: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Some (Simplified) Biology

Very loose inspiration: human neurons

Page 41: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Linear Classifiers

Inputs are feature values

Each feature has a weight

Sum is the activation

If the activation is: Positive, output +1

Negative, output -1

f1

f2

f3

w1

w2

w3

>0?

Page 42: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Weights

Binary case: compare features to a weight vector

Learning: figure out the weight vector from examples

# free : 2

YOUR_NAME : 0

MISSPELLED : 2

FROM_FRIEND : 0

...

# free : 4

YOUR_NAME :-1

MISSPELLED : 1

FROM_FRIEND :-3

...

# free : 0

YOUR_NAME : 1

MISSPELLED : 1

FROM_FRIEND : 1

...

Dot product positive

means the positive class

Page 43: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Decision Rules

Page 44: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Binary Decision Rule

In the space of feature vectors

Examples are points

Any weight vector is a hyperplane

One side corresponds to Y=+1

Other corresponds to Y=-1

BIAS : -3

free : 4

money : 2

...0 1

0

1

2

freem

on

ey

+1 = SPAM

-1 = HAM

Page 45: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Weight Updates

Page 46: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Learning: Binary Perceptron

Start with weights = 0

For each training instance:

Classify with current weights

If correct (i.e., y=y*), no change!

If wrong: adjust the weight vector

Page 47: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Learning: Binary Perceptron

Start with weights = 0

For each training instance:

Classify with current weights

If correct (i.e., y=y*), no change!

If wrong: adjust the weight vector by adding or subtracting the feature vector. Subtract if y* is -1.

Page 48: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Examples: Perceptron

Separable Case

Page 49: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Properties of Perceptrons

Separability: true if some parameters get the training set perfectly correct

Convergence: if the training is separable, perceptron will eventually converge (binary case)

Mistake Bound: the maximum number of mistakes (binary case) related to the margin or degree of separability

Separable

Non-Separable

Page 50: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Examples: Perceptron

Non-Separable Case

Page 51: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Linear Separators

Which of these linear separators is optimal?

Page 52: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Support Vector Machines

Maximizing the margin: good according to intuition, theory, practice

Only support vectors matter; other training examples are ignorable

Support vector machines (SVMs) find the separator with max margin

SVM

Page 53: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

521495A: Artificial Intelligence

Lectured by

Abdenour Hadid

Associate Professor, CMVS, University of Oulu

Slides adopted from http://ai.berkeley.edu

Clustering

Page 54: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Non-Separable Data

Page 55: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Nearest-Neighbor Classification

Nearest neighbor for digits: Take new image Compare to all training images Assign based on closest example

Encoding: image is vector of intensities:

What’s the similarity function? Dot product of two images vectors?

Usually normalize vectors so ||x|| = 1

0

1

2

0

1

2

Page 56: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Similarity Functions

Page 57: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Basic Similarity

Many similarities based on feature dot products:

If features are just the pixels:

Note: not all similarities are of this form

Page 58: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

A Tale of Two Approaches…

Nearest neighbor-like approaches

Can use fancy similarity functions

Don’t actually get to do explicit learning

Perceptron-like approaches

Explicit training to reduce empirical error

Can’t use fancy similarity, only linear

Page 59: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Non-Linearity

Page 60: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Non-Linear Separators

Data that is linearly separable works out great for linear decision rules:

But what are we going to do if the dataset is just too hard?

How about… mapping data to a higher-dimensional space:

0

0

0

x2

x

x

x

Page 61: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Non-Linear Separators

General idea: the original feature space can always be mapped to some higher-dimensional feature space where the training set is separable:

Φ: x→ φ(x)

Page 62: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Some Kernels

Kernels implicitly map original vectors to higher dimensional spaces, take the dot product there, and hand the result back

Linear kernel:

Quadratic kernel:

RBF: infinite dimensional representation

Discrete kernels: e.g. string kernels

Page 63: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

521495A: Artificial Intelligence

Lectured by

Abdenour Hadid

Associate Professor, CMVS, University of Oulu

Slides adopted from http://ai.berkeley.edu

Clustering

Page 64: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Recap: Classification

Classification systems: Supervised learning

Make a prediction given evidence

We’ve seen several methods for this

Useful when you have labeled data

Page 65: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Clustering

Clustering systems: Unsupervised learning Detect patterns in unlabeled data

E.g. group emails or search results E.g. find categories of customers E.g. detect anomalous program executions

Useful when don’t know what you’re looking for

Requires data, but no labels

Page 66: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Clustering

Page 67: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Clustering

Basic idea: group together similar instances Example: 2D point patterns

What could “similar” mean? One option: small (squared) Euclidean distance

Page 68: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

K-Means

Page 69: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

K-Means

An iterative clustering algorithm Pick K random points as cluster

centers (means) Alternate:

Assign data instances to closest mean

Assign each mean to the average of its assigned points

Stop when no points’ assignments change

How many clusters to pick?

Page 70: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Similarity measure depends on the applications

Similarity measure?

Page 71: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

About features

e.g. face descriptors for recognition

The face features for instance, should be robust to changes in pose, facial

expression, illumination, aging, occlusion, presence of glasses etc.

Same features

Page 72: 521495A: Artificial Intelligence - noppa.oulu.fi · PDF file521495A: Artificial Intelligence Lectured by Abdenour Hadid Associate Professor, ... Think about some examples of classification

Recap: Keywords/Concepts