deep learning in ios tutorial

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

Upload: anyline

Post on 20-Mar-2017

109 views

Category:

Software


1 download

TRANSCRIPT

COMPUTER VISION

MEETUP

(Almost) February

#viennaCV @anyline_io

SPONSORS

Drinks are sponsored by Anyline

• Tutorial in Deep Learning on iOS by

Daniel Albertini

AGENDA

Tutorial in Deep Learning in iOS

● About iOS Development

● Accelerate.framework

● BNNS Functions

● About Tensorflow

● Tensorflow Deep MNIST Tutorial

Outline

● 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

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

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

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

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

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

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

Convolution Layer

Convolution Layer

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

Tensorflow Deep MNIST Tutorial

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