Pattern Recoginition 5
Pattern Recoginition 5
((PR))
1
1-Pattern Recognition System
PR Definitions
• Theory, Algorithms, Systems to put Patterns into
Categories
2
1-Pattern Recognition System
1. Domain-specific knowledge
– Acquisition, representation
2. Data acquisition
– camera, ultrasound, MRI,….
3. Preprocessing
– Image enhancement, restoration
4. Segmentation
- Region based methods , Boundaries based methods
5. Representation) feature extraction )
– Features: color, shape, texture,…
6. Post-processing; use of context
7- Classification or Decision making
– Statistical (geometric) pattern recognition
– Syntactic (structural) pattern recognition
– Artificial neural networks
3
A Class is a collection of objects that are similar, but
not necessarily identical, and which is distinguishable
from other classes. Fig.1 illustrates the difference
between classification where the classes are known
beforehand and classification where classes are
created after inspecting the objects
Fig 1 Classification when the classes are (A) known and (B) unknown
beforehand 4
Pattern Class
• A collection of similar (not necessarily
identical) objects
• A class is defined by class samples
(paradigms, exemplars, prototypes,
training/learning samples)
• Inter-class similarity as shown in Fig .2
• Intra-class variability as shown in Fig .3
• How do we define similarity?
Pattern Class
Inter-class Similarity
a- Same face under different expression b- The letter “T” in different typefaces
, pose, illumination
1-Pattern Recognition System
Pattern Class Model
• A mathematical or statistical model
(description) for each class (population);
other models: syntactic/structural, template
• The class description (class-conditional
density) that is learned from samples
• Given a pattern, choose the best-fitting
model for it; assign the pattern to the class
associated with the best-fitting model
1-Pattern Recognition System
Terminology
Classification Decision Rules
9
Feature extraction
Features are characteristic properties of the objects whose
value should be similar to objects in a particular class, and
different from the values for objects in another class (or from
the background).
Features may be either
Continuous (i.e., with numerical values) such as length, area, and texture.
OR
Categorical (i.e., with labeled values). such as features that are either
a- Ordinal [where the order of the labeling is meaningful (e.g., class
standing, military rank, level of satisfaction)]
or
b- Nominal [where the ordering is not meaningful (e.g., name, zip code,
department)].
12
2-Pattern Classification example
Feature extraction
Task: to extract features which are good for classification.
Good features:
•Objects from the same class have similar feature values.
•Objects from different classes have different values.
13
The Classification stage
14
Feature selection—choosing the most informative
subset of features, and removing as many irrelevant
and redundant features as possible .
15
2-Pattern Classification example
• Unsupervised learning
The system forms clusters or “natural groupings” of
the input patterns
18
Approaches to Classification
The goal of the classifier is to classify new
data (test data) to one of the classes,
characterized by a decision region. The
borders between decision regions are called
decision boundaries.
Classification techniques can be divided into
two broad areas: statistical or structural (or
syntactic) techniques, with a third area that
borrows from both , sometimes called
cognitive methods, which include neural
networks and genetic algorithms
19
1- Statistical approaches:- first area deals with
objects or patterns that have an underlying and
quantifiable statistical basis for their generation and
are described by quantitative features such as length,
area, and texture.
Fig 4. (a) Original image, (b) after Otsu thresholding, (c) after subsequent
skeletonization, (d) after conditionally dilating the branch pixels from (c), (e) after
21
logically combining (b) and (d), (f) color coding the nuts and bolts
2- Classification by Size
Fig. 5 (a) Segmented, labeled image (using Fig. 4 a), (b) one-dimensional feature
space showing the areas of the features, (c) the features “painted” with grayscales
representing their measured areas, and (d) after thresholding image (c) at a value 22
of
800
Figure 6 a is an image containing a number of electronic
components, of different shapes and sizes (the transistors are
three-legged, the thyristors are three-legged with a hole in
them, the electrolytic capacitors have a round body with two
legs, and the ceramic capacitors are larger than the resistors).
A combination of the shape and size methods can be used to
separate the objects into their different classes (Fig. 6b)).
Fig. 6 (a) Electronic components (b) classified according to type, using shape
23
and size
In Figure 7 Circularity can distinguish the bananas from the
other two fruit: size (or, perhaps texture, but not color in this
grayscale image) could be used to distinguish the apples from
the grapefruit. from the grapefruit
24
Part 2
25
Shape
,is not the only
but a very powerful
descriptor
of image content
26
What is the shape?
The most commonly cited definition is given as follows:
The shape is all the geometrical information that remains
when location, scale, and rotation effects are filtered out from
an object
27
Static and Dynamic Shapes
Shapes can be either static or
dynamic.
29
What is a Good Representation
• There are a variety of ways to represent a shape, however,
there are certain attributes/criteria for a representation to
be a good one:
1. Sufficient
2. Wide domain
3. Convenient
4. Sensitive
5. Unambiguous
6. Hierarchical
7. Generative
8. Stable
9. Accessible
10.Efficient
30
?What is a Good Representation
1- Sufficient
Is this representation sufficient enough? The answer mainly
depends on the application.
31
What is a Good Representation
2. Uniqueness:-
This is of crucial importance in object recognition because each
object must have a unique Representation.
3 III
– The number three has different representations (Arabic and
roman) however the same representation can not refer to
different numbers.
33
What is a Good Representation
Invariance under translation, rotation, scaling, and
reflection is very important for object recognition
applications.
Capable of directly generating/recovering the represented
shape
34
What is a Good Representation
36
Shape Representation
Chain Codes: Boundary Representation
37
Shape Representation
Chain Codes: Boundary Representation
Problems with the Chain Code
Chain code representation is conceptually appealing, yet
has the following three problems:
1. Dependent on the starting point
2. Dependent on the orientation
3. Dependent on the Scaling
Normalized codes
Differential codes
38
Shape Representation
Chain Codes: Boundary Representation
1- Differentiation Strategy
change in direction around the border (differences between
chain code numbers modulo 4 or 8):
39
Shape Representation
Chain Codes: Boundary Representation
1- Differentiation Strategy
:Differentiate example
40
Shape Representation
Chain Codes: Boundary Representation
Normalization Strategy -2
41
Shape Representation
Chain Codes: Boundary Representation
Any Questions ?