ææŠãã
2018幎ã®Avitoã§ã¯ã250äžå°ã®è»ã販売ãããŸããã ããã¯1æ¥ã«ã»ãŒ7000ã§ãã 販売ãããã¹ãŠã®åºåã«ã¯ãã€ã©ã¹ã-è»ã®åçãå¿ èŠã§ãã ãããããã®äžã®å·çªå·ã«ãã£ãŠãè»ã«é¢ããå€ãã®è¿œå æ å ±ãèŠã€ããããšãã§ããŸãã ãŸããäžéšã®ãŠãŒã¶ãŒã¯èªåã§ãã³ããŒãã¬ãŒããéããããšããŸãã
ãŠãŒã¶ãŒããã³ããŒãã¬ãŒãçªå·ãé衚瀺ã«ããçç±ã¯ç°ãªãå ŽåããããŸãã ç§ãã¡ã¯ã圌ããããŒã¿ãä¿è·ã§ããããã«æ¯æŽããããšèããŠããŸãã ãããŠããŠãŒã¶ãŒã®è²©å£²ãšè³Œå ¥ã®ããã»ã¹ãæ¹åããããšããŠããŸãã ããšãã°ãå¿åçªå·ãµãŒãã¹ã¯é·ãéç§ãã¡ãšååããŠããŸãããè»ã販売ãããšãäžæçãªæºåž¯é»è©±çªå·ãäœæãããŸãã ããŠããã³ããŒãã¬ãŒãäžã®ããŒã¿ãä¿è·ããããã«ãåçãå¿ååããŸãã
ãœãªã¥ãŒã·ã§ã³ã®æŠèŠ
ãŠãŒã¶ãŒã®åçãä¿è·ããããã»ã¹ãèªååããã«ã¯ãç³ã¿èŸŒã¿ãã¥ãŒã©ã«ãããã¯ãŒã¯ã䜿çšããŠããã³ããŒãã¬ãŒãã§ããªãŽã³ãæ€ââåºããŸãã
çŸåšããªããžã§ã¯ãã®æ€åºã«ã¯ã2ã€ã®ã°ã«ãŒãã®ã¢ãŒããã¯ãã£ã䜿çšãããŠããŸããããšãã°ã2段éãããã¯ãŒã¯ïŒFaster RCNNãšMask RCNNãªã©ïŒã ã·ã³ã°ã«ã¹ããŒãžïŒã·ã³ã°ã«ã·ã§ããïŒ-SSDãYOLOãRetinaNetã ãªããžã§ã¯ãã®æ€åºã¯ã察象ã®ãªããžã§ã¯ããå æ¥ããé·æ¹åœ¢ã®4ã€ã®åº§æšã®æŽŸçã§ãã
äžèšã®ãããã¯ãŒã¯ã¯ãåçå ã®ããŸããŸãªã¯ã©ã¹ã®å€ãã®ãªããžã§ã¯ããèŠã€ããããšãã§ããŸããããã¯ããã³ããŒãã¬ãŒãã®æ€çŽ¢åé¡ã解決ããããã«ãã§ã«åé·ã§ãããªããªããç§ãã¡ã®åçã®è»ã¯éåžž1ã€ã ãã§ããããã§ããããããããã¯éåžžã«ãŸãã«ããçºçããªããããããã¯ç¡èŠã§ããŸãïŒã
ãããã®ãããã¯ãŒã¯ã®ãã1ã€ã®æ©èœã¯ãããã©ã«ãã§ã座æšè»žã«å¹³è¡ãªèŸºãæã€å¢çããã¯ã¹ãçæããããšã§ãã ããã¯ãã¢ã³ã«ãŒããã¯ã¹ãšåŒã°ããäžé£ã®å®çŸ©æžã¿ã®é·æ¹åœ¢ãã¬ãŒã ãæ€åºã«äœ¿çšãããããã«çºçããŸãã ããå ·äœçã«ã¯ãæåã«ç³ã¿èŸŒã¿ãããã¯ãŒã¯ïŒresnet34ãªã©ïŒã䜿çšããŠãç»åããå±æ§ã®ãããªãã¯ã¹ãååŸããŸãã 次ã«ãã¹ã©ã€ãã£ã³ã°ãŠã£ã³ããŠã䜿çšããŠååŸããå±æ§ã®ãµãã»ããããšã«ãåé¡ãè¡ãããŸããkã¢ã³ã«ãŒããã¯ã¹ã®ãªããžã§ã¯ãããããã©ãããããã³äœçœ®ã調æŽãããã¬ãŒã ã®4ã€ã®åº§æšã«å¯ŸããŠååž°ãå®è¡ãããŸãã
詳现ã«ã€ããŠã¯ãã¡ããã芧ãã ãã ã
ãã®åŸãããã«2ã€ã®ãããããããŸãã
ãªããžã§ã¯ãïŒç¬/ç«/æ€ç©ãªã©ïŒãåé¡ãããã®ã
2çªç®ïŒbboxãªã°ã¬ããµãŒïŒ-ãªããžã§ã¯ãã®é¢ç©ãšãã¬ãŒã ã®é¢ç©ã®æ¯çãé«ããããã«ãåã®ã¹ãããã§ååŸãããã¬ãŒã ã®åº§æšã®ååž°çšã
å転ãããã¯ã·ã³ã°ãã¬ãŒã ãäºæž¬ããã«ã¯ãbboxãªã°ã¬ããµãŒãå€æŽããŠããã¬ãŒã ã®å転è§åºŠãååŸããå¿ èŠããããŸãã ãããè¡ããªããšãã©ããããããå€æããŸãã
2段éã®Faster R-CNNã«å ããŠãRetinaNetãªã©ã®1段éã®æ€åºåšããããŸãã åã®ã¢ãŒããã¯ãã£ãšã¯ç°ãªãããªããžã§ã¯ããå«ãå¯èœæ§ã®ããç»åã®ã»ã¯ã·ã§ã³ãææ¡ããäºå段éãªãã§ãã¯ã©ã¹ãšãã¬ãŒã ãå³åº§ã«äºæž¬ããŸãã å転ãããã¹ã¯ãäºæž¬ããã«ã¯ãããã¯ã¹ãµããããã®ããããå€æŽããå¿ èŠããããŸãã
å転ããŠã³ãã£ã³ã°ããã¯ã¹ãäºæž¬ããããã®æ¢åã®ã¢ãŒããã¯ãã£ã®äžäŸã¯DRBOXã§ãã ãã®ãããã¯ãŒã¯ã¯ãFaster RCNNã®ããã«ãå°åã®ææ¡ã®äºå段éã䜿çšããªãããã1段éã®æ¹æ³ãä¿®æ£ãããã®ã§ãã ãã®ãããã¯ãŒã¯ããã¬ãŒãã³ã°ããããã«ãç¹å®ã®è§åºŠã§å転ããKïŒå¢çããã¯ã¹ïŒrboxïŒïŒã䜿çšãããŸãã ãããã¯ãŒã¯ã¯ãã¿ãŒã²ãããªããžã§ã¯ãã座æšãbboxãµã€ãºãå転è§åºŠãå«ãK rboxã®ããããã®ç¢ºçãäºæž¬ããŸãã
ã¢ãŒããã¯ãã£ãå€æŽããæ€èšäžã®ããŒã¿ãããã¯ãŒã¯ã®1ã€ãå転å¢çããã¯ã¹ã§åãã¬ãŒãã³ã°ããããšã¯ãå®çŸå¯èœãªã¿ã¹ã¯ã§ãã ããããç§ãã¡ã®ãããã¯ãŒã¯ã®ç¯å²ã¯ãã£ãšçãããã³ããŒãã¬ãŒããé ãã ããªã®ã§ãç®æšã¯ããç°¡åã«éæã§ããŸãã
ãããã£ãŠãæ°ã®4ã€ã®ãã€ã³ããäºæž¬ããããã®åçŽãªãããã¯ãŒã¯ããå§ããããšã«ããŸããããã®åŸãã¢ãŒããã¯ãã£ãè€éã«ããããšãå¯èœã«ãªããŸãã
ããŒã¿
ããŒã¿ã»ããã®ã¢ã»ã³ããªã¯ãè»ã®åçãåéãããã³ããŒãã¬ãŒãã§ãšãªã¢ãããŒã¯ãããšãã2ã€ã®ã¹ãããã«åãããŠããŸãã æåã®ã¿ã¹ã¯ã¯ã€ã³ãã©ã¹ãã©ã¯ãã£ã§æ¢ã«è§£æ±ºãããŠããŸããAvitoã«é 眮ããããã¹ãŠã®åºåãæ éã«ä¿åããŸãã 2çªç®ã®åé¡ã解決ããããã«ãTolokaã䜿çšããŸãã toloka.yandex.ru/requesterã§ã¿ã¹ã¯ãäœæããŸãã
ã¿ã¹ã¯ã¯è»ã®åçãäžããããŸããã åè§åœ¢ã䜿çšããŠè»ã®ãã³ããŒãã¬ãŒãã匷調衚瀺ããå¿ èŠããããŸãã ãã®å Žåãç¶æ çªå·ã¯ã§ããã ãæ£ç¢ºã«å²ãåœãŠãå¿ èŠããããŸãã
Tolokaã䜿çšããŠãããŒã¿ãããŒã¯ã¢ããããã¿ã¹ã¯ãäœæã§ããŸãã ããšãã°ãæ€çŽ¢çµæã®å質ã®è©äŸ¡ãããŸããŸãªã¯ã©ã¹ã®ãªããžã§ã¯ãïŒããã¹ããšåçïŒã®ããŒã¯ã¢ããããããªã®ããŒã¯ã¢ãããªã©ã ãããã¯ãTolokaãŠãŒã¶ãŒãã客æ§ãè«æ±ããæéã§å®è¡ãããŸãã ããšãã°ãç§ãã¡ã®å ŽåããããŒã«ãŒã¯åçã®è»ã®ãã³ããŒãã¬ãŒãã§åãç«ãŠå°ã匷調ããå¿ èŠããããŸãã äžè¬ã«ã倧ããªããŒã¿ã»ãããããŒã¯ã¢ããããã«ã¯éåžžã«äŸ¿å©ã§ãããé«å質ãåŸãã®ã¯éåžžã«å°é£ã§ãã 矀è¡ã®äžã«ã¯å€ãã®ããããããŸãããã®ã¿ã¹ã¯ã¯ãã©ã³ãã ã«çããåºãããäœããã®æŠç¥ã䜿çšããŠãéã皌ãããšã§ãã ãããã®ãããã«å¯Ÿæããããã«ãã«ãŒã«ãšãã§ãã¯ã®ã·ã¹ãã ããããŸãã äž»ãªãã§ãã¯ã¯ãã³ã³ãããŒã«ã®è³ªåã®æ··åã§ããTolokiã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããŠã¿ã¹ã¯ã®äžéšãæåã§ããŒã¯ã¢ããããããããã¡ã€ã³ã¿ã¹ã¯ã«æ··åããŸãã ã³ã³ãããŒã«ã®è³ªåã§ããŒã¯ã¢ãããããééãããå Žåã¯ãããŒã¯ã¢ããããããã¯ããããŒã¯ã¢ãããèæ ®ããŸããã
åé¡ã®åé¡ã«ã€ããŠã¯ãããŒãã³ã°ãééã£ãŠãããã©ãããå€æããã®ã¯éåžžã«ç°¡åã§ãããŸããé åã匷調衚瀺ããåé¡ã«ã€ããŠã¯ãããã»ã©ç°¡åã§ã¯ãããŸããã å€å žçãªæ¹æ³ã¯ãIoUãã«ãŠã³ãããããšã§ãã
ãã®æ¯çãè€æ°ã®ã¿ã¹ã¯ã®ç¹å®ã®ãããå€ãããå°ããå Žåããã®ãããªãŠãŒã¶ãŒã¯ãããã¯ãããŸãã ãã ãã2ã€ã®ä»»æã®åè§åœ¢ã®å Žåãç¹ã«Tolokã§ã¯JavaScriptã§IoUãå®è£ ããå¿ èŠããããããIoUã®èšç®ã¯ããã»ã©åçŽã§ã¯ãããŸããã å°ããªããã¯ãäœæããŸãããå°ããªè¿æã®ãœãŒã¹ããªãŽã³ã®åãã€ã³ãã«ãã¹ã¯ã©ã€ãã§ããŒã¯ããããã€ã³ããããã°ããŠãŒã¶ãŒã¯ééã£ãŠããªãã£ããšèããŠããŸãã ãŸããå¿çã®æ©ããŠãŒã¶ãŒããã£ããã£ãå€æ°æèŠãšã®äžäžèŽãªã©ããããã¯ããã¯ã€ãã¯ã¬ã¹ãã³ã¹ã«ãŒã«ããããŸãã ãããã®ã«ãŒã«ãèšå®ãããšãããªãè¯ãããŒã¯ã¢ãããæåŸ ã§ããŸãããæ¬åœã«é«å質ã§è€éãªããŒã¯ã¢ãããå¿ èŠãªå Žåã¯ãããªãŒã©ã³ãµãŒ-ã¹ã¯ã©ã€ããç¹ã«éãå¿ èŠããããŸãã ãã®çµæãããŒã¿ã»ããã¯4kã®ããŒã¯ãããç»åã«ãªããTolokã§ã¯ãã¹ãŠ28ãã«ããããŸããã
ã¢ãã«
次ã«ããããã¯ãŒã¯ãäœæããŠããšãªã¢ã®4ã€ã®ãã€ã³ããäºæž¬ããŸãã resnet18ã䜿çšããŠæšèãååŸãïŒresnet34ã®å Žåã¯11.7Mãã©ã¡ãŒã¿ãŒå¯Ÿ21.8Mãã©ã¡ãŒã¿ãŒïŒã4ã€ã®ãã€ã³ãïŒ8座æšïŒãžã®ååž°ã®ããããäœæããåçã«ãã³ããŒãã¬ãŒãããããã©ããã®åé¡ã®ããããäœæããŸãã è»ã®ãã¹ãŠã®åçã§ã¯ãªããè»ã®è²©å£²ã®åºåã§ã¯2çªç®ã®é ãå¿ èŠã§ãã åçã¯è»ã®çŽ°éšã§ããå ŽåããããŸãã
ãã¡ãããç§ãã¡ãšåæ§ã«ãæ€åºããå¿ èŠã¯ãããŸããã
å¢çããã¯ã¹ïŒ0,0,0,0,0,0,0,0,0ïŒãå«ããã³ããŒãã¬ãŒãã®ãªãåçãšãåé¡åšã®å€ããã³ããŒãã¬ãŒãã®ãã/ãªãåçããããŒã¿ã»ããã«è¿œå ããããšã«ããã2ã€ã®ç®æšãåæã«èšç·ŽããŸãã 1ïŒã
ãã®åŸã次ã®æ倱ã®åèšãšããŠãäž¡æ¹ã®ç®æšã«å¯ŸããŠåäžã®æ倱é¢æ°ãäœæã§ããŸãã ãã³ããŒãã¬ãŒãããªãŽã³ã®åº§æšãžã®ååž°ã§ã¯ãæ»ãããªL1æ倱ã䜿çšããŸãã
ããã¯ãåŒæ°ã®çµ¶å¯Ÿå€ã倧ããå Žåã¯L1ãšåæ§ã«åäœããåŒæ°ã®å€ããŒãã«è¿ãå Žåã¯L2ãšããŠåäœããL1ãšL2ã®çµã¿åãããšããŠè§£éã§ããŸãã åé¡ã«ã¯ããœããããã¯ã¹æ倱ãšã¯ãã¹ãšã³ããããŒæ倱ã䜿çšããŸãã ç¹åŸŽæœåºããã°ã©ã ã¯resnet18ã§ãImageNetã§äºåã«ãã¬ãŒãã³ã°ãããéã¿ã䜿çšããŸãããã®åŸãããŒã¿ã»ããã§æœåºããã°ã©ã ãšããããããã«ãã¬ãŒãã³ã°ããŸãã ãã®ã¿ã¹ã¯ã§ã¯ãAvitoã®ã³ã³ãã¥ãŒã¿ãŒããžã§ã³ã®ã¡ã€ã³ãã¬ãŒã ã¯ãŒã¯ã§ããmxnetãã¬ãŒã ã¯ãŒã¯ã䜿çšããŸããã äžè¬ã«ããã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã䜿çšãããšãç¹å®ã®ãã¬ãŒã ã¯ãŒã¯ã«çžãããããšã¯ãããŸãããã倧èŠæš¡ãªã³ãŒãããŒã¹ãããå Žåã¯ãããã䜿çšããŠåãã³ãŒããå床èšè¿°ããªãããšããå§ãããŸãã
ããŒã¿ã»ããã®å質ã蚱容ç¯å²å ã«ãªã£ãã®ã§ããã¶ã€ããŒã«äŸé ŒããŠãAvitoããŽä»ãã®ãã³ããŒãã¬ãŒããå ¥æããŸããã ãã¡ããæåã¯èªåã§ããããšããŸããããããŸãçŸãããããŸããã§ããã 次ã«ãAvitoã©ã€ã»ã³ã¹ãã¬ãŒãã®æããããã©ã€ã»ã³ã¹ãã¬ãŒãã®ããå ã®é åã®æããã«å€æŽããå¿ èŠããããç»åã«ããŽãéããããšãã§ããŸãã
補åã§èµ·å
çµæã®åçŸæ§ããããžã§ã¯ãã®ãµããŒãããã³éçºã®åé¡ã¯ãããã¯ãšã³ãããã³ããã³ããšã³ãéçºã®äžçã§å€å°ã®ãšã©ãŒã§è§£æ±ºãããŸããããæ©æ¢°åŠç¿ã¢ãã«ã䜿çšããå¿ èŠãããå Žåã¯æªè§£æ±ºã®ãŸãŸã§ãã ãããããã¬ã¬ã·ãŒã³ãŒãã¢ãã«ãç解ããå¿ èŠããããŸããã readmeã«ããœãªã¥ãŒã·ã§ã³ã®åºã«ãªã£ãèšäºãŸãã¯ãªãŒãã³ãœãŒã¹ãªããžããªãžã®ãªã³ã¯ããããšäŸ¿å©ã§ãã åãã¬ãŒãã³ã°ãéå§ããããã®ã¹ã¯ãªããã¯ãšã©ãŒã§å€±æããå ŽåããããŸããããšãã°ãcudnnããŒãžã§ã³ãå€æŽããããã®ããŒãžã§ã³ã®tensorflowã¯ãã®ããŒãžã§ã³ã®cudnnã§ã¯åäœããªããªããcudnnã¯ãã®ããŒãžã§ã³ã®nvidiaãã©ã€ããŒã§ã¯åäœããªããªããŸãã ãã¬ãŒãã³ã°ã®ããã«ãããŒã¿ã«åŸã£ãŠ1ã€ã®ã€ãã¬ãŒã¿ã䜿çšããå®çšŒåç°å¢ã§å¥ã®ã€ãã¬ãŒã¿ã䜿çšããå¯èœæ§ããããŸãã ãã®ããããã°ããç¶ç¶ããããšãã§ããŸãã äžè¬ã«ãåçŸæ§ã®åé¡ãååšããŸãã
ã¢ãã«ããã¬ãŒãã³ã°ããããã«nvidia-dockerç°å¢ã䜿çšããŠããããåé€ããããšããŸããããã«ã¯cudaã«å¿ èŠãªãã¹ãŠã®äŸåé¢ä¿ããããPythonã®äŸåé¢ä¿ãããã«ã€ã³ã¹ããŒã«ããŸãã ããŒã¿ãæ¡åŒµãããã³æšè«ã¢ãã«ã«å¿ããã€ãã¬ãŒã¿ãŒãåããã©ã€ãã©ãªãŒã®ããŒãžã§ã³ã¯ããã¬ãŒãã³ã°/å®éšæ®µéããã³å®çšŒåã§äžè¬çã§ãã ãããã£ãŠãæ°ããããŒã¿ã§ã¢ãã«ããã¬ãŒãã³ã°ããã«ã¯ããªããžããªããµãŒããŒã«ãã³ãã§éããããã«ãŒç°å¢ãåéããã·ã§ã«ã¹ã¯ãªãããå®è¡ããå¿ èŠããããŸãã å éšã«ã¯ããã¬ãŒãã³ã°ãšãã¹ãçšã®ãã¹ãŠã®ããŒãããã¯ããããŸãããç°å¢ã«ãããšã©ãŒã§ééããªã倱æããããšã¯ãããŸããã ãã¡ããã1ã€ã®train.pyãã¡ã€ã«ãçšæããããšããå§ãããŸãããå®éã«ã¯ãã¢ãã«ãäžãããã®ãåžžã«ç®ã§èŠãŠãåŠç¿ããã»ã¹ã§äœããå€æŽããå¿ èŠãããããšã瀺ãããŠãããããæçµçã«ã¯ãŸã jupyterãå®è¡ããŸãã
ã¢ãã«ã®éã¿ã¯git lfsã«ä¿åãããŸã-ããã¯gitã«å€§ããªãã¡ã€ã«ãä¿åããããã®ç¹å¥ãªæè¡ã§ãããã以åã¯ã¢ãŒãã£ãã¡ã¯ãã䜿çšããŠããŸããããgit lfsã䜿çšããæ¹ã䟿å©ã§ãã èªåãã¹ãã¯ã¢ãã«ã®æšè«çšã«äœæãããŠãããããåæ ŒããªããŠã§ã€ãã䜿çšããŠãµãŒãã¹ãå±éããããšã¯ã§ããŸããã ãµãŒãã¹èªäœã¯ãkubernetesã¯ã©ã¹ã¿ãŒã®ãã€ã¯ããµãŒãã¹ã€ã³ãã©ã¹ãã©ã¯ãã£å ã®dockerã§éå§ãããŸãã ããã©ãŒãã³ã¹ãç£èŠããã«ã¯ãgrafanaã䜿çšããŸãã ããŒãªã³ã°åŸãæ°ããã¢ãã«ã䜿çšããŠãµãŒãã¹ã€ã³ã¹ã¿ã³ã¹ã®è² è·ãåŸã ã«å¢ãããŸãã æ°ããæ©èœãå±éãããšããa / bãã¹ããäœæããçµ±èšãã¹ãã«åºã¥ããŠãæ©èœã®ãããªãéåœã«ã€ããŠè©æ±ºãåºããŸãã
ãã®çµæãç§ãã¡ã¯å人ææè åãã®èªåã«ããŽãªã®åºåã§æ°åã®ã°ãã¹ãéå§ããŸãããæ°åãé ã1ã€ã®ç»åã®åŠçæéã®95ããŒã»ã³ã¿ã€ã«ã¯250ããªç§ã§ãã