SlideShare una empresa de Scribd logo
1 de 39
Descargar para leer sin conexión
Advanced Digital Image Processing
(EE-836)
National University of Sciences and
Technology (NUST)
School of Electrical Engineering and Computer Science
(SEECS)
Khawar Khurshid, 20121
Intro to Pattern
Recognition
Khawar Khurshid, 20122
What is a Pattern?
“A pattern is the opposite of a chaos; it is an entity vaguely
defined, that could be given a name.”
PR Definitions from Literature
“The assignment of a physical object or event to one of several pre-
specified categories” – Duda and Hart
Pattern Recognition is concerned with answering the question
“What is this?” –Morse
Examples of PR Applications
Optical Character Recognition (OCR)
– Sorting letters by postal code.
– Reconstructing text from printed
materials.
– Handwritten character recognition
Analysis and identification of human
patterns (Biometric Classification)
– Face recognition
– Handwriting recognition
– Finger prints and DNA mapping
– Iris scan identification
Examples of Pattern Recognition Problems
Computer aided diagnosis
– Medical imaging,
EEG, ECG signal
analysis
– Designed to assist (not
replace) physicians
Prediction systems
– Weather forecasting (based on satellite data).
– Analysis of seismic patterns
Other Examples
Speech and voice recognition/speaker identification.
Banking and insurance applications
– Credit cards applicants classified by income, credit worthiness,
mortgage amount, # of dependents, etc.
– Car insurance (pattern including make of car, # of accidents,
age, gender, driving habits, location, etc).
A Pattern Classification Example
A fish processing plant wants to automate the process of sorting incoming fish
according to species (salmon or sea bass)
The automation system consists of
– A conveyor belt for incoming products
– A vision system with an overhead CCD camera
– A computer to analyze images and control the robot arm
objects based on selected features
Recognize objects using
Computer vision, Image Processing and PR
Real
world
probabilistic techniques
Image Acquisition by
sensor
Image enhancement and
restoration
Filtering
Feature Extraction
Edge detection
Texture
Interest points
Classification and Recognition
Classification and interpretation of
Segmentation
Impose some order on group of
pixels to separate them from
each other
A Pattern Classification Example
“Sorting incoming Fish on a conveyor according to species using
optical sensing”
Purpose:
To classify the future samples based on the data of extracted
features from the training samples
Problem Analysis
Set up a camera and take some training samples to extract features
• Length
• Lightness
• Width
• Number and shape of fins
• Position of the mouth, etc…
– This is the set of all suggested features to explore for use in our
classifier!
Selection Criterion
Select the length of the fish as a possible feature for discrimination
The length is a poor feature alone!
Select the lightness as a possible feature.
Selection Criterion
Length or Lightness (weight), which one is a better feature?
No value of either feature will “classify” all fish correctly
Fish xT = [x1, x2]
Lightness Width
Selection Criterion and Decision Boundary
Adopt the lightness and add the width of the fish
Decision Boundary Selection
Which of the boundaries would you
choose?
Simple linear boundary (training error > 0)
Nonlinear complex boundary (tr. error = 0)
Simpler nonlinear boundary (tr. error > 0)
Ideally, the best decision boundary should be the one which provides
an optimal performance such as in the following figure:
However, the central aim of designing a classifier is to correctly
classify novel input (classify future samples)
Issue of generalization
Generalization and Decision Boundary
Selected decision boundary
A simpler but generalized boundary in this case may be the
simple nonlinear curve as shown below:
Further features can be added to enhance the performance
However redundancy in information may not be desirable
A classifier, intuitively, is designed to minimize classification error,
the total number of instances (fish) classified incorrectly.
– Is this the best objective (cost) function to minimize? What kinds
of error can be made? Are they all equally bad? What is the real
cost of making an error?
• Sea bass misclassified as salmon: Pleasant surprise for the
consumer, tastier fish
• Salmon misclassified as sea bass: Customer upset, paid too
much for inferior fish
– We may want to adjust our decision boundary to minimize overall
risk –in this case, second type error is more costly, so we may
want to minimize this error.
Adjustment of decision boundary
Adjustment of decision boundary
Error is minimized by moving the threshold to the left
Terminologies in PR
Features: a set of variables believed to carry discriminating and
characterizing information about the objects under consideration
Feature vector: A collection of d features, ordered in some
meaningful way into a d-dimensional column vector, that
represents the signature of the object to be identified.
Feature space: The d-dimensional space in which the feature
vectors lie. A d-dimensional vector in a d-dimensional space
constitutes a point in that space.
Terminologies in PR
Decision boundary:A boundary in the d-dimensional feature space
that separates patterns of different classes from each other.
Training Data: Data used during training of a classifier for which
the correct labels are known
Field Test Data: Unknown data to be classified –for measurements
from which the classifier is trained. The correct class of this data
are not known
Terminologies in PR
Cost Function: A quantitative measure that represents the cost of
making an error. The classifier is trained to minimize this
function.
Classifier: An algorithm which adjusts its parameters to find the
correct decision boundaries –through a learning algorithm using
a training dataset –such that a cost function is minimized.
Error: Incorrect labeling of the data by the classifier
Cost of error: Cost of making a decision, in particular an
incorrect one –not all errors are equally costly!
Training Performance: The ability / performance of the classifier
in correctly identifying the classes of the training data, which it
has already seen. It may not be a good indicator of the
generalization performance.
Cooperative vs. Uncooperative data
Good Features vs. Bad Features
Ideally, for a given group of patterns coming from the same class,
feature values should all be similar
For patterns coming from different classes, the feature values
should be different
Features Correlation
What is the cost of making a decision –what is the risk of
an incorrect decision?
Determine the right type of classifier, right type of
training algorithm and right type of classifier parameters.
How to choose a classifier that minimizes the risk and
maximizes the performance? Can we add prior
knowledge, context to the classifier?
Identify and extract features relevant to distinguishing sea
bass from salmon, but invariant to noise, occlusion
rotations, scale, shift. What if we already have irrelevant
features? Dimensionality reduction?
Separate & isolate fish from background image
CCD Camera on a conveyor belt
Fish
Components of Pattern Recognition System
Example of PR
Consider the problem of recognizing the letters L,P,O,E,Q
– Determine a sufficient set of features
– Design a tree-structured classifier
1
Bayesian Decision Theory
Bayes Rule
We now pose the following question: Given that the event A has
occurred. What is the probability that any single one of the event
B’s occur?
This is known as the Bayes rule
i
i i i
The Real World: The World of Many Dimensions
In most practical applications, we have more then one feature, and
therefore the random variable x must be replaced with a random
vector x. P(x) P(x)
The joint probability mass function P(x) still satisfies the axioms of
probability
The Bayes rule is then
While the notation changes only slightly, the implications are quite
substantial
Bayes Decision theory
Based on quantifying the trade offs betweens various classification
decisions using a probabilistic approach
The theory assumes:
– Decision problem can be posed in probabilistic terms
– All relevant probability values are known (in practice this is not
true)
The sea bass/salmon example
State of nature: w1: Sea bass, w2: Salmon
Assume that we know the probabilities of observing sea bass and
salmons, P(w1) and P(w2) (prior probabilities), for a particular
location of fishing and time of year
Based on this information, how would you guess that the type of
the next fish to be caught?
• Decide w1 if P(w1) > P(w2) otherwise decide w2
A reasonable decision rule?
If the catch of salmon and sea bass is equi-probable
P(w1) = P(w2) (uniform priors)
P(w1) + P( w2) = 1 (exclusivity and exhaustivity)
This rule will not be applicable
Class Conditional Probabilities
p(x|w1) and p(x|w2) describe the difference in lightness between
populations of sea bass and salmon
Posterior Probability
Suppose, we know P(w1), P(w2), p(x|w1) and p(x|w2) and that we have observed
the value of the feature (a random variable) x
– How would you decide on the “state of nature”–type of fish, based on this
info?
– Bayes theory allows us to compute the posterior probabilities from prior and
class-conditional probabilities
Posterior Probability: The
(conditional) probability of
correct class being ùj, given
that feature value x has been
observed
Likelihood: The (class-conditional) probability of
observing a feature value of x, given that the correct class is
wj. All things being equal, the category with higher class
conditional probability is more “likely”to be the correct
class.
Prior Probability:The total
probability of correct class
being class wj determined
based on prior experience
Evidence:The total
probability of observing
the feature value as x
j
Posterior Probabilities
Bayes rule allows us to compute the posterior probability (difficult to
determine) from prior probabilities, likelihood and the evidence (easier to
determine).
Posterior probabilities for
priors P(w1) = 2/3 and P(w2)
= 1/3. For example, given
that a pattern is measured
to have feature value x =14,
the probability it is in
category w2 is roughly 0.08,
and that it is in w1 is 0.92. At
every x, the posteriors sum
to 1.0.
Which class would you choose now?
What is probability of making an error with this decision?
Bayes Decision Rule
Decision given the posterior probabilities
X is an observation for which:
if P(w1 | x) > P(w2 | x) True state of nature = w1
if P(w1 | x) < P(w2 | x) True state of nature = w2
That is Choose the class that has the larger posterior probability !
If there are multiple features, x={x1, x2,…, xd} and multiple classes
Choose wi if P(wi| x) > P(wj| x) for all i = 1, 2, …, c
Error:
whenever we observe a particular x, the probability of error is :
P(error | x) = P(w1 | x) if we decide w2
P(error | x) = P(w2 | x) if we decide w1
Therefore:
P(error | x) = min [P(w1 | x), P(w2 | x)]
(Bayes decision)
Bayesian Decision Theory – Generalization
Generalization of the preceding ideas
– Use of more than one feature
– Use more than two states of nature
– Allowing other actions and not only decide on the state of
nature
– Unequal error cost
Allowing actions other than classification primarily allows the
possibility of rejection: refusing to make a decision in close or bad
cases!
The loss function states how costly each action taken is
Two-category classification
Definitions
a1 : deciding w1
a2 : deciding w2
eij = e(ai | wj), loss incurred for deciding wi when the true state of nature
is wj
Conditional risk:
R(a1 | x) = e11P(w1 | x) + e12P(w2 | x)
R(a2 | x) = e21P(w1| x) + e22P(w2 | x)
Our rule is the following:
if R(a1| x) < R(a2| x) action a1: “decide w1” is taken
End
Intro to Pattern
Recognition
Khawar Khurshid, 201239

Más contenido relacionado

La actualidad más candente

Computer Vision image classification
Computer Vision image classificationComputer Vision image classification
Computer Vision image classificationWael Badawy
 
Pattern Recognition.pptx
Pattern Recognition.pptxPattern Recognition.pptx
Pattern Recognition.pptxhafeez504942
 
An introduction to Machine Learning
An introduction to Machine LearningAn introduction to Machine Learning
An introduction to Machine Learningbutest
 
AI Computer vision
AI Computer visionAI Computer vision
AI Computer visionKashafnaz2
 
Seminar(Pattern Recognition)
Seminar(Pattern Recognition)Seminar(Pattern Recognition)
Seminar(Pattern Recognition)anurodhsinha
 
Pattern recognition and Machine Learning.
Pattern recognition and Machine Learning.Pattern recognition and Machine Learning.
Pattern recognition and Machine Learning.Rohit Kumar
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnIntroduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnBenjamin Bengfort
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary AlgorithmsReem Alattas
 
Computer vision and robotics
Computer vision and roboticsComputer vision and robotics
Computer vision and roboticsBiniam Asnake
 
Image compression
Image compressionImage compression
Image compressionPREEYANKAV
 
MAMMOGRAM IMAGE ANALYSIS
MAMMOGRAM IMAGE ANALYSISMAMMOGRAM IMAGE ANALYSIS
MAMMOGRAM IMAGE ANALYSISajayhakkumar
 
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standardsComparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standardsRishab2612
 
Introduction to Object recognition
Introduction to Object recognitionIntroduction to Object recognition
Introduction to Object recognitionAshiq Ullah
 
Computer animation
Computer animationComputer animation
Computer animationshusrusha
 

La actualidad más candente (20)

Computer Vision image classification
Computer Vision image classificationComputer Vision image classification
Computer Vision image classification
 
Medical Image Processing
Medical Image ProcessingMedical Image Processing
Medical Image Processing
 
Pattern recognition
Pattern recognitionPattern recognition
Pattern recognition
 
HCI
HCIHCI
HCI
 
Pattern Recognition.pptx
Pattern Recognition.pptxPattern Recognition.pptx
Pattern Recognition.pptx
 
An introduction to Machine Learning
An introduction to Machine LearningAn introduction to Machine Learning
An introduction to Machine Learning
 
AI Computer vision
AI Computer visionAI Computer vision
AI Computer vision
 
Machine learning
Machine learningMachine learning
Machine learning
 
Seminar(Pattern Recognition)
Seminar(Pattern Recognition)Seminar(Pattern Recognition)
Seminar(Pattern Recognition)
 
Computer vision
Computer visionComputer vision
Computer vision
 
Pattern recognition and Machine Learning.
Pattern recognition and Machine Learning.Pattern recognition and Machine Learning.
Pattern recognition and Machine Learning.
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnIntroduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Computer vision and robotics
Computer vision and roboticsComputer vision and robotics
Computer vision and robotics
 
Image compression
Image compressionImage compression
Image compression
 
MAMMOGRAM IMAGE ANALYSIS
MAMMOGRAM IMAGE ANALYSISMAMMOGRAM IMAGE ANALYSIS
MAMMOGRAM IMAGE ANALYSIS
 
Computer vision
Computer visionComputer vision
Computer vision
 
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standardsComparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
 
Introduction to Object recognition
Introduction to Object recognitionIntroduction to Object recognition
Introduction to Object recognition
 
Computer animation
Computer animationComputer animation
Computer animation
 

Similar a 12 pattern recognition

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learningbutest
 
Artificial Neural Network Lect4 : Single Layer Perceptron Classifiers
Artificial Neural Network Lect4 : Single Layer Perceptron ClassifiersArtificial Neural Network Lect4 : Single Layer Perceptron Classifiers
Artificial Neural Network Lect4 : Single Layer Perceptron ClassifiersMohammed Bennamoun
 
Quality of Multimedia Experience: Past, Present and Future
Quality of Multimedia Experience: Past, Present and FutureQuality of Multimedia Experience: Past, Present and Future
Quality of Multimedia Experience: Past, Present and FutureTouradj Ebrahimi
 
[UMAP2013] Recommendation with Differential Context Weighting
[UMAP2013] Recommendation with Differential Context Weighting[UMAP2013] Recommendation with Differential Context Weighting
[UMAP2013] Recommendation with Differential Context WeightingYONG ZHENG
 
Introduction to Data Mining
Introduction to Data MiningIntroduction to Data Mining
Introduction to Data MiningKai Koenig
 
NIPS2007: structured prediction
NIPS2007: structured predictionNIPS2007: structured prediction
NIPS2007: structured predictionzukun
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Simplilearn
 
talalalsubaie-1220737011220266-9.pdf
talalalsubaie-1220737011220266-9.pdftalalalsubaie-1220737011220266-9.pdf
talalalsubaie-1220737011220266-9.pdfsomeyamohsen2
 
Automatic System for Detection and Classification of Brain Tumors
Automatic System for Detection and Classification of Brain TumorsAutomatic System for Detection and Classification of Brain Tumors
Automatic System for Detection and Classification of Brain TumorsFatma Sayed Ibrahim
 
A General Framework for Accurate and Fast Regression by Data Summarization in...
A General Framework for Accurate and Fast Regression by Data Summarization in...A General Framework for Accurate and Fast Regression by Data Summarization in...
A General Framework for Accurate and Fast Regression by Data Summarization in...Yao Wu
 
Lec14: Evaluation Framework for Medical Image Segmentation
Lec14: Evaluation Framework for Medical Image SegmentationLec14: Evaluation Framework for Medical Image Segmentation
Lec14: Evaluation Framework for Medical Image SegmentationUlaş Bağcı
 
Datamining intro-iep
Datamining intro-iepDatamining intro-iep
Datamining intro-iepaaryarun1999
 
Using rule based classifiers for the predictive analysis of breast cancer rec...
Using rule based classifiers for the predictive analysis of breast cancer rec...Using rule based classifiers for the predictive analysis of breast cancer rec...
Using rule based classifiers for the predictive analysis of breast cancer rec...Alexander Decker
 

Similar a 12 pattern recognition (20)

Pattern-Analysis (1).pdf
Pattern-Analysis (1).pdfPattern-Analysis (1).pdf
Pattern-Analysis (1).pdf
 
Classification
ClassificationClassification
Classification
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Artificial Neural Network Lect4 : Single Layer Perceptron Classifiers
Artificial Neural Network Lect4 : Single Layer Perceptron ClassifiersArtificial Neural Network Lect4 : Single Layer Perceptron Classifiers
Artificial Neural Network Lect4 : Single Layer Perceptron Classifiers
 
Quality of Multimedia Experience: Past, Present and Future
Quality of Multimedia Experience: Past, Present and FutureQuality of Multimedia Experience: Past, Present and Future
Quality of Multimedia Experience: Past, Present and Future
 
PPT s09-machine vision-s2
PPT s09-machine vision-s2PPT s09-machine vision-s2
PPT s09-machine vision-s2
 
forest-cover-type
forest-cover-typeforest-cover-type
forest-cover-type
 
[UMAP2013] Recommendation with Differential Context Weighting
[UMAP2013] Recommendation with Differential Context Weighting[UMAP2013] Recommendation with Differential Context Weighting
[UMAP2013] Recommendation with Differential Context Weighting
 
Introduction to Data Mining
Introduction to Data MiningIntroduction to Data Mining
Introduction to Data Mining
 
NIPS2007: structured prediction
NIPS2007: structured predictionNIPS2007: structured prediction
NIPS2007: structured prediction
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
 
talalalsubaie-1220737011220266-9.pdf
talalalsubaie-1220737011220266-9.pdftalalalsubaie-1220737011220266-9.pdf
talalalsubaie-1220737011220266-9.pdf
 
Recognition
RecognitionRecognition
Recognition
 
Es1
Es1Es1
Es1
 
Clustering
ClusteringClustering
Clustering
 
Automatic System for Detection and Classification of Brain Tumors
Automatic System for Detection and Classification of Brain TumorsAutomatic System for Detection and Classification of Brain Tumors
Automatic System for Detection and Classification of Brain Tumors
 
A General Framework for Accurate and Fast Regression by Data Summarization in...
A General Framework for Accurate and Fast Regression by Data Summarization in...A General Framework for Accurate and Fast Regression by Data Summarization in...
A General Framework for Accurate and Fast Regression by Data Summarization in...
 
Lec14: Evaluation Framework for Medical Image Segmentation
Lec14: Evaluation Framework for Medical Image SegmentationLec14: Evaluation Framework for Medical Image Segmentation
Lec14: Evaluation Framework for Medical Image Segmentation
 
Datamining intro-iep
Datamining intro-iepDatamining intro-iep
Datamining intro-iep
 
Using rule based classifiers for the predictive analysis of breast cancer rec...
Using rule based classifiers for the predictive analysis of breast cancer rec...Using rule based classifiers for the predictive analysis of breast cancer rec...
Using rule based classifiers for the predictive analysis of breast cancer rec...
 

Último

Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxNiranjanYadav41
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectssuserb6619e
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 

Último (20)

Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptx
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 

12 pattern recognition

  • 1. Advanced Digital Image Processing (EE-836) National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science (SEECS) Khawar Khurshid, 20121
  • 3. What is a Pattern? “A pattern is the opposite of a chaos; it is an entity vaguely defined, that could be given a name.”
  • 4. PR Definitions from Literature “The assignment of a physical object or event to one of several pre- specified categories” – Duda and Hart Pattern Recognition is concerned with answering the question “What is this?” –Morse
  • 5. Examples of PR Applications Optical Character Recognition (OCR) – Sorting letters by postal code. – Reconstructing text from printed materials. – Handwritten character recognition Analysis and identification of human patterns (Biometric Classification) – Face recognition – Handwriting recognition – Finger prints and DNA mapping – Iris scan identification
  • 6. Examples of Pattern Recognition Problems Computer aided diagnosis – Medical imaging, EEG, ECG signal analysis – Designed to assist (not replace) physicians Prediction systems – Weather forecasting (based on satellite data). – Analysis of seismic patterns
  • 7. Other Examples Speech and voice recognition/speaker identification. Banking and insurance applications – Credit cards applicants classified by income, credit worthiness, mortgage amount, # of dependents, etc. – Car insurance (pattern including make of car, # of accidents, age, gender, driving habits, location, etc).
  • 8. A Pattern Classification Example A fish processing plant wants to automate the process of sorting incoming fish according to species (salmon or sea bass) The automation system consists of – A conveyor belt for incoming products – A vision system with an overhead CCD camera – A computer to analyze images and control the robot arm
  • 9. objects based on selected features Recognize objects using Computer vision, Image Processing and PR Real world probabilistic techniques Image Acquisition by sensor Image enhancement and restoration Filtering Feature Extraction Edge detection Texture Interest points Classification and Recognition Classification and interpretation of Segmentation Impose some order on group of pixels to separate them from each other
  • 10. A Pattern Classification Example “Sorting incoming Fish on a conveyor according to species using optical sensing”
  • 11. Purpose: To classify the future samples based on the data of extracted features from the training samples Problem Analysis Set up a camera and take some training samples to extract features • Length • Lightness • Width • Number and shape of fins • Position of the mouth, etc… – This is the set of all suggested features to explore for use in our classifier!
  • 12. Selection Criterion Select the length of the fish as a possible feature for discrimination
  • 13. The length is a poor feature alone! Select the lightness as a possible feature. Selection Criterion Length or Lightness (weight), which one is a better feature? No value of either feature will “classify” all fish correctly
  • 14. Fish xT = [x1, x2] Lightness Width Selection Criterion and Decision Boundary Adopt the lightness and add the width of the fish
  • 15. Decision Boundary Selection Which of the boundaries would you choose? Simple linear boundary (training error > 0) Nonlinear complex boundary (tr. error = 0) Simpler nonlinear boundary (tr. error > 0)
  • 16. Ideally, the best decision boundary should be the one which provides an optimal performance such as in the following figure: However, the central aim of designing a classifier is to correctly classify novel input (classify future samples) Issue of generalization Generalization and Decision Boundary
  • 17. Selected decision boundary A simpler but generalized boundary in this case may be the simple nonlinear curve as shown below: Further features can be added to enhance the performance However redundancy in information may not be desirable
  • 18. A classifier, intuitively, is designed to minimize classification error, the total number of instances (fish) classified incorrectly. – Is this the best objective (cost) function to minimize? What kinds of error can be made? Are they all equally bad? What is the real cost of making an error? • Sea bass misclassified as salmon: Pleasant surprise for the consumer, tastier fish • Salmon misclassified as sea bass: Customer upset, paid too much for inferior fish – We may want to adjust our decision boundary to minimize overall risk –in this case, second type error is more costly, so we may want to minimize this error. Adjustment of decision boundary
  • 19. Adjustment of decision boundary Error is minimized by moving the threshold to the left
  • 20. Terminologies in PR Features: a set of variables believed to carry discriminating and characterizing information about the objects under consideration Feature vector: A collection of d features, ordered in some meaningful way into a d-dimensional column vector, that represents the signature of the object to be identified. Feature space: The d-dimensional space in which the feature vectors lie. A d-dimensional vector in a d-dimensional space constitutes a point in that space.
  • 21. Terminologies in PR Decision boundary:A boundary in the d-dimensional feature space that separates patterns of different classes from each other. Training Data: Data used during training of a classifier for which the correct labels are known Field Test Data: Unknown data to be classified –for measurements from which the classifier is trained. The correct class of this data are not known
  • 22. Terminologies in PR Cost Function: A quantitative measure that represents the cost of making an error. The classifier is trained to minimize this function. Classifier: An algorithm which adjusts its parameters to find the correct decision boundaries –through a learning algorithm using a training dataset –such that a cost function is minimized. Error: Incorrect labeling of the data by the classifier Cost of error: Cost of making a decision, in particular an incorrect one –not all errors are equally costly! Training Performance: The ability / performance of the classifier in correctly identifying the classes of the training data, which it has already seen. It may not be a good indicator of the generalization performance.
  • 24. Good Features vs. Bad Features Ideally, for a given group of patterns coming from the same class, feature values should all be similar For patterns coming from different classes, the feature values should be different
  • 26. What is the cost of making a decision –what is the risk of an incorrect decision? Determine the right type of classifier, right type of training algorithm and right type of classifier parameters. How to choose a classifier that minimizes the risk and maximizes the performance? Can we add prior knowledge, context to the classifier? Identify and extract features relevant to distinguishing sea bass from salmon, but invariant to noise, occlusion rotations, scale, shift. What if we already have irrelevant features? Dimensionality reduction? Separate & isolate fish from background image CCD Camera on a conveyor belt Fish Components of Pattern Recognition System
  • 27. Example of PR Consider the problem of recognizing the letters L,P,O,E,Q – Determine a sufficient set of features – Design a tree-structured classifier 1
  • 29. Bayes Rule We now pose the following question: Given that the event A has occurred. What is the probability that any single one of the event B’s occur? This is known as the Bayes rule i i i i
  • 30. The Real World: The World of Many Dimensions In most practical applications, we have more then one feature, and therefore the random variable x must be replaced with a random vector x. P(x) P(x) The joint probability mass function P(x) still satisfies the axioms of probability The Bayes rule is then While the notation changes only slightly, the implications are quite substantial
  • 31. Bayes Decision theory Based on quantifying the trade offs betweens various classification decisions using a probabilistic approach The theory assumes: – Decision problem can be posed in probabilistic terms – All relevant probability values are known (in practice this is not true)
  • 32. The sea bass/salmon example State of nature: w1: Sea bass, w2: Salmon Assume that we know the probabilities of observing sea bass and salmons, P(w1) and P(w2) (prior probabilities), for a particular location of fishing and time of year Based on this information, how would you guess that the type of the next fish to be caught? • Decide w1 if P(w1) > P(w2) otherwise decide w2 A reasonable decision rule? If the catch of salmon and sea bass is equi-probable P(w1) = P(w2) (uniform priors) P(w1) + P( w2) = 1 (exclusivity and exhaustivity) This rule will not be applicable
  • 33. Class Conditional Probabilities p(x|w1) and p(x|w2) describe the difference in lightness between populations of sea bass and salmon
  • 34. Posterior Probability Suppose, we know P(w1), P(w2), p(x|w1) and p(x|w2) and that we have observed the value of the feature (a random variable) x – How would you decide on the “state of nature”–type of fish, based on this info? – Bayes theory allows us to compute the posterior probabilities from prior and class-conditional probabilities Posterior Probability: The (conditional) probability of correct class being ùj, given that feature value x has been observed Likelihood: The (class-conditional) probability of observing a feature value of x, given that the correct class is wj. All things being equal, the category with higher class conditional probability is more “likely”to be the correct class. Prior Probability:The total probability of correct class being class wj determined based on prior experience Evidence:The total probability of observing the feature value as x j
  • 35. Posterior Probabilities Bayes rule allows us to compute the posterior probability (difficult to determine) from prior probabilities, likelihood and the evidence (easier to determine). Posterior probabilities for priors P(w1) = 2/3 and P(w2) = 1/3. For example, given that a pattern is measured to have feature value x =14, the probability it is in category w2 is roughly 0.08, and that it is in w1 is 0.92. At every x, the posteriors sum to 1.0. Which class would you choose now? What is probability of making an error with this decision?
  • 36. Bayes Decision Rule Decision given the posterior probabilities X is an observation for which: if P(w1 | x) > P(w2 | x) True state of nature = w1 if P(w1 | x) < P(w2 | x) True state of nature = w2 That is Choose the class that has the larger posterior probability ! If there are multiple features, x={x1, x2,…, xd} and multiple classes Choose wi if P(wi| x) > P(wj| x) for all i = 1, 2, …, c Error: whenever we observe a particular x, the probability of error is : P(error | x) = P(w1 | x) if we decide w2 P(error | x) = P(w2 | x) if we decide w1 Therefore: P(error | x) = min [P(w1 | x), P(w2 | x)] (Bayes decision)
  • 37. Bayesian Decision Theory – Generalization Generalization of the preceding ideas – Use of more than one feature – Use more than two states of nature – Allowing other actions and not only decide on the state of nature – Unequal error cost Allowing actions other than classification primarily allows the possibility of rejection: refusing to make a decision in close or bad cases! The loss function states how costly each action taken is
  • 38. Two-category classification Definitions a1 : deciding w1 a2 : deciding w2 eij = e(ai | wj), loss incurred for deciding wi when the true state of nature is wj Conditional risk: R(a1 | x) = e11P(w1 | x) + e12P(w2 | x) R(a2 | x) = e21P(w1| x) + e22P(w2 | x) Our rule is the following: if R(a1| x) < R(a2| x) action a1: “decide w1” is taken