How Can You Get Started with Machine Learning?€¦ · How Can You Get Started with Machine...
Transcript of How Can You Get Started with Machine Learning?€¦ · How Can You Get Started with Machine...
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
How Can You Get Started with Machine Learning?
Harry Wang
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Presentation.introduceSpeaker()
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
-Subset of Artificial Intelligence
-Algorithms that can adjust themselves based on data
-Statistical and Predictive Analytics
-”Gives computers the ability to learn without being explicitly programmed”
-More flexible and less-static in behavior
What is Machine Learning?
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Supervised Learning
InputInput
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Unsupervised Learning
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Semi-Supervised Learning
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Classifier - object in program that learns from the data you give it
Training Data - used to train classifier
Testing Data - used to evaluate the accuracy and performance of classifier
Basic Machine Learning concepts
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Example of a Simple ML Modely = m’x+b’y = mx+b
Initial State
Final State
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Examples of Machine Learning
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
spotted salamander fire salamander retriever
Recognizing images with Inception
https://research.googleblog.com/2016/03/train-your-own-image-classifier-with.html
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Smart reply in Inbox by Gmail
10%of all responses sent on mobile
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
[glacier]
Google Photos
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
How Can You Get Started with Machine Learning?
More flexible, but more
effort required
Three ways, with varying complexity:
(1) Use a Cloud-based or Mobile API (Vision, Natural Language, etc.)
(2) Use an existing model architecture, and retrain it or fine tune on your dataset
(3) Develop your own machine learning models for new problems
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Cloud Machine Learning APIs See, Hear and Understand the world
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Cloud Natural Language
Cloud Speech
Cloud Translate
Cloud Vision
Copyright 2017 Arbormoon Software, Inc. All rights reserved.19
Vision API Demo
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
FacesFaces, facial landmarks, emotions
OCRRead and extract text, with support for > 10 languages
LabelDetect entities from furniture to transportation
LogosIdentify product logos
Landmarks & Image PropertiesDetect landmarks & dominant color of image
Safe SearchDetect explicit content - adult, violent, medical and spoof
Cloud Vision API
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
API Usage: Detect Objects in an Image
Image DetectedItems
Vision API
Create JSON request with the image or pointer to an image
Process the JSON response
Call the REST API1 2 3
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Cloud Natural Language API
Extract sentence, identify parts of speech and create dependency parse trees for each sentence.
Identify entities and label by types such as person, organization, location, events, products and media.
Understand the overall sentiment of a block of text.
Syntax Analysis Entity Recognition
Sentiment Analysis
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Cloud Speech API
Automatic Speech Recognition (ASR) powered by deep learning neural networking to power your applications like voice search or speech transcription.
Recognizes over 80 languages and variants with an extensive vocabulary.
Returns partial recognition results immediately, as they become available.
Filter inappropriate content in text results.
Audio input can be captured by an application’s microphone or sent from a pre-recorded audio file. Multiple audio file formats are supported, including FLAC, AMR, PCMU and linear-16.
Handles noisy audio from many environments without requiring additional noise cancellation.
Audio files can be uploaded in the request and, in future releases, integrated with Google Cloud Storage.
Automatic Speech Recognition Global Vocabulary Inappropriate Content Filtering
Streaming Recognition
Real-time or Buffered Audio Support Noisy Audio Handling Integrated API
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
What’s Next?
Codelabscodelabs.developers.google.com/codelabs/cloud-vision-intro/index.htmlcodelabs.developers.google.com/codelabs/cloud-speech-intro/index.htmlcodelabs.developers.google.com/codelabs/cloud-nl-intro/index.html
For Developerscloud.google.com/vision/cloud.google.com/speech/cloud.google.com/natural-language/cloud.google.com/translate/
Stack Overflow
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Mobile Vision APIProviding on-device vision for applications
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Face APIfaces, facial landmarks, eyes open, smiling
Barcode API1D and 2D barcodes
Text APILatin-based text / structure
Common Mobile Vision APISupport for fast image and video on-device detection and tracking.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Googly Eyes Android App
Video credit Google
1. Create a face detector for facial landmarks (e.g., eyes)
3. For each face, draw the eyes
FaceDetector detector = new FaceDetector.Builder().setLandmarkType(FaceDetector.ALL_LANDMARKS).build();
SparseArray<Face> faces = detector.detect(image);
for (int i = 0; i < faces.size(); ++i) {Face face = faces.valueAt(i);for (Landmark landmark : face.getLandmarks()) {// Draw eyes
2. Detect faces in the image
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Face APIPhoto credit developers.google.com/vision
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Text Structure
Blocks
Lines
Words
Lines
Words Words Words
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Barcode Detection1D barcodes
EAN-13/8UPC-A/ECode-39/93/128
ITFCodabar
2D barcodes QR CodeData MatrixPDF-417AZTEC
UPC
DataMatrix
QR Code
PDF 417
Video and image credit Google
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Combined Vision & Translation
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Mobile Vision: Codelabs and Samples
Googly Eyes Code Samplegithub.com/googlesamples/android-vision/tree/master/visionSamples/googly-eyes
Codelabscodelabs.developers.google.com/codelabs/face-detection/codelabs.developers.google.com/codelabs/mobile-vision-ocr/
Mobile Vision Developersdevelopers.google.com/vision/
GitHub Code Samplesgithub.com/googlesamples/android-vision
Stack OverflowFind and ask questions under the android-vision tag.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Open source Machine Learning library
Especially useful forDeep Learning
For research and production
Apache 2.0 license
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Hello World
Image from https://github.com/mnielsen/neural-networks-and-deep-learning
?
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
What we see What the computer “sees”
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Complete code
import numpy as np
import tensorflow as tf
mnist = tf.contrib.learn.datasets.load_dataset('mnist')
data = mnist.train.images
labels = np.asarray(mnist.train.labels, dtype=np.int32)
data = data[:10000]
labels = labels[:10000]
feature_columns = tf.contrib.learn.infer_real_valued_columns_from_input(data)
classifier = tf.contrib.learn.LinearClassifier(feature_columns=feature_columns, n_classes=10)
classifier.fit(data, labels, batch_size=100, steps=1000)
print("accuracy: ", classifier.evaluate(mnist.test.images, np.asarray(mnist.test.labels, dtype=np.int32))["accuracy"])
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Computer Vision Principles
Filled in Center:Positive Weight for digit being a one
Filled in Center:Negative Weight for digit being a zero
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Computer Vision Principles
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Getting Started Exercises
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Lots of tutorials at tensorflow.org
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Codelab - goo.gl/xGsB9d Video - goo.gl/B2zYWN
TensorFlow for Poets
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Mobile TensorFlow
Copyright 2017 Arbormoon Software, Inc. All rights reserved.Claude Monet - Bouquet of SunflowersImages from the Metropolitan Museum of Art (with permission) Image by @random_forests
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
A little more TensorFlow
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
A multidimensional array.
A graph of operations.
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Data Flow Graphs
Computation is defined as a directed acyclic graph (DAG) to optimize an objective functionGraph is defined in high-level language (Python)Graph is compiled and optimizedGraph is executed (in parts or fully) on available low level devices (CPU, GPU)Data (tensors) flow through the graphTensorFlow can compute gradients automatically
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
ArchitectureCore in C++
Different front ends
- Python and C++ today, community may add more
...
Core TensorFlow Execution System
CPU GPU Android iOS ...
C++ front end Python front end
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Raspberry PiDatacentersYour laptop Android iOS
Portable & Scalable
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
/Serving
Open-source solution for serving trained models
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
tensorflow.orggithub.com/tensorflow
Want to learn more?Udacity class on Deep Learning, goo.gl/iHssII
Guides, codelabs, videosMNIST for Beginners, goo.gl/tx8R2bTF Learn Quickstart, goo.gl/uiefRnTensorFlow for Poets, goo.gl/bVjFILML Recipes, goo.gl/KewA03TensorFlow and Deep Learning without a PhD, goo.gl/pHeXe7
What's Next
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Questions?
Copyright 2017 Arbormoon Software, Inc. All rights reserved.
Thanks and have fun!
Harry Wang