significance parametric pattern - mit … c lassifiers • semi-parametric c lassifiers •...

33
Pattern Classification Introduction Parametric classifiers Semi-parametric classifiers Dimensionality reduction Significance testing 6.345 Automatic Speech Recognition Pattern Classification 1

Upload: hoangque

Post on 15-Dec-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Pattern Classification

• Introduction

• Parametric classifiers

• Semi-parametric classifiers

• Dimensionality reduction

• Significance testing

6.345 Automatic Speech Recognition Pattern Classification 1

rahkuma
Lecture # 7 Session 2003
Page 2: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Pattern Classification

Goal: To classify objects (or patterns) into categories (or classes)

� Feature Extraction

� Classifier �

Observation Feature Vector Class s x ωi

Types of Problems:

1. Supervised: Classes are known beforehand, and data samples of each class are available

2. Unsupervised: Classes (and/or number of classes) are not known beforehand, and must be inferred from data

6.345 Automatic Speech Recognition Pattern Classification 2

Page 3: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Probability Basics

• Discrete probability mass function (PMF): P(ωi )

P(ωi ) = 1 i

• Continuous probability density function (PDF): p(x)

p(x)dx = 1

• Expected value: E(x)

E(x) = xp(x)dx

6.345 Automatic Speech Recognition Pattern Classification 3

Page 4: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

� � �

Kullback-Liebler Distance

• Can be used to compute a distance between two probability mass distributions, P(zi ), and Q (zi )

P(zi )D(P � Q ) = P(zi ) log

Q (zi ) ≥ 0

i

• Makes use of inequality log x ≤ x − 1

iP(zi ) i

P(zi ) − 1) = Q (zi ) − P(zi ) = 0P(zi ) log

Q (zi ) ≤ P(zi )( Q (zi )

i

• Known as relative entropy in information theory

• The divergence of P(zi ) and Q (zi ) is the symmetric sum

D(P � Q ) + D(Q � P)

6.345 Automatic Speech Recognition Pattern Classification 4

Page 5: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Bayes Theorem

PD

F

p(x|ω1) p(x|ω2)

x Define: {ωi } a set of M mutually exclusive classes

P(ωi ) a priori probability for class ωi

p(x|ωi ) PDF for feature vector x in class ωi

P(ωi |x) a posteriori probability of ωi given x

From Bayes Rule: P(ωi |x) = p(x|ωi )P(ωi )

p(x) M

where p(x) = p(x|ωi )P(ωi ) i=1

6.345 Automatic Speech Recognition Pattern Classification 5

Page 6: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Bayes Decision Theory

• The probability of making an error given x is:

P(error|x) = 1 − P(ωi |x) if decide class ωi

• To minimize P(error|x) (and P(error)):

Choose ωi if mathP(ωi |x) > P(ωj |x) ∀j �= i

• For a two class problem this decision rule means:

Choose ω1 if p(x|ω1)P(ω1)

>p(x|ω2)P(ω2)

; else ω2 p(x) p(x)

• This rule can be expressed as a likelihood ratio:

Choose ω1 if p(x|ω1) P(ω2) p(x|ω2)

>P(ω1)

; else choose ω2

6.345 Automatic Speech Recognition Pattern Classification 6

Page 7: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Bayes Risk

• Define cost function λij and conditional risk R(ωi |x):

– λij is cost of classifying x as ωi when it is really ωj

– R(ωi |x) is the risk for classifying x as class ωi

R(ωi |x) = M

λijP(ωj |x) j=1

• Bayes risk is the minimum risk which can be achieved: Choose ωi if R(ωi |x) < R(ωj |x) ∀j �= i

• Bayes risk corresponds to minimum P(error|x) when

– All errors have equal cost (λij = 1, i �= j)

– There is no cost for being correct (λii = 0)

j �=i

P(ωj |x) = 1 − P(ωi |x)R(ωi |x) =

6.345 Automatic Speech Recognition Pattern Classification 7

Page 8: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Discriminant Functions

• Alternative formulation of Bayes decision rule

• Define a discriminant function, gi (x), for each class ωi

Choose ωi if gi (x) > gj (x) ∀j �= i

• Functions yielding identical classification results:

gi (x) = P(ωi |x) = p(x|ωi )P(ωi ) = log p(x|ωi ) + log P(ωi )

• Choice of function impacts computation costs

• Discriminant functions partition feature space into decision regions, separated by decision boundaries

6.345 Automatic Speech Recognition Pattern Classification 8

Page 9: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Density Estimation

• Used to estimate the underlying PDF p(x|ωi )

• Parametric methods:

– Assume a specific functional form for the PDF

– Optimize PDF parameters to fit data

• Non-parametric methods:

– Determine the form of the PDF from the data

– Grow parameter set size with the amount of data

• Semi-parametric methods:

– Use a general class of functional forms for the PDF

– Can vary parameter set independently from data

– Use unsupervised methods to estimate parameters

6.345 Automatic Speech Recognition Pattern Classification 9

Page 10: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Parametric Classifiers

• Gaussian distributions

• Maximum likelihood (ML) parameter estimation

• Multivariate Gaussians

• Gaussian classifiers

6.345 Automatic Speech Recognition Parametric Classifiers 1

Page 11: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Gaussian Distributions

• Gaussian PDF’s are reasonable when a feature vector can be viewed as perturbation around a reference

Pro

babi

lity

Den

sity

0.1

0.2

0.3

0.4

0.0

4 2 0 2 4

x−µσ

• Simple estimation procedures for model parameters

• Classification often reduced to simple distance metrics

• Gaussian distributions also called Normal

6.345 Automatic Speech Recognition Parametric Classifiers 2

Page 12: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Gaussian Distributions: One Dimension

• One-dimensional Gaussian PDF’s can be expressed as:

− (x − µ)2

p(x) = √ 1

e 2σ2 ∼ N (µ, σ2)2πσ

• The PDF is centered around the mean

µ = E(x) = xp(x)dx

• The spread of the PDF is determined by the variance

σ2 = E((x − µ)2) = (x − µ)2p(x)dx

6.345 Automatic Speech Recognition Parametric Classifiers 3

Page 13: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Maximum Likelihood Parameter Estimation

• Maximum likelihood parameter estimation determines an estimate θ̂ for parameter θ by maximizing the likelihood L(θ) of observing data X = {x1, . . . , xn}

θ̂ = arg max L(θ) θ

• Assuming independent, identically distributed data

L(θ) = p(X|θ) = p(x1, . . . , xn|θ) = n

p(xi |θ) i=1

• ML solutions can often be obtained via the derivative

∂ L(θ) = 0

∂θ

• For Gaussian distributions log L(θ) is easier to solve

6.345 Automatic Speech Recognition Parametric Classifiers 4

Page 14: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

� �

Gaussian ML Estimation: One Dimension

• The maximum likelihood estimate for µ is given by:

− (xi − µ)2

n n

L(µ) = p(xi |µ) = √ 1

e 2σ2

i=1 i=1 2πσ 1 � √

log L(µ) = − 2σ2 (xi − µ)2 − n log 2πσ

i ∂ log L(µ) 1 �

(xi − µ) = 0= ∂µ σ2

i 1 �

µ̂ = xi n

i

• The maximum likelihood estimate for σ is given by:

σ2 =1 �

(xi − ˆˆ µ)2

n i

6.345 Automatic Speech Recognition Parametric Classifiers 5

Page 15: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Gaussian ML Estimation: One Dimension

[s] Duration (1000 utterances, 100 speakers)P

roba

bilit

y D

ensi

ty

4 6

810

20

0.05 0.10 0.15 0.20 0.25 0.30 Duration (sec)

(ˆ σ ≈ 40 ms)µ ≈ 120 ms, ˆ

6.345 Automatic Speech Recognition Parametric Classifiers 6

Page 16: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ML Estimation: Alternative Distributions

[s] Duration: Gamma DistributionP

roba

bilit

y D

ensi

ty

4 6

810

20

0.05 0.10 0.15 0.20 0.25 0.30 Duration (sec)

6.345 Automatic Speech Recognition Parametric Classifiers 7

Page 17: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ML Estimation: Alternative Distributions

[s] Log Duration: Normal DistributionP

roba

bilit

y D

ensi

ty

0.4

0.6

0.8

1.0

1.2

1.4

0.2

0.0

-3.5 -3.0 -2.5 -2.0 -1.5 log Duration (sec)

6.345 Automatic Speech Recognition Parametric Classifiers 8

Page 18: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ΣΣ

µµ ΣΣ µµµµ Σ

µµ

Σ µµ µµ

ΣΣ ΣΣ

Gaussian Distributions: Multiple Dimensions

• A multi-dimensional Gaussian PDF can be expressed as:

1

p(x) = (2π)d/

12|Σ|1/2

e − 2

(x − µ)t Σ−1(x − µ) ∼ N (µ, ΣΣ)

• d is the number of dimensions

• x = {x1, . . . , xd } is the input vector

• µ = E(x) = {µ1, . . . , µd } is the mean vector

Σ• Σ = E((x − µ)(x − µ)t ) is the covariance matrix with elements σij , inverse Σ−1 , and determinant |Σ|

• σij = σji = E((xi − µi )(xj − µj )) = E(xixj ) − µiµj

6.345 Automatic Speech Recognition Parametric Classifiers 9

Page 19: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ΣΣ

ΣΣ

Gaussian Distributions: Multi-Dimensional Properties

• If the ith and jth dimensions are statistically or linearly independent then E(xixj ) = E(xi )E(xj ) and σij = 0

• If all dimensions are statistically or linearly independent, then σij = 0 ∀i �= j and Σ has non-zero elements only on the diagonal

• If the underlying density is Gaussian and Σ is a diagonal matrix, then the dimensions are statistically independent and

d

p(x) = p(xi ) p(xi ) ∼ N (µi, σii ) σii = σi 2

i=1

6.345 Automatic Speech Recognition Parametric Classifiers 10

Page 20: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Diagonal Covariance Matrix: ΣΣΣ = σ2I

ΣΣΣ =

�����2 00 2

�����3-Dimensional PDF PDF Contour

-4

-2

0

2

4 -4

-2

0

2

4

-4

-2

0

2

4 -4 -2 0 2 4-4

-2

0

2

4

6.345 Automatic Speech Recognition Parametric Classifiers 11

Page 21: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Diagonal Covariance Matrix: σij = 0 ∀i �= j

ΣΣΣ =

�����2 00 1

�����3-Dimensional PDF PDF Contour

-4

-2

0

2

4 -4

-2

0

2

4

-4

-2

0

2

4 -4 -2 0 2 4-4

-2

0

2

4

6.345 Automatic Speech Recognition Parametric Classifiers 12

Page 22: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

General Covariance Matrix: σij �= 0

ΣΣΣ =

�����2 11 1

�����3-Dimensional PDF PDF Contour

-4

-2

0

2

4 -4

-2

0

2

4

-4

-2

0

2

4 -4 -2 0 2 4-4

-2

0

2

4

6.345 Automatic Speech Recognition Parametric Classifiers 13

Page 23: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

θθ

θθ

θθ θθ θθ θθ

θθ θθ θθ θθ θθ

θθ

µµ ΣΣ

µµ Σ µµ µµ

Multivariate ML Estimation

• The ML estimates for parameters θ = {θ1, . . . , θl } are determined by maximizing the joint likelihood L(θ) of a set of i.i.d. data X = {x1, . . . , xn}

n

L(θ) = p(X|θ) = p(x1, · · · , xn|θ) = p(xi |θ) i=1

• To find ˆ θ we solve �θL(θ) = 0, or �θ log L(θ) = 0

∂ ∂ �θ = { ∂θ1

, · · · , ∂θl

}

• The ML estimates of µ and Σ are:

1 � ˆ

� µ = xi Σ =

1 (xi − ˆ µ)tˆ Σ µ)(xi − ˆ

n ni i

6.345 Automatic Speech Recognition Parametric Classifiers 14

Page 24: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

µµ Σ

µµ ΣΣ

µµ ΣΣ µµ ΣΣ

Multivariate Gaussian Classifier

p(x) ∼ N (µ, ΣΣ)

• Requires a mean vector µi , and a covariance matrix Σi for each of M classes {ω1, · · · , ωM }

• The minimum error discriminant functions are of form:

gi (x) = log P(ωi |x) = log p(x|ωi ) + log P(ωi )

1 d 1 gi (x) = −

2(x − µi )t Σ−

i 1(x − µi ) −

2 log 2π −

2 log |Σi | + log P(ωi )

• Classification can be reduced to simple distance metrics for many situations

6.345 Automatic Speech Recognition Parametric Classifiers 15

Page 25: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ΣΣ

µµ

µµ µµ µµ

Gaussian Classifier: Σi = σ2I

• Each class has the same covariance structure: statistically independent dimensions with variance σ2

• The equivalent discriminant functions are:

gi (x) = −�x − µi �2

+ log P(ωi )2σ2

• If each class is equally likely, this is a minimum distance classifier, a form of template matching

• The discriminant functions can be replaced by the following linear expression:

gi (x) = wit x + ωi0

1where wi = σ 12 µi and ωi0 = − 2σ2 µi

tµi + log P(ωi )

6.345 Automatic Speech Recognition Parametric Classifiers 16

Page 26: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

Gaussian Classifier: ΣΣΣi = σ2I

For distributions with a common covariance structure the decisionregions are hyper-planes.

-1 0 1 2 3 4 5

-1

0

1

2

3

4

5

0

2

4

0

2

4

0

2

4

0

2

4

6.345 Automatic Speech Recognition Parametric Classifiers 17

Page 27: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ΣΣ Σ

ΣΣ

µµ ΣΣ µµ

Σ µµ

µµ ΣΣ µµ

Gaussian Classifier: Σi = ΣΣ

• Each class has the same covariance structure Σ

• The equivalent discriminant functions are:

1 gi (x) = −

2(x − µi )t Σ−1(x − µi ) + log P(ωi )

• If each class is equally likely, the minimum error decision rule is the squared Mahalanobis distance

• The discriminant functions remain linear expressions:

gi (x) = wit x + ωi0

where Σ−1µiwi = Σ 1 tωi0 = − 2

µi Σ−1µi + log P(ωi )

6.345 Automatic Speech Recognition Parametric Classifiers 18

Page 28: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ΣΣ

ΣΣ

µµ ΣΣ µµ ΣΣ

ΣΣ

Σ µµ

µµ ΣΣ µµ ΣΣ

Gaussian Classifier: Σi Arbitrary

• Each class has a different covariance structure Σi

• The equivalent discriminant functions are:

1 1 gi (x) = −

2(x − µi )t Σ−

i 1(x − µi ) −

2 log |Σi | + log P(ωi )

• The discriminant functions are inherently quadratic:

gi (x) = xt Wi x + wit x + ωi0

1where Wi = − 2

Σ− i

1

wi = ΣiΣ−1 µi

1 t 1 ωi0 = −

2 µi Σ

− i

1 µi − 2

log |Σi | + log P(ωi )

6.345 Automatic Speech Recognition Parametric Classifiers 19

Page 29: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ΣΣGaussian Classifier: Σi Arbitrary

For distributions with arbitrary covariance structures the decision regions are defined by hyper-spheres.

3

2

1

0

-1

-2

-3 -1 0 1 2 3 4 5

6.345 Automatic Speech Recognition Parametric Classifiers 20

Page 30: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

3 Class Classification (Atal & Rabiner, 1976)

• Distinguish between silence, unvoiced, and voiced sounds

• Use 5 features:

– Zero crossing count

– Log energy

– Normalized first autocorrelation coefficient

– First predictor coefficient, and

– Normalized prediction error

• Multivariate Gaussian classifier, ML estimation

• Decision by squared Mahalanobis distance

• Trained on four speakers (2 sentences/speaker), tested on 2 speakers (1 sentence/speaker)

6.345 Automatic Speech Recognition Parametric Classifiers 21

Page 31: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

� �

Maximum A Posteriori Parameter Estimation

• Bayesian estimation approaches assume the form of the PDF p(x|θ) is known, but the value of θ is not

• Knowledge of θ is contained in:

– An initial a priori PDF p(θ)

– A set of i.i.d. data X = {x1, . . . , xn} • The desired PDF for x is of the form

p(x|X ) = p(x, θ|X )dθ = p(x|θ)p(θ|X )dθ

• The value θ̂ that maximizes p(θ|X ) is called the maximum a posteriori (MAP) estimate of θ

n

p(θ|X ) =p(X|θ)p(θ)

= α p(xi |θ)p(θ)p(X )

i=1

6.345 Automatic Speech Recognition Parametric Classifiers 23

Page 32: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

ˆ

ˆ

Gaussian MAP Estimation: One Dimension

• For a Gaussian distribution with unknown mean µ:

p(x|µ) ∼ N(µ, σ2) p(µ) ∼ N(µ0, σ2 0 )

• MAP estimates of µ and x are given by:

p(µ|X ) = αn

p(xi |µ)p(µ) ∼ N(µn, σ2 n)

i=1

p(x|µ)p(µ|X )dµ ∼ N(µn, σ2 + σ2 n)p(x|X ) =

nσ2 0

nσ2 0 + σ2

µ + nσ2

σ2

µ0 σ2 n

0 + σ2 =

σ2 0σ2

nσ2 0 + σ2

where µn =

• As n increases, p(µ|X ) converges to µ, and p(x|X ) converges to the ML estimate ∼ N(µ̂, σ2)

6.345 Automatic Speech Recognition Parametric Classifiers 24

Page 33: Significance Parametric Pattern - MIT … c lassifiers • Semi-parametric c lassifiers • Dimensionality r eduction • Significance R t esting 6. 345 Automatic

References

• Huang, Acero, and Hon, Spoken Language Processing, Prentice-Hall, 2001.

• Duda, Hart and Stork, Pattern Classification, John Wiley & Sons, 2001.

• Atal and Rabiner, A Pattern Recognition Approach to Voiced-Unvoiced-Silence Classification with Applications to Speech Recognition, IEEE Trans ASSP, 24(3), 1976.

6.345 Automatic Speech Recognition Parametric Classifiers 25