딥러닝(deep learing) using deepdetect

43
로로로로로로로로 로로로로로로 2016.03.09 로로로 ([email protected] ) 로로로 (Deep Learning) - using DeepDetect -

Upload: junyi-song

Post on 15-Apr-2017

728 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: 딥러닝(Deep Learing) using DeepDetect

로엔엔터테인먼트플랫폼개발팀2016.03.09송준이

([email protected])

딥러닝 (Deep Learning)- using DeepDetect -

Page 2: 딥러닝(Deep Learing) using DeepDetect

목차

• DeepDetect = API + Server– DeepDetect 개요– 설치하기– 학습하고 서비스하기

• DeepDetect /predcit– 이미지 분류하기– pre-trained 모델 받기– 서비스 등록하기– 이미지 분류 예측하기

• DeepDetect /train– 입력 데이터셋 준비하기– 서비스 등록하기– 모델 학습하기– 텍스트 분류 예측하기

Page 3: 딥러닝(Deep Learing) using DeepDetect

목차

• DeepDetect 운영– pre-trained 이미지 분류 모델 등록하기– pre-trained 텍스트 분류 모델 등록하기– 학습 서버와 상용 서버 분리

• Auto-tagging on Elasticsearch– DeepDetect + Elasticsearch– Auto-tagging

Page 4: 딥러닝(Deep Learing) using DeepDetect

DeepDetect= API + Server

Page 5: 딥러닝(Deep Learing) using DeepDetect

DeepDetect 개요

• DeepDetect 특징– 딥러닝을 위한 API 와 서버 제공– 오픈소스– C++1.1 로 개발– Caffe 딥러닝 라이브러리 지원 (https://github.com/BVLC/caffe)– 이미지 / 텍스트 /CSV 파일에 대한 supervised 딥러닝을 구현– API 뿐만 아니라 학습 (training) 과 상용 서비스를 위한 서버를 동시에 지원– 학습을 위한 개발 서버와 서비스를 위한 상용 서버를 분리한 아키텍처 구성

Page 6: 딥러닝(Deep Learing) using DeepDetect

설치하기

• 설치를 위한 사전 준비

• 컴파일

$ sudo apt-get install build-essential libgoogle-glog-dev libgflags-dev libeigen3-dev libopencv-dev libcppnetlib-dev libboost-dev libcurlpp-dev libcurl4-openssl-dev proto-buf-compiler libopenblas-dev libhdf5-dev libprotobuf-dev libleveldb-dev libsnappy-dev liblmdb-dev libutfcpp-dev cmake

$ git clone https://github.com/beniz/deepdetect.git$ cd deepdetect$ mkdir build$ cd build$ cmake ..$ make

Installing DeepDetect, http://www.deepdetect.com/overview/installing/

Page 7: 딥러닝(Deep Learing) using DeepDetect

설치하기

• 서버 실행하기

– 서버는 8080/http 포트에서 실행

• 서버 상태 확인하기

$ ./main/dede DeepDetect [ commit c8556f0b3e7d970bcd9861b910f9eae87cfd4b0c ]Running DeepDetect HTTP server on localhost:8080

Installing DeepDetect, http://www.deepdetect.com/overview/installing/

$ curl -XGET 'http://localhost:8080/info' | json_pp { "status" : { "msg" : "OK", "code" : 200 }, "head" : { "version" : "0.1", "services" : [], "branch" : "master", "commit" : "c8556f0b3e7d970bcd9861b910f9eae87cfd4b0c", "method" : "/info" }}

Page 8: 딥러닝(Deep Learing) using DeepDetect

학습하고 서비스하기

• 이미지 분류기 (Classifier)

1. 분류 (class) 가 알려진 이미지를 입력으로 학습 (training) 시킨다2. 딥러닝 엔진은 학습된 결과로 모델 (model) 을 만든다3. 새로운 이미지에 대한 분류값을 예측 (predict) 요청한다4. 어플리케이션 서비스는 생성된 모델을 기반으로 새로운 이미지에 대한 분류값을

예측한다 .

Page 9: 딥러닝(Deep Learing) using DeepDetect

학습하고 서비스하기

• DeepDetect 로 이미지 분류하기

1. 분류 (class) 가 알려진 이미지를 입력으로 학습 (training) 시킨다2. 딥러닝 엔진은 학습된 결과로 모델 (model) 을 만든다3. 모델에 대한 서비스를 등록한다 .4. 새로운 이미지에 대한 분류값을 예측 (predict) 요청한다5. 어플리케이션 서비스는 생성된 모델을 기반으로 새로운 이미지에 대한 분류값을

예측한다 .

DeepDetect = API + Server

Page 10: 딥러닝(Deep Learing) using DeepDetect

DeepDetect /predict이미지 분류하기 예제

Page 11: 딥러닝(Deep Learing) using DeepDetect

이미지 분류하기

• 학습된 모델로 이미지 분류하기

– 이미 학습된 모델이 있다면 ,• 모델에 대한 서비스를 등록• 새로운 이미지에 대한 분류를 예측

– 학습은 조금 후에 다룰 것…

Setup of image classifier, http://www.deepdetect.com/tutorials/imagenet-classifier/

Page 12: 딥러닝(Deep Learing) using DeepDetect

pre-trained 모델 받기

• GoogleNet 모델 받기

• 서비스할 모델 레파지토리 만들기

– 서버에서 사용할 모델 레파지토리 디렉토리를 생성• 레파지토리 경로는 서비스를 등록할 때 지정하므로 , 위치는 어디든 상관 없다• 서비스 단위로 레파지토리 디렉토리를 생성 . 이 경우에는 imgnet 을 사용

Setup of image classifier, http://www.deepdetect.com/tutorials/imagenet-classifier/

$ cd build/caffe_dd/src/caffe_dd$ ./scripts/download_model_binary.py models/bvlc_googlenet/

$ ls -l models/bvlc_googlenet/*.caffemodel

$ cd deepdetect$ mkdir models$ mkdir models/imgnet$ mv build/caffe_dd/src/caffe_dd/models/bvlc_googlenet/bvlc_googlenet.caffemodel models/imgnet

Page 13: 딥러닝(Deep Learing) using DeepDetect

pre-trained 모델 받기

• 분류 (Class) 매핑 데이터 추가하기

– 학습 단계에서 자동으로 생성됨– 예제에서 사용할 pre-trained 모델에 대한 분류 매핑 데이터를 가짐

Setup of image classifier, http://www.deepdetect.com/tutorials/imagenet-classifier/

cp datasets/imagenet/corresp_ilsvrc12.txt models/imgnet/corresp.txt

$ head models/imgnet/corresp.txt0 n01440764 tench, Tinca tinca1 n01443537 goldfish, Carassius auratus2 n01484850 great white shark, white shark, man-eater, man-eating shark, Carchar-odon carcharias3 n01491361 tiger shark, Galeocerdo cuvieri4 n01494475 hammerhead, hammerhead shark5 n01496331 electric ray, crampfish, numbfish, torpedo…

Page 14: 딥러닝(Deep Learing) using DeepDetect

서비스 등록하기

• 서버 실행하기

• 서비스 등록하기

Setup of image classifier, http://www.deepdetect.com/tutorials/imagenet-classifier/

$ cd deepdetect/build/main$ ./dede

curl -X PUT "http://localhost:8080/services/imageserv" -d '{ "mllib":"caffe", "description":"image classification service", "type":"supervised", "parameters":{ "input":{ "connector":"image" }, "mllib":{ "template":"googlenet", "nclasses":1000 } }, "model":{ "templates":"../templates/caffe/", "repository":"../../models/imgnet" }}' | json_pp{ "status" : { "code" : 201, "msg" : "Created" }}

Page 15: 딥러닝(Deep Learing) using DeepDetect

서비스 등록하기

• 서비스 등록하기– 서비스명 : imgserve

• mlib: Machine learning LIBrary• type: supervised• connector: image, text, csv 중 선택• nclasses: Number of CLASSES, 예측할 분류값 개수• repository: 서비스할 모델이 저장된 위치

Setup of image classifier, http://www.deepdetect.com/tutorials/imagenet-classifier/

Page 16: 딥러닝(Deep Learing) using DeepDetect

이미지 분류 예측하기

• 로컬 이미지 파일로 예측하기

Setup of image classifier, http://www.deepdetect.com/tutorials/imagenet-classifier/

$ cd deepdetect/build/main$ wget http://www.deepdetect.com/img/ambulance.jpg$ curl -X POST "http://localhost:8080/predict" -d'{ "service":"imageserv", "parameters":{ "input":{ "width":224, "height":224 }, "output":{ "best":3 } }, "data":[ "ambulance.jpg" ]}‘ | json_pp

Page 17: 딥러닝(Deep Learing) using DeepDetect

이미지 분류 예측하기

• 로컬 이미지 파일로 예측하기– 서비스명 : imgserve

• output: 예측 결과에 포함할 최대 분류 개수{ "status" : { "code" : 200, "msg" : "OK" }, "body" : { "predictions" : { "uri" : "ambulance.jpg", "classes" : [ { "prob" : 0.992852032184601, "cat" : "n02701002 ambulance" }, { "prob" : 0.0069321496412158, "cat" : "n03977966 police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria" }, { "cat" : "n03769881 minibus", "last" : true, "prob" : 6.9531706685666e-05 } ] } }, "head" : { "time" : 1211, "service" : "imageserv", "method" : "/predict" }}

Page 18: 딥러닝(Deep Learing) using DeepDetect

이미지 분류 예측하기

• 이미지 URL 로 예측하기

$ curl -X POST "http://localhost:8080/predict" -d'{ "service":"imageserv", "parameters":{ "input":{ "width":224, "height":224 }, "output":{ "best":3 } }, "data":[ "http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg" ]}' | json_pp… "predictions" : { "classes" : [ { "cat" : "n03868863 oxygen mask", "prob" : 0.225514054298401 }, { "prob" : 0.209176555275917, "cat" : "n03127747 crash helmet" }, ], "uri" : http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg…

Page 19: 딥러닝(Deep Learing) using DeepDetect

DeepDetect /train텍스트 학습하기 예제

Page 20: 딥러닝(Deep Learing) using DeepDetect

입력 데이터셋 준비하기

• news20 데이터– 20 가지 주제에 대한 이메일 데이터– 각 주제별 1000 개 이하의 텍스트 이메일 파일$ cd deepdetect/$ mkdir input$ mkdir input/models$ mkdir input/models/n20$ cd input/models/n20$ wget http://www.deepdetect.com/dd/examples/all/n20/news20.tar.bz2$ tar xvjf news20.tar.bz2$ rm -rf news20.tar.bz2$ ll news20/drwxr-xr-x 2 socurites socurites 32768 9 월 30 00:52 alt_atheism/drwxr-xr-x 2 socurites socurites 36864 9 월 30 00:52 comp_graphics/drwxr-xr-x 2 socurites socurites 36864 9 월 30 00:52 comp_os_ms_windows_m/…$ cat news20/rec_autos/000000431.emlFrom: [email protected] (Dave Duff)Subject: Re: Waxing a new carI just had my 41 Chrysler painted. I was told to refrain from waxing it andto leave it out in the sun!! Supposedly this let's the volatiles escape fromthe paint over a month or so (I can smell it 15 feet away on a hot day) andlets any slight irregularites in the surface flow out, as the paint remainsa little soft for a while.

Training a model from text, http://www.deepdetect.com/tutorials/txt-training/

Page 21: 딥러닝(Deep Learing) using DeepDetect

서비스 등록하기

• 서버 실행하기

• 서비스 등록하기

$ cd deepdetect/build/main$ ./dede

$ cd deepdetect/models$ mkdir n20$ curl -X PUT "http://localhost:8080/services/n20" -d '{ "mllib":"caffe", "description":"newsgroup classification service", "type":"supervised", "parameters":{ "input":{ "connector":"txt" }, "mllib":{ "template":"mlp", "nclasses":20, "layers":[200, 200], "activation":"relu" } }, "model":{ "templates":"../../templates/caffe/", "repository":"../../models/n20" }}' | json_pp

Page 22: 딥러닝(Deep Learing) using DeepDetect

서비스 등록하기

• 서비스 등록하기– 서비스명 : n20

• layers: 200 X 200, 200 개의 히든 노드 (hidden node) 의 2 개 레이어로 구성• activation: 활성함수로는 relu(Rectified Linear Unit) 을 사용• 상대 경로는 모두 DeepDetect 서버 실행한 경로로부터 시작

Training a model from text, http://www.deepdetect.com/tutorials/txt-training/

Page 23: 딥러닝(Deep Learing) using DeepDetect

모델 학습하기

• BOW(Bag Of Words) 모델로 학습하기curl -X POST "http://localhost:8080/train" -d '{ "service":"n20", "async":true, "parameters":{ "mllib":{ "gpu":true, "solver":{ "iterations":2000, "test_interval":200, "base_lr":0.05 }, "net":{ "batch_size":300 } }, "input":{ "shuffle":true, "test_split":0.2, "min_count":2, "min_word_length":2, "count":false }, "output":{ "measure":[ "mcll", "f1" ] } }, "data":[ "../../input/models/n20/news20" ]}'

Page 24: 딥러닝(Deep Learing) using DeepDetect

모델 학습하기

• BOW(Bag Of Words) 모델로 학습하기– 파라미터

• gpu: 연산시 gpu 사용 여부• iterations: 이터레이션 횟수• test_split: 입력데이터 중 테스트 데이터 비율 (20%)• min_count: 최소 단어 빈도 , 이 빈도보다 적은 단어는 BOW 에서 제외• min_word_length: 단어의 최소 길이 , 이 길이보다 작은 단어는 BOW 에서 제외• count: 빈도값 학습 사용 여부

– 서버 로그INFO - source=../../templates/caffe/mlp/INFO - dest=../../models/n20/mlp.prototxtlist subdirs size=20WARNING: Logging before InitGoogleLogging() is written to STDERRI0309 18:11:13.121186 31042 txtinputfileconn.cc:182] vocabulary size=88631data split test size=3770 / remaining data size=15078vocab size=88631INFO - user batch_size=300 / inputc batch_size=15078INFO - batch_size=359 / test_batch_size=290 / test_iter=13

Page 25: 딥러닝(Deep Learing) using DeepDetect

모델 학습하기

• BOW(Bag Of Words) 단어 리스트$ cd deepdetect$ cd models/n20/$ lltotal 1264drwxrwxr-x 2 socurites socurites 4096 3 월 9 18:11 ./drwxrwxr-x 4 socurites socurites 4096 3 월 9 17:50 ../-rw-rw-r-- 1 socurites socurites 372 3 월 9 18:11 corresp.txt-rw-rw-r-- 1 socurites socurites 1065 3 월 9 18:11 deploy.prototxt-rw-rw-r-- 1 socurites socurites 1704 3 월 9 18:11 mlp.prototxt-rw-rw-r-- 1 socurites socurites 290 3 월 9 18:10 mlp_solver.prototxt-rw-rw-r-- 1 socurites socurites 4389 3 월 9 18:11 model.json-rw-rw-r-- 1 socurites socurites 1259121 3 월 9 18:11 vocab.dat$ head vocab.dat autoposting,0seidov,1ambulances,2isqat,3earring,4grigorevna,5barfling,613271@cs,7024858,8aryeh,9

Page 26: 딥러닝(Deep Learing) using DeepDetect

모델 학습하기

• 학습 진행상황 모니터링하기$ curl -X GET "http://localhost:8080/train?service=n20&job=1" | json_pp{ "status" : { "msg" : "OK", "code" : 200 }, "head" : { "time" : 791, "status" : "running", "method" : "/train", "job" : 1 }, "body" : { "measure" : { "accp" : 0.90053050397878, "iteration" : 800, "recall" : 0.902855203525655, "train_loss" : 0.034172598272562, "precision" : 0.897884533058947, "mcll" : 0.389328922262699, "f1" : 0.900363007899212 } }}

## 1s 마다 상태 출력하기$ while :; do curl -X GET "http://localhost:8080/train?service=n20&job=1"; sleep 1; echo ""; done

Page 27: 딥러닝(Deep Learing) using DeepDetect

모델 학습하기

• 학습 완료

$ curl -X GET "http://localhost:8080/train?service=n20&job=1" | json_pp{ "status":{ "msg":"OK", "code":200 }, "body":{ "parameters":{ "mllib":{ "batch_size":359 } }, "measure":{ "f1":0.8919178423728972, "train_loss":0.0016851313412189484, "mcll":0.5737156999301365, "recall":0.8926410552973584, "iteration":1999.0, "precision":0.8911958003860988, "accp":0.8936339522546419 } }, "head":{ "status":"finished", "job":1, "method":"/train", "time":541.0 }}

Page 28: 딥러닝(Deep Learing) using DeepDetect

텍스트 분류 예측하기

• /predict– 서비스명 : n20

$ curl -X POST 'http://localhost:8080/predict' -d '{ "service":"n20", "parameters":{ "mllib":{ "gpu":true } }, "data":[ "my computer runs linux" ]}‘ | json_pp

Page 29: 딥러닝(Deep Learing) using DeepDetect

텍스트 분류 예측하기

• /predict$ curl -X POST 'http://localhost:8080/predict' -d '{ "service":"n20", "parameters":{ "mllib":{ "gpu":true } }, "data":[ "my computer runs linux" ]}' | json_pp{ "status" : { "msg" : "OK", "code" : 200 }, "body" : { "predictions" : { "classes" : { "prob" : 0.392086714506149, "last" : true, "cat" : "comp_windows_x" }, "uri" : "0" } }, "head" : { "method" : "/predict", "service" : "n20", "time" : 925 }}

Page 30: 딥러닝(Deep Learing) using DeepDetect

DeepDetect 운영학습 서버와 서비스 서버 분리

Page 31: 딥러닝(Deep Learing) using DeepDetect

pre-trained 이미지 분류 모델 등록하기

• pre-trained 이미지 분류 모델 예– 옷

• 분류 개수 : 304• http://www.deepdetect.com/models/clothing.tar.bz2

– 가방• 분류 개수 : 37• http://www.deepdetect.com/models/bags.tar.bz2

– 신발• 분류 개수 : 51• http://www.deepdetect.com/models/footwear.tar.bz2

Application-Ready Deep Neural Net Models, http://www.deepdetect.com/applications/model/

Page 32: 딥러닝(Deep Learing) using DeepDetect

pre-trained 이미지 분류 모델 등록하기

• pre-trained clothing 분류 모델 설치하기$ cd deepdetect/$ 2037 cd models/$ mkdir dd$ cd dd$ wget http://www.deepdetect.com/models/clothing.tar.bz2$ bunzip2 clothing.tar.bz2 $ tar xvf clothing.tar $ rm -rf clothing.tar$ ll clothing/total 99688drwxrwxr-x 2 socurites socurites 4096 11 월 26 06:18 ./drwxrwxr-x 3 socurites socurites 4096 3 월 10 10:12 ../-rw-rw-r-- 1 socurites socurites 6738 11 월 23 16:28 corresp.txt-rw-rw-r-- 1 socurites socurites 35884 11 월 20 04:16 deploy.prototxt-rw-rw-r-- 1 socurites socurites 395 11 월 19 01:46 final.json-rw-rw-r-- 1 socurites socurites 40791 11 월 20 04:16 googlenet.prototxt-rw-rw-r-- 1 socurites socurites 295 11 월 20 04:16 googlenet_solver.prototxt-rw-rw-r-- 1 socurites socurites 602126 11 월 16 00:22 mean.binaryproto-rw-rw-r-- 1 socurites socurites 50682165 11 월 26 06:03 model_iter_300000.caffemodel-rw-rw-r-- 1 socurites socurites 50661476 11 월 26 06:03 model_iter_300000.solverstate-rw-rw-r-- 1 socurites socurites 13896 11 월 20 04:16 model.json$ head clothing/corresp.txt 303 camisole302 array, raiment, regalia301 tricorn, tricorne300 crash helmet299 ensemble298 robe297 seat belt, seatbelt296 parka, windbreaker, windcheater, anorak

Page 33: 딥러닝(Deep Learing) using DeepDetect

pre-trained 이미지 분류 모델 등록하기

• pre-trained clothing 분류 모델 설치하기$ cd deepdetect/$ 2037 cd models/$ mkdir dd$ cd dd$ wget http://www.deepdetect.com/models/clothing.tar.bz2$ bunzip2 clothing.tar.bz2 $ tar xvf clothing.tar $ rm -rf clothing.tar$ ll clothing/total 99688drwxrwxr-x 2 socurites socurites 4096 11 월 26 06:18 ./drwxrwxr-x 3 socurites socurites 4096 3 월 10 10:12 ../-rw-rw-r-- 1 socurites socurites 6738 11 월 23 16:28 corresp.txt-rw-rw-r-- 1 socurites socurites 35884 11 월 20 04:16 deploy.prototxt-rw-rw-r-- 1 socurites socurites 395 11 월 19 01:46 final.json-rw-rw-r-- 1 socurites socurites 40791 11 월 20 04:16 googlenet.prototxt-rw-rw-r-- 1 socurites socurites 295 11 월 20 04:16 googlenet_solver.prototxt-rw-rw-r-- 1 socurites socurites 602126 11 월 16 00:22 mean.binaryproto-rw-rw-r-- 1 socurites socurites 50682165 11 월 26 06:03 model_iter_300000.caffemodel-rw-rw-r-- 1 socurites socurites 50661476 11 월 26 06:03 model_iter_300000.solverstate-rw-rw-r-- 1 socurites socurites 13896 11 월 20 04:16 model.json$ head clothing/corresp.txt 303 camisole302 array, raiment, regalia301 tricorn, tricorne300 crash helmet299 ensemble298 robe297 seat belt, seatbelt296 parka, windbreaker, windcheater, anorak

Page 34: 딥러닝(Deep Learing) using DeepDetect

pre-trained 이미지 분류 모델 등록하기

• pre-trained clothing 분류 서비스 등록하기

$ curl -X PUT "http://localhost:8080/services/clothing" -d '{ "mllib":"caffe", "description":"clothes classification", "type":"supervised", "parameters":{ "input":{ "connector":"image", "height":224, "width":224

}, "mllib":{ "nclasses":304 } }, "model":{ "repository":"../../models/dd/clothing" }}' | json_pp

Page 35: 딥러닝(Deep Learing) using DeepDetect

pre-trained 텍스트 분류 모델 등록하기

• pre-trained n20 분류 서비스 등록하기– dede(DeepDetect) 서버에 등록된 서비스는 메모리 휘발성– 서버 재기동시 메모리 재등록 필요– 앞서 직접 학습한 n20 모델을 서비스로 등록– 학습을 위한 서비스 등록과 구분할 것

$ curl -X PUT "http://localhost:8080/services/n20" -d '{ "mllib":"caffe", "description":"clothes classification", "type":"supervised", "parameters":{ "input":{ "connector":"txt" }, "mllib":{ "nclasses":20 } }, "model":{ "repository":"../../models/n20" }}' | json_pp

Page 36: 딥러닝(Deep Learing) using DeepDetect

학습 서버와 상용 서버 분리

• 서버 구조학습 서버

서비스 서버

Page 37: 딥러닝(Deep Learing) using DeepDetect

Auto-tagging on ElasticsearchDeepDetect + Elasticsearch

Page 38: 딥러닝(Deep Learing) using DeepDetect

DeepDetect + Elasticsearch• 이미지 분류 예측 문서 색인하기

– url: Elasticsearch 색인 URL$ curl -XPOST "http://localhost:8080/predict" -d'{ "service":"clothing", "parameters":{ "mllib":{ "gpu":true }, "input":{ "width":224, "height":224 }, "output":{ "best":3, "network":{ "url":"http://localhost:9200/images/img", "http_method":"POST" } } }, "data":[ "http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg" ]}' | json_pp{ "created" : true, "_type" : "img", "_index" : "images", "_version" : 1, "_id" : "AVNeQmBY4KIRwyO4ideH"}

Page 39: 딥러닝(Deep Learing) using DeepDetect

DeepDetect + Elasticsearch• 색인 결과

$ curl -XGET 'http://localhost:9200/images/img/_search' | json_pp… { "_source" : { "body" : { "predictions" : { "classes" : [ { "cat" : "spacesuit", "prob" : 0.935437917709351 }, { "cat" : "military uniform", "prob" : 0.0494481474161148 } ], "uri" : "http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg" } }, "network" : { "http_method" : "POST", "url" : "http://localhost:9200/images/img" }, "head" : { "time" : 1875, "service" : "clothing", "method" : "/predict" }, },…

Page 40: 딥러닝(Deep Learing) using DeepDetect

DeepDetect + Elasticsearch• 검색하기

– spacesuit( 우주복 ) 이 있는 이미지 검색하기$ curl -XGET "http://localhost:9200/images/_search?q=spacesuit" | json_pp…"hits" : { "hits" : [ { "_id" : "AVNeNkfE4KIRwyO4idNw", "_source" : { "status" : { "msg" : "OK", "code" : 200 }, "head" : { "time" : 1330, "method" : "/predict", "service" : "clothing" }, "network" : { "url" : "http://localhost:9200/images/img", "http_method" : "POST" }, "body" : { "predictions" : { "classes" : [ { "prob" : 0.935437917709351, "cat" : "spacesuit" }, { "prob" : 0.0494481474161148, "cat" : "military uniform“…

Page 41: 딥러닝(Deep Learing) using DeepDetect

Auto-tagging• 문서 자동 태그 붙이기

– 문서 ( 이미지 / 텍스트 등 ) 에 대한 분류 예측 요청– 예측된 분류값을 문서에 포함하여 Elasticsearch 서버에 색인– 검색된 문서에 대한 검색 요청

Page 42: 딥러닝(Deep Learing) using DeepDetect

References• Categorizing images with deep learning into Elasticsearch

https://www.elastic.co/blog/categorizing-images-with-deep-learning-into-elasticsearch

• DeepDetect Homepagehttp://www.deepdetect.com/

• DeepDetect: Installing DeepDetecthttp://www.deepdetect.com/overview/installing/

• DeepDetect: Setup of an image classifierhttp://www.deepdetect.com/tutorials/imagenet-classifier/

• DeepDetect: Training a model from texthttp://www.deepdetect.com/tutorials/txt-training/

• DeepDetect: Application-Ready Deep Neural Net Models, http://www.deepdetect.com/applications/model/