Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.

Slides:



Advertisements
Similar presentations
Principles of Density Estimation
Advertisements

Data Mining Classification: Alternative Techniques
Data Mining Classification: Alternative Techniques
0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Lecture 3 Nonparametric density estimation and classification
Pattern Classification, Chapter 2 (Part 2) 0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R.
Pattern Classification, Chapter 2 (Part 2) 0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R.
Pattern Classification Chapter 2 (Part 2)0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O.
Pattern recognition Professor Aly A. Farag
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Chapter 5: Linear Discriminant Functions
Chapter 4 (Part 1): Non-Parametric Classification
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Pattern Classification, Chapter 3 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
1-NN Rule: Given an unknown sample X decide if for That is, assign X to category if the closest neighbor of X is from category i.
Prénom Nom Document Analysis: Non Parametric Methods for Pattern Recognition Prof. Rolf Ingold, University of Fribourg Master course, spring semester 2008.
Chapter 6: Multilayer Neural Networks
KNN, LVQ, SOM. Instance Based Learning K-Nearest Neighbor Algorithm (LVQ) Learning Vector Quantization (SOM) Self Organizing Maps.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Chapter 4 (part 2): Non-Parametric Classification
Pattern Recognition. Introduction. Definitions.. Recognition process. Recognition process relates input signal to the stored concepts about the object.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Methods in Medical Image Analysis Statistics of Pattern Recognition: Classification and Clustering Some content provided by Milos Hauskrecht, University.
COMMON EVALUATION FINAL PROJECT Vira Oleksyuk ECE 8110: Introduction to machine Learning and Pattern Recognition.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
An Introduction to Support Vector Machine (SVM) Presenter : Ahey Date : 2007/07/20 The slides are based on lecture notes of Prof. 林智仁 and Daniel Yeung.
Nearest Neighbor (NN) Rule & k-Nearest Neighbor (k-NN) Rule Non-parametric : Can be used with arbitrary distributions, No need to assume that the form.
Non-Parameter Estimation 主講人:虞台文. Contents Introduction Parzen Windows k n -Nearest-Neighbor Estimation Classification Techiques – The Nearest-Neighbor.
1 Pattern Recognition: Statistical and Neural Lonnie C. Ludeman Lecture 24 Nov 2, 2005 Nanjing University of Science & Technology.
Image Modeling & Segmentation Aly Farag and Asem Ali Lecture #2.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
METU Informatics Institute Min720 Pattern Classification with Bio-Medical Applications Part 6: Nearest and k-nearest Neighbor Classification.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Chapter 13 (Prototype Methods and Nearest-Neighbors )
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Eick: kNN kNN: A Non-parametric Classification and Prediction Technique Goals of this set of transparencies: 1.Introduce kNN---a popular non-parameric.
Debrup Chakraborty Non Parametric Methods Pattern Recognition and Machine Learning.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Pattern Classification All materials in these slides* were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Pattern Classification Chapter 2(Part 3) 0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O.
Nonparametric Density Estimation – k-nearest neighbor (kNN) 02/20/17
Non-Parameter Estimation
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
School of Computer Science & Engineering
Lecture 05: K-nearest neighbors
K Nearest Neighbor Classification
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
LECTURE 16: NONPARAMETRIC TECHNIQUES
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Lecture 03: K-nearest neighbors
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Nonparametric density estimation and classification
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
ECE – Pattern Recognition Lecture 10 – Nonparametric Density Estimation – k-nearest-neighbor (kNN) Hairong Qi, Gonzalez Family Professor Electrical.
Presentation transcript:

Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley & Sons, 2000 with the permission of the authors and the publisher

Chapter 4 (part 2): Non-Parametric Classification (Sections ) Parzen Window (cont.) Kn –Nearest Neighbor Estimation The Nearest-Neighbor Rule

Pattern Classification, Chapter 4 (Part 2) 2

3 Parzen Windows (cont.) Parzen Windows – Probabilistic Neural Networks Compute a Parzen estimate based on n patterns Patterns with d features sampled from c classes The input unit is connected to n patterns. x1x1 x2x2 xdxd p1p1 p2p2 pnpn Input unit Input patterns.... Modifiable weights (trained) W dn W d2 W 11..

Pattern Classification, Chapter 4 (Part 2) 4 p1p1 p2p2 pnpn Input patterns pnpn pkpk 11 22 cc... Category units Activations (Emission of nonlinear functions)

Pattern Classification, Chapter 4 (Part 2) 5 Training the network Algorithm 1.Normalize each pattern x of the training set to 1 2.Place the first training pattern on the input units 3.Set the weights linking the input units and the first pattern units such that: w 1 = x 1 4.Make a single connection from the first pattern unit to the category unit corresponding to the known class of that pattern 5.Repeat the process for all remaining training patterns by setting the weights such that w k = x k (k = 1, 2, …, n) We finally obtain the following network

Pattern Classification, Chapter 4 (Part 2) 6

7 Testing the network Algorithm 1.Normalize the test pattern x and place it at the input units 2.Each pattern unit computes the inner product in order to yield the net activation and emit a nonlinear function 3.Each output unit sums the contributions from all pattern units connected to it 4.Classify by selecting the maximum value of P n (x |  j ) (j = 1, …, c)

Pattern Classification, Chapter 4 (Part 2) 8 K n - Nearest neighbor estimation Goal: a solution for the problem of the unknown “best” window function Let the cell volume be a function of the training data Center a cell about x and let it grows until it captures k n samples (k n = f(n)) k n are called the k n nearest-neighbors of x 2 possibilities can occur: Density is high near x; therefore the cell will be small which provides a good resolution Density is low; therefore the cell will grow large and stop until higher density regions are reached We can obtain a family of estimates by setting k n =k 1 /  n and choosing different values for k 1

Pattern Classification, Chapter 4 (Part 2) 9

10

Pattern Classification, Chapter 4 (Part 2) 11 Illustration For k n =  n = 1 ; the estimate becomes: P n (x) = k n / n.V n = 1 / V 1 =1 / 2|x-x 1 |

Pattern Classification, Chapter 4 (Part 2) 12

Pattern Classification, Chapter 4 (Part 2) 13

Pattern Classification, Chapter 4 (Part 2) 14 Estimation of a-posteriori probabilities Goal: estimate P(  i | x) from a set of n labeled samples Let’s place a cell of volume V around x and capture k samples k i samples amongst k turned out to be labeled  i then: p n (x,  i ) = k i /n.V An estimate for p n (  i | x) is:

Pattern Classification, Chapter 4 (Part 2) 15 k i /k is the fraction of the samples within the cell that are labeled  i For minimum error rate, the most frequently represented category within the cell is selected If k is large and the cell sufficiently small, the performance will approach the best possible

Pattern Classification, Chapter 4 (Part 2) 16 The nearest –neighbor rule Let D n = {x 1, x 2, …, x n } be a set of n labeled prototypes Let x’  D n be the closest prototype to a test point x then the nearest-neighbor rule for classifying x is to assign it the label associated with x’ The nearest-neighbor rule leads to an error rate greater than the minimum possible: the Bayes rate If the number of prototype is large (unlimited), the error rate of the nearest-neighbor classifier is never worse than twice the Bayes rate (it can be demonstrated!) If n  , it is always possible to find x’ sufficiently close so that: P(  i | x’)  P(  i | x)

Pattern Classification, Chapter 4 (Part 2) 17 Example: x = (0.68, 0.60) t Decision:  5 is the label assigned to x PrototypesLabelsA-posteriori probabilities estimated (0.50, 0.30) (0.70, 0.65) 2356235 = P(  m | x)

Pattern Classification, Chapter 4 (Part 2) 18 If P(  m | x)  1, then the nearest neighbor selection is almost always the same as the Bayes selection

Pattern Classification, Chapter 4 (Part 2) 19

Pattern Classification, Chapter 4 (Part 2) 20 The k – nearest-neighbor rule Goal: Classify x by assigning it the label most frequently represented among the k nearest samples and use a voting scheme

Pattern Classification, Chapter 4 (Part 2) 21

Pattern Classification, Chapter 4 (Part 2) 22 Example: k = 3 (odd value) and x = (0.10, 0.25) t Closest vectors to x with their labels are: {(0.10, 0.28,  2 ); (0.12, 0.20,  2 ); (0.15, 0.35,  1 )} One voting scheme assigns the label  2 to x since  2 is the most frequently represented PrototypesLabels (0.15, 0.35) (0.10, 0.28) (0.09, 0.30) (0.12, 0.20) 12521252

Pattern Classification, Chapter 4 (Part 2) 23

Pattern Classification, Chapter 4 (Part 2) Metrics and NN Classification Metrics = “distance” between patterns Four properties: Non-negativity D(a, b) ≧ 0 Reflexivity D(a, b) = 0 iff a = b Symmetry D(a, b) = D(b, a) Triangle inequality D(a, b)+ D(b, c) ≧ D(a, c) Euclidean distance k=2 Minkowski metric Manhattan distance k=1

Pattern Classification, Chapter 4 (Part 2) 25 Distance 1.0 from (0,0,0) for different k

Pattern Classification, Chapter 4 (Part 2) 26 Scaling the coordinates

Pattern Classification, Chapter 4 (Part 2) 27 Tanimoto metric Use in taxonomy Identical D(S1, S2) = 0 Overlap 50% D(S1, S2) = (1+1-2*0.5)/( )=1/1.5=0.666 No intersection D(S1, S2) = 1

Pattern Classification, Chapter 4 (Part 2) Tangent Distance Transformed patterns to be as similar as possible Linear approximation to the arbitrary transforms Perform each of the transformation F i (x’; a i ) on each stored prototype x’. Tangent vector TV i TV i = F i (x’; a i ) - x’ Tangent distance D tan (x’, x) = min [ ||( x’ + Ta) – x|| ] a Tangent space

Pattern Classification, Chapter 4 (Part 2) dim patterns Shifted s pixelsHand write “8”

Pattern Classification, Chapter 4 (Part 2) 30

Pattern Classification, Chapter 4 (Part 2) 31

Pattern Classification, Chapter 4 (Part 2) Reduced Coulomb Energy Networks Parzen-window -> Fixed window K-NN -> adjusting the region based on the density RCE network -> adjust the size of the window during training according to the distance to the nearest point of a different category.

Pattern Classification, Chapter 4 (Part 2) 33

Pattern Classification, Chapter 4 (Part 2) 34

Pattern Classification, Chapter 4 (Part 2) 35 RCE Training begin init j=0, λ m =max radius do j = j + 1 w ij = x i = arg min D(x, x’) λ j = min[ D(, x’) - ε, λ m ] if x  w k then a jk =1 until j = n end Train weight Find nearest point not in w i Set radius Connect pattern and category

Pattern Classification, Chapter 4 (Part 2) 36 RCE Classification begin init j=0, k=0, x=test pattern, D t ={} do j = j + 1 if D(x, x j ’) < λ j then D t = D t ∪ x j ’ until j=n if label of all x j ’  D t is the same then return label of all x k  D t else return “ambiguous” label end Prototype x j ’ Radius of x j ’ Set of stored prototypes

Pattern Classification, Chapter 4 (Part 2) 37 Summary 2 Nonparametric estimation approaches 1. Densities are estimated (then used for classification) 2. Category is chosen directly Densities are estimated Parzen windows, probabilistic neural networks Category is chosen directly K-nearest-neighbor, reduced coulomb energy networks

Pattern Classification, Chapter 4 (Part 2) 38

Pattern Classification, Chapter 4 (Part 2) 39 Class Exercises Ex. 13 p.159 Ex. 3 p.201 Write a C/C++/Java program that uses a k-nearest neighbor method to classify input patterns. Use the table on p.209 as your training sample. Experiment the program with the following data: k = 3 x 1 = (0.33, 0.58, - 4.8) x 2 = (0.27, 1.0, ) x 3 = (- 0.44, 2.8, 6.20) Do the same thing with k = 11 Compare the classification results between k = 3 and k = 11 (use the most dominant class voting scheme amongst the k classes)