SlideShare a Scribd company logo
ⓒ 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.
1. INTRODUCTION
ⓒ 2016	UEC	Tokyo.
• Deep Learning	achieved	remarkable	progress
– E.g.	Audio	Recognition,	Natural	Language	Processing,
• Especially,	in	Image	Recognition, Deep	Learning	gave	
the	best	performance
– Outperform	even	humans	such	as	recognition	of	1000	
object(He+,	Delving	deep	into	rectifier,	2015)
Deep	Learning(DNN,DCNN,CNN)
0
20
40
60
80
100
2010 2011				2012				2013				2014					2015				Human
Trained
72% 75%
85% 88.3% 93.3% 96.4% 94.9%
SIFT+BOF
Deep	Learning
Deeeeeeeep
Outperform	
Human	!
ⓒ 2016	UEC	Tokyo.
• Many	Deep	Learning	Framework	have	emerged
– E.g.	Caffe,	TensorFlow,	Chainer
Deep	Learning	Framework
ⓒ 2016	UEC	Tokyo.
Convolution	Architecture	For	Feature	Extraction(CAFFE)
Open	Framework,	models	and	examples	for	Deep	Learning
• Focus	on	Compuer Vision
• Pure	C++/CUDA	architecture	for	deep	learning
• Command	line,	Python	MATLAB	interface
• Fastest	processing	speed
• Caffe	is	the	most	popular	framework	in	the	world
What	is	Caffe?
ⓒ 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
High	Computational	Power	and	Memory are	Bottleneck!!
ⓒ 2016	UEC	Tokyo.
Files
• 3 files	are	required	for	Training	->	Output:	Model
– 3 files:	Network	definition,	Mean,	Label
How	to	train	a	model	by	caffe?
Training
・Network
・Mean
・Label
3	files
Dataset
Output
・Caffemodel
Use	these	4 files
on	mobile
ⓒ 2016	UEC	Tokyo.
• We	currently	need	to	use	OpenCV DNN	module
– not	optimized	for	the	mobile	devices
– their	execution	speed	is	relatively	slow
Use	the	4	Files	
by	Caffe	on	the	Mobile
・Network
・Mean
・Label
・Model
4	files
ⓒ 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	
image	recognition	apps	on	iOS.
Objective
ⓒ 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	
image	recognition	apps	on	iOS.
Contributions
ⓒ 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.
Deployment	Procedure
1. Train	Deep	CNN	model	by	Caffe
2. Prepare	model	files
3. Generate	a	C	source	code	by	Caffe2C automatically
4. Implement	C	code	on	mobile	with	GUI	code	
Trained	Deep	
CNN	Model
Deep	CNN
Train	Phase
1
・Caffemodel
・Network
・Mean
・Label
Model	
Preparation
2
Convert	
C	code
3
Caffe2C
Implement	
on	Mobile
4
ⓒ 2016	UEC	Tokyo.
• We	implemented	apply	our	mobile	framework	into	
real-time	CNN-based	mobile	image	processing
– such	as	Neural	Style	Transfer	
Additional work
ⓒ 2016	UEC	Tokyo.
Thank	you	for	listening
Object Recognition
Neural Style Transfer
iOS App is Available !
“DeepFoodCam“
iOS App is Available !
“RealTimeMultiStyleTransfer”

More Related Content

PDF
"Making OpenCV Code Run Fast," a Presentation from Intel
PDF
Introduction to OpenCL, 2010
PDF
OpenCL - The Open Standard for Heterogeneous Parallel Programming
PDF
OpenCL Programming 101
PDF
Introduction to OpenVX
PDF
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
PDF
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
PDF
An Overview of the IHK/McKernel Multi-kernel Operating System
"Making OpenCV Code Run Fast," a Presentation from Intel
Introduction to OpenCL, 2010
OpenCL - The Open Standard for Heterogeneous Parallel Programming
OpenCL Programming 101
Introduction to OpenVX
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
An Overview of the IHK/McKernel Multi-kernel Operating System

What's hot (20)

PDF
"Portable Performance via the OpenVX Computer Vision Library: Case Studies," ...
PPTX
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
PDF
Startup Containers in Lightning Speed with Lazy Image Distribution
PDF
DockerとKubernetesをかけめぐる
PDF
Kernel Recipes 2014 - kGraft: Live Patching of the Linux Kernel
PDF
P2P Container Image Distribution on IPFS With containerd and nerdctl
PDF
180 nm Tape out experience using Open POWER ISA
PDF
Stargz Snapshotter: イメージのpullを省略しcontainerdでコンテナを高速に起動する
PDF
Concurrency and Python - PyCon MY 2015
PDF
containerdの概要と最近の機能
PDF
The overview of lazypull with containerd Remote Snapshotter & Stargz Snapshotter
PPTX
Trends of SW Platforms for Heterogeneous Multi-core systems and Open Source ...
PDF
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
PDF
JCConf 2020 - New Java Features Released in 2020
PPTX
Tackling non-determinism in Hadoop - Testing and debugging distributed system...
PPTX
SDAccel Design Contest: SDAccel and F1 Instances
PDF
SDAccel Design Contest: Vivado HLS
PPTX
Kernel Proc Connector and Containers
PDF
HCQC : HPC Compiler Quality Checker
PDF
BuildKitでLazy Pullを有効にしてビルドを早くする話
"Portable Performance via the OpenVX Computer Vision Library: Case Studies," ...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
Startup Containers in Lightning Speed with Lazy Image Distribution
DockerとKubernetesをかけめぐる
Kernel Recipes 2014 - kGraft: Live Patching of the Linux Kernel
P2P Container Image Distribution on IPFS With containerd and nerdctl
180 nm Tape out experience using Open POWER ISA
Stargz Snapshotter: イメージのpullを省略しcontainerdでコンテナを高速に起動する
Concurrency and Python - PyCon MY 2015
containerdの概要と最近の機能
The overview of lazypull with containerd Remote Snapshotter & Stargz Snapshotter
Trends of SW Platforms for Heterogeneous Multi-core systems and Open Source ...
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
JCConf 2020 - New Java Features Released in 2020
Tackling non-determinism in Hadoop - Testing and debugging distributed system...
SDAccel Design Contest: SDAccel and F1 Instances
SDAccel Design Contest: Vivado HLS
Kernel Proc Connector and Containers
HCQC : HPC Compiler Quality Checker
BuildKitでLazy Pullを有効にしてビルドを早くする話
Ad

Similar to OpenCV DNN module vs. Ours method (20)

PDF
Caffe2C: A Framework for Easy Implementation of CNN-based Mobile Applications
PDF
Deep Learning on the Mobile Devices
PDF
Automated Podcasting System for Universities
PPTX
t.pptx is a ppt for DDS and software applications
ZIP
PPTX
DIY Deep Learning with Caffe Workshop
PPTX
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
PDF
Introducing TensorFlow: The game changer in building "intelligent" applications
PDF
34th.余凯.机器学习进展及语音图像中的应用
PPT
CloudEngine at Dev8D 2011
PDF
H2O Deep Water - Making Deep Learning Accessible to Everyone
PPTX
Deep learning takes on Signal Processing
PPTX
The deep learning tour - Q1 2017
PPTX
Amazon Deep Learning
PPT
Lectures On Demand: delivering traditional lectures over the web
PDF
Class Intro.: Software Design
PDF
Understanding Deep Learning
PDF
Deep Learning Cases: Text and Image Processing
PDF
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
PDF
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
Caffe2C: A Framework for Easy Implementation of CNN-based Mobile Applications
Deep Learning on the Mobile Devices
Automated Podcasting System for Universities
t.pptx is a ppt for DDS and software applications
DIY Deep Learning with Caffe Workshop
BEST IMAGE PROCESSING TOOLS TO EXPECT in 2023 – Tutors India
Introducing TensorFlow: The game changer in building "intelligent" applications
34th.余凯.机器学习进展及语音图像中的应用
CloudEngine at Dev8D 2011
H2O Deep Water - Making Deep Learning Accessible to Everyone
Deep learning takes on Signal Processing
The deep learning tour - Q1 2017
Amazon Deep Learning
Lectures On Demand: delivering traditional lectures over the web
Class Intro.: Software Design
Understanding Deep Learning
Deep Learning Cases: Text and Image Processing
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
Ad

More from Ryosuke Tanno (15)

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

Recently uploaded (20)

PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PPTX
ECG_Course_Presentation د.محمد صقران ppt
PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PPTX
INTRODUCTION TO EVS | Concept of sustainability
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PPTX
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
PPTX
Introduction to Cardiovascular system_structure and functions-1
PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
DOCX
Viruses (History, structure and composition, classification, Bacteriophage Re...
PDF
Sciences of Europe No 170 (2025)
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
PPTX
BIOMOLECULES PPT........................
PPTX
Cell Membrane: Structure, Composition & Functions
PDF
. Radiology Case Scenariosssssssssssssss
PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PDF
The scientific heritage No 166 (166) (2025)
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
ECG_Course_Presentation د.محمد صقران ppt
The KM-GBF monitoring framework – status & key messages.pptx
INTRODUCTION TO EVS | Concept of sustainability
POSITIONING IN OPERATION THEATRE ROOM.ppt
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
Introduction to Cardiovascular system_structure and functions-1
Classification Systems_TAXONOMY_SCIENCE8.pptx
Viruses (History, structure and composition, classification, Bacteriophage Re...
Sciences of Europe No 170 (2025)
Introduction to Fisheries Biotechnology_Lesson 1.pptx
BIOMOLECULES PPT........................
Cell Membrane: Structure, Composition & Functions
. Radiology Case Scenariosssssssssssssss
TOTAL hIP ARTHROPLASTY Presentation.pptx
7. General Toxicologyfor clinical phrmacy.pptx
The scientific heritage No 166 (166) (2025)
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...

OpenCV DNN module vs. Ours method