CS 4501 Introduction to Computer Vision Neural Networks

  • Slides: 34
Download presentation
CS 4501: Introduction to Computer Vision Neural Networks + Convolutional Neural Networks

CS 4501: Introduction to Computer Vision Neural Networks + Convolutional Neural Networks

Last Class • Global Features • The perceptron model • Neural Networks – multilayer

Last Class • Global Features • The perceptron model • Neural Networks – multilayer perceptron model (MLP) • Backpropagation

Today’s Class • Neural Networks – multilayer perceptron model (MLP) • Backpropagation • Convolutional

Today’s Class • Neural Networks – multilayer perceptron model (MLP) • Backpropagation • Convolutional Neural Networks

Perceptron Model Frank Rosenblatt (1957) - Cornell University More: https: //en. wikipedia. org/wiki/Perceptron Activation

Perceptron Model Frank Rosenblatt (1957) - Cornell University More: https: //en. wikipedia. org/wiki/Perceptron Activation function

Perceptron Model Frank Rosenblatt (1957) - Cornell University !? More: https: //en. wikipedia. org/wiki/Perceptron

Perceptron Model Frank Rosenblatt (1957) - Cornell University !? More: https: //en. wikipedia. org/wiki/Perceptron

Perceptron Model Frank Rosenblatt (1957) - Cornell University More: https: //en. wikipedia. org/wiki/Perceptron Activation

Perceptron Model Frank Rosenblatt (1957) - Cornell University More: https: //en. wikipedia. org/wiki/Perceptron Activation function

Activation Functions Step(x) Tanh(x) Sigmoid(x) Re. LU(x) = max(0, x)

Activation Functions Step(x) Tanh(x) Sigmoid(x) Re. LU(x) = max(0, x)

Pytorch - Perceptron

Pytorch - Perceptron

Two-layer Multi-layer Perceptron (MLP) ”hidden" layer Loss / Criterion

Two-layer Multi-layer Perceptron (MLP) ”hidden" layer Loss / Criterion

Forward pass

Forward pass

Backward pass Grad. Params Grad. Inputs

Backward pass Grad. Params Grad. Inputs

Pytorch – Two-layer MLP + Regression

Pytorch – Two-layer MLP + Regression

Pytorch – Two-layer MLP + Log. Softmax # of Hidden Units

Pytorch – Two-layer MLP + Log. Softmax # of Hidden Units

Pytorch – Two-layer MLP + Log. Softmax + Negative Likelihood Loss

Pytorch – Two-layer MLP + Log. Softmax + Negative Likelihood Loss

Bookmark Opportunity!

Bookmark Opportunity!

SGD training code (Project 4)

SGD training code (Project 4)

Convolutional (Neural) Networks

Convolutional (Neural) Networks

Convolutional Layer

Convolutional Layer

Convolutional Layer

Convolutional Layer

Convolutional Layer Weights

Convolutional Layer Weights

Convolutional Layer Weights 4

Convolutional Layer Weights 4

Convolutional Layer Weights 4 1

Convolutional Layer Weights 4 1

Convolutional Layer (with 4 filters) Input: 1 x 224 weights: 4 x 1 x

Convolutional Layer (with 4 filters) Input: 1 x 224 weights: 4 x 1 x 9 x 9 Output: 4 x 224 if zero padding, and stride = 1

Convolutional Layer (with 4 filters) Input: 1 x 224 weights: 4 x 1 x

Convolutional Layer (with 4 filters) Input: 1 x 224 weights: 4 x 1 x 9 x 9 Output: 4 x 112 if zero padding, but stride = 2

Convolutional Layer in Torch k. W Input Output n. Output. Plane x k. H

Convolutional Layer in Torch k. W Input Output n. Output. Plane x k. H n. Input. Plane (e. g. 3 for RGB inputs) n. Output. Plane (equals the number of convolutional filters for this layer)

Convolutional Layer in Keras Convolution 2 D(n. Output. Plane, k. W, k. H, input_shape

Convolutional Layer in Keras Convolution 2 D(n. Output. Plane, k. W, k. H, input_shape = (3, 224), subsample = 2, border_mode = valid) k. W Input Output n. Output. Plane x k. H n. Input. Plane (e. g. 3 for RGB inputs) n. Output. Plane (equals the number of convolutional filters for this layer)

Convolutional Layer in pytorch kernel_size Input Output out_channels x kernel_size in_channels (e. g. 3

Convolutional Layer in pytorch kernel_size Input Output out_channels x kernel_size in_channels (e. g. 3 for RGB inputs) out_channels (equals the number of convolutional filters for this layer)

Convolutional Network: Le. Net

Convolutional Network: Le. Net

Le. Net in Pytorch

Le. Net in Pytorch

Spatial. Max. Pooling Layer take the max in this neighborhood 8 8 8

Spatial. Max. Pooling Layer take the max in this neighborhood 8 8 8

Convolutional Layers as Matrix Multiplication https: //petewarden. com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Convolutional Layers as Matrix Multiplication https: //petewarden. com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Convolutional Layers as Matrix Multiplication https: //petewarden. com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Convolutional Layers as Matrix Multiplication https: //petewarden. com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Convolutional Layers as Matrix Multiplication Pros? Cons? https: //petewarden. com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Convolutional Layers as Matrix Multiplication Pros? Cons? https: //petewarden. com/2015/04/20/why-gemm-is-at-the-heart-of-deep-learning/

Questions? 34

Questions? 34