Deep Learning by Doing

arconsis IT-Solutions GmbH Who?

Achim Baier Wolfgang Frank @wolfgangfrank

@arconsis Let’s talk about… Cucumber … we will get back to that later! Why learn about ? Web Search

News Search …maybe more important… Cool & Fun Inspirational Applications of

Source: http://machinelearningmastery.com Video posted on YouTube by Yann LeCun

Yann LeCun's convolutional neural network 1993 10%-20% of all checks in US Instant Visual Translation Example of instant visual translation, taken from the Google Blog.

Automatic Machine Translation Thomas Samson/AFP/Getty Images

Google Translate 103 languages! Colorization of Black and White Photographs Image taken from Richard Zhang, Phillip Isola and Alexei A. Efros.

Automatic Colorization of Black and White Images Very large convolutional neural networks and supervised layers recreate the image with the addition of color. Example of Object Detection within Photogaphs Taken from the Google Blog.

Object Classification and Detection in Photographs Automatic Image Caption Generation Sample taken from Andrej Karpathy, Li Fei-Fei

Automatic Image Caption Generation 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/

Many more examples / applications …

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

Artificial Intelligence — Human Intelligence Exhibited by Machines

Machine Learning — An Approach to Achieve Artificial Intelligence

Deep Learning — A Technique for Implementing Machine Learning “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…

Train a model with known / labeled data to make predictions for new data (regression, classification)

regression: continuous value output classification>; discrete value output

Find common structures in unknown / unlabeled data (clustering, patterns, find coherent groups)

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

Machine Learning

Classic Algorithms Neural Networks

Linear Regression Q Policy NN Softmax Regression K-means Convolutional NN Self-organizing map Recurrent NN Viberti Deep NN 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 source: Wikipedia - Shoulder of Giants

Standing on the shoulders of giants! Some known DL frameworks • Python • Easy to learn • Many examples and well known NN available • Difficult for low-level customizations • Hard to debug • Primary developed by Univerity Montreal • Python / ++ • Simple interface • Specialized to deal with images • Primarily from Berkley Univeristy • 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! Training data collection mobile device / desktop / big data server

Unlabeled Input data, Training sensors, camera, … data

saveTrainingData() upload training data Training API Training API Client e.g. supervised training mobile device / desktop server

Unlabeled Labeled Training App Training Training data data getUnlabeled TrainingData() get saveLabeled unlabeled TrainingData() Training API Training API Client upload labeled Training on Server

server 1. TF performs training on Training Tensorflow server data Training on Server

server 1. TF performs training on Training Tensorflow server data 2. TF saves trained NN saveNN()

Trained NN Training on Server

server 1. TF performs training on Training Tensorflow server data 2. TF saves trained NN 3. API provides download of persisted trained NN Training API Trained NN Inference on Mobile Online

mobile device server

Input Inference Training Tensorflow data App data

fit() Training API Trained NN Inference on Mobile Offline mobile device server

Training Tensorflow data

download trained NN Trained Training API Trained NN NN Inference on Mobile Offline

mobile device server

Input Inference Training Tensorflow data App data

fit()

Tensorflow Trained Training API Trained NN NN Tensorflow on iOS & Android Getting started…

Start CPU only container $ docker run -it -p 8888:8888 gcr.io//tensorflow Go 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/ Android https://github.com/tensorflow/tensorflow/tree/master/ tensorflow/contrib/android

iOS https://github.com/tensorflow/tensorflow/tree/master/ tensorflow/contrib/ios_examples Demo iOS Camera Example Demo

Convolutional Networks: from TensorFlow to iOS BNNS

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

https://github.com/paiv/mnist-bnns 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 Sources & more info

• http://machinelearningmastery.com/deep-learning-for-developers/

• http://www.networkworld.com/article/3025698/microsoft-subnet/ skype-real-time-language-translator-download-windows-- android.html

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

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

• http://deeplearning4j.org

• http://tensorflow.org

• https://www.manning.com/books/machine-learning-with-tensorflow Thank you!

Achim Baier Wolfgang Frank @arconsis @wolfgangfrank [email protected] [email protected]