You are on page 1of 101

Pattern Recognition

A. G. Schwing

University of Illinois at Urbana-Champaign, 2017

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 1 / 37


L1: ECE 544 Pattern Recognition

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 2 / 37


Goals of this lecture

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 3 / 37


Goals of this lecture
Introduction to pattern recognition

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 3 / 37


Goals of this lecture
Introduction to pattern recognition
Organizational details

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 3 / 37


Goals of this lecture
Introduction to pattern recognition
Organizational details

Style of this lecture

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 3 / 37


Goals of this lecture
Introduction to pattern recognition
Organizational details

Style of this lecture


Interactive

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 3 / 37


Pattern recognition

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 4 / 37


A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 5 / 37
somewhat dated joke

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 5 / 37


What is pattern recognition? What applications?

Discuss with your neighbor

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 6 / 37


Where pattern recognition shows up:

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 7 / 37


Where pattern recognition shows up:
Chess play (Deep Blue, IBM, 1997)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 7 / 37


Where pattern recognition shows up:
Chess play (Deep Blue, IBM, 1997)
Jeopardy (Watson, IBM, 2011)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 7 / 37


Where pattern recognition shows up:
Chess play (Deep Blue, IBM, 1997)
Jeopardy (Watson, IBM, 2011)
Playing Atari games (DQN, Deepmind, 2015)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 7 / 37


Where pattern recognition shows up:
Chess play (Deep Blue, IBM, 1997)
Jeopardy (Watson, IBM, 2011)
Playing Atari games (DQN, Deepmind, 2015)
Game of Go (AlphaGo, Deepmind, 2016)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 7 / 37


Where pattern recognition shows up:
Chess play (Deep Blue, IBM, 1997)
Jeopardy (Watson, IBM, 2011)
Playing Atari games (DQN, Deepmind, 2015)
Game of Go (AlphaGo, Deepmind, 2016)
Autonomous Driving (Audi, BMW, Mercedes, Uber, Waymo, Lyft,
NVIDIA, Intel, ...)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 7 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

Algorithm/Model

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

Algorithm/Model yes

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

Algorithm/Model

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

Algorithm/Model yes

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

Algorithm/Model

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Example:

Let’s get a computer to recognize whether there is a cat in the image.

Algorithm/Model no

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 8 / 37


Formulation of pattern recognition:

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 9 / 37


Formulation of pattern recognition:
input value: x (i)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 9 / 37


Formulation of pattern recognition:
input value: x (i)
label/output: y (i)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 9 / 37


Formulation of pattern recognition:
input value: x (i)
label/output: y (i)

x (i) Model/Algorithm y (i)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 9 / 37


Formulation of pattern recognition:
input value: x (i)
label/output: y (i)

x (i) Model/Algorithm y (i)

Inference

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 9 / 37


Formulation of pattern recognition:
input value: x (i)
label/output: y (i)

x (i) Model/Algorithm y (i)

Inference
Prediction

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 9 / 37


x (i) Model/Algorithm y (i)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 10 / 37


x (i) Model/Algorithm y (i)

Model/Algorithm depends on parameters w

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 10 / 37


x (i) Model/Algorithm y (i)

Model/Algorithm depends on parameters w


Learning/Fitting of parameters w

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 10 / 37


x (i) Model/Algorithm y (i)

Model/Algorithm depends on parameters w


Learning/Fitting of parameters w
Based on dataset D = {(x (i) , y (i) )}N
i=1

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 10 / 37


How could we recognize a cat? What should the algorithm do?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 11 / 37


How does an image look like for a computer?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 12 / 37


How does an image look like for a computer?

Demo

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 12 / 37


How does an image look like for a computer?

Demo

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 12 / 37


How does an image look like for a computer?

Cell phone screen:

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 13 / 37


Given that we know how a computer ‘sees’ an image, how can it
recognize cats?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 14 / 37


Given that we know how a computer ‘sees’ an image, how can it
recognize cats?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 14 / 37


Given that we know how a computer ‘sees’ an image, how can it
recognize cats?

Still very hard to describe what a cat looks like.

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 14 / 37


Given that we know how a computer ‘sees’ an image, how can it
recognize cats?

Still very hard to describe what a cat looks like.

Let’s look at tons of examples (Dataset).

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 14 / 37


Dataset (Thousands of examples):

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 15 / 37


Dataset (Thousands of examples):

Instead of asking to recognize cats in general, let’s recognize cats in


this dataset

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 15 / 37


Dataset (Thousands of examples):

Instead of asking to recognize cats in general, let’s recognize cats in


this dataset

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 15 / 37


Dataset (Thousands of examples):

Instead of asking to recognize cats in general, let’s recognize cats in


this dataset

Algorithm: if bottom left corner is black (0) say no, otherwise say yes

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 15 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model yes

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model no

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model no

Works perfect on our dataset. :)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model

Works perfect on our dataset. :)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model yes (?)

Works perfect on our dataset. :)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Algorithm: if bottom left corner is black (0) say no, otherwise say yes

Algorithm/Model yes (?)

Works perfect on our dataset. :)


But does not generalize to other data. :(

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 16 / 37


Conclusion:

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 17 / 37


Conclusion:

We designed a simple “classifier” that works on this dataset but


doesn’t work on real data.

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 17 / 37


Conclusion:

We designed a simple “classifier” that works on this dataset but


doesn’t work on real data.

To our rescue:

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 17 / 37


Conclusion:

We designed a simple “classifier” that works on this dataset but


doesn’t work on real data.

To our rescue:

Machine learning/Pattern recognition found mechanisms to search for


mappings which generalize.

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 17 / 37


Conclusion:

We designed a simple “classifier” that works on this dataset but


doesn’t work on real data.

To our rescue:

Machine learning/Pattern recognition found mechanisms to search for


mappings which generalize.

Scope of this class:

In this lecture we talk about mechanisms. A detailed treatment about


generalization is left to lectures on learning theory.

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 17 / 37


Categorization of pattern recognition algorithms according to

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 18 / 37


Categorization of pattern recognition algorithms according to
Available annotated data (supervised vs. unsupervised)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 18 / 37


Categorization of pattern recognition algorithms according to
Available annotated data (supervised vs. unsupervised)
Complexity of model (linear vs. non-linear)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 18 / 37


Categorization of pattern recognition algorithms according to
Available annotated data (supervised vs. unsupervised)
Complexity of model (linear vs. non-linear)
Structure of output (independent vs. structured)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 18 / 37


Categorization of pattern recognition algorithms according to
Available annotated data (supervised vs. unsupervised)
Complexity of model (linear vs. non-linear)
Structure of output (independent vs. structured)
Modeling of data (x (i) ) or label (y (i) ) (generative vs. discriminative)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 18 / 37


Syllabus

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 19 / 37


Classification tasks:

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 20 / 37


Classification tasks:
Spam filter

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 20 / 37


Classification tasks:
Spam filter
Cancer classification

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 20 / 37


Classification tasks:
Spam filter
Cancer classification
...

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 20 / 37


More examples

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 21 / 37


Example: Differentiating between 1000 image categories

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Differentiating between 1000 image categories

Which object is illustrated?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Differentiating between 1000 image categories

Which object is illustrated?


Car

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Differentiating between 1000 image categories

Which object is illustrated?


Car
Truck

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Differentiating between 1000 image categories

Which object is illustrated?


Car
Truck
Recreational Vehicle

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Differentiating between 1000 image categories

Which object is illustrated?


Car
Truck
Recreational Vehicle
Ambulance truck

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Differentiating between 1000 image categories

Which object is illustrated?


Car
Truck
Recreational Vehicle
Ambulance truck
Fire truck

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 22 / 37


Example: Instance level video segmentation

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 23 / 37


Results from A. Karpathy & L. Fei-Fei

Example: Describing an image

Works

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 24 / 37


Results from A. Karpathy & L. Fei-Fei

Example: Describing an image

Works

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 24 / 37


Results from A. Karpathy & L. Fei-Fei

Works, ...

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 25 / 37


Results from A. Karpathy & L. Fei-Fei

Works, ...

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 25 / 37


Results from A. Karpathy & L. Fei-Fei

Kind of works, ...

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 26 / 37


Results from A. Karpathy & L. Fei-Fei

Kind of works, ...

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 26 / 37


Results from A. Karpathy & L. Fei-Fei

And fails occasionally too

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 27 / 37


Results from A. Karpathy & L. Fei-Fei

And fails occasionally too

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 27 / 37


Creativity

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 28 / 37


Example: Describing an image

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 29 / 37


Example: Describing an image
Object Labels: ‘person’ Object Labels: ‘person’,‘bus’
AG-CVAE sentences: AG-CVAE sentences:
a man and a woman standing in a room a man and a woman sitting on a bus
a man and a woman are playing a game a man and a woman sitting on a train
a man standing next to a woman in a room a man and woman sitting on a bus
a man standing next to a woman in a field a man and a woman sitting on a bench
a man standing next to a woman in a suit a man and a woman are sitting on a bus
Object Labels: ‘person’, ‘remote’ Object Labels: ‘person’, ‘train’
AG-CVAE sentences: AG-CVAE sentences:
a man and a woman playing a video game a man and a woman sitting on a train
a man and a woman are playing a video game a woman and a woman sitting on a train
a man and woman are playing a video game a woman sitting on a train next to a train
a man and a woman playing a game with a remote a woman sitting on a bench in a train
a woman holding a nintendo wii game controller a man and a woman sitting on a bench

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 29 / 37


Results from U. Jain et al.

Example: Asking questions about an image

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 30 / 37


Results from U. Jain et al.

Example: Asking questions about an image

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 30 / 37


Questionnaire

Syllabus
Assignments
Project
Final exam
Piazza
Grading policy (50% Final, 30% Homework, 20% Project)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 31 / 37


So far:

What can a computer do for you?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 32 / 37


So far:

What can a computer do for you?

Now:

What will a computer be able to do for you?

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 32 / 37


A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 33 / 37
Future: (years from 2016; from https://arxiv.org/pdf/1705.08807.pdf)

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 34 / 37


A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 35 / 37
Videos

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 36 / 37


Amazing future ahead. Let’s make it happen.

A. G. Schwing (UofI) ECE 544: Pattern Recognitition 2017 37 / 37

You might also like