You are on page 1of 68

Pattern Recognition

CSE 802
Michigan State University
Spring 2017
Lecture 1, January 9, 2017
Pattern Recognition
The real power of human thinking is
based on recognizing patterns. The better
computers get at pattern recognition, the
more humanlike they will become.
Ray Kurzweil, NY Times, Nov 24, 2003

The problem of searching for patterns in data


is a fundamental one and has a long and
successful history. Bishop

Jain CSE 802, Spring 2017


Jain CSE 802, Spring 2017
Pattern Recognition

The act of taking as input sensed data


(measurements) and taking an action
based on the category or class of
the pattern.

Jain CSE 802, Spring 2017


What is a Pattern?
A pattern is the opposite of a chaos; it is an entity
vaguely defined, that could be given a name.
(Watanabe)

Jain CSE 802, Spring 2017


Recognition
Identification of a pattern as a member of a category
(class) we already know, or we are familiar with
n Classification (known categories)

n Clustering (learning categories)

Category A

Category B

Clustering
Classification

Jain CSE 802, Spring 2017


Pattern Class
n A collection of similar (not necessarily
identical) objects
n A class is defined by class samples
(exemplars, prototypes)
n Intra-class variability
n Inter-class similarity
n How to define similarity?

Jain CSE 802, Spring 2017


Intra-Class Variability

Handwritten numerals

Jain CSE 802, Spring 2017


Inter-class Similarity

Characters that look similar

Identical twins

Jain CSE 802, Spring 2017


Cat vs. Dog:
2-class Classification

Jain CSE 802, Spring 2017


(Supervised) Classification

Labeled training samples for classifier design

Jain CSE 802, Spring 2017


Clustering:
Unsupervised Classification

Training samples are unlabeled


Jain CSE 802, Spring 2017
1. Use shape and appearance to classify a pet breed automatically from an
image.
2. Shape is captured by a deformable part model detecting the pet face;
appearance is captured by a bag-of-words model to describe the pet fur.
3. Automatically segmenting the animal in the image.
4. Two classification approaches: a hierarchical one, in which a pet is first
assigned to the cat or dog family and then to a breed, and a flat one, in
which the breed is obtained directly.

https://www.robots.ox.ac.uk/~vgg/publications/2012/parkhi12a/parkhi12a.pdf
Jain CSE 802, Spring 2017
Problem Definition & Data
Oxford-IIIT Pet dataset: 7,349 images of cats & dogs of
37 different breeds: 25 dogs & 12 cats. ~200 images/
breed, split randomly into 50 for training, 50 for
validation, and 100 for testing. Three tasks are defined:

Pet family classification (Cat vs Dog, a 2- class problem)

Breed classification given the family (a 12-class problem


for cats and a 25-class problem for dogs)

Breed and family classification (a 37-class problem)

Jain CSE 802, Spring 2017


Example Images of Cats & Dogs

Jain CSE 802, Spring 2017


Segmentation: Foreground v. Background

Jain CSE 802, Spring 2017


Feature Extraction

Jain CSE 802, Spring 2017


Classification Performance

Jain CSE 802, Spring 2017


Pattern Recognition Applications
Problem Input Output
Speech recognition Speech waveforms Spoken words, speaker
identity

Non-destructive testing Ultrasound, eddy current, Presence/absence of flaw,


acoustic emission waveforms type of flaw

Medical waveform analysis EKG, EEG waveforms Types of cardiac


conditions, classes of
brain conditions

Remote sensing Multispectral images Terrain forms, vegetation


cover

Aerial reconnaissance Visual, infrared, radar images Tanks, airfields


Character recognition scanned image Alphanumeric characters
(page readers, zip code,
license plate)

Jain CSE 802, Spring 2017


Pattern Recognition Applications
Problem Input Output
Identification and Slides of blood samples, micro- Type of cells
counting of cells sections of tissues
Industrial inspection (PC Scanned image (visible, Acceptable/unacceptable
boards, IC masks, infrared)
textiles)
Factory automation 3-D images (structured light, Identify objects, pose,
laser, stereo) assembly
Web search Key words specified by a user Text relevant to the user
Fingerprint identification Input image from fingerprint Owner of the fingerprint,
sensors fingerprint classes
Signature recognition Signature Financial transactions
(off-line, on-line)

Jain CSE 802, Spring 2017


License Plate Reading System
n Detect and read the license plates

n Modules: (i) acquisition, (ii) enhancement,


(iii) segmentation, (iv) character recognition
n Accuracy, robustness & real-time

Jain CSE 802, Spring 2017


Processing Steps
n Plate localization: Isolate the plate in image
n Preprocessing: Plate orientation and sizing;
n Normalization: Adjust image brightness & contrast
n Segmentation: Find individual characters
n Character recognition: OCR
n Post-processing: Rules for character placement

Jain CSE 802, Spring 2017


Challenges
n Poor image resolution: plate too far; low-res. image
n Motion blur
n Low contrast: overexposure, reflection/shadows
n Viewpoint variation and occlusion
n Different fonts, background
Pattern Recognition System
n Challenges

n Pattern representation
n Pattern classification

n System design

n System training or learning


n System testing or evaluation

Jain CSE 802, Spring 2017


Representation

What facial features to use to account for the large intra-class variability?

John P. Frisby, Seeing. Illusion, Brian and Mind, Oxford University Press, 1980
Jain CSE 802, Spring 2017
Jain CSE 802, Spring 2017
Jain CSE 802, Spring 2017
Representation: Desirable Properties
n Invariance
n Account for intra-class variations
n Ability to discriminate classes of interest;
low inter-class similarity
n Robustness to noise, occlusion,..
n Provide simple decision making strategies
n Low measurement cost; real-time

Jain CSE 802, Spring 2017


Invariant Representation
Invariant to
Translation
Rotation
Scale
Skew
Deformation
Color
Not all invariant properties are needed for a given application

Jain CSE 802, Spring 2017


Jain CSE 802, Spring 2017
System Performance
n Error rate; confusion matrix, RoC
n Speed (throughput)
n Cost
n Robustness
n Reject option
n Return on Investment (RoI)

Jain CSE 802, Spring 2017


Reject Option
What if the system encounters a previously unseen class?

Jain CSE 802, Spring 2017


Fruit Sorter
TV Camera
Control unit

Fruit
Conveyor
belt
Movable
Partition
Crates

Statistical Pattern Recognition, Anil K. Jain


Jain CSE 802, Spring 2017
Veggie Vision: A Produce Recognition System

A test of 145 items, every item on the shelf, was performed, using all
produce items available in a supermarket. Ten images per item was
collected for a total of 1,450 images. Leave-one-out method for
evaluation was used. For color & texture features combined, 84% of the
time, correct produce class was selected, 96% of the time, the correct
class was present in the top four choices.
http://researcher.watson.ibm.com/researcher/files/us-smiyaza/jhc-waiat.pdf
http://researcher.watson.ibm.com/researcher/files/us-smiyaza/jhc-wacv.pdf
Jain CSE 802, Spring 2017
Pattern Recognition System

Jain CSE 802, Spring 2017


Fish Classification: Salmon v. Sea Bass

Preprocessing
(enhancement,
segmentation)
Separate touching
or occluding fishes
Extract fish contour

Jain CSE 802, Spring 2017


Cut out each of the fish cards on this page, then follow your teachers
instructions for sorting the fish into categories. After you have
compared your classification system with your classmates, follow the
steps in the fish key below to identify the names of the fish.

http://www-tc.pbs.org/wgbh/nova/education/activities/pdf/2215_reef.pdf
Jain CSE 802, Spring 2017
Fish Key (Rule-based System, Decision Tree)
Step 1 Step 4 Step 7
If fish shape is long and If the fish has long whip-like If fish has stripes then
skinny tail, it is a spotted eagle ray go to step 8
then go to Step 2 If the fish has short, blunt If fish does not have
If fish shape is not long and tail, it is a peacock flounder stripes, it is a glassy
skinny sweeper
then go to step 3
Step 2 Step 5 Step 8
If the fish has pointed fins, If fish has spots then go to If fish has a v-shaped tail,
it is a trumpet fish step 6 it is a squirrel fish
If the fish has smooth fins, If fish does not have spots If fish has a blunt tail, it is
it is a spotted moray eel then go to step 7 a glass-eye snapper

Step 3 Step 6
If fish has both eyes on top If fish has chin whiskers, it is a
of the head then go to spotted goat fish
step 4 If fish does not have chin
If fish has one eye on each whiskers, it is a band-tail
side of the head then go puffer
to step 5 Jain CSE 802, Spring 2017
Jain CSE 802, Spring 2017
Representation: Fish Length as a Feature
Training samples

Jain CSE 802, Spring 2017


Fish Lightness as a Feature

Overlap of these histograms is small compared to length feature


Jain CSE 802, Spring 2017
Two-dimensional Feature Space
Linear (simple) decision boundary; linear classifier

Joint distribution of two features leads to better separation


Jain CSE 802, Spring 2017
Complex Decision Boundary
(Polynominal classifier)

What is the generalization ability of the classifier?


Jain CSE 802, Spring 2017
Good Generalization & Good Accuracy

Simple decision boundaries are preferred

Jain CSE 802, Spring 2017


Occams Razor (William of Ockham (c. 12871347)

"If you have two equally likely solutions


to a problem, choose the simplest"

Jain CSE 802, Spring 2017


Feature Selection & Extraction
Feature selection: which subset to use? Some
features may be redundant

Feature extraction: which combination of


given features to use?

Curse of dimensionalityError rate may in


fact increase with too many features in the
case of small number of training samples

Jain CSE 802, Spring 2017


Pattern Recognition Models
n Template matching
n Class-specific shape & appearance models
n Statistical (geometric)
n Class-specific Prob. density function (pdf)
n Syntactic (structural)
n Class-specific grammar
n Neural networks

Jain CSE 802, Spring 2017


Rigid Template Matching

Template
Prototype

Input scene

Jain CSE 802, Spring 2017


Deformable Template
Corpus callosum Prototype registration to the
shape training set low-level segmented image
Prototype and
variation learning

Prototype warping

Jain CSE 802, Spring 2017


Statistical Pattern Recognition

pattern Feature
Preprocessing Classification
extraction

Recognition

Training
Feature
Preprocessing Learning
Patterns selection
+
Class labels

Jain CSE 802, Spring 2017


Representation
n Each pattern is represented as a point in d-
dimensional feature space
n Choice of features and their desired invariance
properties are domain-specific

x2 x2

x1 x1

n Good representation implies (i) small intra-class


variation, (ii) large interclass separation and (iii)
simple decision boundary
Jain CSE 802, Spring 2017
Jain CSE 802, Spring 2017
Jain CSE 802, Spring 2017
Jain CSE 802, Spring 2017
Structural Patten Recognition
n Instead of describing an object in terms of a
feature vector, describe it by its structure
n Complex objects are represented in terms of
simple primitives (shapes) and their
relationship; parts-based representation
(represent face as eyes, mouth, nose,)
Scene
N
L
X Object Background
T
M
Z
D E M N
D E
L T X Y Z
Jain CSE 802, Spring 2017
Syntactic Pattern Recognition

pattern Primitives &


Syntax
Preprocessing relationship
analysis
extraction
Recognition

Training
Primitive Grammatical
Preprocessing
Patterns selection inference
+
Class labels

Jain CSE 802, Spring 2017


Chromosome Grammars
n Terminals:
VT={,,,, }
n Non-terminals:
VN={A,B,C,D,E,F}
n Pattern Classes:

Median Submedian

Acrocentric Telocentric

Jain CSE 802, Spring 2017


Chromosome Grammars

Image of human chromosomes

Hierarchical-structure description of a submedium chromosome


Jain CSE 802, Spring 2017
Neural Networks
n Massive parallelism essential for complex
recognition tasks (speech & image recognition)
n Humans take only ~200ms. for most cognitive
tasks; this suggests parallel computation in
human brain
n Biological networks achieve excellent recognition
performance via dense interconnection of simple
computational elements (neurons)
n Number of neurons 1010 1012
n Number of interconnections/neuron 103 104
n Total number of interconnections 1014

Jain CSE 802, Spring 2017


Neuron
n Nodes are nonlinear, typically analog

x1 w1
x2
Y (output)
xd wd

where is internal threshold or offset

Jain CSE 802, Spring 2017


Neural Networks
n Feed-forward networks with one or more
layers (hidden) between input & output nodes
n How many nodes & hidden layers?

. .
. . . .
. . .
c outputs
d inputs First hidden layer Second hidden layer
NH1 input units NH2 input units

n Network training

Jain CSE 802, Spring 2017


Context: Post-processing

How m ch
info mation are
y u mi sing
Qvest
Jain CSE 802, Spring 2017
Constraining the Recognition Problem
n Graffiti alphabet

GRAFFITIS MODIFIED alphabet is largely based on single


pen strokes, starting at the dots. As soon as the pen is
lifted from the screen, the letter is immediately translated
into normal text. The letter X is the exception
Jain CSE 802, Spring 2017
Super Classifier

Pool the evidence from component


recognizers; also known as classifier
combination, mixture of experts, evidence
accumulation

Jain CSE 802, Spring 2017


Summary
n Pattern recognition
n Automatic decision making
n Assist human decision makers
n General-purpose PR is difficult; systems available
for constrained domains: mugshot face recognition
n No single recognition approach is optimal for all PR
problems; toolbox of classifiers
n Use of object models, constraints and context helps
n Careful sensor design and feature extraction lead to
simple classifiers

Jain CSE 802, Spring 2017


Same Problems, Many Approaches
Recognition, Classification, Clustering, Regression
n Fisher Linear Discriminant (1936)
n Perceptron, Rumelhart (1958)
n Adaptive multilayer networks, Widrow (1960s)
n Backpropagation learning algorithm, Werbos (1974)
n Artificial Intelligence (AI), McCarthy (1956)
n Pattern recognition
n Artificial neural networks
n Data mining
n Machine learning
n Knowledge discovery, expert systems
n Deep networks, convolution neural networks
Jain CSE 802, Spring 2017
Key Concepts
n Pattern class
n Representation, feature set
n Feature selection
n Feature extraction
n Linear transformation (PCA, LDA)
n Feature invariance
n Preprocessing
n Segmentation
n Training set
n Validation set
n Test set
n Error rate
n Reject rate
n Curse of dimensionality
Jain CSE 802, Spring 2017
Key Concepts
n Supervised learning
n Decision boundary
n Classifier
n unsupervised learning
n Clustering
n Density Estimation
n Cost of misclassification/Risk
n Feature space partitioning
n Generalization (overfitting)
n Contextual information
n Combination of classifiers
n Prior knowledge

Jain CSE 802, Spring 2017

You might also like