Nas 也可以揀土豆

64
NAS 也可以揀土豆 Open source application

Transcript of Nas 也可以揀土豆

NAS 也可以揀土豆

Open source application

Hello!I am Cage Chung

I am here because I like to share my experiences.

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

Andy

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的!

“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

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

Photographer○ Photos (jpeg, RAW)

Musicians○ Music files (mp3)○ Videos

NAS | usage

Our scenario is easy

Portraitlandscape

wildlife

sports

folk

Retrain Inception classifier

Photographer

Product

NAS

outline

◎ Machine learning◎ Deep learning

○ Neural Network○ Convolutional neural network

◎ Building a classifier for NAS◎ Study information

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

Supervised Learning

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

Supervised Learning workflow

Raw Data

Labes

FeatureExtraction

Train the

Model

EvalModelModel

FeatureExtraction Predict

New DataModel

Labels

Training

Predicting

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

Unsupervised Learning

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

Ripe

Ripe

Raw

Raw

Raw Data Automated Clusters

Learning Algorithm

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

Semi-Supervised Learning

Reinforcement Learning

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

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)

Mario - Machine Learning for Video Games 1

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

Mario - Machine Learning for Video Games 2

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

Smart programs can

learn from examples

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

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

Deep learning

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

Deep learning

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

one architecture to rule them

all

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

2.1.Neural Network

Neural Network Architecture

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

First Example: MNIST handwritten digits

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 ...

2.2.Convolutional Neural Network

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

WHAT IS CONVOLUTION?

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

Convolution with 3×3 Filter.

WHAT IS CONVOLUTION?

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

Convolutional Neural Network, CNN

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

Convolutional Neural Network, CNN

Convolutional Neural Network, CNN

becomes

Peeking inside Convnets

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

a few hours

60,000 imagesMNIST resource

Intel i5 2.5GhzCPU build-in graphics

Not as easy as we think ...

99% AccuracyMy Goodness ...

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/)

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

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

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)

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

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)

Case study: Types of Photography via Flickr

Portrait landscape wildlife

folk sport art

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

89.0 %Final test accuracy

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

4000 timesRetain iterator

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

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

Portrait landscape wildlife

folk sport conceptual

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

competitor銅牌

佳作

入選乙

入選甲

優選

金牌 銀牌

碩學會士/博學會士

45.8 %Final test accuracy

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

4000 timesRetain iterator

DemoCustom Photo classifier

Image type classifier

Invoices Business cards Scan documents

Next Steps | video

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

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)

Search

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)

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)

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

◎ [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

◎ [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

Thanks!Any questions?

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