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
99
JOIN して1ヶ月のエンジニアに聞いた Liiga の良いところ 3 選
doarakko
0
93
わんわおーん
doarakko
0
82
職場を明るくする
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
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
180
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
2
200
AI Augmentation Techniques with Liberty
ivargrimstad
1
340
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
300
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
320
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
220
Next.js: The final boss of Web Performance
guaca
0
380
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
310
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
400
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
610
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.5k
Featured
See All Featured
Being A Developer After 40
akosma
PRO
92
590k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Claude Code のすすめ
schroneko
67
230k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
420
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Ruling the World: When Life Gets Gamed
codingconduct
0
430
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
Code Reviewing Like a Champion
maltzj
529
40k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
660
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