Deep Learning by Doing HANDOUT - Entwicklertag · Deep NN Famous Algorithms Machine Learning. A top...

76
Deep Learning by Doing arconsis IT-Solutions GmbH

Transcript of Deep Learning by Doing HANDOUT - Entwicklertag · Deep NN Famous Algorithms Machine Learning. A top...

Deep Learning by Doing

arconsis IT-Solutions GmbH

Wolfgang Frank @wolfgangfrank

Achim Baier

Who?

@arconsis

Let’s talk about…

Cucumber

… we will get back to that later!

Why learn about Machine Learning?

Web Search

News Search

…maybe more important…Cool & Fun

Inspirational Applications of Deep Learning

Source: http://machinelearningmastery.com

Yann LeCun's convolutional neural network 1993

10%-20% of all checks in US

Video posted on YouTube by Yann LeCun

Automatic Machine Translation

Instant Visual Translation Example of instant visual translation, taken from the Google Blog.

Google Translate 103 languages!

Thomas Samson/AFP/Getty Images

Automatic Colorization of Black and White Images Very large convolutional neural networks and supervised layers recreate the image with the

addition of color.

Colorization of Black and White Photographs Image taken from Richard Zhang, Phillip Isola and Alexei A. Efros.

Object Classification and Detection in Photographs

Example of Object Detection within Photogaphs Taken from the Google Blog.

Automatic Image Caption Generation

Automatic Image Caption Generation Sample taken from Andrej Karpathy, Li Fei-Fei

Automatic Game Playing Deep reinforcement models learns how to play breakout based only on the pixels on the screen

Real-Time object detection

Source: http://pjreddie.com/darknet/yolo/

Self driving vehicles

Source: https://electrek.co/2016/12/21/tesla-autopilot-vision-neural-net-data-elon-musk/

Source: deeplearning4j.org

Many more examples / applications …

Artificial Intelligence — Human Intelligence Exhibited by Machines

Machine Learning — An Approach to Achieve Artificial Intelligence

Deep Learning — A Technique for Implementing Machine Learning

source: https://blogs.nvidia.com/blog/2016/07/29/whats-difference-artificial-intelligence-machine-learning-deep-learning-ai/

“Machine learning is about using examples to develop an expert system that can make useful

statements about new inputs.”

Machine Learning with TensorFlow MEAP, Manning

Typical principles & algorithms…

Supervised LearningTrain a model with known / labeled data to make predictions for

new data (regression, classification)

regression: continuous value outputclassification>; discrete value output

Unsupervised LearningFind common structures in unknown / unlabeled data

(clustering, patterns, find coherent groups)

Reinforcement Learning

Getting an agent to act in the world so as to maximize its rewards(Trial & Error —> construct knowledge —> Map situations to actions)

Classic Algorithms

Linear Regression

Logistic Regression Softmax Regression

K-means Self-organizing map

Viberti

Neural Networks

Autoencoder

Q Policy NN Perceptron

Convolutional NN Recurrent NN

Deep NN

Famous AlgorithmsMachine Learning

A top down approach…

n*log(n)Arrays.sort(int[] a) —> tuned quicksort

Arrays.sort(Object[] a) —> modified merge sort

Derive the “back propagation” equation from

first principles and implement it from scratch?

Instead, just call model.fit() on the

deep learning API.

Top engineering and academic capabilities do not have to

come first, they can come later.

Deep Learning for Industry 4.0 / IOT

Japanese cucumber farmer is using deep learning and TensorFlow

https://cloud.google.com/blog/big-data/2016/08/how-a-japanese-cucumber-farmer-is-using-deep-learning-and-tensorflow

Makoto used the sample TensorFlow code “Deep MNIST for Experts” with minor modifications to the convolution, pooling and last layers, changing the

network design to adapt to the pixel format of cucumber images and the number of cucumber

classes.

https://cloud.google.com/blog/big-data/2016/08/how-a-japanese-cucumber-farmer-is-using-deep-learning-and-tensorflow

https://cloud.google.com/blog/big-data/2016/08/how-a-japanese-cucumber-farmer-is-using-deep-learning-and-tensorflow

Typical workflow…

Two phases

1. Learning 2. Inference

learning paradigm

Training Data -> Feature Vector -> Learning Algorithm -> Model

inference paradigm

“Test” Data -> Feature Vector -> Model -> Prediction

Standing on the shoulders

of giants!

source: Wikipedia - Shoulder of Giants

Some known DL frameworks

Theano• Python • Easy to learn • Many examples and well known NN available • Difficult for low-level customizations • Hard to debug • Primary developed by Univerity Montreal

Caffe• Python / C++ • Simple interface • Specialized to deal with images • Primarily from Berkley Univeristy

Torch• Lua • Strong support for optimization solvers • Used by Facebook

DL4J - Deeplearning 4 Java

• Java / Scala • Spark support for parallelism • Good documentation (now) • Many good examples • Very active community • Works on mobile but slow

Tensorflow• C++ / Python • Growing number of language wrappers, i.e. Java • Works on large-scale GPU as well as Mobile • Very good documentation and example • TensorBoard for visualization • Very fast • Proven to work very well (Google Speech Recognition,

Photos, Gmail, …)

Use & re-use existing

Models and Networks

and Training Data

Transfer Learning

CNN

source: https://devblogs.nvidia.com/parallelforall/deep-learning-nutshell-core-concepts/

Example: FaceNet—> Google’s Inception-ResNet-v1 model

—> Training set 453.450 images over 10.575 identities after face detection

Inference on Mobile!

servermobile device / desktop / big data

upload training data

Training API Client

Input data,sensors, camera, …

Training data collection

saveTrainingData()

UnlabeledTraining

data

Training API

server

LabeledTraining

data

mobile device / desktop

get unlabeled

upload labeled

Training API Client

e.g. supervised training

saveLabeled TrainingData()

Training AppUnlabeledTraining

data

Training API

getUnlabeledTrainingData()

server

Training dataTensorflow

1. TF performs training on server

Training on Server

server

Training dataTensorflow

TrainedNN

saveNN()

1. TF performs training on server

2. TF saves trained NN

Training on Server

server

Training dataTensorflow

TrainedNN

1. TF performs training on server

2. TF saves trained NN 3. API provides download of persisted trained NN

Training API

Training on Server

server

Training data

TrainedNN

mobile device

TensorflowInference App

Input data

fit()

Inference on Mobile Online

Training API

server

Training data

TrainedNN

mobile device

Training API

download trained NN

Tensorflow

TrainedNN

Inference on Mobile Offline

server

Training data

TrainedNN

mobile device

TensorflowInference App

Tensorflow

Input data

fit()

TrainedNN

Inference on Mobile Offline

Training API

Tensorflow on iOS & Android

Start CPU only container $ docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflowGo to your browser on http://localhost:8888/

Start GPU (CUDA) container Install nvidia-docker and run$ nvidia-docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-gpu

Go to your browser on http://localhost:8888/

Getting started…

https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/android

https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ios_examples

Android

iOS

Demo iOS Camera Example

https://github.com/paiv/mnist-bnns

Demo

Convolutional Networks: from TensorFlow to iOS BNNS

https://paiv.github.io/blog/2016/09/25/tensorflow-to-bnns.html

Neural Network as a Service

Predicting car prices

Source: http://www.datasciencecentral.com/profiles/blogs/predicting-car-prices-part-2-using-neural-network

Deep Learning on Raspberry Pi

How to build a robot that “sees” with $100 and TensorFlow

https://www.oreilly.com/learning/how-to-build-a-robot-that-sees-with-100-and-tensorflow

Takeaways?

Takeaways…

1. Don’t be scared 2. Leverage existing 3. Be a part of the future now

Wolfgang Frank @wolfgangfrank

[email protected]

Achim Baier @arconsis

[email protected]

Thank you!