Top Banner
Copyright © 2014 MathWorks, Inc. 1 Your Company Logo goes here. See Slide 10 for instructions Avinash Nehemiah 29 May 2014 How to Create a Great Object Detector
25
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 1 Your Company Logo

goes here. See Slide

10 for instructions

Avinash Nehemiah

29 May 2014

How to Create a Great Object Detector

Page 2: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 2 Your Company Logo

goes here. See Slide

10 for instructions

Objectives

• Learn the key steps to create your own object detector

• This does not have to be a 6 month research project

• Tips and Tricks

• How to create a great object detector

• Design considerations for embedded devices

Page 3: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 3 Your Company Logo

goes here. See Slide

10 for instructions

Why Create Object Detectors ?

Object detectors help us understand real-world scenes.

Page 4: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 4 Your Company Logo

goes here. See Slide

10 for instructions

What is Object Detection ?

• Detect and locate an object or class of objects in a scene

• Object detection is NOT recognition

• You can’t perform recognition without detection

Specific Object Class of objects

e.g. Faces

Page 5: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 5 Your Company Logo

goes here. See Slide

10 for instructions

Getting Started with Object Detection

Goal: Locate object and non-object

regions

• Use training data to “learn” what

object looks like

• Learn how to reject non-object

regions

• More compact representation

than image pixels are used

• Known as features

Object Region

Attribution: Examples in this talk created using INRIA Person Dataset

http://pascal.inrialpes.fr/data/human/

Page 6: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 6 Your Company Logo

goes here. See Slide

10 for instructions

Object Detection is Data Classification

Machine

Learning

Training Data

Features Classifier

Label: ‘Person’/’Non Person’

Response: Likelihood that input

belongs to labelled class

Learned

Classifier

Page 7: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 7 Your Company Logo

goes here. See Slide

10 for instructions

Creating an Object Detector

Collect Training

Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Design Implementation

Attribution: Examples in this talk created using INRIA Person Dataset

http://pascal.inrialpes.fr/data/human/

Page 8: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 8 Your Company Logo

goes here. See Slide

10 for instructions

Creating an Object Detector

Collect Training

Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Design Implementation

Page 9: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 9 Your Company Logo

goes here. See Slide

10 for instructions

Training Data

Training Data is Key

• Good sampling of object (positive)

• Different scale, orientation, and

environmental conditions

• Negative data

• Representing environment object

usually appears

• Too few positive samples leads to

insufficient true detection

• Not enough variation in training set

leads to overfitting

• Too few negative samples leads to too

many false positives

Page 10: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 10 Your Company Logo

goes here. See Slide

10 for instructions

Preparing Data for Training

Label,

Normalize and

Resize

Generate

Negative

Samples

Feature

Extraction

Features #1

Features #2

.

.

.

.

.

.

Features #N

Features #1

Features #2

.

.

.

.

.

.

Features #N

Positive Samples

Negative Samples

Learning Algorithm

Page 11: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 11 Your Company Logo

goes here. See Slide

10 for instructions

Creating an Object Detector

Collect Training

Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Design Implementation

Page 12: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 12 Your Company Logo

goes here. See Slide

10 for instructions

Feature Extraction

Sparse Dense

SURF HOG Image

Pixels Bag of Words

Feature Extraction

• Representations often invariant to

changes in scale, rotation, illumination

• More compact than storing pixel data

• Feature selection based on nature of

detection problem

• Consider alternatives like convolutional

neural nets

Factors to consider:

• Scale change

• Orientation

differences

• Environmental

conditions

Page 13: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 13 Your Company Logo

goes here. See Slide

10 for instructions

Creating an Object Detector

Collect Training

Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Design Implementation

Page 14: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 14 Your Company Logo

goes here. See Slide

10 for instructions

Find the Best Classifier-Feature Combination

• Steps

• Use a small subset of training data

• Train several different types of classifiers

• Compare performance

• Cross-validation

• Objective performance metrics

Page 15: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 15 Your Company Logo

goes here. See Slide

10 for instructions

Important Classification Methods

Supervised Classification

• Support Vector Machines

• E.g. Pedestrian detectors

• Neural Networks

• Great when low variation in orientation and

appearance

Unsupervised Classification

• Gaussian Mixture Model

• Hidden Markov Models

• Works well when large amount of data/classes in

training set

Ensemble Methods

• Adaboost

• E.g. Viola-Jones face detection

• Great when classifier needs to operate in many

different conditions

Page 16: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 16 Your Company Logo

goes here. See Slide

10 for instructions

Example: Support Vector Machine

Page 17: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 17 Your Company Logo

goes here. See Slide

10 for instructions

Analyzing Classifier Performance

Option 1: Eye Test

• Look at classification results

Option 2: Receiver Operating Curve

(ROC)

• Means to compare ranges of

performance of classifiers

• Ideal curves are toward the top-

left

• Larger area under the curve is

better

• Do not ignore false alarm rate (

1% of false alarm rate translates

to ~25000/day)

Page 18: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 18 Your Company Logo

goes here. See Slide

10 for instructions

Creating an Object Detector

Collect Training

Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Design Implementation

Page 19: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 19 Your Company Logo

goes here. See Slide

10 for instructions

Sliding

Window

Object Classifier Label/

Response

Constructing the Detector

Label: ‘Person’/’Non Person’

Response: Distance from boundary

Page 20: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 20 Your Company Logo

goes here. See Slide

10 for instructions

Constructing the Detector

• Classify patches at each

location and scale

• Resolve detection scores

• Pick strongest bounding box

Page 21: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 21 Your Company Logo

goes here. See Slide

10 for instructions

Creating an Object Detector

Collect Training

Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Design Implementation

Page 22: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 22 Your Company Logo

goes here. See Slide

10 for instructions

Considerations for Embedded Vision

Memory

• Memory footprint of classifier model

Processing Time

• Classification time for each window-step

• Granularity of sliding window step size

• Cascading-classifiers for faster rejection of negatives

Potential Porting Issues

• Fixed point accuracy

Tip: Consider dimensionality reduction

E.g. For pedestrian detector 99.3% speedup using PCA dimensionality reduction

Page 23: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 23 Your Company Logo

goes here. See Slide

10 for instructions

Classifier Training Workflow

Collect Training Data

Feature Selection

Evaluate Different

Classifiers

Construct Detector

Optimize for Embedded

Implementation

Few iterations might be necessary to create a GREAT detector

Computer Vision System Toolbox

Parallel Computing Toolbox

Statistics Toolbox

MATLAB Coder ( C/C++)

HDL Coder

Fixed Point Designer

Page 24: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 24 Your Company Logo

goes here. See Slide

10 for instructions

Key Takeaways

• It is not difficult to create your own object detector

• Smart feature and classifier selection helps create great object

detectors

• Never ever rely on solely the “eye test” for evaluation

• Insufficient training data will hold you back

Page 25: "How to Create a Great Object Detector," a Presentation from MathWorks

Copyright © 2014 MathWorks, Inc. 25 Your Company Logo

goes here. See Slide

10 for instructions

Resources

Computer Vision and Machine Learning with MATLAB

• http://www.mathworks.com/products/computer-vision/

• http://www.mathworks.com/machine-learning/index.html

INRIA Person Dataset

• http://pascal.inrialpes.fr/data/human/

Presentations

• http://courses.engr.illinois.edu/cs543/sp2011/lectures/Lecture%20

19%20-%20Sliding%20Window%20Detection%20-

%20Vision_Spring2011.pdf

Contact [email protected] for more information or source code