SlideShare a Scribd company logo
1 of 29
Download to read offline
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

What's hot

Development of a Location Invariant Crack Detection and Localisation Model (L...
Development of a Location Invariant Crack Detection and Localisation Model (L...Development of a Location Invariant Crack Detection and Localisation Model (L...
Development of a Location Invariant Crack Detection and Localisation Model (L...
CSCJournals
 
Leveraging Deep Learning Representation for search-based Image Annotation
Leveraging Deep Learning Representation for search-based Image AnnotationLeveraging Deep Learning Representation for search-based Image Annotation
Leveraging Deep Learning Representation for search-based Image Annotation
mahyamk
 
Image Classification using Deep Learning
Image Classification using Deep LearningImage Classification using Deep Learning
Image Classification using Deep Learning
ijtsrd
 
11.0003www.iiste.org call for paper.survey on wireless intelligent video surv...
11.0003www.iiste.org call for paper.survey on wireless intelligent video surv...11.0003www.iiste.org call for paper.survey on wireless intelligent video surv...
11.0003www.iiste.org call for paper.survey on wireless intelligent video surv...
Alexander Decker
 

What's hot (19)

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

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

Zejia_CV_final
Zejia_CV_finalZejia_CV_final
Zejia_CV_final
ZJ Zheng
 

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

The pulse of cloud computing with bioinformatics as an example
The pulse of cloud computing with bioinformatics as an exampleThe pulse of cloud computing with bioinformatics as an example
The pulse of cloud computing with bioinformatics as an example
 
Designing High performance & Scalable Middleware for HPC
Designing High performance & Scalable Middleware for HPCDesigning High performance & Scalable Middleware for HPC
Designing High performance & Scalable Middleware for HPC
 
Data-intensive bioinformatics on HPC and Cloud
Data-intensive bioinformatics on HPC and CloudData-intensive bioinformatics on HPC and Cloud
Data-intensive bioinformatics on HPC and Cloud
 
Deep Learning Jeff-Shomaker_1-20-17_Final_
Deep Learning Jeff-Shomaker_1-20-17_Final_Deep Learning Jeff-Shomaker_1-20-17_Final_
Deep Learning Jeff-Shomaker_1-20-17_Final_
 
Introduction to Deep learning
Introduction to Deep learningIntroduction to Deep learning
Introduction to Deep learning
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Cloud computing and bioinformatics
Cloud computing and bioinformaticsCloud computing and bioinformatics
Cloud computing and bioinformatics
 
Data-intensive applications on cloud computing resources: Applications in lif...
Data-intensive applications on cloud computing resources: Applications in lif...Data-intensive applications on cloud computing resources: Applications in lif...
Data-intensive applications on cloud computing resources: Applications in lif...
 
Zejia_CV_final
Zejia_CV_finalZejia_CV_final
Zejia_CV_final
 
Cloud Standards in the Real World: Cloud Standards Testing for Developers
Cloud Standards in the Real World: Cloud Standards Testing for DevelopersCloud Standards in the Real World: Cloud Standards Testing for Developers
Cloud Standards in the Real World: Cloud Standards Testing for Developers
 
Gridforum David De Roure Newe Science 20080402
Gridforum David De Roure Newe Science 20080402Gridforum David De Roure Newe Science 20080402
Gridforum David De Roure Newe Science 20080402
 
2016 05 sanger
2016 05 sanger2016 05 sanger
2016 05 sanger
 
Dp2 ppt by_bikramjit_chowdhury_final
Dp2 ppt by_bikramjit_chowdhury_finalDp2 ppt by_bikramjit_chowdhury_final
Dp2 ppt by_bikramjit_chowdhury_final
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Metaverse for Dataverse
Metaverse for DataverseMetaverse for Dataverse
Metaverse for Dataverse
 
MDEC Data Matters Series: machine learning and Deep Learning, A Primer
MDEC Data Matters Series: machine learning and Deep Learning, A PrimerMDEC Data Matters Series: machine learning and Deep Learning, A Primer
MDEC Data Matters Series: machine learning and Deep Learning, A Primer
 
Designing High-Performance and Scalable Middleware for HPC, AI and Data Science
Designing High-Performance and Scalable Middleware for HPC, AI and Data ScienceDesigning High-Performance and Scalable Middleware for HPC, AI and Data Science
Designing High-Performance and Scalable Middleware for HPC, AI and Data Science
 
Open source ai_technical_trend
Open source ai_technical_trendOpen source ai_technical_trend
Open source ai_technical_trend
 
2016 open-source-network-softwarization
2016 open-source-network-softwarization2016 open-source-network-softwarization
2016 open-source-network-softwarization
 
2016 open-source-network-softwarization
2016 open-source-network-softwarization2016 open-source-network-softwarization
2016 open-source-network-softwarization
 

More from Ahmed Gad

Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Derivation of Convolutional Neural Network from Fully Connected Network Step-...
Ahmed Gad
 
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Derivation of Convolutional Neural Network (ConvNet) from Fully Connected Net...
Ahmed Gad
 
Brief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNsBrief Introduction to Deep Learning + Solving XOR using ANNs
Brief Introduction to Deep Learning + Solving XOR using ANNs
Ahmed Gad
 
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...Graduation Project - Face Login : A Robust Face Identification System for Sec...
Graduation Project - Face Login : A Robust Face Identification System for Sec...
Ahmed Gad
 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Ahmed Gad
 
AI Heuristic Search - Beam Search - Simulated Annealing
AI Heuristic Search - Beam Search - Simulated AnnealingAI Heuristic Search - Beam Search - Simulated Annealing
AI Heuristic Search - Beam Search - Simulated Annealing
Ahmed Gad
 

More from Ahmed Gad (20)

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

Recently uploaded

Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
AroojKhan71
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 

Recently uploaded (20)

Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 

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