Upgrade to Pro — share decks privately, control downloads, hide ads and more …

オフィスの前にある信号が変わる
タイミング教えてくれるWebページ
作ろうとしたよ with DeepLearning

オフィスの前にある信号が変わる
タイミング教えてくれるWebページ
作ろうとしたよ with DeepLearning

2017年末に社内で開かれたハッカソンの発表資料を社外向けに少し修正したものです。

Takayuki Sakai

January 15, 2018
Tweet

More Decks by Takayuki Sakai

Other Decks in Programming

Transcript

  1. ΦϑΟεͷલʹ͋Δ৴߸͕มΘΔ

    λΠϛϯάڭ͑ͯ͘ΕΔ
    Webϖʔδ

    ࡞ͬͨΑ࡞Ζ͏ͱͨ͠Α
    Hackday2017 Team4
    ञҪ ਸࢸ
    ※Hackday2017ͱ͸ɺ౦ূҰ෦্৔اۀͷגࣜձࣾϑΝϯίϛϡχέʔγϣϯζࣾ಺Ͱ೥຤ͷ
    Ջͳ༨༟ͷ͋Δ࣌ʹߦΘΕͨνʔϜ੍ϋοΧιϯͷ͜ͱͰ͢

    View full-size slide

  2. ੒Ռ෺
    ͜Μͳײ͡

    View full-size slide

  3. ͳͥ࡞͔ͬͨ
    - ΦϑΟεͷલͷาߦऀ৴߸ͷ଴ͪ࣌ؒ݁ߏ
    ௕͍
    - ੨ʹͳΔ·Ͱͷ͕࣌ؒ෼͔Ε͹ɺ੮Λཱͭ
    λΠϛϯά΋෼͔Δ͸ͣ

    View full-size slide

  4. ΈΜͳϋοϐʔ

    ؒҧ͍ͳ͍ʂ
    - ΦϑΟεͷલͷาߦऀ৴߸ͷ଴ͪ࣌ؒ݁ߏ
    ௕͍
    - ੨ʹͳΔ·Ͱͷ͕࣌ؒ෼͔Ε͹ɺ੮Λཱͭ
    λΠϛϯά΋෼͔Δ͸ͣ

    View full-size slide

  5. ֓ཁ
    - ৴߸ͷมΘΔपظ͸༧Ίଌ͓ͬͯ͘
    - ͨ·ʹը૾ೝࣝͰ੺੨੾ΓସΘΓ

    λΠϛϯάΛิਖ਼͢Δ

    View full-size slide

  6. पظ؅ཧαʔό
    पظऔಘ ৴߸ͷ৭
    ৴߸ͷपظΛ؅ཧ
    ੺੨൑ఆϓϩάϥϜ
    શମߏ੒
    ৴߸ͷը૾ࡱӨ
    ৴߸ͷ৭Λ൑ఆ
    ϒϥ΢β
    ৴߸ͷλΠϛϯάΛදࣔ

    View full-size slide

  7. ৴߸ͷ੺੨ೝࣝͷ

    ͨΊʹ΍ͬͨ͜ͱ

    View full-size slide

  8. ͜ΜͳΧϝϥͰ

    View full-size slide

  9. ͜Μͳը૾ͷ৴߸ͷ৭Λ

    View full-size slide

  10. ͜͜ʹ͋Δʢ੨ʣ

    View full-size slide

  11. ൑ఆ͍ͨ͠ʂ

    View full-size slide

  12. ͜͏͍͏ը૾ॲཧͱ͍͑͹

    View full-size slide

  13. Deep Learning
    Ͱ͢ΑͶ…

    View full-size slide

  14. ཁ݅
    - WebΧϝϥͰࡱͬͨը૾Λ࢖͏
    - ҎԼ͸ېࢭ
    - खಈͰ৴߸ʹζʔϜ
    - खಈͰը૾Ճ޻
    - ΧϝϥΛ׬શʹݻఆ͢Δ

    View full-size slide

  15. ·ͣ͸ֶशσʔλ࡞Γ

    ʢ৭Μͳ֯౓͔ΒࡱΔ,໿5000ຕʣ
    ੺ ੨
    ੺ ੨

    View full-size slide

  16. PythonͷίʔυΛΨʔοͱॻ͍ͯ
    ʢ200ߦ͘Β͍ʣ

    def vgg_std16_model(img_rows, img_cols):
    model = Sequential()
    model.add(ZeroPadding2D((1, 1), input_shape=(3,
    img_rows, img_cols)))
    model.add(Convolution2D(64, 3, 3, activation='relu'))
    model.add(ZeroPadding2D((1, 1)))
    model.add(Convolution2D(64, 3, 3, activation='relu'))
    model.add(MaxPooling2D((2, 2), strides=(2, 2)))
    model.add(ZeroPadding2D((1, 1)))
    model.add(Convolution2D(128, 3, 3, activation='relu'))

    View full-size slide

  17. ֶशʂ(ŕŦŖƃ
    ~/hackday/python$ python3 train_and_evaluate.py
    4591 train samples
    Start training...........
    Train on 3121 samples, validate on 551 samples
    10/3121 [=>..............................] -
    ETA: 35023s - loss: 0.5735 - acc: 0.6032

    View full-size slide

  18. Μ…ʁ
    ~/hackday/python$ python3 train_and_evaluate.py
    4591 train samples
    Start training...........
    Train on 3121 samples, validate on 551 samples
    10/3121 [=>..............................] -
    ETA: 35023s - loss: 0.5735 - acc: 0.6032

    View full-size slide

  19. ࢒Γ࣌ؒ35023s ≒ 10࣌ؒ
    ~/hackday/python$ python3 train_and_evaluate.py
    4591 train samples
    Start training...........
    Train on 3121 samples, validate on 551 samples
    10/3121 [=>..............................] -
    ETA: 35023s - loss: 0.5735 - acc: 0.6032

    View full-size slide

  20. ๻ʮऴΘΒͳ͍… Ͳ͏͢Ε͹…ʯ

    View full-size slide

  21. ʁʮCPU͕΍ΒΕͨΑ͏ͩͳ…ʯ

    View full-size slide

  22. ๻ʮ͋ɺ͋ͳͨ͸…ʂʂʯ

    View full-size slide

  23. ๻ʮGPU͞Μʂʯ

    View full-size slide

  24. ͬͯ͜ͱͰGPUͰ࠶ֶशʂ(ŕŦŖƃ
    ※AWSͷGPUΠϯελϯε࢖͍·ͨ͠
    ~/hackday/python$ python3 train_and_evaluate.py
    Using gpu device 0: Tesla M60 (CNMeM is
    disabled, cuDNN 4007)
    4591 train samples
    Start training...........
    Train on 3121 samples, validate on 551 samples
    10/3121 [=>..............................] -
    ETA: 2714s - loss: 0.5735 - acc: 0.6032

    View full-size slide

  25. 1࣌ؒҎ಺ͰऴΘΔʂ
    ~/hackday/python$ python3 train_and_evaluate.py
    Using gpu device 0: Tesla M60 (CNMeM is
    disabled, cuDNN 4007)
    4591 train samples
    Start training...........
    Train on 3121 samples, validate on 551 samples
    10/3121 [=>..............................] -
    ETA: 2714s - loss: 0.5735 - acc: 0.6032

    View full-size slide

  26. ๻ʮ͓ɺֶशऴΘͬͯΔ…ʯ
    3121/3121 [==============================] - 0s
    - loss: 0.0051 - acc: 1.0000 - val_loss: 0.0085
    - val_acc: 1.0000

    View full-size slide

  27. ๻ʮਫ਼౓͸… 100%ʂʁʯ
    3121/3121 [==============================] - 0s
    - loss: 0.0051 - acc: 1.0000 - val_loss: 0.0085
    - val_acc: 1.0000

    View full-size slide

  28. ๻ʮਫ਼౓͸… 100%ʂʁʯ

    ๻ʮ͜ͷউෛ΋ΖͨͰʂʯ
    3121/3121 [==============================] - 0s
    - loss: 0.0051 - acc: 1.0000 - val_loss: 0.0085
    - val_acc: 1.0000

    View full-size slide

  29. 1೔໨ऴྃ

    View full-size slide

  30. ๻ʮͯ͞ϦΞϧλΠϜʹࡱͬ
    ͨ৴߸ͷ৭Λ༧ଌ͢Δ͔…ʯ

    View full-size slide

  31. PCʮ੨ʂʯ
    ๻ʮਖ਼ղʂʯ

    View full-size slide

  32. PCʮ੺ʂʯ
    ๻ʮ͍͢͝ʂʯ

    View full-size slide

  33. PCʮ੺ʂʯ
    ๻ʮ͋Ε…ʁʯ

    View full-size slide

  34. PCʮ੨ʂʯ
    ๻ʮΜΜΜ...ʁʯ

    View full-size slide

  35. ๻ʮ͍ͭ͜΋͠΍…ʯ

    View full-size slide

  36. ๻ʮԣஅาಓͷ্ʹਓ͕͍Δ͔Ͳ
    ͏͔Ͱ൑அͯ͠΍͕Δʂʂʂʯ

    View full-size slide

  37. Deep Learning͸෺ମೝࣝೳྗ͕

    ߴ͗ͯ͢ɺਓؒͰ͸ࢥ͍͔ͭͳ͍Α͏
    ͳϧʔϧΛউखʹ࡞ͬͯ͠·͏ͷͰ͢ɻ

    View full-size slide

  38. ๻ʮͰ΋͜Ε͸๻͕ࡱͬͨσʔλ
    ʹภΓ͕͚͋ͬͨͩ…ʯ

    View full-size slide

  39. ๻ʮҎԼͷΑ͏ͳը૾Λͨ͘͞Μ
    ࡱͬͯ࠶ֶश΍ʂʯ
    - ੺͚ͩͲ౉ͬͯΔਓ͕͍Δࣸਅ
    - ੨͚ͩͲ୭΋౉ͬͯͳ͍ࣸਅ

    View full-size slide

  40. ࠶ֶशޙ…

    View full-size slide

  41. PCʮ੺ʂʯ
    ๻ʮΑ͠Α͠ʯ

    View full-size slide

  42. PCʮ੨ʂʯ
    ๻ʮ͓΍ʁʯ

    View full-size slide

  43. ๻ʮ͍ͭ͜…ʯ

    View full-size slide

  44. ๻ʮࠓ౓͸͜͜Λं͕૸ͬͯΔ͔
    Ͳ͏͔Ͱ൑ఆͯ͠΍͕Δʂʯ

    View full-size slide

  45. ҎԼ͍ͨͪͬ͜͝ʢഊ๺ʣ

    View full-size slide

  46. ݁Ռ
    - ࠷ऴతʹ·͊·͊ͳਫ਼౓ʹ͸ͳͬͨ

    ʢϦΞϧλΠϜը૾Ͱ90%͘Β͍ʁʣ
    - Ͱ΋ɺࠓճͷ໨తͷͨΊʹ͸ਫ਼౓ෆ଍
    - ภΓͷͳֶ͍शσʔλΛ΋ͬͱͨ͘͞Μ

    ࡱΕΕ͹ղܾ͢Δ͸ͣ

    View full-size slide

  47. ݸਓతײ૝
    - Deep Learning͍͢͝

    - GPU͍͢͝

    - ྑֶ͍शσʔλΛ࡞ΔͷΉ͍ͣ

    View full-size slide