Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
にゃーんとわんわん
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Doarakko
December 11, 2020
Programming
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
にゃーんとわんわん
Doarakko
December 11, 2020
More Decks by Doarakko
See All by Doarakko
Cloudflare Workers で X(Twitter)のボットを作ってみた
doarakko
0
340
Vercel Edge Functions を使って作る画像メーカー
doarakko
0
96
JOIN して1ヶ月のエンジニアに聞いた Liiga の良いところ 3 選
doarakko
0
92
わんわおーん
doarakko
0
78
職場を明るくする
doarakko
0
350
コードレビューの時間を削減しました
doarakko
0
120
仕事中に隠れてテレビ番組表を見るぞ
doarakko
0
230
GitHub Project の運用を自動化しました
doarakko
0
140
GitHub Actions に入門しました
doarakko
0
1.4k
Other Decks in Programming
See All in Programming
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1k
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
100
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
150
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
470
Kotlinの15年とServer-Side Kotlin
n_takehata
1
140
AWSに止められる覚悟してますか?
morizo_1984
2
530
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
330
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
4.8k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
R8 の設定見直しでアプリサイズ削減
andpad
0
210
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
WENDY [Excerpt]
tessaabrams
14
40k
From π to Pie charts
rasagy
1
400
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Optimising Largest Contentful Paint
csswizardry
37
4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Rails Girls Zürich Keynote
gr2m
96
14k
Transcript
にゃーんとわんわん @Doarakko
・2019年12月入社(2社目) ・エンジニア歴1.5年 - 仕事: Go, PHP - 趣味: Python, C++
・AtCoder 緑 ・海外サッカーをよく見ます 自己紹介 2
3
4
Slackbot を使ってます 5 ・Slack 標準搭載のボット ・誰でも簡単に使える ・改行で区切るとランダムで返る ・画像 URL は展開される
手動追加面倒くさい & 文字数制限あり 6
Bot 作りました 7 ⚽ GitHub: https://github.com/Doarakko/iyashi
Heroku 全体の構成と流れ:画像投稿 8 bot ML model postgres ① ② ③
④ ⑤
Heroku 全体の構成と流れ:にゃーん 9 bot ML model postgres ① ② ③
④ にゃーん
使用したもの Slack Bot ・Heroku:Bot を動かしている場所 ・slackbot:Python で簡単に Slack Bot を作成するためのライブラリ
動物の画像認識モデル ・PyTorch:機械学習のライブラリ ・flickr API:動物画像の収集 ・Google Colab:モデル作成の作業場所 10
・超簡単に Slack Bot を作れる ・特定のメッセージに対して、送信・返信・絵文字をつけられる Python のライブラリ slackbot 11 https://github.com/lins05/slackbot
1. データ収集 2. 画像のノイズ除去 3. 前処理 4. 転移学習 5. モデル評価
モデル作成手順 12
flickr API を使って各動物 600 枚の画像を収集(合計 3,000 枚) モデル作成手順(1 / 5):データ収集
13 flickr: 写真共有サイト
モデル作成手順(2 / 5):画像のノイズ除去 14 今回はサボりました
モデル作成手順(3 / 5):前処理 15 今回行ったもの ・画像サイズをあわせる ・正規化 よく行うもの ・ 写真から顔を切り取る(for
顔認識モデル) ・オリジナルを回転した画像を生成(水増し) ・位置の補正
モデル作成手順(4 / 5):転移学習 16 過学習:模擬試験は 90 点だったけど本番は 30 点 ・学習済みモデルのパラメータをそのまま使用
・最終層以外のパラメータを学習させないため過学習を抑えられる ・クラス数にあわせて最終層を変更 https://www.youtube.com/watch?v=yv0SzIvIhGk
モデル作成手順(4 / 5):転移学習 17 ・ImageNet で学習させた ResNet-18 を使用 ・ResNet は最大
152 層(今回は一番小さいものを使用) PyTorch から簡単に学習済みのモデルを使えます https://www.researchgate.net/figure/Proposed-Mod ified-ResNet-18-architecture-for-Bangla-HCR-In-th e-diagram-conv-stands-for_fig1_323063171
モデル作成手順(5 / 5):モデル評価 18 ・合計 3,000 枚の画像をランダムに分ける(各クラスごとの画像枚数は均等に) - 学習用:2,000 枚
- バリデーション用:500 枚 - テスト用:500 枚 テスト用のデータに対して Accuracy 0.9820 各データは必ず独立させる(例:学習用とテスト用で同じデータを使わない)
1. データ収集 2. 画像のノイズ除去 3. 前処理 4. 転移学習 5. モデル評価
モデル作成手順(再掲) 19
ルールベース 1:80 % (仮) ・「ネコ」がほとんど(弊社)なので全て「ネコ」として判定 ルールベース 2:90 % (仮) ・A
さんは「イヌ」を飼っている → A さんから投稿された画像は全て「イヌ」として判定 ・B さんは「ネコ」と「イヌ」を飼っている → ランダムで判定 機械学習:98 % ・実装難易度、工数、スペシャリスト、運用コスト、 etc 機械学習本当に必要ですか? 20 本当に機械学習が必要なのか、他に方法がないかしっかりと考える必要がある
付録:誰でもどこでもコーディングフリーで with Heroku Button 21 JSON ファイルを書くだけで簡単にツールを配布可能 ⚽ https://github.com/Doarakko/iyashi
⚽ https://speakerdeck.com/8823scholar/herokuhasi-ndafalseka
にゃーんとわんわん @Doarakko