linear classifiers rubine & ca-linear ruben balcazar

37
Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Upload: barbra-charles

Post on 18-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Linear ClassifiersRubine & CA-Linear

Ruben Balcazar

Page 2: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Classification Task

Given a group of labels, can we identify an input as belonging to one of those labels?

Page 3: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

To be more concrete LABELS

Cat

Dog

INPUT

?

Page 4: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

To be more concrete LABELS

Cat

Dog

INPUT

How could we make a machine that could do these classifications?

Page 5: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Features

Qualities that can describe and differentiate our labels:• Size• Weight• Fluffiness• Appetite• Time spent sleeping

Page 6: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

One Feature

Size

Page 7: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

One Feature

Size

Training Set

Page 8: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

One Feature

Size

?Input

Page 9: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

One Feature

Size

Input

Page 10: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Two Feature

Size

Appetite

Page 11: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Two Feature

Size

Appetite

Page 12: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Two Feature

Size

Appetite

Good Linear Classifier

Page 13: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Two Feature

Size

Appetite

Bad Linear Classifier

Page 14: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Features Vector

Allows us to represent any number of n features:

𝑓 < 𝑓 1 , 𝑓 2 ,…, 𝑓 𝑛>¿

Page 15: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Weights

Not every feature is equally important!

Every feature f has an associated weight w to reflect how much it contributes to classification.

Weights are found through the use of training sets.

Page 16: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Evaluation Score

𝑆𝑐𝑜𝑟𝑒=𝑤0+∑ 𝑓 𝑖𝑤𝑖In two class(label) systems, score works as a threshold: In more complex systems, the class with the highest

score is the best match.

In gesture recognition, our classes are the different gesturetypes.

Page 17: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

RubineFeature are extracted from gesture point data:

Example:

Feature 1 is the cosine of the initial angle of the gesture.

Feature 4 is the angle of the diagonal of the gesture’s bounding box.

Rubine specifies 13 features total.

Page 18: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

RubineGiven a:• Feature vector f<f1,f2, … ,fF> where F = total # of

features for an input gesture g.• Gesture class c’ and C = total # of classes what contain

F amount of weights.

Page 19: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Finding the Weights

Assume we have a training set with E amount of examples for class c’:

Calculate the average of each feature in a class c’:

Page 20: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Finding the Weights

Estimate a sample covariance(COV) matrix for gesture class c’

COV matrix is F x F

Page 21: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Finding the Weights

Common Covariance (CCOV) for ALL gesture classes

𝐶𝐶𝑂𝑉 11 𝐶𝐶𝑂𝑉 12 𝐶𝐶𝑂𝑉 13

𝐶𝐶𝑂𝑉 21 𝐶𝐶𝑂𝑉 22 𝐶𝐶𝑂𝑉 23

𝐶𝐶𝑂𝑉 31 𝐶𝐶𝑂𝑉 32 𝐶𝐶𝑂𝑉 33

CCOV is also an FxF matrix

Page 22: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Finding the Weights

Invert the CCOV matrix : CCOV-1

Remember: An inverse of a matrix A is a matrix A-1 such that:

AA-1 = <- Identity Matrix

Page 23: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Finding the Weights

Finally, we can find the weights via:

For Reference:

Page 24: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Finding the Weights

The Constant Weight:

For Reference:

Page 25: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

RejectionLABELS

Cat

Dog

INPUT

Linear Classifiers ALWAYS return a class.

Page 26: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

RejectionLABELS

Cat

Dog

INPUT

?What if our input is not relevant?

Page 27: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

RejectionLABELS

Cat

Dog

INPUT

Ruben is a dog?

Page 28: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

RejectionLABELS

Cat

Dog

INPUT

Ambiguous or irrelevant classifications should be rejected.

Page 29: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Rejection in Rubine

Given a gesture g with a feature vector f classified as class i with an evaluation score vi:

Reject Classification if < 0.95.

Page 30: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

CA-Linear

CA-Linear is a modification of Rubine.

CA stands for “Context Aware.”

CA-Linear uses “context” to remove potential gesture candidates from a classification.

Page 31: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Context : First Modification

𝑣𝑐 ′=𝑤𝑐 ′ 0+∑𝑖=1

𝐹

(𝑤 ¿¿𝑐 ′ 𝑖) ( 𝑓 𝑔𝑖 )0≤𝑐 ′<𝐶 ¿

Rubine:

𝑣𝑐 ′=¿CA-Linear:

Context is denoted by I, an indicator or relative context function.

Page 32: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

ParKorror’s Context

Player Context:

Environmental context:

𝐼𝑔 :Φ×Ψ→𝑅0+¿¿

Page 33: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Gesture Prior Function: Second ModificationEach supported gesture g out of a set of G gestures is given a probability of occurring in a given context I as:

In ParKorror: 𝑃 (𝑔|𝐼 ¿=𝐼𝑔(Φ,Ψ )

∑𝑖∈ 𝐺

𝐼𝑖 (Φ,Ψ )

Page 34: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Gesture Prior Function: Second ModificationRubines:Common Covariance (CCOV) for ALL gesture classes

CA-Linear:

Page 35: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Summary:

Rubine:• Gesture is defined by a features vector• The supported gestures use examples(training sets) to calculate the weight of

these features using CCOV matrixes• Input gestures are classified by evaluation equation

• The highest evaluation score is the classified gesture• We reject classification if P(g|c) < 0.95.

𝑣𝑐 ′=𝑤𝑐 ′ 0+∑𝑖=1

𝐹

(𝑤 ¿¿𝑐 ′ 𝑖) ( 𝑓 𝑔𝑖 )0≤𝑐 ′<𝐶 ¿

Page 36: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

SummaryCA-Linear:• Identical to Rubine with the exception of the addition of Context and

the Gesture Prior Function• Context is used to remove irrelevant gestures from classification:

• The Gesture Prior Function defines the probability of gesture being correctly classified in a given context and is used to create a context aware CCOV matrix to obtain the weights of each feature:

𝑣𝑐 ′=¿

Page 37: Linear Classifiers Rubine & CA-Linear Ruben Balcazar

Questions?