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

Introduction To Pattern Recognition: Instructor: Amany Al Luhaybi

This document provides an introduction and overview of a pattern recognition course. The course aims to study pattern recognition and machine learning techniques, including topics like clustering, classification, and graphical models. Assessment is based on labs, a midterm exam, assignments, and a final exam. The summary introduces what pattern recognition is, provides an example of classifying fish by species, and outlines the typical stages of a pattern recognition system from sensing and preprocessing to feature extraction and classification.

Uploaded by

qu 55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Introduction To Pattern Recognition: Instructor: Amany Al Luhaybi

This document provides an introduction and overview of a pattern recognition course. The course aims to study pattern recognition and machine learning techniques, including topics like clustering, classification, and graphical models. Assessment is based on labs, a midterm exam, assignments, and a final exam. The summary introduces what pattern recognition is, provides an example of classifying fish by species, and outlines the typical stages of a pattern recognition system from sensing and preprocessing to feature extraction and classification.

Uploaded by

qu 55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 37

Pattern Recognition (60014703-3)

Lecture 1
Introduction to Pattern Recognition

Instructor: Amany Al Luhaybi

Most of the material in these slides was taken from the figures in 1
Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley & Sons, 2001
COURSE DESCRIPTION
The aim of this course is to study pattern recognition and
machine learning techniques. Topics include modern statistical
methodologies (Bayesian Decision Theory, Probability
Theory), clustering (K-Means, Fuzzy Clustering), classifiers
(Support Vector Machines, Decision Trees, Nearest Neighbour
Classification), Parameter Estimation, Graphical Models
(Markov Random Field), and Sequential Pattern Recognition.

2
MARKS DISTRIBUTION
Assessment Task Mark

Lab 25
Midterm Exam 25
Assignment 10
Final Exam 40
Total 100
3
What is pattern recognition?

• “ the act of taking in raw data and taking an action based


on the “category” of the pattern”
• "‫"ف علأخذ ا لبياناتا لخام واتخاذ إجراء علىأساس"ا لفئة" منا لنمط‬
• We gain an understanding and appreciation for pattern
recognition in the real world – visual scenes, noises, etc.
– Human senses: sight, hearing, taste, smell, touch
– ،‫ المشاهد البصرية‬- ‫نحن اكتساب فهم وتقدير للتعرف على نمط في العالم الحقيقي‬
‫ الخ‬،‫والضوضاء‬.
– ‫ البصر وـالسمع وـالذوق وـالشم وـاللمس‬:‫الحوـاس البشرية‬

What is a Pattern?
• A pattern could be an object  x1 
x 
or event.  2
x . 
• Typically, represented by a  
.
vector x of numbers.  xn 

biometric patterns hand gesture patterns

5
Handwriting Recognition

6
License Plate Recognition

7
Biometric Recognition

8
Autonomous Systems

9
Medical Applications
Skin Cancer Detection Breast Cancer Detection

10
“Trending” Applications

• Recommendation systems‫ن ظم ا لتوصيات‬


– Amazon, Netflix
• Targeted advertising‫ا إلعالناتا لمستهدفة‬
• Spam filters‫مرشحاتا لبريد ا لمزعج‬
• Loan/Credit Card Applications‫طلبات‬
‫ب طاقاتا الئتمان‬/‫ا لقروض‬
• Malicious website detection‫اكتشافموقع ويب‬
‫ض ار‬
11
An Introductory Example
• “Sorting incoming Fish on a conveyor
according to species using optical sensing”
• ‫" فرز األسماك الواردة على الناقل وفقا لألنواع باستخدام االستشعار البصري‬
Sea bass
Species
Salmon
Problem Analysis
• Set up a camera and take some sample
images to extract features
• ‫إعداد الكاميرا وأخذ بعض الصور عينة الستخراج الميزات‬
– Length
– Lightness
‫طول‬
– Width ‫خفه‬
‫عرـض‬
– Number and shape of fins ‫عدد وشكل الزـعانف‬
‫ الخ‬،‫ موـقف الفم‬...
– Position of the mouth, etc…
Pattern Classification System
• Preprocessing‫ت جهيزها‬
– Segment (isolate) fishes from one another and from the
background
– ‫قطاع (عزل) األسماك من بعضها البعض ومن الخلفية‬
• Feature Extraction‫استخراج ميزة‬
– Reduce the data by measuring certain features
– ‫تقليل البيانات من خالل قياس ميزات معينة‬
• Classification
‫ت صنيف‬
– Divide the feature space into decision regions
– ‫تقسيم مساحة المعالم إلى مناطق اتخاذ القرار‬
Feature Extraction - Example
• Let’s consider the fish classification
example:
• ‫دعونا ننظر في مثال تصنيف األسماك‬
– Assume a fisherman told us that a sea bass
is generally longer than a salmon.
– ‫افترض أن صياد قال لنا أن باس البحر عموما أطول‬
‫من سمك السلمون‬.
– We can use length as a feature and decide
between sea bass and salmon according to
a threshold on length.
– ‫يمكننا استخدام طول كميزة وتقرر بين باس البحر‬
‫والسلمون وفقا لعتبة على طول‬.
– How should we choose the threshold?
– ‫كيف ينبغي لنا أن نختار العتبة؟‬

16
Feature Extraction - Length
Histogram of “length”

threshold l*
• Even though sea bass is longer than salmon on
the average, there are many examples of fish
where this observation does not hold.
• ‫ وهناك العديد من‬،‫على الرغم من أن باس البحر أطول من سمك السلمون في المتوسط‬
‫األمثلة على األسماك حيث ال تعقد هذه المالحظة‬.
17
Feature Extraction - Lightness
• Consider different features, e.g., “lightness”
• ‫ "خفة‬،‫ على سبيل المثال‬،‫"النظر في ميزات مختلفة‬
Histogram of “lightness”

• It seems easier to choose the threshold x* but we still cannot


threshold x*
make a perfect decision.
• ‫ يبدو من األسهل اختيار عتبة‬x * ‫ولكننا ال تزال ال يمكن اتخاذ قرار مثالي‬.
• 18
Multiple Features
• To improve recognition accuracy, we might need to use more than
one features.
• ‫ قد نحتاج إلى استخدام أكثر من ميزات‬،‫لتحسين دقة التعرف‬.
– Single features might not yield the best performance.
– ‫قد ال تحقق الميزات الفردية أفضل أداء‬.
– Using combinations of features might yield better performance.
– ‫قد يؤدي استخدام مجموعات من الميزات إلى تحسين األداء‬.

 x1  x1 : lightness
x  x2 : width
 2

19
Threshold decision boundary
and cost relationship
‫حد قرار العتبة‬
‫وـالعالـقة بين التكلفة‬

• Move decision boundary toward smaller


values of lightness in order to minimize the
cost (reduce the number of sea bass that are
classified salmon!)
• ‫نقل حد القرار نحو قيم أصغر من خفة من أجل تقليل التكلفة‬
)!‫(تقليل عدد باس البحر التي تصنف السلمون‬
Features
• We might add other features that are not highly
correlated with the ones we already have. Be sure not
to reduce the performance by adding “noisy features”
• .‫قد نضيف ميزات أخرى ال ترتبط بشكل كبير مع تلك التي لدينا بالفعل‬
‫تأكد من عدم تقليل األداء بإضافة "ميزات صاخبة‬
• Ideally, you might think the best decision boundary is
the one that provides optimal performance on the
training data (see the following figure)
• ‫ قد تعتقد أن أفضل حد للقرار هو الذي يوفر األداء‬،‫من الناحية المثالية‬
)‫األمثل على بيانات التدريب (انظر الشكل التالي‬
Is this a good decision boundary?
Decision Boundary Choice
• Our satisfaction is premature because the central aim of
designing a classifier is to correctly classify new (test) input
‫صنيف إلدخا الت‬
‫ا‬ ‫هدف لمركزيل تصميم ا لمصنفهو ت‬
‫رضانا س ابقأل وانه أل نا ل ا‬
‫ا لجديدة (ا الختبار) ا لجديدة ب شكلص حيح‬

‫!مسألة التعميم‬
Issue of generalization!
Generalization
• Generalization is defined as the ability of a classifier to produce correct results on
novel patterns.
• ‫يتم تعريف التعميم على أنه قدرة المصنف على إنتاج نتائج صحيحة على األنماط الجديدة‬.
• How can we improve generalization performance ?
• ‫كيف يمكننا تحسين أداء التعميم؟‬
– More training examples (i.e., better model estimates).‫مزيد منا ألمثلة ا لتدريبية (أيت قديراتأفضل‬
)‫ل لنموذج‬.
– Simpler models usually yield better performance.‫ن ماذج أبسط عادة ما ت سفر عنأداء أفضل‬.

complex model simpler model

24
Pattern Recognition Stages
‫ألنماط‬AA‫رفعلىا‬A‫لتع‬AA‫حلا‬A‫مرا‬
• Sensing‫ا الستشع ار‬
– Use of a sensor (camera or microphone)
– )‫استخدام جهاز استشعار (كاميرا أو ميكروفون‬
– PR system depends on the bandwidth, the resolution, sensitivity,
distortion of the sensor
– ‫ تشويه أجهزة‬،‫ والحساسية‬،‫ والقرار‬،‫نظام العالقات العامة يعتمد على عرض النطاق الترددي‬
‫االستشعار‬
• Preprocessing‫ت جهيزها‬
Segmentation and grouping - patterns should be well separated and not
overlap, Noise removal, Image enhancement, Extract boundary of each fish
‫ وتعزي ز‬،‫ وإزال ة الضوضاء‬،‫ أنماط ينبغ ي أ ن تكون منفص لة بشك ل جي د ولي س تداخ ل‬- ‫تجزئ ة وتجمي ع‬
‫ واستخراج الحدود من كل سمكة‬،‫الصورة‬
Pattern Recognition Stages (cont)
Feature extraction
• ‫استخراج ميزة‬
– Discriminative features‫ميزاتت مييزية‬
– Invariant features with respect to translation, rotation, and scale
– ‫ميزات ثابتة فيما يتعلق بالترجمة والتناوب والحجم‬
• Classification‫ت صنيف‬
– Use the feature vector provided by a feature extractor to assign the object to a
category
– ‫استخدام متجه الميزة التي يوفرها مستخرج ميزة لتعيين الكائن إلى فئة‬
• Post Processing
– Exploit context-dependent information to improve performance
– ‫معالجة ما بعد‬

– ‫استغالل المعلوـمات التي تعتمد على السياق لتحسين األدـاء‬


Classification
• Partition the feature space into two regions by
finding the decision boundary that minimizes the
error.
• ‫تقسيم مساحة الميزة إلى منطقتين عن طريق البحث عن حد‬
‫القرار الذي يقلل من الخطأ‬.

27
Improve Classification Performance
through Post-processing

• Consider the problem of character


recognition.
• ‫خذ بعين االعتبار مشكلة التعرف على الحرف‬.
• Exploit context to improve performance.
• ‫استغالل السياق لتحسين األداء‬.

How m ch info mation are
y u mi sing?
28
The Design Cycle
• Data collection ‫جمع البيانات‬
• Feature Choice ‫اـختيار الميزـة‬
‫اـختيار النموذج‬
‫التدريب‬
• Model Choice ‫التقييم‬
‫التعقيد الحسابي‬
• Training
• Evaluation
• Computational Complexity
Training/Test data
• How do we know that we have collected an
adequately large and representative set of
examples for training/testing the system?
– ‫كيف لنا أن نعرف أننا جمعنا مجموعة كبيرة وتمثيلية كافية من األمثلة على تدريب النظام واختباره؟‬

Training Set ?

Test Set ?

31
Choice of Features
• Depends on the characteristics of the
problem domain
• ‫يعتمد على خصائص المجال المشكلة‬
• Simple to extract, invariant to irrelevant
transformations
• ‫ ثابتة إلى التحوالت غير ذات صلة‬،‫بسيطة الستخراج‬
Model Choice

• Unsatisfied with the performance of


our fish classifier and want to jump to
another class of model
• ‫غير راض عن أداء مصنف األسماك لدينا وتريد‬
‫القفز إلى فئة أخرى من نموذج‬
Training
• Use data to determine the classifier
• ‫استخدام البيانات لتحديد المصنف‬
• (Many different procedures for training
classifiers and choosing models)
• (‫ا لع ديد منا إلجراءاتا لمختلفة ل تدريبا لمصنفاتواختيار‬
‫)ا لنماذج‬
Evaluation

• Measure the error rate (or performance)


• )‫قياس معدل الخطأ (أو األداء‬
• Possibly switch from one set of features to
another one
• ‫ربما التحول من مجموعة واحدة من الميزات إلى واحدة‬
‫أخرى‬
Computational Complexity
How does an algorithm scale as a function of the
number of features, patterns, or categories?
•‫كيف يمكن لخوارزمية أن تتدرج كدالة لعدد الميزات أو‬
‫األنماط أو الفئات؟‬
•Need to consider tradeoffs between
computational complexity and performance.
•‫الحاجة إلى النظر في المقايضات بين التعقيد الحسابي واألداء‬.


Would it be possible to build a
“general purpose” PR system?
• It would be very difficult to design a system that is
capable of performing a variety of classification tasks.
• ‫وسيكون من الصعب جدا تصميم نظام قادر على أداء مجموعة متنوعة‬
‫من مهام التصنيف‬.
– Different problems require different features.
– ‫تتطلب المشاكل المختلفة ميزات مختلفة‬.
– Different features might yield different solutions.
– ‫قد تسفر الميزات المختلفة عن حلول مختلفة‬.
– Different tradeoffs exist for different problems.
– ‫توجد مفاضالت مختلفة لمشاكل مختلفة‬.

37

You might also like