View
228
Download
5
Category
Preview:
Citation preview
Chapter 4Chapter 4
Pattern Recognition ConceptsPattern Recognition Concepts
continuedcontinued
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)
Decision treeDecision tree
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.
Classifying using nearest class Classifying using nearest class mean (with good results)mean (with good results)
Euclidean distanceEuclidean distance(and scaled Euclidean (and scaled Euclidean
distance)distance)
d
iii
XXXX1
22121
d
i i
iiXX
XX1
2
2121
Other distance measuresOther distance measures
from http://www.molmine.com/magma/analysis/distance.htmfrom http://www.molmine.com/magma/analysis/distance.htm
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
Classifying using nearest class Classifying using nearest class mean (with poor results)mean (with poor results)
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.
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.
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.
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).
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.
bay=intrusion of background
bay=intrusion of backgroundlid=virtual line segment that close
the bay
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
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
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.
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.”
Confusion matrixConfusion matrix
Empirical error rate = % Empirical error rate = % misclassifiedmisclassified
Empirical reject rate = % rejectedEmpirical reject rate = % rejected
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?
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)
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
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
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
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
Skip remainder of Chapter Skip remainder of Chapter 44
Recommended