Top Banner
COMPUTER VISION MEETUP (Almost) February #viennaCV @anyline_io
15

Deep Learning in iOS Tutorial

Mar 20, 2017

Download

Software

Anyline
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Deep Learning in iOS Tutorial

COMPUTER VISION

MEETUP

(Almost) February

#viennaCV @anyline_io

Page 2: Deep Learning in iOS Tutorial

SPONSORS

Drinks are sponsored by Anyline

Page 3: Deep Learning in iOS Tutorial

• Tutorial in Deep Learning on iOS by

Daniel Albertini

AGENDA

Page 4: Deep Learning in iOS Tutorial

Tutorial in Deep Learning in iOS

Page 5: Deep Learning in iOS Tutorial

● About iOS Development

● Accelerate.framework

● BNNS Functions

● About Tensorflow

● Tensorflow Deep MNIST Tutorial

Outline

Page 6: Deep Learning in iOS Tutorial

● Both Languages build on top of C

● -> C Code can be mixed with Objective-C / Swift

● C++ Code can be mixed with Objective-C Code

● Apple’s higher level public API’s are all written in

Objective-C

● The low level API like CoreAudio, CoreVideo, … are

all still written in C

Objective-C / Swift

Page 7: Deep Learning in iOS Tutorial

C API’s for vector and matrix math, digital signal processing, large number handling and image processing

Optimized for high performance on arm64 chips.

Runs on the CPU

Accelerate.framework

Page 8: Deep Learning in iOS Tutorial

vImageProvides image processing capabilities like:● Alpha composition● Image format conversions● Image convolution (smoothing, sharpening)● Geometry functions● Decompression filtering● Histogram functions● Morphology functions● Image Transformations

QuadratureQuadrature provides an approximation of the definite integral of a function over a finite or infinite interval.

Accelerate.framework

Page 9: Deep Learning in iOS Tutorial

vDSPProvides functions releated to digital signal processing like:● Vector and matrix arithmetic● Fourier transforms● Convolution, correlation, and window generation● Biquadratic filtering

BLAS & vecLibBasic Linear Algebra Subprograms provide standard building blocks for basic vector and matrix operations.

Accelerate.framework

Page 10: Deep Learning in iOS Tutorial

BNNSAllows you to configure NN with different kind of layers and run the forward pass.

There are no backward propagation capabilities.

But you train your NN using tensorflow, caffe, … and then export the weights for the BNNS.

BNNS functions are optimized for all CPU’s Apple supports.

Accelerate.framework

Page 11: Deep Learning in iOS Tutorial

BNNSSupports the following 3 kinds of layers:

● Convolution Layer

● Pooling Layer

● Fully Connected Layer

There is also native GPU support for CNN’s, but that’s part of Apple’s Metal Performance Shaders framework and is a little harder to get started with.

Accelerate.framework

Page 12: Deep Learning in iOS Tutorial

BNNSFilter BNNSFilterCreateConvolutionLayer(const BNNSImageStackDescriptor * in_desc, const BNNSImageStackDescriptor * out_desc, const BNNSConvolutionLayerParameters * layer_params, const BNNSFilterParameters * _Nullable filter_params)

Convolution Layer

Page 13: Deep Learning in iOS Tutorial

Convolution Layer

Page 14: Deep Learning in iOS Tutorial

About Tensorflow

● Open Source Library for Deep Neuronal Networks● Developed by Google and public available since late

2015● 1.0 version was released 2 weeks ago● Core is developed in C++ and it also runs on NVIDIA

GPU’s● Works on a lot of platforms (Unix, Windows, iOS,

Android)● High Level API’s written in Python

Page 15: Deep Learning in iOS Tutorial

Tensorflow Deep MNIST Tutorial

https://www.tensorflow.org/get_started/mnist/pros