SlideShare a Scribd company logo
1 of 17
Download to read offline
2016 UEC Tokyo.
Deep Learning on the Mobile Devices
Ryosuke Tanno and Keiji Yanai
Department of Informatics,
The University of Electro-Communications,
Tokyo, Japan
ⓒ 2016 UEC Tokyo.
1. INTRODUCTION
ⓒ 2016 UEC Tokyo.
• There are many attempts to archive CNN on the
mobile
– Require a high computational power and memory
Bring to CNN to Mobile
CNN into mobile !
High Computational Power and Memory are Bottleneck!!
ⓒ 2016 UEC Tokyo.
• We create a Caffe2C which converts the CNN model
definition files and the parameter files trained by
Caffe to a single C language code that can run on
mobile devices
• Caffe2C makes it easy to use deep learning on the C
language operating environment
• Caffe2C achieves faster runtime in comparison to
the existing OpenCV DNN module
Objective
Network
Mean
Label
Model
4 files
Caffe2C
Single C code
ⓒ 2016 UEC Tokyo.
• In order to demonstrate the utilization of the Caffe2C,
we have implemented 4 kinds of mobile CNN-based
apps on iOS.
Objective
ⓒ 2016 UEC Tokyo.
2. CONSTRUCTION OF CNN-
BASED MOBILE RECOGNITION
SYSTEM
ⓒ 2016 UEC Tokyo.
• In order to use the learned parameters by Caffe on
mobile devices, it is necessary to currently use the
OpenCV DNN module not optimized, relatively slow
• We create a Caffe2C which converts the CNN model
definition files and the parameter files trained by Caffe
to a single C language code
– We can use parameter files trained by Caffe on mobile devices
Caffe2C
ⓒ 2016 UEC Tokyo.
• Caffe2C achieves faster execution speed in comparison
to the existing OpenCV DNN module
Caffe2C
Caffe2C OpenCV DNN
AlexNet
iPhone 7 Plus 106.9 1663.8
iPad Pro 141.5 1900.1
iPhone SE 141.5 2239.8
Runtime[ms] Caffe2C vs. OpenCV DNN(Input size: 227x227)
Speedup Rate:
About 15X
ⓒ 2016 UEC Tokyo.
1. Caffe2C directly converts the Deep Neural Network to
a C source code
Reasons for Fast Execution
Caffe2C
OpenCV DNN
Network
Mean
Label
Model
Caffe2C
Single C code
Execution
like Compiler
Execution
like Interpreter
ⓒ 2016 UEC Tokyo.
2. Caffe2C performs the pre-processing of the CNN as
much as possible to reduce the amount of online
computation
– Compute batch normalization in advance for conv weight.
3. Caffe2C effectively uses NEON/BLAS by multi-threading
Reasons for Fast Execution
Network
Mean
Label
Model
4 files
Caffe2C
Single C code
ⓒ 2016 UEC Tokyo.
3. EXAMPLES OF MOBILE
APPLICATIONS
ⓒ 2016 UEC Tokyo.
• We have implemented 4 kinds of mobile CNN-based
apps on iOS
– Food recognition app: “DeepFoodCam”
– Neural Style Transfer app: “DeepStyleCam”
– Material Transfer app: “DeepMaterialCam”
– Text Inpaint app: “DeepTextInpaintCam”
4 iOS Applications
ⓒ 2016 UEC Tokyo.
DeepFoodCam
• Recognize 101 classes including 100 food classes and
one nonfood class
Training Phase
• fine-tuned the CNN with 101 class images
– totally 20,000 images
– UECFOOD-100 and non-food collected from Twitter
Target Top-1 Top-5
Food 101 class 74.5% 93.5%
Accuracy
ⓒ 2016 UEC Tokyo.
DeepStyleCam
• Neural Style Transfer
– Synthesize an image which has the style of a given style
image and the contents of a given content image using
Convolutional Neural Network
ⓒ 2016 UEC Tokyo.
DeepMaterialCam
• Translate an image from a source domain X to a
target domain Y in the absence of paired examples.
ⓒ 2016 UEC Tokyo.
1. We create a Caffe2C which converts the model
definition files and the parameter files of Caffe into
a single C code that can run on mobile devices
2. We explain the flow of construction of recognition
app using Caffe2C
3. We have implemented 4 kinds of mobile CNN-based
apps on iOS.
Conclusions
2016 UEC Tokyo.
Thank you for listening
iOS App is Available !
“DeepFoodCam“
iOS App is Available !
“DeepStyleCam”

More Related Content

Similar to Deep Learning on the Mobile Devices

Efficient Mobile Implementation ofA CNN-based Object Recogni.docx
Efficient Mobile Implementation ofA CNN-based Object Recogni.docxEfficient Mobile Implementation ofA CNN-based Object Recogni.docx
Efficient Mobile Implementation ofA CNN-based Object Recogni.docxtoltonkendal
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - IntroductionRakesh Jha
 
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...Daniel Krook
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
presentation describing NewsShorts an androif app design
presentation describing NewsShorts an androif app designpresentation describing NewsShorts an androif app design
presentation describing NewsShorts an androif app designAditya14359
 
Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introducing MQ Light - IBM Interconnect 2015 session AME4181Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introducing MQ Light - IBM Interconnect 2015 session AME4181Robert Nicholson
 
Hybrid Apps in a Snap
Hybrid Apps in a SnapHybrid Apps in a Snap
Hybrid Apps in a SnapPaulina Gallo
 
Rehosting apps between k8s clusters and automating deployment using crane
Rehosting apps between k8s clusters and automating deployment using craneRehosting apps between k8s clusters and automating deployment using crane
Rehosting apps between k8s clusters and automating deployment using craneKonveyor Community
 
Native development kit (ndk) introduction
Native development kit (ndk)  introductionNative development kit (ndk)  introduction
Native development kit (ndk) introductionRakesh Jha
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsJohn M. Wargo
 
Continous Integration.pptx
Continous Integration.pptxContinous Integration.pptx
Continous Integration.pptxAnuj Sharma
 

Similar to Deep Learning on the Mobile Devices (20)

Efficient Mobile Implementation ofA CNN-based Object Recogni.docx
Efficient Mobile Implementation ofA CNN-based Object Recogni.docxEfficient Mobile Implementation ofA CNN-based Object Recogni.docx
Efficient Mobile Implementation ofA CNN-based Object Recogni.docx
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Coca
CocaCoca
Coca
 
Android NDK
Android NDKAndroid NDK
Android NDK
 
Android ndk
Android ndkAndroid ndk
Android ndk
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - Introduction
 
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
presentation describing NewsShorts an androif app design
presentation describing NewsShorts an androif app designpresentation describing NewsShorts an androif app design
presentation describing NewsShorts an androif app design
 
Unit 2 Java
Unit 2 JavaUnit 2 Java
Unit 2 Java
 
Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introducing MQ Light - IBM Interconnect 2015 session AME4181Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introducing MQ Light - IBM Interconnect 2015 session AME4181
 
Hybrid Apps in a Snap
Hybrid Apps in a SnapHybrid Apps in a Snap
Hybrid Apps in a Snap
 
Carbon vs cocoa
Carbon vs cocoaCarbon vs cocoa
Carbon vs cocoa
 
Rehosting apps between k8s clusters and automating deployment using crane
Rehosting apps between k8s clusters and automating deployment using craneRehosting apps between k8s clusters and automating deployment using crane
Rehosting apps between k8s clusters and automating deployment using crane
 
Native development kit (ndk) introduction
Native development kit (ndk)  introductionNative development kit (ndk)  introduction
Native development kit (ndk) introduction
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
 
Andrew Resume
Andrew ResumeAndrew Resume
Andrew Resume
 
Mini Project- USB Temperature Logging
Mini Project- USB Temperature LoggingMini Project- USB Temperature Logging
Mini Project- USB Temperature Logging
 
Continous Integration.pptx
Continous Integration.pptxContinous Integration.pptx
Continous Integration.pptx
 

More from Ryosuke Tanno

【2017年度】勉強会資料_学習に関するテクニック
【2017年度】勉強会資料_学習に関するテクニック【2017年度】勉強会資料_学習に関するテクニック
【2017年度】勉強会資料_学習に関するテクニックRyosuke Tanno
 
【2016年度】勉強会資料_word2vec
【2016年度】勉強会資料_word2vec【2016年度】勉強会資料_word2vec
【2016年度】勉強会資料_word2vecRyosuke Tanno
 
【2016年度】勉強会資料_Chainer
【2016年度】勉強会資料_Chainer【2016年度】勉強会資料_Chainer
【2016年度】勉強会資料_ChainerRyosuke Tanno
 
ECCV2016, ACMMM2016参加報告
ECCV2016, ACMMM2016参加報告ECCV2016, ACMMM2016参加報告
ECCV2016, ACMMM2016参加報告Ryosuke Tanno
 
敵対的生成ネットワークによる食事画像の変換に関する研究
敵対的生成ネットワークによる食事画像の変換に関する研究敵対的生成ネットワークによる食事画像の変換に関する研究
敵対的生成ネットワークによる食事画像の変換に関する研究Ryosuke Tanno
 
深層学習ネットワークのモバイル実装
深層学習ネットワークのモバイル実装深層学習ネットワークのモバイル実装
深層学習ネットワークのモバイル実装Ryosuke Tanno
 
第三回勉強会 Keras担当回
第三回勉強会 Keras担当回第三回勉強会 Keras担当回
第三回勉強会 Keras担当回Ryosuke Tanno
 
複数スタイルの融合と 部分的適用を可能とする Multi-style Feed-forward Networkの提案
複数スタイルの融合と部分的適用を可能とするMulti-style Feed-forward Networkの提案複数スタイルの融合と部分的適用を可能とするMulti-style Feed-forward Networkの提案
複数スタイルの融合と 部分的適用を可能とする Multi-style Feed-forward Networkの提案Ryosuke Tanno
 
Conditional CycleGANによる食事画像変換
Conditional CycleGANによる食事画像変換Conditional CycleGANによる食事画像変換
Conditional CycleGANによる食事画像変換Ryosuke Tanno
 
モバイルOS上での深層学習による 画像認識システムの実装と比較分析
モバイルOS上での深層学習による 画像認識システムの実装と比較分析モバイルOS上での深層学習による 画像認識システムの実装と比較分析
モバイルOS上での深層学習による 画像認識システムの実装と比較分析Ryosuke Tanno
 
AR DeepCalorieCam: AR表示型食事カロリー量推定システム
AR DeepCalorieCam: AR表示型食事カロリー量推定システムAR DeepCalorieCam: AR表示型食事カロリー量推定システム
AR DeepCalorieCam: AR表示型食事カロリー量推定システムRyosuke Tanno
 
CoreMLによるiOS深層学習アプリの実装と性能分析
CoreMLによるiOS深層学習アプリの実装と性能分析CoreMLによるiOS深層学習アプリの実装と性能分析
CoreMLによるiOS深層学習アプリの実装と性能分析Ryosuke Tanno
 

More from Ryosuke Tanno (14)

【2017年度】勉強会資料_学習に関するテクニック
【2017年度】勉強会資料_学習に関するテクニック【2017年度】勉強会資料_学習に関するテクニック
【2017年度】勉強会資料_学習に関するテクニック
 
【2016年度】勉強会資料_word2vec
【2016年度】勉強会資料_word2vec【2016年度】勉強会資料_word2vec
【2016年度】勉強会資料_word2vec
 
【2016年度】勉強会資料_Chainer
【2016年度】勉強会資料_Chainer【2016年度】勉強会資料_Chainer
【2016年度】勉強会資料_Chainer
 
MMM2017参加報告
MMM2017参加報告MMM2017参加報告
MMM2017参加報告
 
ECCV2016, ACMMM2016参加報告
ECCV2016, ACMMM2016参加報告ECCV2016, ACMMM2016参加報告
ECCV2016, ACMMM2016参加報告
 
敵対的生成ネットワークによる食事画像の変換に関する研究
敵対的生成ネットワークによる食事画像の変換に関する研究敵対的生成ネットワークによる食事画像の変換に関する研究
敵対的生成ネットワークによる食事画像の変換に関する研究
 
深層学習ネットワークのモバイル実装
深層学習ネットワークのモバイル実装深層学習ネットワークのモバイル実装
深層学習ネットワークのモバイル実装
 
研究紹介
研究紹介研究紹介
研究紹介
 
第三回勉強会 Keras担当回
第三回勉強会 Keras担当回第三回勉強会 Keras担当回
第三回勉強会 Keras担当回
 
複数スタイルの融合と 部分的適用を可能とする Multi-style Feed-forward Networkの提案
複数スタイルの融合と部分的適用を可能とするMulti-style Feed-forward Networkの提案複数スタイルの融合と部分的適用を可能とするMulti-style Feed-forward Networkの提案
複数スタイルの融合と 部分的適用を可能とする Multi-style Feed-forward Networkの提案
 
Conditional CycleGANによる食事画像変換
Conditional CycleGANによる食事画像変換Conditional CycleGANによる食事画像変換
Conditional CycleGANによる食事画像変換
 
モバイルOS上での深層学習による 画像認識システムの実装と比較分析
モバイルOS上での深層学習による 画像認識システムの実装と比較分析モバイルOS上での深層学習による 画像認識システムの実装と比較分析
モバイルOS上での深層学習による 画像認識システムの実装と比較分析
 
AR DeepCalorieCam: AR表示型食事カロリー量推定システム
AR DeepCalorieCam: AR表示型食事カロリー量推定システムAR DeepCalorieCam: AR表示型食事カロリー量推定システム
AR DeepCalorieCam: AR表示型食事カロリー量推定システム
 
CoreMLによるiOS深層学習アプリの実装と性能分析
CoreMLによるiOS深層学習アプリの実装と性能分析CoreMLによるiOS深層学習アプリの実装と性能分析
CoreMLによるiOS深層学習アプリの実装と性能分析
 

Recently uploaded

Mobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationMobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationChandrakantDivate1
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesChandrakantDivate1
 
原版定制英国伦敦大学金史密斯学院毕业证原件一模一样
原版定制英国伦敦大学金史密斯学院毕业证原件一模一样原版定制英国伦敦大学金史密斯学院毕业证原件一模一样
原版定制英国伦敦大学金史密斯学院毕业证原件一模一样AS
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsChandrakantDivate1
 
Mobile App Penetration Testing Bsides312
Mobile App Penetration Testing Bsides312Mobile App Penetration Testing Bsides312
Mobile App Penetration Testing Bsides312wphillips114
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsChandrakantDivate1
 
Bromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pure
Bromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pureBromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pure
Bromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pureamy56318795
 
Abortion pills in Riyadh+966572737505 cytotec jeddah
Abortion pills in Riyadh+966572737505 cytotec jeddahAbortion pills in Riyadh+966572737505 cytotec jeddah
Abortion pills in Riyadh+966572737505 cytotec jeddahsamsungultra782445
 

Recently uploaded (9)

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Mobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationMobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android Installation
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
原版定制英国伦敦大学金史密斯学院毕业证原件一模一样
原版定制英国伦敦大学金史密斯学院毕业证原件一模一样原版定制英国伦敦大学金史密斯学院毕业证原件一模一样
原版定制英国伦敦大学金史密斯学院毕业证原件一模一样
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
Mobile App Penetration Testing Bsides312
Mobile App Penetration Testing Bsides312Mobile App Penetration Testing Bsides312
Mobile App Penetration Testing Bsides312
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Bromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pure
Bromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pureBromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pure
Bromazolam CAS 71368-80-4 high quality opiates, Safe transportation, 99% pure
 
Abortion pills in Riyadh+966572737505 cytotec jeddah
Abortion pills in Riyadh+966572737505 cytotec jeddahAbortion pills in Riyadh+966572737505 cytotec jeddah
Abortion pills in Riyadh+966572737505 cytotec jeddah
 

Deep Learning on the Mobile Devices

  • 1. 2016 UEC Tokyo. Deep Learning on the Mobile Devices Ryosuke Tanno and Keiji Yanai Department of Informatics, The University of Electro-Communications, Tokyo, Japan
  • 2. ⓒ 2016 UEC Tokyo. 1. INTRODUCTION
  • 3. ⓒ 2016 UEC Tokyo. • There are many attempts to archive CNN on the mobile – Require a high computational power and memory Bring to CNN to Mobile CNN into mobile ! High Computational Power and Memory are Bottleneck!!
  • 4. ⓒ 2016 UEC Tokyo. • We create a Caffe2C which converts the CNN model definition files and the parameter files trained by Caffe to a single C language code that can run on mobile devices • Caffe2C makes it easy to use deep learning on the C language operating environment • Caffe2C achieves faster runtime in comparison to the existing OpenCV DNN module Objective Network Mean Label Model 4 files Caffe2C Single C code
  • 5. ⓒ 2016 UEC Tokyo. • In order to demonstrate the utilization of the Caffe2C, we have implemented 4 kinds of mobile CNN-based apps on iOS. Objective
  • 6. ⓒ 2016 UEC Tokyo. 2. CONSTRUCTION OF CNN- BASED MOBILE RECOGNITION SYSTEM
  • 7. ⓒ 2016 UEC Tokyo. • In order to use the learned parameters by Caffe on mobile devices, it is necessary to currently use the OpenCV DNN module not optimized, relatively slow • We create a Caffe2C which converts the CNN model definition files and the parameter files trained by Caffe to a single C language code – We can use parameter files trained by Caffe on mobile devices Caffe2C
  • 8. ⓒ 2016 UEC Tokyo. • Caffe2C achieves faster execution speed in comparison to the existing OpenCV DNN module Caffe2C Caffe2C OpenCV DNN AlexNet iPhone 7 Plus 106.9 1663.8 iPad Pro 141.5 1900.1 iPhone SE 141.5 2239.8 Runtime[ms] Caffe2C vs. OpenCV DNN(Input size: 227x227) Speedup Rate: About 15X
  • 9. ⓒ 2016 UEC Tokyo. 1. Caffe2C directly converts the Deep Neural Network to a C source code Reasons for Fast Execution Caffe2C OpenCV DNN Network Mean Label Model Caffe2C Single C code Execution like Compiler Execution like Interpreter
  • 10. ⓒ 2016 UEC Tokyo. 2. Caffe2C performs the pre-processing of the CNN as much as possible to reduce the amount of online computation – Compute batch normalization in advance for conv weight. 3. Caffe2C effectively uses NEON/BLAS by multi-threading Reasons for Fast Execution Network Mean Label Model 4 files Caffe2C Single C code
  • 11. ⓒ 2016 UEC Tokyo. 3. EXAMPLES OF MOBILE APPLICATIONS
  • 12. ⓒ 2016 UEC Tokyo. • We have implemented 4 kinds of mobile CNN-based apps on iOS – Food recognition app: “DeepFoodCam” – Neural Style Transfer app: “DeepStyleCam” – Material Transfer app: “DeepMaterialCam” – Text Inpaint app: “DeepTextInpaintCam” 4 iOS Applications
  • 13. ⓒ 2016 UEC Tokyo. DeepFoodCam • Recognize 101 classes including 100 food classes and one nonfood class Training Phase • fine-tuned the CNN with 101 class images – totally 20,000 images – UECFOOD-100 and non-food collected from Twitter Target Top-1 Top-5 Food 101 class 74.5% 93.5% Accuracy
  • 14. ⓒ 2016 UEC Tokyo. DeepStyleCam • Neural Style Transfer – Synthesize an image which has the style of a given style image and the contents of a given content image using Convolutional Neural Network
  • 15. ⓒ 2016 UEC Tokyo. DeepMaterialCam • Translate an image from a source domain X to a target domain Y in the absence of paired examples.
  • 16. ⓒ 2016 UEC Tokyo. 1. We create a Caffe2C which converts the model definition files and the parameter files of Caffe into a single C code that can run on mobile devices 2. We explain the flow of construction of recognition app using Caffe2C 3. We have implemented 4 kinds of mobile CNN-based apps on iOS. Conclusions
  • 17. 2016 UEC Tokyo. Thank you for listening iOS App is Available ! “DeepFoodCam“ iOS App is Available ! “DeepStyleCam”