• No results found

Image and Video Understanding

N/A
N/A
Protected

Academic year: 2022

Share "Image and Video Understanding"

Copied!
124
0
0

Loading.... (view fulltext now)

Full text

(1)

Image and Video Understanding

Slide credits:

Many thanks to all the great computer vision researchers on which this presentation relies on.

Most material is taken from tutorials at NIPS, CVPR and BMVC conferences.

2VO 710.095 WS

Christoph Feichtenhofer, Axel Pinz

(2)

Outline

• Convolutional Networs (ConvNets) for Image Classification

– Operations in each layer – Architecture

– Training

– Visualizations

– State of the art methods

– Applications of ConvNets

Krizhevsky, A., Sutskever, I. and Hinton, G. E., ImageNet Classification with Deep Convolutional Neural Networks, NIPS 2012

M. Zeiler & R. Fergus, Visualizing and Understanding Convolutional Networks, ECCV, 2014

A. Mahendran and A. Vedaldi. Understanding Deep Image Representations by Inverting Them CVPR 2015

K. Simonyan and A. Zisserman, Very Deep

Convolutional Networks for Large-Scale Image Recognition. ICLR 2015.

S. Ioffe, C. Szegedy, Batch Normalization:

Accelerating Deep Network Training by Reducing Internal Covariate Shift, ICML 2015

K. He, X. Zhang, S. Ren, & j. Sun. Deep Residual Learning for Image Recognition. arXiv 2015.

(3)

Goal: Scene Understanding

Activities

Objects Scenes

Actions

Temporal input sequence

Desert

Car

Open door Get out of car

Leave a car in the desert Person

(4)

One application: Image retrieval

(5)

Deep Learning - breakthrough in visual and speech recognition

Credit: B. Ginzburg

(6)

ConvNet Detection Examples

(7)

Image

Pixels

Apply

Gabor filters

Spatial pool (Sum)

Normalize to unit length

Feature Vector

Credit: R. Fergus

Summary: Compare: SIFT Descriptor

(8)

What are the weakest links limiting performance?

● Replace each component of the deformable part model detector with humans

● Good Features (part detection) and accurate Localization (NMS) are most important

[Parikh & Zitnick CVPR’10]

(9)

Typical visual recognition pipeline

Feature Extractor

e.g. SIFT, HoG...

Trainable Classifier e.g. SVM

Image/Video Pixels

• Select / develop features

• Add on top of this Machine Learning for multi-class recognition and train classifier

Object Class

(10)

• Build features automatically based on training data

• Combine feature extraction and classification

• All the way from pixels  classifier

• One layer extracts features from output of previous layer

Intuition Behind Deep Neural Nets

Layer 1 Layer 2 Layer 3 “CAR”

Each box is a feature detector

(11)

Some Key Ingredients for Convolutional

Neural Networks

(12)

Neural networks trained via backpropagation

input vector

hidden layers (features)

outputs

Back-propagate error signal to get

derivatives for learning parameters θ

Compare outputs with correct answer to get

error signal L

Training

• F-Prop / B-Prop

• Learning by

stochastic gradient descent (SGD):

• A) Compute loss L on small mini-batch of data

• B) Compute gradient w.r.t. θ

• C) Use gradient to update θ (make a step in the opposite direction) weights

Non-linearity

Credit: G. Hinton

F-Prop B-Prop

(13)

Cat

Neural networks trained via backpropagation

input vector Compare outputs with

correct answer to get error signal

Training

• F-Prop / B-Prop

• Learning by SGD:

• A) Compute loss on small mini-batch

• B) Compute gradient w.r.t. θ

• C) Use gradient to update θ Back-propagate

error signal to get

derivatives for learning parameters θ

Credit: G. Hinton

(14)

Dog

Neural networks trained via backpropagation

input vector Compare outputs with

correct answer to get error signal

Training

• F-Prop / B-Prop

• Learning by SGD:

• A) Compute loss on small mini-batch

• B) Compute gradient w.r.t. θ

• C) Use gradient to update θ Back-propagate

error signal to get

derivatives for learning parameters θ

Credit: G. Hinton

(15)

Neural networks testing

Cat

Credit: G. Hinton

F-Prop

(16)

Neural networks testing

Dog

Credit: G. Hinton

F-Prop

(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
(31)
(32)

Summary: Modularity of backpropagation

Credit: A. Vedaldi

(33)

Motivation: Images as a composition of local parts

“Pixel-based” representation

Credit: M. A. Ranzato

Too many parameters!

(34)

Motivation: Images as a composition of local parts

“Patch-based” representation

Credit: M. A. Ranzato

(35)

Credit: M. A. Ranzato

Motivation: Images as a composition of local parts

“Patch-based” representation

Still too many parameters!

(36)

Credit: M. A. Ranzato

Motivation: Images as a composition of local parts Convolution example

(37)

Credit: M. A. Ranzato

Motivation: Images as a composition of local parts Convolution example

(38)

Motivation: Images as a composition of local parts Filtering example

Credit: R. Fergus

• Why translation equivariance?

Input translation leads to a translation of features

– Fewer filters needed: no translated replications – But still need to cover orientation/frequency

Patch-based Convolutional

Patch-based

(39)

Convolutional Neural

Networks

(40)

Multistage HubelWiesel Architecture:

An Old Idea for Local Shift Invariance

• [Hubel & Wiesel 1962]

• Simple cells detect local features

• Complex cells “pool” the outputs of simple cells within a retinotopic neighborhood.

Convolutional Networks [LeCun 1988-present]

pooling & subsampling

“Simple cells” “Complex cells”

Multiple convolutions

Retinotopic Feature Maps

Credit: Y. LeCun

(41)

Convolutional Neural Networks

• Neural network with specialized connectivity structure

• After a few convolution and subsampling stages, spatial resolution is very small

• Use fully connected layers up to classification at output layer

[LeCun et al. 1989]

[LeCun et al. 1989]

(42)

Training large ConvNets on

Imagenet database:

• 1K classes

• ~ 1K training images per class!

• ~ 1M training images

Paradigm shift enabled by

• Large annotated dataset

• Strong regularization (dropout)

• GPU(s) for fast processing

~ 150 images/sec

days—weeks of training

[Russakovsky et al. ICCV’13]

(43)

ImageNet Classification 2012

• Krizhevsky et al. -- 16.4% error (top-5)

• Next best (non-convnet) – 26.2% error

0 5 10 15 20 25 30 35

SuperVision ISI Oxford INRIA Amsterdam

Top-5 error rate %

Credit: R. Fergus

(44)

Architecture of [Krizhevsky et al. NIPS’12]

Overall: 60,000,000 parameters which are trained on 2 GPUs for a week with several tricks to reduce overfitting

Data augmentation

DropOut (new regularization)

ImageNet Classification 2012

16.4% error (top-5)

next best (variant of SIFT + Fisher Vectors) – 26.2% error Same idea as in [LeCun’98] but on a larger scale:

more training images (106 vs 103)

more hidden layers

(45)

ConvNet Architecture

• Feed-forward:

– Convolve input

– Non-linearity (rectified linear) – Pooling (local max)

• Supervised

• Train convolutional filters by

back-propagating classification error

Input Image Convolution (Learned)

Non-linearity Pooling Feature maps

Credit: R. Fergus

(46)

Components of Each Layer

Pixels / Features

Filter with Dictionary

(convolutional or tiled)

Spatial/Feature (Sum or Max)

Normalization between

feature responses Output Features

+ Non-linearity

[Optional]

Credit: R. Fergus

(47)

• Why convolution?

– Statistics of images look similar at different locations

– Dependencies are very local – Filtering is an opteration with

translation equivariance

Input Feature Map

. . .

Credit: R. Fergus

Convolutional filtering

(48)

Non-Linearity

• Non-linearity applied to each response

– Per-feature independent – Tanh

– Sigmoid: 1/(1+exp(-x)) – Rectified linear : max(0,x)

• Simplifies backprop

• Makes learning faster

• Avoids saturation issues

(much higher dynamic range)

 Preferred option

Credit: A. Vedaldi

(49)

Pooling

• Spatial Pooling

– Non-overlapping / overlapping regions (-0.3% in error) – Sum or max

– Provides invariance to local transformations

Credit: R. Fergus

Max

Sum

(50)

Normalization

The same response for different contrasts is desired

• Contrast normalization

(51)

• Contrast normalization (between/across feature maps)

– Local mean = 0, local std. = 1, “Local”  7x7 Gaussian – Equalizes the features maps

Feature Maps Feature Maps

After Contrast Normalization

Normalization

Credit: R. Fergus

(52)

Local feature normalisation

Credit: A. Vedaldi

(53)

Recap: Components of a CNN

CNN - multi-layer NN architecture

– Convolutional + Non-Linear Layer – Sub-sampling Layer

– Convolutional +Non-Linear Layer – Fully connected layers

• Supervised

Feature Extraction Classi- fication

Credit: B. Ginzburg

(54)

Summary: Components of Each Layer

Credit: A. Vedaldi

(55)

Architecture of Krizhevsky et al.

• Trained via backprop by maximizing the log-prob.

of the correct class-label

• 8 layers total

• Trained on ImageNet dataset

Input Image

Layer 1: Conv + Pool Layer 6: Full

Layer 3: Conv Softmax Output

Layer 2: Conv + Pool Layer 4: Conv Layer 5: Conv + Pool

Layer 7: Full

Credit: R. Fergus

(56)

Improving Generalization: DropOut

Motivation:

• Random Forests generalize well due to averaging of many models

• Decision Trees are fast - ConvNets are slow – many models are not feasible

• Similar to random forest bagging [Breiman’94], but differs in that parameters are shared

• For fully connected layers only:

In training: Independently set each hidden unit activity to zero with 0.5 probability

In testing multiply neuron output by 0.5

• Corresponds to averaging over exponentially many samples from different model architectures

[Hinton et al. NIPS’12]

(57)

• Mean removal Centered (0-

mean) RGB values.

• Data

augmentation Train on 224x224 patches extracted randomly from images, and also their horizontal reflections

Input representation

Centered (0-mean) RGB values.

An input image (256x256) Minus sign The mean input image

[Krizhevsky et al. NIPS’12]

Further pre-processing tricks

[Chatfield et al. BMVC’14]

(58)

ImageNet Classification 2013/2014 Results

• http://www.image-net.org/challenges/LSVRC/2013/results.php

0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17

Test error (top-5)

• Pre-2012: 26.2% error  2012: 16.5% error  2013: 11.2% error

Credit: R. Fergus

(59)

[Krizhevsky et al. NIPS’12]

ImageNet Sample classifications

(60)

Validation classification

ImageNet Sample classifications [Krizhevsky et al. NIPS’12]

(61)

ImageNet Classification Progress from ‘12-’14

Credit: Y. LeCun

(62)

Credit: K. Simonyan

(63)

Credit: K. Simonyan

ILSVRC14 Winners: ~7.3% Top-5 error

 VGG: 16 layers of stacked 3x3 convolution with stride 1 Better (≈deeper) architectures exist now

(64)

Credit: K. Simonyan

ILSVRC14 Winners: ~7.3% Top-5 error

 VGG: 16 layers of

stacked 3x3 convolution with stride 1

Better (≈deeper) architectures exist now

(65)

Better (≈deeper) architectures exist now

ILSVRC14 Winners: ~6.6% Top-5 error

- GoogLeNet: composition of multi-scale dimension- reduced modules:

- 1x1 convolutions serve

as dimensionality reduction

Convolution Pooling

Softmax Other Zeiler-Fergus Architecture (1 tower)

Credit: C. Szegedy

“wire together what fires together

(66)

In images, correlations tend to be local

Credit: C. Szegedy

(67)

Cover very local clusters by 1x1 convolutions

Credit: C. Szegedy

1x1

number of filters

(68)

Less spread out correlations

Credit: C. Szegedy

1x1

number of filters

(69)

Cover more spread out clusters by 3x3 convolutions

Credit: C. Szegedy

1x1

3x3

number of filters

(70)

Cover more spread out clusters by 5x5 convolutions

Credit: C. Szegedy

1x1

number of filters

3x3

(71)

Cover more spread out clusters by 5x5 convolutions

Credit: C. Szegedy

1x1

number of filters

3x3 5x5

(72)

A heterogeneous set of convolutions

Credit: C. Szegedy

1x1

number of filters

3x3

5x5

(73)

Schematic view (naive version)

Credit: C. Szegedy

1x1

number of filters

3x3

5x5

1x1 convolutions

3x3 convolutions

5x5 convolutions Filter

concatenation

Previous layer

(74)

1x1 convolutions

3x3 convolutions

5x5 convolutions Filter

concatenation

Previous layer

Naive idea

Credit: C. Szegedy

(75)

1x1 convolutions

3x3 convolutions

5x5 convolutions Filter

concatenation

Previous layer

Naive idea (does not work!) - Too many parameters

3x3 max pooling

Credit: C. Szegedy

(76)

1x1 convolutions

3x3 convolutions

5x5 convolutions Filter

concatenation

Previous layer

Inception module

3x3 max pooling 1x1

convolutions

1x1 convolutions

1x1 convolutions

• 1x1 Convolution

– Only operates across channels

– Performs a linear projections of a single pixel’s features – Can be used to reduce dimensionality

– Increases depth

(77)

9 Inception modules

Convolution Pooling

Softmax Other Network in a network in a network...

Credit: C. Szegedy

Inception

(78)

Classification failure cases

Groundtruth: coffee mug GoogLeNet:

table lamp

lamp shade

printer

projector

desktop computer

Credit: C. Szegedy

(79)

Classification failure cases

Groundtruth: hay GoogLeNet:

● sorrel (horse)

● hartebeest

● Arabian camel

● warthog

● gaselle

Credit: C. Szegedy

(80)

Classification failure cases

Groundtruth: Police car GoogLeNet:

laptop

hair drier

binocular

ATM machine

seat belt

Credit: C. Szegedy

(81)

Credit: K. Simonyan

(82)

Credit: K. Simonyan

(83)

Credit: K. Simonyan

(84)

Credit: K. He

ILSVRC15 Winners: ~3.57% Top-5 error

Better (≈deeper) architectures exist now

(85)

Faster R-CNN + ResNet Examples

Credit: K. He

(86)

Faster R-CNN + ResNet Examples

Credit: K. He

(87)

Faster R-CNN + ResNet Examples

Credit: K. He

(88)

Credit: K. He

ILSVRC15 Winners: Object detection revolution

Better (≈deeper) architectures exist now

(89)

Better (≈deeper) architectures exist now

2014

Credit: K. He

“Ultra deep”

all 3x3 conv filters (except first: 7x7)

spatial size /2 →# filters x2

Uses Batch Normalisation during training

Standard hyperparameters

& data augmentation

No hidden fc layer

No max pooling

(except after first layer)

No dropout

(90)

Credit: K. He

Simply stacking layers does not work

(91)

Simply stacking layers does not work

Credit: K. He

(92)

Credit: K. He Kaiming He, Xiangyu Zhang, Shaoqing Ren, & Jian Sun. “Deep Residual Learning for Image Recognition”. arXiv 2015.

Solution: Residual learning

(93)

Breaking CNNs

Intriguing properties of neural networks [Szegedy ICLR 2014]

(94)

What is going on?

x

x x

x

 

  E

x

E

Explaining and Harnessing Adversarial Examples [Goodfellow ICLR 2015]

Adversarial examples: modify the image to increase classifier error

(95)

What is learned?

Visualizing CNNs

M. Zeiler & R. Fergus, Visualizing and Understanding Convolutional Networks, ECCV, 2014

A. Mahendran and A. Vedaldi. Understanding Deep Image Representations by Inverting Them, CVPR 2015

(96)

Visualization using Deconvolutional Networks

• Provides way to map activations at high layers back to the input

• Same operations as Convnet, but in reverse:

– Unpool feature maps

– Convolve unpooled maps

• Filters copied from Convnet

• Used here purely as a probe

– Originally proposed as unsupervised learning method

– No inference, no learning

Input Image

Convolution (learned) Unpooling

Feature maps

Non-linearity

[Zeiler et al. CVPR’10, ICCV’11, ECCV’14]

Credit: R. Fergus

(97)

Unpooling Operation

• Switches record where the pooled activations came from to

“unpool” the reconstructed layer above

Credit: R. Fergus

(98)

Deconvnet Projection from Higher Layers

Input Image Visualization

Layer 1: Feature maps

Layer 2: Feature maps

Feature

Map ....

Filters

Layer 1 Reconstruction

Layer 2 Reconstruction

0 .... 0

Filters

Co n vn et

D ec o n vn et

[Zeiler and Fergus. ECCV’14]

Credit: R. Fergus

(99)

Visualizations of Higher Layers

• Use ImageNet 2012 validation set (stack of images)

• Push each image through network and look for image with the strongest activation for each feature map

Input Image Feature

Map

Lower Layers ....

Filters

Validation Images

Take max activation from feature map associated with each filter

Use Deconvnet to project back to pixel space

Use pooling “switches”

distinctive to that activation

Credit: R. Fergus

(100)

Layer 1 Filters

Credit: R. Fergus

(101)

Layer 1: Top-9 Patches

Credit: R. Fergus

(102)

Layer 2: Top-1

Credit: R. Fergus

(103)

Layer 2: Top-9

• Parts of input image that give strong activation of this feature map

(104)

Layer 2: Top-9 Patches

• Patches from validation images that give maximal activation of a given feature map

(105)

Layer 3: Top-1

(106)

Layer 3: Top-9

(107)

Layer 3: Top-9 Patches Layer 3: Top-9

(108)

Layer 4: Top-1

(109)

Layer 4: Top-9

(110)

Layer 4: Top-9 patches

(111)

Layer 5: Top-1

(112)

Layer 5: Top-9

(113)

Layer 5: Top-9 Patches

(114)

Evolution of Features During Training

(115)

Evolution of Features During Training

Credit: R. Fergus

Higher layers evolve later in later epochs during training.

(116)

Visualizations can be used to improve model

Visualization of Krizhevsky et al.’s architecture showed some problems with layers 1 and 2

Alter architecture: smaller stride & filter size

Visualizations look better and Performance improves

Blocking artifacts Smaller stride for convolution

Layer 2 filters

Credit: R. Fergus

(117)

Layer 1 filters

11x11 filters, stride 4 7x7 filters, stride 2

Too specific for low-level

+ dead filters Restrict size (smaller)

Visualizations can be used to improve model

Credit: R. Fergus

Visualization of Krizhevsky et al.’s architecture showed some problems with layers 1 and 2

Alter architecture: smaller stride & filter size

Visualizations look better and Performance improves

(118)

Occlusion Experiment

• Mask parts of input with occluding square

• Monitor output of classification network

• Perhaps network using scene context?

Credit: R. Fergus

(119)

Input image

p(True class) Most probable class

Credit: R. Fergus

(120)

Input image

p(True class) Most probable class

Credit: R. Fergus

(121)

Input image

p(True class) Most probable class

Credit: R. Fergus

(122)

Finding a Pre-Image

Credit: A. Vedaldi

(123)

Images are locally smooth

Credit: A. Vedaldi

(124)

Finding a pre-Image at intermediat layers

Credit: A. Vedaldi

References

Related documents

• Specifically, we show that when multiple macro users are served by the macro cell, the optimal value of power and number of ABS obtained by performing interference management on

{Factors contributing to the performance of a farmworker equity-share scheme} Policy & program interventions Conceptual Framework Institutional & macro-policy framework

As estimated above, a 10 cent tax increase per drink would reduce the consumption of beer (8.4 percent), wine (7 percent), and spirits (11.5 percent), but these are not the

Key words: Fuzzy controller, shunt active power filter, control of harmonics, predictive current control; four leg converters, and power

Unmet need for spacing is applied to non pregnant and non post partum women who are not using a FP method, who want more children but not for at least two

• Promote an international network of professionals in both the fields of technology and cultural heritage for scientific research but also applied practical experience;. •

1.The Network administrator has sensitive data where he distributes the data to some group of trusted third parties who are called as agents, where there is a possibility of some

While this material is not classified as hazardous under OSHA, GHS or WHMIS 2015 regulations, this SDS contains valuable information critical to the safe handling and proper use of