SlideShare a Scribd company logo
NumPyCNNAndroid: A Library for Straightforward
Implementation of Convolutional Neural
Networks for Android Devices
Menoufia University
Faculty of Computers and Information
Information Technology Department
By
Ahmed Fawzy Gad
International Conference on Innovative Trends in Computer Engineering (ITCE’2019)
Index
2
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Index
3
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Introduction
4
Machine
Learning
Algorithm
Data
Trained
Model
Feature Engineering
Data Scientist Data Analysis Features
Introduction
▰ Working with huge amounts of data makes it challenging to
decide what are the suitable features for use.
▰ A dataset such as ImageNet contains millions of images
distributed across thousands of classes.
5
Convolutional Neural Network (CNN)
▰ The problem with the deep learning architectures is being time
consuming and require high processing power.
Introduction
▰ There are some already existing libraries for building deep learning
models such as TensorFlow, Keras, Theano, Caffe, and others.
▰ These libraries are normally available for desktop computers due to
the availability of both memory and processing power.
▰ Working with mobile devices, there are 2 important issues.
6
Availability Efficiency
▰ This paper solves the availability issue by proposing a library called
NumPyCNNAndroid (NPCA) for building CNNs for Android devices.
Index
7
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Related Work
▰ A network architecture called MobileNets proposes the use of
depthwise separable convolution.
▰ In regular convolution, the 2 steps (filtering and combining) are done
in a single step. These steps are split in the dephwise separable
convolution. The first step is applying a pointwise convolution with
filter size equal to 1x1. Then another pointwise convolution for
combining the results.
8Howard, Andrew G., et al. "Mobilenets: Efficient convolutional neural networks for mobile vision applications."
arXiv preprint arXiv:1704.04861 (2017).
▰ MobileNets requires the creation of a new network architecture for
every application in order to be supported by the mobile devices.
Related Work
▰ A GPU-accelerated
library called
CNNdroid.
9Latifi Oskouei, Seyyed Salar, et al. "CNNdroid: GPU-accelerated execution of trained deep convolutional neural
networks on android." Proceedings of the 2016 ACM Conference on Multimedia. ACM, 2016.
Related Work
▰ Some of the exisiting libraries have some releases for supporting the
mobile devices. For example, there is a library called TensorFlow Lite
from TensorFlow. Also there is Caffe mobile from Caffe.
▰ Similar to CNNdroid, there must be an in-between step for converting
the original model into a format supported by the mobile devices.
10
Related Work
▰ Here is the summary of the model conversion in TensorFlow.
11
Prepare the TF Model.
Convert the TF Model to TF Lite Model
Create an Android Project
Import the TF Lite Model within the Project
Call the Model within Java Code
▰ In TF Lite, the developer uses multiple tools (Python, TOCO,
Android Studio, and Java)
Index
12
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Proposed Work
Advantages
▰ NPCA uses Python for its development which is one of the best tools
in data science.
▰ The same code, unchanged, is executed in all platforms due to the use
of a cross-platform library called Kivy.
▰ Faster deployment for the models of the mobile devices as there is no
in-between step to customize the model.
13
Index
14
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Proposed Work
Development Process
▰ The CNN can be trained on the mobile device but it is time-consuming
at least in the current version.
▰ The preferred way is to train the CNN in a desktop computer and then
use it on the mobile device.
15
Index
16
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Proposed Work
Supported Layers
▰ Convolution (conv)
▰ Rectified Linear Unit (relu)
▰ Max Pooling (maxpool)
▰ Average Pooling (avgpool)
▰ Fully Connected (fc)
17
GitHub – NumPyCNN
https://github.com/ahmedfgad/NumPyCNN
GitHub – NumPyCNNAndroid
https://github.com/ahmedfgad/NumPyCNNAndroid
Index
18
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Proposed Work
Example
19
Read Image - PIL
Index
20
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Validation
21
Index
22
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
Find NumPyCNNAndroid at Google Play
▰ To facilitate testing the library,
a free application named
NumPyCNNAndroid is
available at Google Play for
download.
▰ https://play.google.com/store/
apps/details?id=org.numpycnn.
numpycnn
23
Find NumPyCNNAndroid at Google Play
24
Index
25
• Introduction
• Related Work
• Proposed Library (NumPyCNNAndroid)
• Advantages
• Development Process
• Supported Layers
• Example
• Validation
• Find NumPyCNNAndroid at Google Play
• References
References
▰ Nanni, Loris, Stefano Ghidoni, and Sheryl Brahnam. "Handcrafted vs. non-handcrafted features for computer vision classification." Pattern
Recognition 71 (2017): 158-172.
▰ Russakovsky, Olga, et al. "Imagenet large scale visual recognition challenge." International Journal of Computer Vision 115.3 (2015): 211-252.
▰ Aghdam, Hamed Habibi, and Elnaz Jahani Heravi. Guide to Convolutional Neural Networks: A Practical Application to Traffic-Sign Detection and
Classification. Springer, 2017.
▰ Schmidhuber, Jürgen. "Deep learning in neural networks: An overview." Neural networks 61 (2015): 85-117.
▰ Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural
information processing systems. 2012.
▰ Simonyan, Karen, and Andrew Zisserman. "Very deep convolutional networks for large-scale image recognition." arXiv preprint arXiv:1409.1556
(2014).
▰ Szegedy, Christian, et al. "Going deeper with convolutions." Cvpr, 2015.
▰ Cai, Ermao, et al. "Neuralpower: Predict and deploy energy-efficient convolutional neural networks." arXiv preprint arXiv:1710.05420 (2017).
▰ Kim, Yong-Deok, et al. "Compression of deep convolutional neural networks for fast and low power mobile applications." arXiv preprint
arXiv:1511.06530 (2015).
▰ Latifi Oskouei, Seyyed Salar, et al. "CNNdroid: GPU-accelerated execution of trained deep convolutional neural networks on android." Proceedings of
the 2016 ACM Conference on Multimedia. ACM, 2016. https://github.com/ENCP/CNNdroid
26
References
▰ Abadi, Martín, et al. "TensorFlow: A System for Large-Scale Machine Learning." OSDI. Vol. 16. 2016.
▰ Jia, Yangqing, et al. "Caffe: Convolutional architecture for fast feature embedding." Proceedings of the 22nd ACM international conference on
Multimedia. ACM, 2014.
▰ Al-Rfou, Rami, et al. "Theano: A Python framework for fast computation of mathematical expressions." arXiv preprint arXiv:1605.02688 472 (2016):
473.
▰ Nicholson, A. Chris, and Adam Gibson. "Deeplearning4j: Open-source, Distributed Deep Learning for the JVM." https://Deeplearning4j.org (2017).
▰ Chen, Tianqi, et al. "MXNet: A flexible and efficient machine learning library for heterogeneous distributed systems." arXiv preprint arXiv:1512.01274
(2015).
▰ Chollet, François. "Keras: Deep learning library for Theano and TensorFlow." URL: https://keras.io/ (2015): 8.
▰ Torch: http://torch.ch/
▰ Wu, Jiaxiang, et al. "Quantized convolutional neural networks for mobile devices." Proceedings of the IEEE Conference on Computer Vision and
Pattern Recognition. 2016.
▰ Han, Song, Huizi Mao, and William J. Dally. "Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman
coding." arXiv preprint arXiv:1510.00149 (2015).
▰ Chen, Wenlin, et al. "Compressing neural networks with the hashing trick." International Conference on Machine Learning. 2015.
▰ Howard, Andrew G., et al. "Mobilenets: Efficient convolutional neural networks for mobile vision applications." arXiv preprint arXiv:1704.04861
(2017).
▰ Zhang, Xiangyu, et al. "Shufflenet: An extremely efficient convolutional neural network for mobile devices." arXiv preprint arXiv:1707.01083 (2017).
27
References
28
▰ TensorFlow Lite: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite.
▰ Caffe Android: https://github.com/sh1r0/caffe-android-lib.
▰ Torch Android: https://github.com/soumith/torch-android.
▰ python-for-android: https://github.com/kivy/python-for-android
▰ Virbel, Mathieu, Thomas E. Hansen, and Oleksandr Lobunets. "Kivy-A Framework for Rapid Creation of Innovative User Interfaces." Mensch &
Computer Workshopband. 2011.
▰ Walt, Stéfan van der, S. Chris Colbert, and Gael Varoquaux. "The NumPy array: a structure for efficient numerical computation." Computing in
Science & Engineering 13.2 (2011): 22-30.
▰ Python Imaging Library (PI) http://www.pythonware.com/products/pil
▰ Buildozer: https://github.com/kivy/buildozer
▰ NumPyCNN (NPC): https://github.com/ahmedfgad/NumPyCNN
▰ NumPyCNNAndroid (NPCA): https://github.com/ahmedfgad/NumPyCNNAndroid
▰ NumPyCNNAndroid (NPCA): https://play.google.com/store/apps/details?id=org.numpycnn.numpycnn
29
THANKS

More Related Content

PDF
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
PDF
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
PPTX
Beyond Counting: Comparisons of Density Maps for Crowd Analysis Tasks—Countin...
PPTX
A Proposed Framework for Robust Face Identification System
PDF
TOP 5 Most View Article From Academia in 2019
PDF
Satellite and Land Cover Image Classification using Deep Learning
PDF
Stereoscopic Display of Lung PET/CT DICOM Scans using Perspective
PDF
Learning Disentangled Representation for Robust Person Re-identification
ICCES 2017 - Crowd Density Estimation Method using Regression Analysis
M.Sc. Thesis - Automatic People Counting in Crowded Scenes
Beyond Counting: Comparisons of Density Maps for Crowd Analysis Tasks—Countin...
A Proposed Framework for Robust Face Identification System
TOP 5 Most View Article From Academia in 2019
Satellite and Land Cover Image Classification using Deep Learning
Stereoscopic Display of Lung PET/CT DICOM Scans using Perspective
Learning Disentangled Representation for Robust Person Re-identification

What's hot (19)

PPTX
GSU-RF-2013-Reddy-4
PDF
Deep learning for person re-identification
PDF
Recent articles published in Signal & Image Processing: An InternationalJourn...
PPTX
Single image haze removal
PPT
Applying Deep Learning with Weak and Noisy labels
PDF
PDF
October 202:top read articles in signal & image processing
PDF
IRJET- A Survey on Medical Image Interpretation for Predicting Pneumonia
PDF
MediaEval 2017 - Satellite Task: Flood detection using Social Media Data and ...
PDF
Development of a Location Invariant Crack Detection and Localisation Model (L...
PPTX
Leveraging Deep Learning Representation for search-based Image Annotation
PDF
Image Classification using Deep Learning
DOC
Word
PDF
11.0003www.iiste.org call for paper.survey on wireless intelligent video surv...
PDF
3.survey on wireless intelligent video surveillance system using moving objec...
PDF
New Research Articles 2019 October Issue Signal & Image Processing An Interna...
PPTX
Deep re-id: 关于行人重识别的深度学习方法
PDF
Big Data and AI for Covid-19
GSU-RF-2013-Reddy-4
Deep learning for person re-identification
Recent articles published in Signal & Image Processing: An InternationalJourn...
Single image haze removal
Applying Deep Learning with Weak and Noisy labels
October 202:top read articles in signal & image processing
IRJET- A Survey on Medical Image Interpretation for Predicting Pneumonia
MediaEval 2017 - Satellite Task: Flood detection using Social Media Data and ...
Development of a Location Invariant Crack Detection and Localisation Model (L...
Leveraging Deep Learning Representation for search-based Image Annotation
Image Classification using Deep Learning
Word
11.0003www.iiste.org call for paper.survey on wireless intelligent video surv...
3.survey on wireless intelligent video surveillance system using moving objec...
New Research Articles 2019 October Issue Signal & Image Processing An Interna...
Deep re-id: 关于行人重识别的深度学习方法
Big Data and AI for Covid-19
Ad

Similar to NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutional Neural Networks for Android Devices - ITCE 2019 (20)

PDF
open source nn frameworks on cellphones
PPTX
Squeezing Deep Learning Into Mobile Phones
PDF
Tensorflow on Android
PDF
Deep learning with C++ - an introduction to tiny-dnn
PPTX
Introduction to computer vision
PDF
“Introduction to Computer Vision with CNNs,” a Presentation from Mohammad Hag...
PDF
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
PPTX
Introduction to computer vision with Convoluted Neural Networks
PDF
IRJET- Python Libraries and Packages for Deep Learning-A Survey
PDF
ML in Android
PDF
Deep Learning libraries and first experiments with Theano
PPTX
Deep learning on mobile
PPTX
BRV CTO Summit Deep Learning Talk
PPTX
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
PDF
Efficient mobilenet architecture_as_image_recognit
PDF
Introduction to Convolutional Neural Networks
PDF
Deep Learning Applications and Image Processing
PPTX
Automatic Attendace using convolutional neural network Face Recognition
DOCX
Efficient Mobile Implementation ofA CNN-based Object Recogni.docx
PPTX
2018/03/28 Sony's deep learning software "Neural Network Libraries/Console“ a...
open source nn frameworks on cellphones
Squeezing Deep Learning Into Mobile Phones
Tensorflow on Android
Deep learning with C++ - an introduction to tiny-dnn
Introduction to computer vision
“Introduction to Computer Vision with CNNs,” a Presentation from Mohammad Hag...
"Large-Scale Deep Learning for Building Intelligent Computer Systems," a Keyn...
Introduction to computer vision with Convoluted Neural Networks
IRJET- Python Libraries and Packages for Deep Learning-A Survey
ML in Android
Deep Learning libraries and first experiments with Theano
Deep learning on mobile
BRV CTO Summit Deep Learning Talk
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
Efficient mobilenet architecture_as_image_recognit
Introduction to Convolutional Neural Networks
Deep Learning Applications and Image Processing
Automatic Attendace using convolutional neural network Face Recognition
Efficient Mobile Implementation ofA CNN-based Object Recogni.docx
2018/03/28 Sony's deep learning software "Neural Network Libraries/Console“ a...
Ad

More from Ahmed Gad (20)

PPTX
ICEIT'20 Cython for Speeding-up Genetic Algorithm
PDF
Python for Computer Vision - Revision 2nd Edition
PDF
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
PDF
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
PDF
Introduction to Optimization with Genetic Algorithm (GA)
PDF
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
PDF
Avoid Overfitting with Regularization
PDF
Genetic Algorithm (GA) Optimization - Step-by-Step Example
PDF
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
PDF
Computer Vision: Correlation, Convolution, and Gradient
PDF
Python for Computer Vision - Revision
PDF
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
PDF
Brief Introduction to Deep Learning + Solving XOR using ANNs
PDF
Operations in Digital Image Processing + Convolution by Example
PDF
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
PDF
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
PDF
Graduation Project - Face Login : A Robust Face Identification System for Sec...
PDF
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
PDF
Introduction to Digital Signal Processing (DSP) - Course Notes
PDF
AI Heuristic Search - Beam Search - Simulated Annealing
ICEIT'20 Cython for Speeding-up Genetic Algorithm
Python for Computer Vision - Revision 2nd Edition
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Introduction to Optimization with Genetic Algorithm (GA)
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Avoid Overfitting with Regularization
Genetic Algorithm (GA) Optimization - Step-by-Step Example
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Computer Vision: Correlation, Convolution, and Gradient
Python for Computer Vision - Revision
Anime Studio Pro 10 Tutorial as Part of Multimedia Course
Brief Introduction to Deep Learning + Solving XOR using ANNs
Operations in Digital Image Processing + Convolution by Example
MATLAB Code + Description : Real-Time Object Motion Detection and Tracking
MATLAB Code + Description : Very Simple Automatic English Optical Character R...
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to Digital Signal Processing (DSP) - Course Notes
AI Heuristic Search - Beam Search - Simulated Annealing

Recently uploaded (20)

PDF
Fluorescence-microscope_Botany_detailed content
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PPTX
CEE 2 REPORT G7.pptxbdbshjdgsgjgsjfiuhsd
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
PDF
Mega Projects Data Mega Projects Data
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
A Quantitative-WPS Office.pptx research study
PDF
Lecture1 pattern recognition............
PPTX
Moving the Public Sector (Government) to a Digital Adoption
PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Computer network topology notes for revision
Fluorescence-microscope_Botany_detailed content
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
CEE 2 REPORT G7.pptxbdbshjdgsgjgsjfiuhsd
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
Mega Projects Data Mega Projects Data
oil_refinery_comprehensive_20250804084928 (1).pptx
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
A Quantitative-WPS Office.pptx research study
Lecture1 pattern recognition............
Moving the Public Sector (Government) to a Digital Adoption
Reliability_Chapter_ presentation 1221.5784
Data_Analytics_and_PowerBI_Presentation.pptx
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
IB Computer Science - Internal Assessment.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Clinical guidelines as a resource for EBP(1).pdf
climate analysis of Dhaka ,Banglades.pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Computer network topology notes for revision

NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutional Neural Networks for Android Devices - ITCE 2019

  • 1. NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutional Neural Networks for Android Devices Menoufia University Faculty of Computers and Information Information Technology Department By Ahmed Fawzy Gad International Conference on Innovative Trends in Computer Engineering (ITCE’2019)
  • 2. Index 2 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 3. Index 3 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 5. Introduction ▰ Working with huge amounts of data makes it challenging to decide what are the suitable features for use. ▰ A dataset such as ImageNet contains millions of images distributed across thousands of classes. 5 Convolutional Neural Network (CNN) ▰ The problem with the deep learning architectures is being time consuming and require high processing power.
  • 6. Introduction ▰ There are some already existing libraries for building deep learning models such as TensorFlow, Keras, Theano, Caffe, and others. ▰ These libraries are normally available for desktop computers due to the availability of both memory and processing power. ▰ Working with mobile devices, there are 2 important issues. 6 Availability Efficiency ▰ This paper solves the availability issue by proposing a library called NumPyCNNAndroid (NPCA) for building CNNs for Android devices.
  • 7. Index 7 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 8. Related Work ▰ A network architecture called MobileNets proposes the use of depthwise separable convolution. ▰ In regular convolution, the 2 steps (filtering and combining) are done in a single step. These steps are split in the dephwise separable convolution. The first step is applying a pointwise convolution with filter size equal to 1x1. Then another pointwise convolution for combining the results. 8Howard, Andrew G., et al. "Mobilenets: Efficient convolutional neural networks for mobile vision applications." arXiv preprint arXiv:1704.04861 (2017). ▰ MobileNets requires the creation of a new network architecture for every application in order to be supported by the mobile devices.
  • 9. Related Work ▰ A GPU-accelerated library called CNNdroid. 9Latifi Oskouei, Seyyed Salar, et al. "CNNdroid: GPU-accelerated execution of trained deep convolutional neural networks on android." Proceedings of the 2016 ACM Conference on Multimedia. ACM, 2016.
  • 10. Related Work ▰ Some of the exisiting libraries have some releases for supporting the mobile devices. For example, there is a library called TensorFlow Lite from TensorFlow. Also there is Caffe mobile from Caffe. ▰ Similar to CNNdroid, there must be an in-between step for converting the original model into a format supported by the mobile devices. 10
  • 11. Related Work ▰ Here is the summary of the model conversion in TensorFlow. 11 Prepare the TF Model. Convert the TF Model to TF Lite Model Create an Android Project Import the TF Lite Model within the Project Call the Model within Java Code ▰ In TF Lite, the developer uses multiple tools (Python, TOCO, Android Studio, and Java)
  • 12. Index 12 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 13. Proposed Work Advantages ▰ NPCA uses Python for its development which is one of the best tools in data science. ▰ The same code, unchanged, is executed in all platforms due to the use of a cross-platform library called Kivy. ▰ Faster deployment for the models of the mobile devices as there is no in-between step to customize the model. 13
  • 14. Index 14 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 15. Proposed Work Development Process ▰ The CNN can be trained on the mobile device but it is time-consuming at least in the current version. ▰ The preferred way is to train the CNN in a desktop computer and then use it on the mobile device. 15
  • 16. Index 16 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 17. Proposed Work Supported Layers ▰ Convolution (conv) ▰ Rectified Linear Unit (relu) ▰ Max Pooling (maxpool) ▰ Average Pooling (avgpool) ▰ Fully Connected (fc) 17 GitHub – NumPyCNN https://github.com/ahmedfgad/NumPyCNN GitHub – NumPyCNNAndroid https://github.com/ahmedfgad/NumPyCNNAndroid
  • 18. Index 18 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 20. Index 20 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 22. Index 22 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 23. Find NumPyCNNAndroid at Google Play ▰ To facilitate testing the library, a free application named NumPyCNNAndroid is available at Google Play for download. ▰ https://play.google.com/store/ apps/details?id=org.numpycnn. numpycnn 23
  • 24. Find NumPyCNNAndroid at Google Play 24
  • 25. Index 25 • Introduction • Related Work • Proposed Library (NumPyCNNAndroid) • Advantages • Development Process • Supported Layers • Example • Validation • Find NumPyCNNAndroid at Google Play • References
  • 26. References ▰ Nanni, Loris, Stefano Ghidoni, and Sheryl Brahnam. "Handcrafted vs. non-handcrafted features for computer vision classification." Pattern Recognition 71 (2017): 158-172. ▰ Russakovsky, Olga, et al. "Imagenet large scale visual recognition challenge." International Journal of Computer Vision 115.3 (2015): 211-252. ▰ Aghdam, Hamed Habibi, and Elnaz Jahani Heravi. Guide to Convolutional Neural Networks: A Practical Application to Traffic-Sign Detection and Classification. Springer, 2017. ▰ Schmidhuber, Jürgen. "Deep learning in neural networks: An overview." Neural networks 61 (2015): 85-117. ▰ Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural information processing systems. 2012. ▰ Simonyan, Karen, and Andrew Zisserman. "Very deep convolutional networks for large-scale image recognition." arXiv preprint arXiv:1409.1556 (2014). ▰ Szegedy, Christian, et al. "Going deeper with convolutions." Cvpr, 2015. ▰ Cai, Ermao, et al. "Neuralpower: Predict and deploy energy-efficient convolutional neural networks." arXiv preprint arXiv:1710.05420 (2017). ▰ Kim, Yong-Deok, et al. "Compression of deep convolutional neural networks for fast and low power mobile applications." arXiv preprint arXiv:1511.06530 (2015). ▰ Latifi Oskouei, Seyyed Salar, et al. "CNNdroid: GPU-accelerated execution of trained deep convolutional neural networks on android." Proceedings of the 2016 ACM Conference on Multimedia. ACM, 2016. https://github.com/ENCP/CNNdroid 26
  • 27. References ▰ Abadi, Martín, et al. "TensorFlow: A System for Large-Scale Machine Learning." OSDI. Vol. 16. 2016. ▰ Jia, Yangqing, et al. "Caffe: Convolutional architecture for fast feature embedding." Proceedings of the 22nd ACM international conference on Multimedia. ACM, 2014. ▰ Al-Rfou, Rami, et al. "Theano: A Python framework for fast computation of mathematical expressions." arXiv preprint arXiv:1605.02688 472 (2016): 473. ▰ Nicholson, A. Chris, and Adam Gibson. "Deeplearning4j: Open-source, Distributed Deep Learning for the JVM." https://Deeplearning4j.org (2017). ▰ Chen, Tianqi, et al. "MXNet: A flexible and efficient machine learning library for heterogeneous distributed systems." arXiv preprint arXiv:1512.01274 (2015). ▰ Chollet, François. "Keras: Deep learning library for Theano and TensorFlow." URL: https://keras.io/ (2015): 8. ▰ Torch: http://torch.ch/ ▰ Wu, Jiaxiang, et al. "Quantized convolutional neural networks for mobile devices." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2016. ▰ Han, Song, Huizi Mao, and William J. Dally. "Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding." arXiv preprint arXiv:1510.00149 (2015). ▰ Chen, Wenlin, et al. "Compressing neural networks with the hashing trick." International Conference on Machine Learning. 2015. ▰ Howard, Andrew G., et al. "Mobilenets: Efficient convolutional neural networks for mobile vision applications." arXiv preprint arXiv:1704.04861 (2017). ▰ Zhang, Xiangyu, et al. "Shufflenet: An extremely efficient convolutional neural network for mobile devices." arXiv preprint arXiv:1707.01083 (2017). 27
  • 28. References 28 ▰ TensorFlow Lite: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite. ▰ Caffe Android: https://github.com/sh1r0/caffe-android-lib. ▰ Torch Android: https://github.com/soumith/torch-android. ▰ python-for-android: https://github.com/kivy/python-for-android ▰ Virbel, Mathieu, Thomas E. Hansen, and Oleksandr Lobunets. "Kivy-A Framework for Rapid Creation of Innovative User Interfaces." Mensch & Computer Workshopband. 2011. ▰ Walt, Stéfan van der, S. Chris Colbert, and Gael Varoquaux. "The NumPy array: a structure for efficient numerical computation." Computing in Science & Engineering 13.2 (2011): 22-30. ▰ Python Imaging Library (PI) http://www.pythonware.com/products/pil ▰ Buildozer: https://github.com/kivy/buildozer ▰ NumPyCNN (NPC): https://github.com/ahmedfgad/NumPyCNN ▰ NumPyCNNAndroid (NPCA): https://github.com/ahmedfgad/NumPyCNNAndroid ▰ NumPyCNNAndroid (NPCA): https://play.google.com/store/apps/details?id=org.numpycnn.numpycnn