nas 也可以揀土豆

64
NAS 也可以揀土豆 Open source application

Upload: kai-chu-chung

Post on 12-Jan-2017

829 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Nas 也可以揀土豆

NAS 也可以揀土豆

Open source application

Page 2: Nas 也可以揀土豆

Hello!I am Cage Chung

I am here because I like to share my experiences.

You can find me at:QNAP 雲端應用部資深工程師 / http://kaichu.io

Page 3: Nas 也可以揀土豆

Andy

Page 4: Nas 也可以揀土豆

https://www.facebook.com/groups/GCPUG.TW/

https://plus.google.com/u/0/communities/116100913832589966421

Google Cloud Platform User Group Taiwan我們是Google Cloud Platform Taiwan User Group。在Google雲端服務在台灣地區展露頭角之後,

有許多新的服務、新的知識、新的創意,歡迎大家一起分享,一起了解 Google雲端服務...

GCPUG透過網際網路串聯喜好Google Cloud的使用者,分享與交流使用 GCP的點滴鑑驗。如果您

是Google Cloud Platform的初學者,您應該來聽聽前輩們的使用經驗;如果您是 Google Cloud Platform的Expert,您應該來分享一下寶貴的經驗,並與更多高手互相交流;如果您還沒開始用

Google Cloud Platform,那麼您應該馬上來聽聽我們是怎麼使用 Google Cloud的!

Page 5: Nas 也可以揀土豆

“Lessons learned building a

classifier for NAS. Try to get a big picture, get some useful

keywords

I cannot explain everything, you cannot get every details

Page 6: Nas 也可以揀土豆

General user○ Videos○ Music○ Movies○ Photos○ Files○ Games

Photographer○ Photos (jpeg, RAW)

Musicians○ Music files (mp3)○ Videos

NAS | usage

Page 7: Nas 也可以揀土豆

Our scenario is easy

Portraitlandscape

wildlife

sports

folk

Retrain Inception classifier

Photographer

Product

NAS

Page 8: Nas 也可以揀土豆

outline

◎ Machine learning◎ Deep learning

○ Neural Network○ Convolutional neural network

◎ Building a classifier for NAS◎ Study information

Page 9: Nas 也可以揀土豆

1.Machine LearningLet’s start with the first set of slides

Page 10: Nas 也可以揀土豆

Supervised Learning

[image](http://www.safebee.com/family/5-healthy-hygiene-habits-your-child-needs-learn)

Page 11: Nas 也可以揀土豆

Supervised Learning workflow

Raw Data

Labes

FeatureExtraction

Train the

Model

EvalModelModel

FeatureExtraction Predict

New DataModel

Labels

Training

Predicting

Page 12: Nas 也可以揀土豆

Supervised Learning workflow

Raw Data

Labes

FeatureExtraction

Train the

Model

EvalModelModel

FeatureExtraction Predict

New DataModel

Labels

Training

Predicting

Ripe Raw

Color/Shape etc...

Ripe

Raw

Ripe

Raw

Page 13: Nas 也可以揀土豆

Unsupervised Learning

[image](http://thoughtcatalog.com/nikolao-montaya/2014/06/how-to-be-cool-in-high-school/)

Page 14: Nas 也可以揀土豆

Ripe

Ripe

Raw

Raw

Raw Data Automated Clusters

Learning Algorithm

Page 15: Nas 也可以揀土豆

[image](http://www.artbooms.com/blog/primo-toy-cubetto-robot-legno-programmazione-prescolare)

Semi-Supervised Learning

Page 16: Nas 也可以揀土豆

Reinforcement Learning

[image](https://www.shutterstock.com/search/horse%20carrot)

Page 17: Nas 也可以揀土豆

Reinforcement Learning (RL)

[AlphaGo: Mastering the Game of Go with Deep Neural Networks and Tree …](http://www.slideshare.net/KarelHa1/alphago-mastering-the-game-of-go-with-deep-neural-networks-and-tree-search)

Page 18: Nas 也可以揀土豆

Mario - Machine Learning for Video Games 1

[NEATEvolve.lua - Pastebin.com](http://pastebin.com/ZZmSNaHX)

Page 19: Nas 也可以揀土豆

Mario - Machine Learning for Video Games 2

[NEATEvolve.lua - Pastebin.com](http://pastebin.com/ZZmSNaHX)

Page 20: Nas 也可以揀土豆

Smart programs can

learn from examples

[image](https://www.engadget.com/2016/07/12/machine-learning-ai/)

Page 21: Nas 也可以揀土豆

2.Deep LearningLet’s start with the second set of slides

Page 22: Nas 也可以揀土豆

Deep learning

[Deep Learning - Convolutional Neural Networks](http://www.slideshare.net/perone/deep-learning-convolutional-neural-networks)

Page 23: Nas 也可以揀土豆

Deep learning

[自然言語処理のためのDeep Learning](http://www.slideshare.net/yutakikuchi927/deep-learning-26647407)

Page 24: Nas 也可以揀土豆

one architecture to rule them

all

[image](http://www.consultparagon.com/blog/what-is-leadership-digital-transformation)

Page 25: Nas 也可以揀土豆

2.1.Neural Network

Page 26: Nas 也可以揀土豆

Neural Network Architecture

[Neural networks and deep learning](http://neuralnetworksanddeeplearning.com/chap1.html)

Page 27: Nas 也可以揀土豆

First Example: MNIST handwritten digits

Page 28: Nas 也可以揀土豆
Page 29: Nas 也可以揀土豆
Page 30: Nas 也可以揀土豆
Page 31: Nas 也可以揀土豆
Page 32: Nas 也可以揀土豆

a few seconds

60,000 imagesMNIST resource

Intel HD GraphicsCPU build-in graphics

Piece of cake ...

90% AccuracyFeeling good? But Google said it’s shameful ...

Page 33: Nas 也可以揀土豆

2.2.Convolutional Neural Network

The Google “Inception” deep neural network architecture. Source: Christian Szegedy et. al. Going deeper with convolutions. CVPR 2015.

Page 34: Nas 也可以揀土豆

WHAT IS CONVOLUTION?

Source: http://deeplearning.stanford.edu/wiki/index.php/Feature_extraction_using_convolution

Convolution with 3×3 Filter.

Page 35: Nas 也可以揀土豆

WHAT IS CONVOLUTION?

Source: http://deeplearning.stanford.edu/wiki/index.php/Feature_extraction_using_convolution

Page 36: Nas 也可以揀土豆

Convolutional Neural Network, CNN

[Understanding Convolutional Neural Networks for NLP – WildML](http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/)

Page 37: Nas 也可以揀土豆

Convolutional Neural Network, CNN

Page 38: Nas 也可以揀土豆

Convolutional Neural Network, CNN

Page 39: Nas 也可以揀土豆

becomes

Peeking inside Convnets

[Peeking inside Convnets | Audun M Øygard](https://auduno.github.io/2016/06/18/peeking-inside-convnets/)

Page 40: Nas 也可以揀土豆

a few hours

60,000 imagesMNIST resource

Intel i5 2.5GhzCPU build-in graphics

Not as easy as we think ...

99% AccuracyMy Goodness ...

Page 41: Nas 也可以揀土豆

Deep learning is a kind of neural network, and a neural network

is a kind of machine learning.

[image](https://www.hpcwire.com/2015/04/30/machine-learning-guru-sees-future-in-multi-gpu-clusters/)

Page 42: Nas 也可以揀土豆

3.Building a classifier for NASLet’s start with the third set of slides

Page 43: Nas 也可以揀土豆

Outline | Building a classifier for NAS

◎ How to train ?○ Train from scratch○ Re-train from inception modal

◎ Photo classifier Case study○ Flickr Photos/ Google search○ Fuji photography society monthly competition○ Imagenet sources

◎ Image type classifier (photos、scan document、business card)◎ Demo◎ Next Steps

○ video post-processing?○ Musicians?

◎ Search

Page 44: Nas 也可以揀土豆

2 weeksSpend a lot of time

14,197,122 imagesImageNet resource

8 NVIDIA Tesla K40sHigh-end professional graphics

[Research Blog: Train your own image classifier with Inception in TensorFlow](https://research.googleblog.com/2016/03/train-your-own-image-classifier-with.html)

Page 45: Nas 也可以揀土豆

Retrain Inception's Final Layer for New Categories

◎ reuse Imagenet pre-trained model extract features to predict new tasks?

◎ Transfer learning◎ General visual features

DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition

Page 46: Nas 也可以揀土豆

Retrain Inception's Final Layer for New Categories Cont.

◎ Installing and Running the TensorFlow Docker Image (gcr.io/tensorflow/tensorflow:latest-devel)

◎ Preparing target images○ Quantity > 100○ representation

◎ Use Python to train your own image classifier○ Distortions (--random_crop, --random_scale ects.)○ Hyper-parameters (--learning_rate ects.)

◎ Classify images with your trained classifier

[TensorFlow For Poets](https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/index.html?index=..%2F..%2Findex#0)

Page 47: Nas 也可以揀土豆

Case study: Types of Photography via Flickr

Portrait landscape wildlife

folk sport art

Page 48: Nas 也可以揀土豆

68.8 %Final test accuracy

23,666 imagesFlickr photos & Google search Art x 4545 , Folk x 4782, Landscape x 3379Portrait x 3706, Sport x 4967, Wildlife x 2887

5000 timesRetain iterator

Page 49: Nas 也可以揀土豆

89.0 %Final test accuracy

10,349 imagesFlickr photosFolk x 2083, Landscape x 3497Portrait x 3215, Wildlife x 1554

4000 timesRetain iterator

Page 50: Nas 也可以揀土豆

97.0 %Final test accuracy

13,685 imagesImagenet 11 categoriesAgaric/bolete/buckeye, horse chestnut, conker/coral fungus/ear, spike, capitulum/earthstar/gyromitra/hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa/peanut/stinkhorn, carrion fungus/toilet tissue, toilet paper, bathroom tissue/

4000 timesRetain iterator

Page 51: Nas 也可以揀土豆

Case study: Types of Photography via Fuji photography society (富士生活攝影協會月賽)

Portrait landscape wildlife

folk sport conceptual

Page 52: Nas 也可以揀土豆

Case study: Types of Photography via Fuji photography society (富士生活攝影協會月賽)

competitor銅牌

佳作

入選乙

入選甲

優選

金牌 銀牌

碩學會士/博學會士

Page 53: Nas 也可以揀土豆

45.8 %Final test accuracy

424 imagesFuji photography society monthly competition photos佳作 x 32, 入選乙 x 137, 入選甲 x 255, 優選 x 2, 未入選?

4000 timesRetain iterator

Page 54: Nas 也可以揀土豆

DemoCustom Photo classifier

Page 55: Nas 也可以揀土豆

Image type classifier

Invoices Business cards Scan documents

Page 56: Nas 也可以揀土豆

Next Steps | video

[Large-scale Video Classification with Convolutional Neural Networks (CVPR 2014)](http://cs.stanford.edu/people/karpathy/deepvideo/)

Page 57: Nas 也可以揀土豆

Next Steps | music

[Large-scale Video Classification with Convolutional Neural Networks (CVPR 2014)](http://cs.stanford.edu/people/karpathy/deepvideo/)[Deep Learning - Convolutional Neural Networks](http://www.slideshare.net/perone/deep-learning-convolutional-neural-networks)

Page 58: Nas 也可以揀土豆

Search

Page 59: Nas 也可以揀土豆

Open framework, models and worked examples for deep learning | Caffe

Caffe offers the○ model definitions○ optimization settings○ pre-trained weights

so you can start right away.

The BVLC models are licensed for unrestricted use.

The community shares models in our Model Zoo.

[DIY Deep Learning for Vision: a Hands-On Tutorial with Caffe - Google Slides](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.gc2fcdcce7_216_48)

Page 60: Nas 也可以揀土豆

Brewing by the Numbers … | Caffe

Speed with Krizhevsky's 2012 model:

○ 2 ms/image on K40 GPU

○ <1 ms inference with Caffe + cuDNN v4 on Titan X

○ 72 million images/day with batched IO

○ 8-core CPU: ~20 ms/image Intel optimization in progress

9k lines of C++ code (20k with tests)

[DIY Deep Learning for Vision: a Hands-On Tutorial with Caffe - Google Slides](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.gc2fcdcce7_216_48)

Page 61: Nas 也可以揀土豆

4.Study informationLet’s start with the fourth set of slides

Page 62: Nas 也可以揀土豆

◎ [Deep Learning | Udacity](https://www.udacity.com/course/deep-learning--ud730)

◎ [Research Blog: Train your own image classifier with Inception in TensorFlow](https://research.googleblog.com/2016/03/train-your-own-image-classifier-with.html)

◎ [jtoy/awesome-tensorflow: TensorFlow - A curated list of dedicated resources http://tensorflow.org](https://github.com/jtoy/awesome-tensorflow)

◎ [Deep Learning - Convolutional Neural Networks](http://www.slideshare.net/perone/deep-learning-convolutional-neural-networks)

◎ [Neural networks and deep learning](http://neuralnetworksanddeeplearning.com/chap1.html)

◎ [Multiple Component Learning](http://valse.mmcheng.net/ftp/20150312/dsn.pdf)◎ [Classifying Handwritten Digits with TF.Learn - Machine Learning Recipes #7 -

YouTube](https://www.youtube.com/watch?v=Gj0iyo265bc)

Study information

Page 63: Nas 也可以揀土豆

◎ [DIGITS/GettingStarted.md at master · NVIDIA/DIGITS](https://github.com/NVIDIA/DIGITS/blob/master/docs/GettingStarted.md)

◎ [How to Retrain Inception's Final Layer for New Categories](https://www.tensorflow.org/versions/r0.9/how_tos/image_retraining/index.html)

◎ [TensorFlow For Poets](https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/index.html?index=..%2F..%2Findex#0)

◎ [DIY Deep Learning for Vision: a Hands-On Tutorial with Caffe - Google Slides](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.gc2fcdcce7_216_48)

◎ [Caffe | Deep Learning Framework](http://caffe.berkeleyvision.org/)◎ [Understanding Convolutional Neural Networks for NLP –

WildML](http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/)

Study information

Page 64: Nas 也可以揀土豆

Thanks!Any questions?

You can find me at:http://[email protected]