chapter 4 pattern recognition concepts continued

44
Chapter 4 Chapter 4 Pattern Recognition Pattern Recognition Concepts Concepts continued continued

Upload: julie-webb

Post on 11-Jan-2016

227 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Chapter 4 Pattern Recognition Concepts continued

Chapter 4Chapter 4

Pattern Recognition ConceptsPattern Recognition Concepts

continuedcontinued

Page 2: Chapter 4 Pattern Recognition Concepts continued

Using featuresUsing features

Ex. Recognizing charactersEx. Recognizing characters AreaArea HeightHeight WidthWidth # of holes# of holes # of strokes# of strokes CentroidCentroid Best axis (of least inertia)Best axis (of least inertia) Second moments (about axis of least and most Second moments (about axis of least and most

inertia)inertia)

Page 3: Chapter 4 Pattern Recognition Concepts continued

Decision treeDecision tree

Page 4: Chapter 4 Pattern Recognition Concepts continued
Page 5: Chapter 4 Pattern Recognition Concepts continued
Page 6: Chapter 4 Pattern Recognition Concepts continued

Classifying using nearest class Classifying using nearest class meanmean

Some problems are more “fuzzy” and Some problems are more “fuzzy” and can’t be solved using simple decision can’t be solved using simple decision trees.trees.

To classify a candidate, c, compute its To classify a candidate, c, compute its distance from all know class means distance from all know class means and assign it to the same class as the and assign it to the same class as the class of the nearest mean.class of the nearest mean.

Page 7: Chapter 4 Pattern Recognition Concepts continued

Classifying using nearest class Classifying using nearest class mean (with good results)mean (with good results)

Page 8: Chapter 4 Pattern Recognition Concepts continued

Euclidean distanceEuclidean distance(and scaled Euclidean (and scaled Euclidean

distance)distance)

d

iii

XXXX1

22121

d

i i

iiXX

XX1

2

2121

Page 9: Chapter 4 Pattern Recognition Concepts continued

Other distance measuresOther distance measures

from http://www.molmine.com/magma/analysis/distance.htmfrom http://www.molmine.com/magma/analysis/distance.htm

Page 10: Chapter 4 Pattern Recognition Concepts continued

What is a distance metric?What is a distance metric?

3 properties:3 properties:1.1. g(x,y) = g(y,x)g(x,y) = g(y,x) symmetricsymmetric

2.2. g(x,x) = 0 and g(x,y)=0 implies x=yg(x,x) = 0 and g(x,y)=0 implies x=y

3.3. g(x,y) + g(y,z) >= g(x,z)g(x,y) + g(y,z) >= g(x,z) triangle inequalitytriangle inequality

from http://mathworld.wolfram.com/Metric.htmlfrom http://mathworld.wolfram.com/Metric.html

Page 11: Chapter 4 Pattern Recognition Concepts continued

Classifying using nearest class Classifying using nearest class mean (with poor results)mean (with poor results)

Page 12: Chapter 4 Pattern Recognition Concepts continued

Classifying using nearest Classifying using nearest neighborneighbor

To classify a candidate, c, compute To classify a candidate, c, compute its distance to all member of all know its distance to all member of all know classes and assign it to the same classes and assign it to the same class as the class of the nearest class as the class of the nearest element.element.

Page 13: Chapter 4 Pattern Recognition Concepts continued
Page 14: Chapter 4 Pattern Recognition Concepts continued

Precision vs. recallPrecision vs. recall Say we have an image db we wish to Say we have an image db we wish to

query.query. ““Show me all images of tanks.”Show me all images of tanks.”

Precision = # of relevant documents Precision = # of relevant documents retrieved divided by the total number of retrieved divided by the total number of documents retrieveddocuments retrieved

Precision = TP / (TP+FP)Precision = TP / (TP+FP) PPV = positive predictive valuePPV = positive predictive value

Probability that the target is is actually present Probability that the target is is actually present when the observer says that is it present.when the observer says that is it present.

Page 15: Chapter 4 Pattern Recognition Concepts continued

Precision vs. recallPrecision vs. recall Say we have an image db we wish to query.Say we have an image db we wish to query.

““Show me all images of tanks.”Show me all images of tanks.”

Recall = # of relevant documents retrieved Recall = # of relevant documents retrieved divided by the total number of relevant divided by the total number of relevant documents in the db.documents in the db.

Recall = TP / (TP+FN) = TPFRecall = TP / (TP+FN) = TPF

Negative predictive valueNegative predictive value NPV = TN / (TN+FN)NPV = TN / (TN+FN) Probability that the target is actually absent when the Probability that the target is actually absent when the

observer says that it is absent.observer says that it is absent.

Page 16: Chapter 4 Pattern Recognition Concepts continued

Structural (pattern recognition) Structural (pattern recognition) techniquestechniques

Simple features may not be enough Simple features may not be enough for recognition.for recognition.

So relationships between these So relationships between these primitive features are used (in primitive features are used (in structural techniques).structural techniques).

Page 17: Chapter 4 Pattern Recognition Concepts continued

Same bounding box, holes, strokes, Same bounding box, holes, strokes, centroid, 2centroid, 2ndnd moments in row and moments in row and column directions, and similar major column directions, and similar major axis direction.axis direction.

Page 18: Chapter 4 Pattern Recognition Concepts continued

bay=intrusion of background

Page 19: Chapter 4 Pattern Recognition Concepts continued

bay=intrusion of backgroundlid=virtual line segment that close

the bay

Page 20: Chapter 4 Pattern Recognition Concepts continued

Structural graphsStructural graphs

a graph G = ( V, E )a graph G = ( V, E ) where V is a vertex set and E is an edge setwhere V is a vertex set and E is an edge set

from http://mathworld.wolfram.com/Graph.htmlfrom http://mathworld.wolfram.com/Graph.html

Page 21: Chapter 4 Pattern Recognition Concepts continued

Structural graphsStructural graphs

a graph G = ( V, E )a graph G = ( V, E ) where V is a vertex set and E is an edge setwhere V is a vertex set and E is an edge set

VV S = sideS = side L = lakeL = lake B = bayB = bay

EE CON = connection of 2 strokesCON = connection of 2 strokes ADJ = stroke region is immediately adjacent to a ADJ = stroke region is immediately adjacent to a

lake or bay regionlake or bay region ABOVE = 1 hole (lake or bay) lies above anotherABOVE = 1 hole (lake or bay) lies above another

Page 22: Chapter 4 Pattern Recognition Concepts continued
Page 23: Chapter 4 Pattern Recognition Concepts continued

Structural graph conclusionsStructural graph conclusions

Graph-matching techniques can be Graph-matching techniques can be used for recognition.used for recognition.

Or we can count occurrences of Or we can count occurrences of relationships and use these counts as relationships and use these counts as a feature vector for statistical PR.a feature vector for statistical PR.

Page 24: Chapter 4 Pattern Recognition Concepts continued

Structural graph homeworkStructural graph homework

Create structural graphs for the Create structural graphs for the following characters:following characters: XX 88 CC 66

Email your answers to me with the Email your answers to me with the subject, “structural.”subject, “structural.”

Page 25: Chapter 4 Pattern Recognition Concepts continued

Confusion matrixConfusion matrix

Page 26: Chapter 4 Pattern Recognition Concepts continued

Empirical error rate = % Empirical error rate = % misclassifiedmisclassified

Empirical reject rate = % rejectedEmpirical reject rate = % rejected

Page 27: Chapter 4 Pattern Recognition Concepts continued

Empirical error rate = % misclassified = Empirical error rate = % misclassified = 25/1000 overall (does not include rejects); 25/1000 overall (does not include rejects); 5/100 for 9s5/100 for 9s

Empirical reject rate = % rejected = Empirical reject rate = % rejected = 7/10007/1000

Can ROC analysis be applied?Can ROC analysis be applied?

Page 28: Chapter 4 Pattern Recognition Concepts continued

Recall ROC analysisRecall ROC analysis TP = true positive = present and detectedTP = true positive = present and detected TN = true negative = not present and not detectedTN = true negative = not present and not detected FP = false positive = not present but detectedFP = false positive = not present but detected FN = false negative = present but not detectedFN = false negative = present but not detected True positive fractionTrue positive fraction

TPF = TP / (TP+FN)TPF = TP / (TP+FN) true abnormals called abnormal by the observertrue abnormals called abnormal by the observer

False positive fractionFalse positive fraction FPF = FP / (FP+TN)FPF = FP / (FP+TN)

Page 29: Chapter 4 Pattern Recognition Concepts continued

Ex. ROC analysis for the classification of ‘3’Ex. ROC analysis for the classification of ‘3’ TPTP = ‘3’ present and ‘3’ detected = ‘3’ present and ‘3’ detected TNTN = not present and not detected = not present and not detected FPFP = not present but detected = not present but detected FNFN = present but not detected = present but not detected

Page 30: Chapter 4 Pattern Recognition Concepts continued

Ex. ROC analysis for the classification of ‘3’Ex. ROC analysis for the classification of ‘3’ TPTP = ‘3’ present and ‘3’ detected = ‘3’ present and ‘3’ detected TNTN = not present and not detected = not present and not detected FPFP = not present but detected = not present but detected FNFN = present but not detected = present but not detected

Page 31: Chapter 4 Pattern Recognition Concepts continued

Ex. ROC analysis for the classification of ‘3’Ex. ROC analysis for the classification of ‘3’ TPTP = ‘3’ present and ‘3’ detected = ‘3’ present and ‘3’ detected TNTN = not present and not detected = not present and not detected FPFP = not present but detected = not present but detected FNFN = present but not detected = present but not detected

Page 32: Chapter 4 Pattern Recognition Concepts continued

Ex. ROC analysis for the classification of ‘3’Ex. ROC analysis for the classification of ‘3’ TPTP = ‘3’ present and ‘3’ detected = ‘3’ present and ‘3’ detected TNTN = not present and not detected = not present and not detected FPFP = not present but detected = not present but detected FNFN = present but not detected = present but not detected

Page 33: Chapter 4 Pattern Recognition Concepts continued

Skip remainder of Chapter Skip remainder of Chapter 44

Page 34: Chapter 4 Pattern Recognition Concepts continued
Page 35: Chapter 4 Pattern Recognition Concepts continued
Page 36: Chapter 4 Pattern Recognition Concepts continued
Page 37: Chapter 4 Pattern Recognition Concepts continued
Page 38: Chapter 4 Pattern Recognition Concepts continued
Page 39: Chapter 4 Pattern Recognition Concepts continued
Page 40: Chapter 4 Pattern Recognition Concepts continued
Page 41: Chapter 4 Pattern Recognition Concepts continued
Page 42: Chapter 4 Pattern Recognition Concepts continued
Page 43: Chapter 4 Pattern Recognition Concepts continued
Page 44: Chapter 4 Pattern Recognition Concepts continued