redes neurais artificiais - ufganderson/deeplearning/deep learning - redes neura… · introduziram...

160
Redes Neurais Profundas Deep Learning Aula 4 Prof. Anderson Soares www.inf.ufg.br/~anderson Instituto de Informática Universidade Federal de Goiás

Upload: others

Post on 05-Jun-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Redes Neurais Profundas –Deep Learning

Aula 4Prof. Anderson Soares

www.inf.ufg.br/~andersonInstituto de Informática

Universidade Federal de Goiás

Page 2: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aula 4:Convolutional Neural Network

2

Page 3: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

3

Introdução

Page 4: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Relembrando...

4

Entrada Extração de características

Machine Learning

Saída

Entrada Deep Learning Saída

Page 5: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Rede Neural Convolucional Problema: Entrada pode ter uma dimensão muito alta.

Utilizando uma Multi-Layer Perceptron precisamos de uma quantidade muito grande de parâmetros.

Inspirado pelos experimentos de neurofisiologia [Hubel & Wiesel 1962], CNNs são um tipo especial de redesneurais que usam o conceito de campo receptivo local.

Exemplo: 200x200 imagema) MLP: 40,000 hidden units

=> 1.6 bilhões de parametros

b) CNN: 5x5 kernel, 100 campos receptivos => 2,500 parametros

Page 6: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

6

In 1995, Yann LeCun e Yoshua BengioIntroduziram o conceito de redes neuraisconvolucionais.

Yann LeCun, Professor of Computer ScienceThe Courant Institute of Mathematical SciencesNew York UniversityRoom 1220, 715 Broadway, New York, NY 10003, USA.(212)998-3283 [email protected]

Page 7: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

7

CNN’s foram inspiradas pela sensibilidadelocal e orientação seletiva do cérebo.

Projetaram uma rede neural que implicitamente extraim característicasrelevantes da entrada.

Redes convolucionais são um tipo especial de multi-layer neural networks (MLP).

Page 8: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

8

CNN é um rede feed-forward que extraipropriedades topológicas a partir da imagem. Como qualquer outra rede neural a

arquitetura é treinada com alguma variaçãodo alglritmo back-propagation. Capazes de reconhecer padrões com muita

variabilidade (Caracteres escritos a mão).

Page 9: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

X or OCNN

Matriz de pixeis

Page 10: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Por exemplo:

CNN X

CNN O

Page 11: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Casos mais complicados

CNN X

CNN O

Page 12: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Decisão difícil

=?

Page 13: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 1 -1 -1 -1-1 -1 1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 1 -1 -1-1 -1 -1 1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

O que o computador “enxerga”?

=?

Page 14: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 X -1 -1 -1 -1 X X -1-1 X X -1 -1 X X -1 -1-1 -1 X 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 X -1 -1-1 -1 X X -1 -1 X X -1-1 X X -1 -1 -1 -1 X -1-1 -1 -1 -1 -1 -1 -1 -1 -1

O que o computador “enxerga”?

Page 15: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 1 -1 -1 -1-1 -1 1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 1 -1 -1-1 -1 -1 1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 -1 -1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

O que o computador “enxerga”?

=x

Page 16: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Camadas de Rede Convolucional

Page 17: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

5 2 5 4 4

5 200 3 200 4

1 5 5 4 4

5 5 1 1 2

200 1 3 5 200

1 200 200 200 1

F

.06 .12 .06

.12 .25 .12

.06 .12 .06

H

u = -1, v = -1

(0, 0)

(i, j)Convolução

output filter input (image)

Page 18: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

5 2 5 4 4

5 200 3 200 4

1 5 5 4 4

5 5 1 1 2

200 1 3 5 200

1 200 200 200 1

F

.06 .12 .06

.12 .25 .12

.06 .12 .06

H

u = -1, v = -1 v = 0

(0, 0)

Convolução(i, j)

output filter input (image)

Page 19: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

5 2 5 4 4

5 200 3 200 4

1 5 5 4 4

5 5 1 1 2

200 1 3 5 200

1 200 200 200 1

F

.06 .12 .06

.12 .25 .12

.06 .12 .06

H

u = -1, v = -1 v = 0 v = +1

(0, 0)

Convolução(i, j)

output filter input (image)

Page 20: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

5 2 5 4 4

5 200 3 200 4

1 5 5 4 4

5 5 1 1 2

200 1 3 5 200

1 200 200 200 1

F

.06 .12 .06

.12 .25 .12

.06 .12 .06

H

u = -1, v = -1 v = 0 v = +1

u = 0, v = -1

(0, 0)

Convolução(i, j)

output filter input (image)

Page 21: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

IMPORTANTE

Convolução discreta

h(x): resposta de impulso (impulse response), kernel, máscara, filtroou template.

21

Page 22: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

* -1 0 1-1 0 1-1 0 1

=

Multiplicação ponto-a-ponto e soma de um filtro com o sinal

IMPORTANTE

Page 23: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Filtros: A matemática atrás da comparaçãoConvolução de gabaritos (templates)

Se T(x,y) é um gabarito (mxn) e I(x,y) é a Imagem (MxN) A convolução de T⊗I é dada

por:

23

Page 24: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 25: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Filtros: A matemática atrás da comparação

1.

2.3.

Page 26: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 27: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 28: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 29: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 30: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 31: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 32: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 33: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11 1 11

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 34: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11 1 11 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 35: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 11 1 11 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 36: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1

1 1 11 1 11 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 37: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 38: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 -11 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 39: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 1 -11 1 1-1 1 1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

Page 40: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

1 1 -11 1 1-1 1 1

Filtros: A matemática atrás da comparação

55

1 1 -11 1 1-1 1 1

Page 41: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 42: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 -1 -1-1 1 -1-1 -1 1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Filtros: A matemática atrás da comparação

=

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 43: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Filtros: A matemática atrás da comparação

Page 44: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

O resultado, omitindo-se a multiplicação dos valores zerados será dado por (50*30)+(50*30)+(50*30)+(20*30)+(50*30)=6600. O valor 6600 quantifica a presença da característica descrita pelo filtro convolucional na imagem.

Page 45: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

[From recent Yann LeCun slides]

Page 46: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Obtido de: https://github.com/InFoCusp/tf_cnnvisVer o vídeo de http://yosinski.com/deepvis

Page 47: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1 -1 -1-1 1 -1-1 -1 1

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

=

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

=

=

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Page 48: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Camada de convolução

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

1 -1 -1-1 1 -1-1 -1 1

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-1 -1 1-1 1 -11 -1 -1

1 -1 1-1 1 -11 -1 1

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

Page 49: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

32

32

3

Convolution Layer

Mapas de ativação

6

28

28

Por exemplo, se nós temos 6 filtros 5x5, nós iremos obter 6 mapas de ativação:

Nós empilhamos estas novamos imagens 28x28x6!

Camada de convolução

Page 50: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Olhando mais de perto as dimensões:

32

32

3

Mapa de ativação32x32x3 imagem5x5x3 filtro

128

28

Convolua (slide) sobre todas as posições

Camada de convolução: detalhes

Page 51: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada 7x7Filtro 3x3

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 52: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada 7x7 Filtro 3x3

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 53: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada 7x7 Filtro 3x3

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 54: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada 7x7 Filtro 3x3

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 55: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

=> 5x5 output

Entrada 7x7 Filtro 3x3

7

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 56: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada 7x7 Filtro 3x3 filter com stride 2

7

7

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 57: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

7

7

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Entrada 7x7 Filtro 3x3 filter com stride 2

Page 58: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

7

7

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Entrada 7x7 Filtro 3x3 filter com stride 2=> Saída 3x3

Page 59: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

7

7

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Entrada 7x7 Filtro 3x3 filter com stride 3

Page 60: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

7

7 doesn’t fit!Você não consegue usar um filtro 3x3 em uma imagem 7x7 com stride 3.

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Entrada 7x7 Filtro 3x3 filter com stride 3

Page 61: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

N

F

F

N

Calculando a saída:(N - F) / stride + 1

e.g. N = 7, F = 3:stride 1 => (7 - 3)/1 + 1 = 5stride 2 => (7 - 3)/2 + 1 = 3stride 3 => (7 - 3)/3 + 1 = 2.33 :\

Olhando mais de perto as dimensões:

Camada de convolução: detalhes

Page 62: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Na prática, costuma-se usar zero na borda0 0 0 0 0 0

0

0

0

0

e.g. Entrada 7x7Filtro 3x3 com stride 1pad com 1 pixel de borda=> Qual é a saída?

(recall:)(N - F) / stride + 1

Camada de convolução: detalhes

Page 63: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

In practice: Common to zero pad the bordere.g. Entrada 7x7Filtro 3x3 com stride 1pad com 1 pixel de borda => Qual é a saída?

7x7 output!

0 0 0 0 0 0

0

0

0

0

Camada de convolução: detalhes

Page 64: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

In practice: Common to zero pad the bordere.g. Entrada 7x7Filtro 3x3 com stride 1pad com 1 pixel de borda => Qual é a saída?

7x7 output!Geralmente o mais comum é camada com stride 1, filtros de tamanho FxF e zero-padding (F-1)/2. (preserva a dimensão)e.g. F = 3 => zero pad with 1 F = 5 => zero padwith 2 F = 7 => zero pad with 3

0 0 0 0 0 0

0

0

0

0

Camada de convolução: detalhes

(N + 2*padding - F) / stride + 1

Page 65: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Exemplos:

Entrada: 32x32x310 filtros 5x5 com stride 1, pad 2

Dimensão da saída: ?

Camada de convolução: detalhes

Page 66: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Exemplos:

Entrada: 32x32x310 filtros 5x5 com stride 1, pad 2

Dimensão da saída:(32+2*2-5)/1+1 = 32

Logo: 32x32x10

Camada de convolução: detalhes

Page 67: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada: 32x32x310 filtros 5x5 com stride 1, pad 2

Número de parâmetros na camada?

Camada de convolução: detalhes

Page 68: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entrada: 32x32x310 filtros 5x5 com stride 1, pad 2

(+1 for bias)Número de parâmetros na camada? Cada filtro possui 5*5*3 + 1 = 76 parâmetros=> 76*10 = 760

Camada de convolução: detalhes

Page 69: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Camada de convolução: detalhes

Page 70: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 71: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 72: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada ReLU

••

Page 73: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada ReLU

Tanh(x) ReLU

Page 74: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

https://www.completegate.com/2017022864/blog/deep-machine-learning-images-lenet-alexnet-cnn/alexnet-a-deep-convolutional-neural-network

Page 75: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada ReLU

Page 76: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada ReLU

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.77

Page 77: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

0.77 0

Entendendo a camada ReLU

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 78: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

0.77 0 0.11 0.33 0.55 0 0.33

Entendendo a camada ReLU

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 79: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

0.77 0 0.11 0.33 0.55 0 0.33

0 1.00 0 0.33 0 0.11 0

0.11 0 1.00 0 0.11 0 0.55

0.33 0.33 0 0.55 0 0.33 0.33

0.55 0 0.11 0 1.00 0 0.11

0 0.11 0 0.33 0 1.00 0

0.33 0 0.55 0.33 0.11 0 0.77

Entendendo a camada ReLU

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 80: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada ReLU0.77 0 0.11 0.33 0.55 0 0.33

0 1.00 0 0.33 0 0.11 0

0.11 0 1.00 0 0.11 0 0.55

0.33 0.33 0 0.55 0 0.33 0.33

0.55 0 0.11 0 1.00 0 0.11

0 0.11 0 0.33 0 1.00 0

0.33 0 0.55 0.33 0.11 0 0.77

0.33 0 0.11 0 0.11 0 0.33

0 0.55 0 0.33 0 0.55 0

0.11 0 0.55 0 0.55 0 0.11

0 0.33 0 1.00 0 0.33 0

0.11 0 0.55 0 0.55 0 0.11

0 0.55 0 0.33 0 0.55 0

0.33 0 0.11 0 0.11 0 0.33

0.33 0 0.55 0.33 0.11 0 0.77

0 0.11 0 0.33 0 1.00 0

0.55 0 0.11 0 1.00 0 0.11

0.33 0.33 0 0.55 0 0.33 0.33

0.11 0 1.00 0 0.11 0 0.55

0 1.00 0 0.33 0 0.11 0

0.77 0 0.11 0.33 0.55 0 0.33

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

Page 81: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 82: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada de Pooling

•••

Page 83: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada de Pooling

Page 84: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 85: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 86: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 87: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Pooling: Algoritmo

1.2.3.

Page 88: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 89: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00 0.33

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 90: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00 0.33 0.55

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 91: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00 0.33 0.55 0.33

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 92: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00 0.33 0.55 0.33

0.33

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 93: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

Pooling

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

Page 94: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.77

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

0.33 0.55 1.00 0.77

0.55 0.55 1.00 0.33

1.00 1.00 0.11 0.55

0.77 0.33 0.55 0.33

0.55 0.33 0.55 0.33

0.33 1.00 0.55 0.11

0.55 0.55 0.55 0.11

0.33 0.11 0.11 0.33

Page 95: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada Pooling

1.00 0.33 0.55 0.33

0.33 1.00 0.33 0.55

0.55 0.33 1.00 0.11

0.33 0.55 0.11 0.77

0.77 -0.11 0.11 0.33 0.55 -0.11 0.33

-0.11 1.00 -0.11 0.33 -0.11 0.11 -0.11

0.11 -0.11 1.00 -0.33 0.11 -0.11 0.55

0.33 0.33 -0.33 0.55 -0.33 0.33 0.33

0.55 -0.11 0.11 -0.33 1.00 -0.11 0.11

-0.11 0.11 -0.11 0.33 -0.11 1.00 -0.11

0.33 -0.11 0.55 0.33 0.11 -0.11 0.770.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.11 0.33 -0.77 1.00 -0.77 0.33 -0.11

0.11 -0.55 0.55 -0.77 0.55 -0.55 0.11

-0.55 0.55 -0.55 0.33 -0.55 0.55 -0.55

0.33 -0.55 0.11 -0.11 0.11 -0.55 0.33

0.55 0.33 0.55 0.33

0.33 1.00 0.55 0.11

0.55 0.55 0.55 0.11

0.33 0.11 0.11 0.33

Page 96: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada Pooling

Page 97: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Entendendo a camada Pooling

Page 98: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 99: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Fully connected layer

1.00

0.55

0.55

1.00

1.00

0.55

0.55

0.55

0.55

1.00

1.00

0.55

X

O

1.00

0.55

0.55

1.00

1.00

0.55

0.55

0.55

0.55

1.00

1.00

0.55

1.00 0.55

0.55 1.00

0.55 1.00

1.00 0.55

1.00 0.55

0.55 0.55

Page 100: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Fully connected layer

X

O

0.55

1.00

1.00

0.55

0.55

0.55

0.55

0.55

1.00

0.55

0.55

1.00

1.00 0.55

0.55 1.00

0.55 1.00

1.00 0.55

1.00 0.55

0.55 0.55

Page 101: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Fully connected layer

X

O

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

1.00 0.55

0.55 1.00

0.55 1.00

1.00 0.55

1.00 0.55

0.55 0.55

Page 102: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Fully connected layer

X

O

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

1.00 0.55

0.55 1.00

0.55 1.00

1.00 0.55

1.00 0.55

0.55 0.55

Page 103: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Fully connected layer

X

O

0.9

0.65

0.45

0.87

0.96

0.73

0.23

0.63

0.44

0.89

0.94

0.53

Page 104: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 105: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Calma…. Juntando tudo…

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Page 106: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Backprop

Page 107: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Backprop

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Page 108: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Right answer Actual answer ErrorX 1O

Backprop

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Page 109: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Right answer Actual answer ErrorX 1 0.92O

Backprop

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Page 110: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Right answer Actual answer ErrorX 1 0.92 0.08O

Backprop

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Page 111: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Right answer Actual answer ErrorX 1 0.92 0.08O 0 0.51 0.49

Backprop

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Page 112: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Backprop

-1 -1 -1 -1 -1 -1 -1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 -1 -1 1 -1 -1 -1 -1-1 -1 -1 1 -1 1 -1 -1 -1-1 -1 1 -1 -1 -1 1 -1 -1-1 1 -1 -1 -1 -1 -1 1 -1-1 -1 -1 -1 -1 -1 -1 -1 -1

XO

Right answer Actual answer ErrorX 1 0.92 0.08O 0 0.51 0.49

Total 0.57

Page 113: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Resumindo os parâmetros

Page 114: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

Page 115: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Como escolher o filtro de convolução?Depende da aplicação

Gaussian1st derivativeof Gaussian

2nd derivativeof Gaussian

Bom para suavização Bom para realçe

Aspectos de projeto da rede

Page 116: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

Page 117: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

= 30 pixels= 1 pixel = 5 pixels = 10 pixels

Page 118: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Input: 227x227x3 images

First layer (CONV1): 96 11x11 filters applied at stride 4

Volume size: Hint: (227-11)/4+1 = 55

Page 119: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Input: 227x227x3 images

First layer (CONV1): 96 11x11 filters applied at stride 4Output volume [55x55x96]

Page 120: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Input: 227x227x3 images

First layer (CONV1): 96 11x11 filters applied at stride 4=>Output volume [55x55x96]Parameters: (11*11*3)*96 = 35K

Page 121: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Input: 227x227x3 imagesAfter CONV1: 55x55x96

Second layer (POOL1): 3x3 filters applied at stride 2

Q: what is the output volume size? Hint: (55-3)/2+1 = 27

Page 122: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Input: 227x227x3 imagesAfter CONV1: 55x55x96

Second layer (POOL1): 3x3 filters applied at stride 2Output volume: 27x27x96

Page 123: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Input: 227x227x3 imagesAfter CONV1: 55x55x96After POOL1: 27x27x96...

Page 124: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Full (simplified) AlexNet architecture:[227x227x3] INPUT[55x55x96] CONV1: 96 11x11 filters at stride 4, pad 0[27x27x96] MAX POOL1: 3x3 filters at stride 2[27x27x96] NORM1: Normalization layer[27x27x256] CONV2: 256 5x5 filters at stride 1, pad 2[13x13x256] MAX POOL2: 3x3 filters at stride 2[13x13x256] NORM2: Normalization layer[13x13x384] CONV3: 384 3x3 filters at stride 1, pad 1[13x13x384] CONV4: 384 3x3 filters at stride 1, pad 1[13x13x256] CONV5: 256 3x3 filters at stride 1, pad 1[6x6x256] MAX POOL3: 3x3 filters at stride 2[4096] FC6: 4096 neurons[4096] FC7: 4096 neurons[1000] FC8: 1000 neurons (class scores)

Page 125: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Case Study: AlexNet[Krizhevsky et al. 2012]

Full (simplified) AlexNet architecture:[227x227x3] INPUT[55x55x96] CONV1: 96 11x11 filters at stride 4, pad 0[27x27x96] MAX POOL1: 3x3 filters at stride 2[27x27x96] NORM1: Normalization layer[27x27x256] CONV2: 256 5x5 filters at stride 1, pad 2[13x13x256] MAX POOL2: 3x3 filters at stride 2[13x13x256] NORM2: Normalization layer[13x13x384] CONV3: 384 3x3 filters at stride 1, pad 1[13x13x384] CONV4: 384 3x3 filters at stride 1, pad 1[13x13x256] CONV5: 256 3x3 filters at stride 1, pad 1[6x6x256] MAX POOL3: 3x3 filters at stride 2[4096] FC6: 4096 neurons[4096] FC7: 4096 neurons[1000] FC8: 1000 neurons (class scores)

Details/Retrospectives: - first use of ReLU- used Norm layers (not common anymore- heavy data augmentation- dropout 0.5- batch size 128- SGD Momentum 0.9- L2 weight decay 5e-4- 7 CNN ensemble: 18.2% -> 15.4%

Page 126: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

Page 127: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

Page 128: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

Page 129: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Aspectos de projeto da rede

Page 130: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Possibilidades de aplicações

Page 131: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Imagens

Page 132: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Sons

Page 133: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Texto

Page 134: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

A 22 1A a@a 1 aa a1.a 123 aa1

B 33 2B b@b 2 bb b2.b 234 bb2

C 44 3C c@c 3 cc c3.c 345 cc3

D 55 4D d@d 4 dd d4.d 456 dd4

E 66 5E e@e 5 ee e5.e 567 ee5

F 77 6F f@f 6 ff f6.f 678 ff6

G 88 7G g@g 7 gg g7.g 789 gg7

H 99 8H h@h 8 hh h8.h 890 hh8

I 111 9I i@i 9 ii i9.i 901 ii9

Dados de cliente

Page 135: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Uma nova era....

Page 136: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Uma nova era....

Page 137: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

10 categorias50,000 Imagens de treinamento, imagens de 32x32x310,000 imagens de teste.

CIFAR-10

Page 138: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Uma nova era....

••••

Page 139: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Computer Vision – Deep Networks

Page 140: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Computer Vision – Deep Networks

Page 141: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Computer Vision – Deep Networks

Page 142: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Assignment 1 coming out today.

Self-contained, written in Python.

Please submit via bCourses.

Administrivia

Apresentador
Notas de apresentação
Arguably realizes the Marr pipeline
Page 143: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Image Classification: a core task in Computer Vision

cat

(assume given set of discrete labels){dog, cat, truck, plane, ...}

Page 144: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

The problem:semantic gap

Images are represented as 3D arrays of numbers, with integers between [0, 255].

E.g. 300 x 100 x 3

(3 for 3 color channels RGB)

Page 145: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Challenges: Viewpoint Variation

Page 146: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Challenges: Illumination

Page 147: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Challenges: Deformation

Page 148: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Challenges: Occlusion

Page 149: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Challenges: Background clutter

Page 150: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Desafio: Variação na classe

Page 151: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 152: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Uma nova era....

Page 153: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science
Page 154: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Uma nova era....

Page 155: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Exemplo de uma rede executando no browser

Page 156: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Resumindo...

Page 157: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

Resumindo...

IA tradicional Deep learning

Engenharia de variáveis Modelo hierárquico com camadas de abstrações

Rótulos geralmente definidos por humanos Dados não rotulados

Computação sequencial Múltiplas decisões simultâneas

Page 160: REDES NEURAIS ARTIFICIAIS - UFGanderson/deeplearning/Deep Learning - Redes Neura… · Introduziram o conceito de redes neurais convolucionais. Yann LeCun, Professor of Computer Science

160

Fim