0% found this document useful (0 votes)
2 views

Lesson4-IntroPR

Uploaded by

Huy Nguyen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lesson4-IntroPR

Uploaded by

Huy Nguyen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Introduction to pattern recognition

■ Outline:
1. What is pattern recognition?
2. How to perform pattern recognition?
3. Some examples
4. Components of a pattern recognition system
5. How to evaluate a pattern recognition system?
Introduction

■ Outline:
1. What is pattern recognition?
2. How to perform pattern recognition?
3. Some examples
4. Components of a pattern recognition system
5. How to evaluate a pattern recognition system?
Examples of patterns

ECG

Speech signal
What is pattern recognition?

▪ Important component of AI systems


ECG
▪ One of the most common applications of machine learning

▪ Aiming to give human perception capabilities to machines

▪ Process of recognizing regularities in data by using machine


learning algorithms, based on statistical information,
historical data, or the machine’s memory.
Speech signal
▪ During recognition given objects are assigned to prescribed
classes
Applications of pattern recognition

People detection

ECG

Speech signal
Applications of pattern recognition

Face recognition

ECG

Paul
Alex
Bob

Speech signal
Applications of pattern recognition

License plate recognition

ECG

Speech signal
Applications of pattern recognition

■ OCR (Optical Character Recognition): handwritten, printed text,…


ECG
■ Biometrics: face, finger prints, speech,…
■ Medical diagnosis: X-ray, MRI analysis,…

■ Education
■ Biology: fruit, leaf,…
■ Smart transportation: traffic light, traffic sign,…
Speech signal
Applications of pattern recognition

■ Security surveillance
ECG
■ Entertainment, sport
■ Agriculture

■ Commercial
■ Military technology: target recognition, satellite image analysis,…
… and more…
Speech signal
Introduction

■ Outline:
1. What is pattern recognition?
2. How to perform pattern recognition?
3. Some examples
4. Components of a pattern recognition system
5. How to evaluate a pattern recognition system?
Grid-by-grid comparison

ECG

From: Talal Alsubaie


Grid-by-grid comparison

ECG

From: Talal Alsubaie


Grid-by-grid comparison

ECG

From: Talal Alsubaie


Grid-by-grid comparison

ECG

From: Talal Alsubaie


The statistical way

■ Problems with grid-by-grid comparison: too costly


■ Solution: ECG
artificial intelligence/machine learning
■ Two phases: learning and classification
Ø Learning: learn the rule from data (supervised and unsupervised)
Ø Classification: decide a pattern to a known category/class

Speech signal
Challenges

■ Intra-class variability
■ ECG
Inter-class variability

Speech signal
Intra-class variability

Ex: different typefaces of letter “T”


ECG

Speech signal
Inter-class variability

Ex: lisianthus (hoa cát tường) and carnation (hoa cẩm chướng)
ECG

Speech signal
Introduction

■ Outline:
1. What is pattern recognition?
2. How to perform pattern recognition?
3. Some examples
4. Components of a pattern recognition system
5. How to evaluate a pattern recognition system?
Example 1: fish classification

Sea bass

Fish

Salmon
Problem analysis

n Set up a camera
ECG
n Take some sample images

n Note physical differences (features):

Ø Length

Ø Lightness

Ø Width
Speech signal
Ø Number and shape of fins

Ø Position of the mouth, etc…

n Classify fish
Implementation

ECG
To isolate fishes from one another
and from the background

To reduce the data by measuring


certain features

To discriminate salmon and sea


Speech signal
bass (by statistical/ by machine
learning)
Feature selection

■ Sea bass is generally longer than salmon à Length becomes


a feature.

Length is a poor feature


Feature selection

■ Lightness feature: better than length feature but not adequate


ECG
■ Move the decision boundary toward smaller values of lightness to
reduce the number of sea bass that are classified as salmon

Lightness is better
Feature selection
2D feature vector
■ Multiple features
■ LightnessECG
+ width Fish x = [x1, x2]

Lightness width

Combination is better
How many features?

■ More is not always better


ECG
■ There could be redundancy

■ Over complication can occur


Classification model selection

ECG

n There is a tradeoff between complexity of the decision rules and


their performances to unknown patterns.

n Generalization: The ability of the classifier to produce correct


results on novel patterns.

à Simplify the decision boundary!


Example 2: person detection

ECG
System building

n Data:

Ø Images withECG
people (positive)
Ø Images without people (negative)
System building (cont)

n Feature extraction:
Human
Ø
ECG
HOG feature

n Classification:

Ø SVM classification model

Non-human
System building

n Detecting:

Ø
ECG
Sliding window
Ø Detecting a

person/non-person

within a sliding

window
(HOG+SVM)
System building

n Detecting:

Ø
ECG
Sliding window
Ø Detecting a

person/non-person

within a sliding

window
(HOG+SVM)
System building

n Detecting:

Ø
ECG
Sliding window
Ø Detecting a

person/non-person

within a sliding

window
(HOG+SVM)
System building (cont)

n Image pyramic:

Ø To change ECG
the window size

https://www.youtube.com/watch?v=sDByl84n5mY
Đọc thêm

■ Fruit recognition:
https://www.youtube.com/watch?v=cBOSGQo1A10
■ Grading fruit:
https://www.youtube.com/watch?v=a8UZkCQqzNQ
Introduction

■ Outline:
1. What is pattern recognition?
2. How to perform pattern recognition?
3. Some examples
4. Components of a pattern recognition system
5. How to evaluate a pattern recognition system?
Typical pattern recognition system

ECG

Testing data
The design cycle

ECG
1 2 3

5 4

Performance evaluation
Computational complexity evaluation
Bài tập

n Đề:

Tự động đánhECG
giá độ ngọt của quả xoài dựa vào màu sắc của vỏ
https://drive.google.com/drive/folders/1tZZ5MCpfXG0zwehCl-
_uFlFpkjn4kltL
Bài tập lớn số 1

n Đề: Xây dựng hệ thống tự động phát hiện đối tượng trong ảnh
ECG
n Phương pháp: grid-by-grid comparison

n Phạm vi:

Ø ảnh nền trơn chứa 1 đối tượng

Ø kích thước cửa sổ cố định

n Bài nộp: báo cáo và code (pdf), riêng nhóm thuyết trình nộp thêm
file ppt đã chuyển pdf

n Danh sách nhóm thuyết trình bài tập lớn số 1: 1, 11


Introduction

■ Outline:
1. What is pattern recognition?
2. How to perform pattern recognition?
3. Some examples
4. Components of a pattern recognition system
5. How to evaluate a pattern recognition system?
Cross validation

ECG

Speech signal
Data splitting for cross validation

Dataset
ECG

Speech signal
Holdout method

ECG

Speech signal
K-fold cross validation method

ECG

Speech signal
K-fold cross validation
Leave-one-out cross validation method

ECG

Speech signal
Evaluation tools and metrics

n Confusion matrix
ECG
n Accuracy

n Recall, Precision, F1-score

n AUC (Area Under the ROC Curve), ROC (Receiver Operating


Characteristic)

n MAE (Mean Absolute Error)


Speech signal
n MSE (Mean Squared Error)

n IoU
Confusion matrix

n A table summarizes how successful the model is at predicting


ECG

Speech signal
An example of confusion matrix

Speech signal
Recall, Precision, F1-score

ECG

Speech signal
An example of Recall, Precision, F1-score

ECG

n TP = 23, TN = 556

n FP = 12, FN = 1

n RC = 0.96, PR = 0.66, F-1 = 0.78, ACC = 0.98


Speech signal
Receiver operating characteristic

ECG

Speech signal
Area under the curve

ECG

Speech signal
How to get ROC for multiclass classification model?

ECG

Speech signal
Intersection over Union (IoU) for object detection

n Be used to evaluate the performance of object detection on a


ECG
particular dataset.

n Comparing the ground truth bounding box to the predicted


bounding box

Speech signal
Intersection over Union (IoU) for object detection

ECG

Speech signal
Intersection over Union (IoU) for object detection

ECG

Speech signal
Bài tập lớn số 2

n Đề: Phân loại rượu vang Ý bằng phương pháp template matching

n
ECG https://github.com/MukeshTirupathi/Wine-
Cơ sở dữ liệu:
Classifier-Italy?tab=readme-ov-file

These data are the results of a chemical analysis of wines grown in


the same region in Italy but derived from three different cultivars. The
analysis determined the quantities of 13 constituents found in each of
the three types of wines.

n Phương pháp đánh giá: hold-out crossvalidation (30:70), 10-fold


cross validation, LOOCV
Bài tập lớn số 2

n Bài nộp: báo cáo và code (pdf), riêng nhóm thuyết trình nộp thêm
ECG pdf
file ppt đã chuyển

n Danh sách nhóm thuyết trình bài tập lớn số 2:

Ø Nhóm

Ø Nhóm

You might also like