2017/07/01 chainerã®ãã¦ã³ã°ã¬ã¼ãã«é¢ãã¦è¿½è¨
ã¯ã¦ãªTã·ã£ããæã«å ¥ããããã«äººå·¥ç¥è½ã使ã£ã¦ã¿ããã¨ãèãã¾ãã
ãã¯ã¦ãªããã°ã®ãã©ãã³ã³ãã¹ããæ¯å¹´ææ¦ãã¦ããã®ã§ããã1åè½é¸ã2åå ¥è³ã¨ããæ績ã§ããä»å¹´ããTã·ã£ã絶対ã²ããããã¨ããå ãæããæã£ã¦ãã¾ãããã©ãã³ã³ã§åã¤ããã«ã¯ã©ãããã°è¯ããããã¤ãæ©ãã®ããã©ã®åçããã©ãã³ã³ã«åºããã§ããéå»ãä»ã®åçãåºãã¦ããã°åè³ã§ãã¦ããã®ã§ã¯ï¼ã¨æããã¨ãå¤ã æãã¾ãï¼åéãããã§ããï¼ã
ãã§ããã©ãããã©ãã³ã³ã§åè³ã§ããåçããªãã¦åãããããããã¾ããâ¦ãã¼ããåçãã¿ãã ãã§éæ³ã®ããã«å¤å¥ãã¦ããã便å©ãªãã®ãããã°â¦ã¾ã¦ãã人é¡ã«ã¯ãã£ã¼ãã©ã¼ãã³ã°ããããããªããï¼ããã使ãã°ä½ã§ãã§ããã¯ãï¼ãã£ã¨ãã©ãã³ã³ã®åè³åçãå¤å¥ãããªãã¦ãè¶ã®åããããã®ã¯ãï¼
ãã¨ããããã§ãã¯ã¦ãªããã°ã®ãã©ãã³ã³ã§ã¯ã¦ãªTã·ã£ããã²ããã§ãããå¤å¥ãã人工ç¥è½ãèªä½ãã¦ã¿ããã¨ã«ãã¾ãããã¡ãªã¿ã«ããããããã°ããå®å®èªãç¶ãã®ã§ãããããããªã人ã¯ãæå¾ã®ã¾ã¨ãã ãè¦ãããããã§é¢è±ããæ¹ããã¿ã¼ã§ããã¡ãªã¿ã«æåã«è¨ã£ã¦ããã¨ã¿ã¤ãã«ã®éãå ¨ç¶ãã¾ãããã¾ããã§ããã
GUIã®ãã£ã¼ãã©ã¼ãã³ã°ãã¼ã«CSLAIERã®æ¦è¦ã¨ã»ããã¢ãã
CSLAIERã¨ã¯ï¼
ãä»åã¯ããã£ã¼ãã©ã¼ãã³ã°ã®å¦ç¿ã¨å¤å¥ã«CSLAIERã¨ããSONYã¨UEIãéçºãããã£ã¼ãã©ã¼ãã³ã°ã®GUIãã¼ã«ã使ãã¾ããããã使ãã¨GUIã§ç´æçã«ãã£ã¼ãã©ã¼ãã³ã°ã使ããã®ã§é常ã«è¯ãã§ãã詳ããã¯ãéçºè ã®ä¸äººã® id:shi3z ããã®ä»¥ä¸ã®èæ¸ãèªãã®ãä¸çªããã¨æãã¾ãã
ããã¼ã«èªä½ã¯ãGitHubã§MITã©ã¤ã»ã³ã¹ã§å
¬éããã¦ãã¦ã誰ã§ãåç¨ã«ãå人ç¨ã«ã使ç¨ã§ããããã«ãªã£ã¦ãã¾ããç´ æ´ãããã§ããããã£ã¼ãã©ã¼ãã³ã°ã®ãã¬ã¼ã ã¯ã¼ã¯ã¯ãå½ç£ã®Chainer
ã¨ãããã¬ã¼ã ã¯ã¼ã¯ã使ç¨ããã¦ãã¾ãã
ãChainerã§ã®ç»åèªèãªã©ã¯ã以åãã£ãããã¦ãã¾ããèå³ããæ¹ã¯ä»¥ä¸åç §ãã ãã
ãå¦ç¿ã«é¢ãã¦ã¯ããªããªãæ軽ã«ããæ¹æ³ããªãäºã®è¶³ã®è¸ãã§ããã®ã§ãããCSLAIERã使ãã¨é常ã«ç°¡åã«å¦ç¿ããå¤å¥ã¾ã§å®æ½ãããã¨ãå¯è½ã«ãªãã¾ãã
CSLAIERã»ããã¢ãã
ãå ¬å¼ã¯ã以ä¸GitHubã®REAMEã«æ¸ãã¦ããã¾ãã
ãåºæ¬çã«ã¯å ¬å¼ã«å¾ãã°ããã®ã§ãããåèã¾ã§ã«èªåãMacã§pyenvã使ã£ã¦è¨å®ããä¾ãè¨è¼ãã¦ããã¾ãã以ä¸ã¯åºæ¬èªåã®ã¡ã¢ãªã®ã§ãã¾ããããªãå ´åã¯å ¬å¼ãåèã«ãã¾ãããã
ãã¾ãã以ä¸è¨äºãåç
§ã«ãpyenv-virtualenvã¤ã³ã¹ãã¼ã«
ã®ã¨ããã¾ã§å®æ½ãã¾ãã
ããã®ãã¨ã¯CSLAIERç¨ã®ä»®æ³ç°å¢ãæ§ç¯ãã¦ãä»®æ³ç°å¢ã«å ¥ãã¾ãã
$ pyenv global anaconda-2.4.0 $ conda create -n cslaier opencv hdf5 scipy matplotlib $ pyenv global anaconda-2.4.0/envs/cslaier
ããã¨ã¯ãä»®æ³ç°å¢ã§å¿ è¦ãªããã±ã¼ã¸ãREADMEã®éãã¤ã³ã¹ãã¼ã«ãã¾ãã
$ git clone https://github.com/SonyCSL/CSLAIER $ cd CSLAIER $ ./setup.sh $ pip install -r requirements.txt
ã追è¨ã2017å¹´7æç¾å¨ãchainer
ã®ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ããã«ããåä½ããªããªã£ã¦ããããã§ãã以ä¸ã§chainer
ã®ãã¦ã³ã°ã¬ã¼ãããã¦ä¸ããã
$ pip uninstall chainer $ pip install chainer==1.8.1
ãããã§ã»ããã¢ããå®äºããã®ã§ã以ä¸ã§CSLAIERãèµ·åãã¾ãã
$ ./run.sh
ã以ä¸ã®ããã«è¡¨ç¤ºããããOKã§ã
[INFO] Starting CSLAIER server on localhost:8080
ãSafariãªã©ã®ãã©ã¦ã¶ã®ã¢ãã¬ã¹æ¬ã«localhost:8080
ãå
¥åãã¾ãã以ä¸ã®ãããªç»é¢ãã§ãã°ã»ããã¢ããã¯å®äºã§ãã
CSLAIERã§å¦ç¿ããå¤å¥ã¾ã§ãã¹ã
ãCSLAIERã§ã®å¦ç¿ããå¤å¥ã¾ã§ã®æµãã¯ä»¥ä¸ã®éãã§ããããã¯ãä»ã®ãã£ã¼ãã©ã¼ãã³ã°ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãåæ§ã®æµãã§ããã
- ãã¼ã¿ã»ããæºå
- å¦ç¿
- å¤å¥ãã¹ã
ãã¼ã¿ã»ããæºå
ãã¾ãã¯ãã¹ãçã«ã代表çãªå¤å¥ç¨ã®ãã¼ã¿ã»ããããã¦ã³ãã¼ããã¾ããå
·ä½çã«ã¯ã以ä¸ã®Caltech101
ã¨ãããã¤ãè½ã¨ãã¾ãã
ãä¸è¨ãµã¤ãããããããã¯ãªãã¯ãã¦ãã¦ã³ãã¼ããã¦å§ç¸®ããã°ããã®ã§ããã説æãé¢åãããã®ã§ä»¥ä¸Macã®ã¿ã¼ããã«ã®ã³ãã³ãã§èª¬æãã¾ããã³ãã³ãããããããªã人ã¯ãä¸è¨ãµã¤ããããã¦ã³ãã¼ããããã¡ã¤ã«ãã¨ã«ããzipã§åºããã°ããã§ããé å¼µã£ã¦ã¿ã¦ãã ããã
ã以ä¸ã³ãã³ãã§ãã¼ã¿ã»ãããã¦ã³ãã¼ããã¦è§£åãã¾ãã
$ wget http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz $ tar xvzf 101_ObjectCategories.tar.gz
ããã¡ã¤ã«ã®ä¸èº«ã¯ä»¥ä¸ã®ããã«ããã©ã«ãåãã¯ã©ã¹ãä¸ã«ç»åãã¡ã¤ã«ãããããå ¥ã£ã¦ããããã«ãªã£ã¦ããã°OK
ãä¸èº«ã¯åé¡ãªããããªã®ã§ã以ä¸ã³ãã³ãã§å§ç¸®ãã¾ãã
$ zip -r 101_ObjectCategories.zip 101_ObjectCategories
ãããã§å¦ç¿ãã¼ã¿ã®æºåã¯å®äºã§ãã
å¦ç¿
ã次ã«ãã¼ã¿ã»ãããç¨ãã¦ããã¥ã¼ã©ã«ãããã®å¦ç¿ãè¡ãã¾ãã
ã以ä¸ç»é¢ã§ãã¾ãã¯Dataset
ã®å³ã®+New
ãé¸æ
ãImages
ãé¸æãDataset Name
ã«å¥½ããªååï¼ä»åã¯101_ObjectCategories
ï¼ãå
¥åãã¦ãå
ã»ã©zipã§åºãããã¼ã¿ãé¸æãã¾ã
ããã¼ã¿ãã¢ãããã¼ããã¾ã
ãã¢ãããã¼ãå®äºãããã次ã¯ä»¥ä¸ç»é¢ã§ãModels
ã®å³ã®+New
ãé¸æãã¾ã
ããããã¯ã¼ã¯ãé¸æãä»åã¯åãæ¢ããnin.py
ã¨ããã·ã³ãã«ï¼ãããï¼ãããã¯ã¼ã¯ã使ç¨ãFrameworkã¯chainer
ãTraining Typeã¯Image Classification
ãé¸æãã¦ãä¸å¤®ä¸ã®Create
ãã¯ãªãã¯ãã¾ã
ã次ã«Start Train
ãã¯ãªãã¯ããã¨å¦ç¿ã®è¨å®ç»é¢ã«ãªãã¾ããSelect Dataset
ã¯ãå
ã»ã©å
¥åãã101_ObjectCategories
ãPretrained Model
ã¯New
ãEpochï¼ä¸ä»£æ°ï¼
ã20ãããã«ãã¾ãããã®ä¸ã®ç»åå¦çã®è¨å®ã¯ãã¨ããããããã©ã«ãã§Start
ãã¯ãªãã¯ãã¾ã
ãå¦ç¿ãå§ã¾ã
ããã°ããã»ã£ã¨ããå¾ããã©ã¦ã¶ãæ´æ°ããã¨å¦ç¿ãé²ãã§è¡ã
ãMac Book Proã§10æéããããããã¨ãè¨ã£ã¦ãâ¦GPU使ããªããããããªããããª
å¤å¥ãã¹ã
ã次ã¯å¤å¥ã§ããããç¨åº¦å¦ç¿é²ãããå¦ç¿å®äºãããå·¦ä¸ã®Inspect
ãã¯ãªãã¯
ããã¡ã¤ã«ãé¸æãã¯ãªãã¯ãã¦ããã¤ã¢ãã°ããå¤å¥ãããç»åãé¸æã
ãå¦ç¿ããçµæã表示ããã¾ã
ã2epochã®å¦ç¿ã§ããã¡ããã¨é£è¡æ©ã¨å¤å¥ãã¦ããã¦ãã¾ããç´ æ´ãããã§ããã
èªåã®å¦ç¿ãã¼ã¿ã§å¦ç¿ããã¦å¤å¥
ãã¾ãã¯ããã¼ã¿ã»ãããæºåãã¾ããããã¯ã¦ãªããã°ã®éå»ã®è¨äºãããTã·ã£ããç²å¾ããç»åã¨å
¥é¸ããç»åãè½é¸ããç»åããã¦ã³ãã¼ããã¦ããããhatenaphoto
ã¨ãããã©ã«ãã®ç´ä¸ã«Tshirt
Accept
NG
ã¨ãããã©ã«ãã«åãã¦å
¥ãã¾ãã
ããããªæãã
ãåãçµãã£ããhatenaphoto
ãã©ã«ããã¾ããã¨zip
ãã¡ã¤ã«ã«å§ç¸®ãã¾ãããã¨ã¯Caltech101
ã®ã¨ãã¨åæ§ã«ãCSLAIERã®ã¢ãã«ãä½æãã¾ãã
ãã¢ãããã¼ãããå¾
ããããªæãã«ã¡ããã¨åé¡ããã¦ç»é²ããã¦ããã°OK
ããã®å¾ã®å¦ç¿ããå¤å¥ã¾ã§ã®æµãã¯Caltech101
ã®ã¨ãã¨å
¨ãåãã§ãã
ããã ãCaltech101
ã®ã¨ãã¨éã£ã¦4種é¡ã®ã°ã©ããã¡ããã¨åºã¦æ¥ãªããå«ãªäºæããã¾ããã¯ã¦ãªTã·ã£ãéå»ã²ããããåçã§å¤å¥
ããªã¼ï¼æ£ããå¤å®ããã¦ããªãï¼ï¼
ãå¥ã®åçã§è©¦ãã¨
ãããã¾ããã¡ï¼Why Deep Learning Peopleï¼ï¼
ãä»ã®ç»åã試ãã¦ã¿ã¾ããããã»ã¨ãã©æ£ããå¤å¥ãããã¨ã¯ã§ãã¾ããã§ããï¼å ¨é¨ã»ã¼åãçµæãåºã¦ãã¾ãï¼ã
ãä¸å¿ãã¥ã¼ã©ã«ãããã¯ã¼ã¯ã®å±¤ã®ä¸èº«ã¨ããã以ä¸ã®ããã«è¦ããã®ã§ããã
ããããããããï¼ï¼
ããã¼ã¿ã足ããªãã®ããªã¨ãã¯ã¦ãªTã·ã£ã+å ¥é¸ãã¨ããã以å¤ãã®2ã°ã«ã¼ãã«åãã¦å¦ç¿ããããã¦ã¿ãã®ã§ãããaccuracyãå ¨ç¶ä¸ãããªãâ¦
ã2ã°ã«ã¼ãã§0.5ãªã®ã§ãã³ãã³ã¸ã¼ãé©å½ã«é¸ã¶ã®ã¨å¤ãããªãç¨åº¦ã®ç¥è½ãããªããã¨ã«ãªã£ã¦ãã¾ãã¾ãã
ã¾ã¨ã
ã人工ç¥è½ã使ã£ã¦ã¯ã¦ãªTã·ã£ããã²ãããããã¨ããã®ã§ãããèªåã®åã§ã¯ãã³ãã³ã¸ã¼ä»¥ä¸ã®äººå·¥ç¥è½ããçã¿åºããã¨ã¯ã§ãã¾ããã§ããããã£ã¼ãã©ã¼ãã³ã°ã£ã¦åºæ¬ãã©ãã¯ããã¯ã¹ãªã®ã§ããã¾ããã£ãã¨ãã¯è¯ãã®ã§ãããã¾ããããªãã¨ãã£ã¦åå ã調ã¹ãã®ãè¾ãã§ãããçµå±ãããã¯ã¼ã¯ã試è¡é¯èª¤ã§å¤ãã¦ã¿ããããã¼ã¿éãã¬ã³ã¬ã³å¢ãããããããããããã¨ããªãæ°ããã¦ãã¾ãã
ãããããªããªãã«åå ãæ¨å¯ããã«ãåçã«ãã¾ãã«å ±éç¹ããªãã¦äººå·¥ç¥è½ã§å¤å¥ãããããªç¹å¾´éããã¾ãæ½åºãããã¨ãã§ããªãã£ãããããªãããªï¼ã¨åæã«æã£ã¦ãã¾ãã
ãããããä»åã¯ãã¾ããããªãã£ãã¨ã¯ããããããã£ã¦æ軽ã«ãã£ã¼ãã©ã¼ãã³ã°ã¨ããæå 端æè¡ãç´ äººã«ãç°¡åã«è©¦ããããã«ãªã£ãã®ã¯ãªããªãåããã¨ã§ããããã ããã®ã¾ã¾ãã©ãã¯ããã¯ã¹çã«é»éè¡ã¨ãã¦ãã£ã¼ãã©ã¼ãã³ã°ã使ãç¶ããã®ã¯ãè´å½çãªééããã¦ãã¦ãæ°ã¥ããªãã£ããããå¯è½æ§ãé«ãã£ããããã¼ã«ã®ä½¿ãæ¹ã®ç¨èªãåãããªãã£ããããã¼ã«ç¡ãã§ã¯ä½ãã§ããªããªã£ã¦ãã¾ãã®ãèªåã¨ãã¦ã¯å«ãªæããªã®ã§ã以ä¸ã®ãããªãã«ã¹ã¯ã©ããã§ãã£ã¼ãã©ã¼ãã³ã°ãå®è£ ã§ãããããªæ¬ãèªãã§ãçè«ã®æ¹ãè£å®ãã¦ãããããªã¨æã£ã¦ãã¾ãã
ããã®æ¬ã¯æéããã¦èªã価å¤ã®ããåèï¼ï¼ã¨æãï¼ãã¨ããããã§ãä»åã®å®é¨ããå¾ãèªåãªãã®çµè«ã¯ãã¯ã¦ãªããã°ã®ãã©ãã³ã³ã®ä¼ç»ã¯äººå·¥ç¥è½ã«ã¯ç½®ãæããããªãï¼ãã§ãããæ¬å½ããªï¼æããã¯ã¨ããæ¹ã¯ããã©ãã³ã³å¿ å人工ç¥è½ãçæãã¦ç§ã«ãã£ã¨æä¾ãã¦ä¸ããï¼ï¼