Lecture 5 Smaller Network: CNN

Slides:



Advertisements
Similar presentations
Face Recognition: A Convolutional Neural Network Approach
Advertisements


Lecture 14 – Neural Networks
Computer Vision Introduction to Image formats, reading and writing images, and image environments Image filtering.
Lecture 3: CNN: Back-propagation
Overview of Back Propagation Algorithm
Convolutional Neural Networks for Image Processing with Applications in Mobile Robotics By, Sruthi Moola.
Object detection, deep learning, and R-CNNs
Object Recognition Tutorial Beatrice van Eden - Part time PhD Student at the University of the Witwatersrand. - Fulltime employee of the Council for Scientific.
Convolutional Neural Network
1 Convolutional neural networks Abin - Roozgard. 2  Introduction  Drawbacks of previous neural networks  Convolutional neural networks  LeNet 5 
Deep Learning Overview Sources: workshop-tutorial-final.pdf
Facial Detection via Convolutional Neural Network Nathan Schneider.
Demo.
The Relationship between Deep Learning and Brain Function
CS 6501: 3D Reconstruction and Understanding Convolutional Neural Networks Connelly Barnes.
Machine Learning for Big Data
Data Mining, Neural Network and Genetic Programming
DeepCount Mark Lenson.
Convolutional Neural Fabrics by Shreyas Saxena, Jakob Verbeek
Applications of Deep Learning and how to get started with implementation of deep learning Presentation By : Manaswi Advisor : Dr.Chinmay.
CSCI 5922 Neural Networks and Deep Learning: Convolutional Nets For Image And Speech Processing Mike Mozer Department of Computer Science and Institute.
Mini Presentations - part 2
Supervised Training of Deep Networks
Neural Networks 2 CS446 Machine Learning.
Training Techniques for Deep Neural Networks
Convolutional Networks
CS6890 Deep Learning Weizhen Cai
Machine Learning: The Connectionist
R-CNN region By Ilia Iofedov 11/11/2018 BGU, DNN course 2016.
Non-linear classifiers Neural networks
Dynamic Routing Using Inter Capsule Routing Protocol Between Capsules
Deep Learning Convoluted Neural Networks Part 2 11/13/
Introduction to Deep Learning for neuronal data analyses
Computer Vision James Hays
Introduction to Neural Networks
Tensorflow in Deep Learning
CSC 578 Neural Networks and Deep Learning
Counting in Dense Crowds using Deep Learning
Introduction to Deep Learning with Keras
Deep learning Introduction Classes of Deep Learning Networks
Very Deep Convolutional Networks for Large-Scale Image Recognition
Smart Robots, Drones, IoT
network of simple neuron-like computing elements
CSC 578 Neural Networks and Deep Learning
Creating Data Representations
Faster R-CNN By Anthony Martinez.
Age and Gender Classification using Convolutional Neural Networks
On Convolutional Neural Network
Lecture: Deep Convolutional Neural Networks
Computer Vision Basics
Forward and Backward Max Pooling
Analysis of Trained CNN (Receptive Field & Weights of Network)
RCNN, Fast-RCNN, Faster-RCNN
Convolutional Neural Networks
Deep Learning Some slides are from Prof. Andrew Ng of Stanford.
Mihir Patel and Nikhil Sardana
Convolutional Neural Network
CSCI 5922 Neural Networks and Deep Learning: Convolutional Nets For Image And Speech Processing Mike Mozer Department of Computer Science and Institute.
Face Recognition: A Convolutional Neural Network Approach
CSC 578 Neural Networks and Deep Learning
CS295: Modern Systems: Application Case Study Neural Network Accelerator Sang-Woo Jun Spring 2019 Many slides adapted from Hyoukjun Kwon‘s Gatech “Designing.
VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION
Image recognition.
Debasis Bhattacharya, JD, DBA University of Hawaii Maui College
End-to-End Facial Alignment and Recognition
Example of training and deployment of deep convolutional neural networks. Example of training and deployment of deep convolutional neural networks. During.
CSC 578 Neural Networks and Deep Learning
CSC 578 Neural Networks and Deep Learning
Prabhas Chongstitvatana Chulalongkorn University
Presentation transcript:

Lecture 5 Smaller Network: CNN We know it is good to learn a small model. From this fully connected model, do we really need all the edges? Can some of these be shared?

Consider learning an image: Some patterns are much smaller than the whole image Can represent a small region with fewer parameters “beak” detector

Same pattern appears in different places: They can be compressed Same pattern appears in different places: They can be compressed! What about training a lot of such “small” detectors and each detector must “move around”. “upper-left beak” detector They can be compressed to the same parameters. “middle beak” detector

A convolutional layer A CNN is a neural network with some convolutional layers (and some other layers). A convolutional layer has a number of filters that does convolutional operation. Beak detector A filter

Convolution …… These are the network parameters to be learned. 1 -1 1 Filter 1 -1 1 Filter 2 …… 6 x 6 image Each filter detects a small pattern (3 x 3).

Convolution 1 -1 Filter 1 stride=1 1 Dot product 3 -1 6 x 6 image

Convolution 1 -1 Filter 1 If stride=2 1 3 -3 6 x 6 image

Convolution 1 -1 Filter 1 stride=1 1 3 -1 -3 -1 -3 1 -3 -3 -3 1 3 -2 3 -1 -3 -1 -3 1 -3 -3 -3 1 3 -2 -2 -1 6 x 6 image

Convolution Repeat this for each filter Feature Map -1 1 Filter 2 stride=1 Repeat this for each filter 1 3 -1 -3 -1 -1 -1 -1 -1 -3 1 -3 -1 -1 -2 1 Feature Map -3 -3 1 -1 -1 -2 1 3 -2 -2 -1 6 x 6 image -1 -4 3 Two 4 x 4 images Forming 2 x 4 x 4 matrix

Color image: RGB 3 channels 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 Filter 1 Filter 2 Color image 1 1 1

Convolution v.s. Fully Connected 1 1 -1 -1 1 convolution image 1 Fully-connected …… ……

… … fewer parameters! … 1 1 -1 1 Filter 1 2 3 3 4: 1 8 1 9 10: 13 3 3 4: 1 … 8 1 9 10: … 13 6 x 6 image 14 fewer parameters! Only connect to 9 inputs, not fully connected 15 1 16 1 …

… … … 1: 1 -1 1 2: Filter 1 3: 3 4: 1 7: 8: 1 -1 9: 10: 13: 3: 3 4: 1 … 7: 8: 1 -1 9: 10: … 13: 6 x 6 image 14: Fewer parameters 15: 1 16: Shared weights Even fewer parameters 1 …

Fully Connected Feedforward network The whole CNN cat dog …… Convolution Fully Connected Feedforward network Max Pooling Can repeat many times Convolution Max Pooling Flattened

Max Pooling 1 -1 -1 1 Filter 1 Filter 2 3 -1 -3 -1 -1 -1 -1 -1 -3 1 -3 -3 -1 -1 -2 1 -3 -3 1 -1 -1 -2 1 3 -2 -2 -1 -1 -4 3

Why Pooling Subsampling pixels will not change the object bird bird We can subsample the pixels to make image smaller fewer parameters to characterize the image

A CNN compresses a fully connected network in two ways: Reducing number of connections Shared weights on the edges Max pooling further reduces the complexity

Max Pooling New image but smaller Conv Max Pooling Each filter 1 Conv 3 -1 1 Max Pooling 3 1 3 2 x 2 image 6 x 6 image Each filter is a channel

The whole CNN Smaller than the original image 3 1 -1 Convolution Max Pooling Can repeat many times A new image Convolution Smaller than the original image Max Pooling The number of channels is the number of filters

Fully Connected Feedforward network The whole CNN cat dog …… Convolution Fully Connected Feedforward network Max Pooling A new image Convolution Max Pooling A new image Flattened

Fully Connected Feedforward network 3 Flattening 1 3 1 -1 Fully Connected Feedforward network 3 -1 Flattened 1 3

CNN in Keras …… input There are 25 3x3 filters. Only modified the network structure and input format (vector -> 3-D tensor) CNN in Keras input Convolution 1 -1 -1 1 There are 25 3x3 filters. …… Max Pooling Input_shape = ( 28 , 28 , 1) 28 x 28 pixels Convolution 1: black/white, 3: RGB 3 -1 3 Max Pooling -3 1

Only modified the network structure and input format (vector -> 3-D array) CNN in Keras Input 1 x 28 x 28 Convolution How many parameters for each filter? 9 25 x 26 x 26 Max Pooling 25 x 13 x 13 Convolution How many parameters for each filter? 225= 25x9 50 x 11 x 11 Max Pooling 50 x 5 x 5

Fully connected feedforward network Only modified the network structure and input format (vector -> 3-D array) CNN in Keras Input 1 x 28 x 28 Output Convolution Fully connected feedforward network 25 x 26 x 26 Max Pooling 25 x 13 x 13 Convolution 50 x 11 x 11 Max Pooling 1250 50 x 5 x 5 Flattened

AlphaGo Neural Network 19 x 19 matrix (19 x 19 positions) Next move 19 x 19 matrix Fully-connected feedforward network can be used Black: 1 white: -1 none: 0 But CNN performs much better

AlphaGo’s policy network The following is quotation from their Nature article: Note: AlphaGo does not use Max Pooling.

CNN in speech recognition The filters move in the frequency direction. CNN Frequency Image Time Spectrogram

CNN in text classification ? Source of image: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.703.6858&rep=rep1&type=pdf