Is Bigger CNN Better? Samer Hijazi on behalf of IPG CTO Group Embedded Neural Networks Summit (enns2016) San Jose Feb. 9th
Today s Story Why does CNN matter to the embedded world? How to enable CNN in embedded devices? Complexity vs. performance tradeoff? Concluding thoughts 2 2016 Cadence Design Systems, Inc. All rights reserved.
Why does CNN matter to the embedded world?
What is the semiconductor industry asking for? We are trying to motivate bridging the gap between academic developments and the semiconductor industry needs 4 2016 Cadence Design Systems, Inc. All rights reserved.
CNN is growing fast Today s deep learning industry motto is Bigger is Better Net name Layers Parameters MAC LeNet-5 for MNIST (1998) 7 58,996 77,484 M ImageNet (2012) 8 60 M 1.1 G Deepface (2014) 8 >120 M 1.4 G Ensemble CNN(2014) 16x20 23 M 1.4 G FaceNet (2014) 22 140 M 1.6 G VGG for face (2015) 37 29.7 M 15.5 G Embedded devices power, price, and form-factor requirements can not accommodate this trend Dr. Stephen Hicks, Nuffield Department of Clinical Neurosciences, University of Oxford 5 2016 Cadence Design Systems, Inc. All rights reserved.
Complexity vs Performance Performance Cloud Budget Target recognition rate Current Industry Trend Complexity 6 2016 Cadence Design Systems, Inc. All rights reserved. Embedded Device Budget
Methodology Step 1. Train a network to your heart s desire Use the tool/programming language you are most familiar with (e.g., caffe, tensor flow, matcovnet, theano, CNTK, torch, ) Step 2. Iteratively reduce the key parameters Utilize: Statistics Linear algebra Use the validation set as guidance for convergence 7 2016 Cadence Design Systems, Inc. All rights reserved.
Balancing performance and complexity
How to do it? Reducing number of feature maps AlexNet has up to 384 feature maps. Reducing network depth Oxford VGG face recognition network has 37 layers. Divide and Conquer Do we need them all? Are they all equally important? How many classes should a single network handle? What can a single device see? 9 2016 Cadence Design Systems, Inc. All rights reserved.
Feature Map Reduction
Feature Maps Number of Feature Maps = Number of 3-D filters These filters are highly correlated. Input feature maps/images Output feature maps Feature Map Feature Map Convolutional Layer 11 2016 Cadence Design Systems, Inc. All rights reserved.
Redundancies in Filter Weights Q: How many filters do we need? A: How many independent filters can we really have? Back to linear algebra 101 12 2016 Cadence Design Systems, Inc. All rights reserved.
Linear Algebra 101 The space spanned by a vector of size N is referred to as N - dimensional space v3 c 3 a i Any vector in this space can be expressed as a linear combination of the basis of the space v2 c 2 c 1 v1 It can be shown that there is only N independent basis in the space a i = j=1 N c j v j 13 2016 Cadence Design Systems, Inc. All rights reserved.
Linear Algebra 101 (cont d) Q: How to find v j s? A: SVD (Singular Value Decomposition) M N M M N N N M 0 A U Σ V T A = UΣ V T 14 2016 Cadence Design Systems, Inc. All rights reserved.
Eigen-basis Size Reduction for the Convolutional Filters The i-th convolutional layer C i is of size L i W i H i K i L i, W i, H i : 3D filter size K i : number of feature maps Form the filter coefficients into an matrix A of size M K i Apply SVD decomposition: A = UΣ V T Use the M dominating basis (associated with the M largest singular vales) to initialize the filter at C i Size Reduction 15 2016 Cadence Design Systems, Inc. All rights reserved.
Results Analysis Traffic Sign Recognition German Traffic Sign Recognition Benchmark (GTSRB) 51840 images of German road signs in 43 classes Size of Images varies between 15x15 to 222x193 Images grouped by Class and Track with atleast 30 images per track. Images available as Color Images (RGB), HOG features, Haar features and Color Histograms. 16 2016 Cadence Design Systems, Inc. All rights reserved.
Results Analysis Traffic Sign Recognition (Cont d) Performance(% Correct Detection) 99.9% 99.7% 99.5% 99.3% 99.1% 98.9% GTSRB Best result achieved by HCNN Baseline (LeNet) Best prev. result Eliminating the redundancy in the coefficients Improve training efficiency and performance simultaneously control performance degradation as a function of complexity reduction 98.7% 1,000,000 10,000,000 100,000,000 1,000,000,000 Complexity (MACs per Frame) Log-scale 17 2016 Cadence Design Systems, Inc. All rights reserved.
Results Analysis Handwriting Recognition The database is provided by Mixed National Institute of Standards and Technology (MNIST) 60,000 training images and 10,000 testing images Black and white images Size normalized to fit in a 20 by 20 pixel box Centered in a 28 by 28 field 18 2016 Cadence Design Systems, Inc. All rights reserved.
Results Analysis Handwriting Recognition (Cont d) Performance (% Correction Detection) 99.20% 99.15% 99.10% 99.05% 99.00% 98.95% MNIST 98.90% 300000 3000000 Complexity (MACs per frame) Log-scale Baseline (LeNet-5) Eliminating the redundancy in the coefficients Improve training efficiency and performance simultaneously control performance degradation as a function of complexity reduction 19 2016 Cadence Design Systems, Inc. All rights reserved.
Network Depth Reduction
Network Depth Q1: Are all layers equally important? Q2: How to utilize the difference among layers importance to reduce complexity? 21 2016 Cadence Design Systems, Inc. All rights reserved.
Are all layers equally important? Define a metric to measure the amount of refinement each layer can contribute. C1 C2 C3 C4 C5 input C6 pool relu relu pool relu pool relu relu dropout Level Quality Metric C5 C1 C2 C3 C4 22 2016 Cadence Design Systems, Inc. All rights reserved.
How to use the layer quality (LQ) metric? Eliminate low LQ layers and distribute their functionality over the entire network. C1 C2 C3 C4 C5 input C6 pool relu relu pool relu pool relu relu dropout 23 2016 Cadence Design Systems, Inc. All rights reserved.
How to use the layer quality (LQ) metric? Eliminate low LQ layers and distribute their functionality over the entire network. This can be tricky due to the nonlinear components of the network. C1 C2 C4 C5 input C6 pool relu pool relu pool relu relu dropout An alternative way to use LQ metric is to allocate the computational resources based on LQ 24 2016 Cadence Design Systems, Inc. All rights reserved.
Divide and Conquer Presenter Name and Title (Arial 16pt) Event Name Location Date
What is this? An animal? Wolf? 26 2016 Cadence Design Systems, Inc. All rights reserved.
What is this? An animal? Wolf? Cute Wolf? 27 2016 Cadence Design Systems, Inc. All rights reserved.
What is this? Barking Husky Howling Wolf 28 2016 Cadence Design Systems, Inc. All rights reserved.
Hierarchical Recognition Concept Not all images are equally hard to recognize Dynamically allocate resources based on the problem difficulty. Let CNN automate the partitioning process. 29 2016 Cadence Design Systems, Inc. All rights reserved.
GTSRB Ideal Traffic Sign Speed Limit Signs Other Prohibitory Signs Derestriction Signs Mandatory Signs Other Prohibitory Signs 30 2016 Cadence Design Systems, Inc. All rights reserved.
Hierarchical-CNN for TSR MC-CNN 1 FC-CNN MC-CNN 2 Level-1: Family Classifier CNN (FC-CNN) Level-2: Member Classifier CNN (MC-CNN)... MC-CNN 5 Using hierarchical CNN we are able to dynamically allocate resources in accordance with the problem difficulty The CNN-oriented family clustering method groups signs into subsets that is more preferable than the pre-defined subset for a CNN classifier. Family 1 Decision Decision Decision Family 2 5+1 different CNNs for classification, each has lower complexity than one-vs-all classifier Family 3 Family 4 Family 5 31 2016 Cadence Design Systems, Inc. All rights reserved.
Results CCR% Team Method 99.82 Cadence HCNN + color 99.65 Tsinghua Hinge Loss Trained CNN 99.46 IDSIA Committee of CNNs 99.30 Cadence Modified UYN 99.22 INI-RTCV Human (best individual) 99.17 Sermanet (UNY) Updated multi-scale CNN 98.84 INI-RTCV Human (average) 98.31 Sermanet (UNY) Multi-scale CNN 96.14 CAOR) Random Forest 95.68 INI-RTCV LDA (HOG 2) 32 2016 Cadence Design Systems, Inc. All rights reserved.
Alternative Network Architecture Hierarchical decision process can be incorporated in the network training if we allow gradual decision after each layer Input Conv Pooling ReLU Conv Pooling ReLU Fully Connected 33 2016 Cadence Design Systems, Inc. All rights reserved.
Closing Thoughts
What is the semiconductor industry asking for? We are trying to motivate bridging the gap between academic developments and the semiconductor industry needs 35 2016 Cadence Design Systems, Inc. All rights reserved.
See you in Vegas! The premier summer conference for the computer vision community Computer Vision Pattern Recognition (CVPR2016) will be held in Vegas from June 27-30. Cadence will be offering a tutorial on low complexity recognition SoCs. Embedded CNN Local vs Cloud Compute, why and why not? Complexity Reduction Techniques 36 2016 Cadence Design Systems, Inc. All rights reserved.