SlideShare a Scribd company logo
麻雀PJのご紹介と裏話
Platinum Data Meetup vol.1
2018/08/30
Rio Kurihara
2
はじめに
資料は後日公開予定
写真撮影OK
SNSアップOK
麻雀
機械学習
アウトドアコミュ力
エンジニアリング
3
自己紹介 栗原 理央(Rio Kurihara)
▪ データサイエンティスト 新卒3年目
4
本発表の目的
▪ 麻雀(PJ)に興味を持ってもらう
▪ あわよくば一緒に開発してくれる人を探す
▪ 「麻雀の人」という洗脳がしたい
※技術の細かい話はしません
麻雀PJとは
プロセスイメージ
Input(画像)
※Sample
牌の識別
役名 1p 2p 3p … 8m 9m p f c
平和 1 1 1 … 0 0 0 0 0
断ヤオ 0 1 1 … 1 0 0 0 0
混一 0 0 0 … 1 1 3 0 0
点数計算
ルールベース
4
一萬:3枚 九萬:3枚
二筒:1枚 三筒:1枚
四筒:1枚 …
Who? ただの麻雀好き1名+心優しい助っ人の方々(完全非業務)
What? 麻雀の点数計算を自動化する
Why? 点数計算ができない・覚えるの面倒くさい・初心者のハードル下げたい
How? 画像つかう ※詳細は後述
※お遊びで始まり、
未だお遊びの域を出ていない
6
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
7
ふわっとPJ始動
8
PJ開始時のリサーチ(2017/2時点)
▪ 需要はあるのか? → 無くはなさそう
▪ 既存サービスは? → 1つ見つけたがリリース前
役自動計算アプリ①(非画像認識)
役自動計算アプリ②(画像認識・開発途中)
• 役自動計算アプリ②を作った人っぽい人のブログ
9
とりあえずテンプレートマッチング
試してみよう
10
テンプレートマッチングとは
テンプレート画像(探索対象)と、 探索領域となる画像を入力とする。テンプレート画像を
少しずつずらしながら、探索領域内の対象領域との比較を行う。
11
テンプレートマッチングによる検出結果(1)
output
(閾値0.55)
output
(閾値0.6)
テンプレート
画像
入力画像
(探索用)
牌 max_val
e 0.763
c 0.534
9s 0.740
9p 0.529
9m 0.749
8s 0.656
7s 0.732
6s 0.601
4p 0.639
3p 0.694
3m 0.577
2p 0.796
1p 0.546
1m 0.721
8m 0.478
6m 0.470
7p 0.466
1s 0.456
2s 0.438
Before After
12
テンプレートマッチングによる検出結果(2)
▪ 牌毎の閾値を設定しようと複数データを識別させてみましたが、そもそも、撮影条件がかなり整っていないと識別は難しそう
⇒完全真上からの撮影、明るさが適切、方向が正しい
逆さま・明るめ・画質悪めの画像(閾値0.4)
正解牌数:0
(閾値0.55で識別0、閾値0.4で上記結果)
かなりいい感じの画像①(閾値0.55)
正解牌数:14牌(100%)
ちょっと斜めからの画像①(閾値0.55)
正解牌数:2
明るめ・画質悪めの画像(閾値0.4)
正解牌数:0
(閾値0.55で識別0、閾値0.4で上記結果)
ちょっと斜めの画像②(閾値0.55)
正解牌数:3
かなり斜め・暗めの画像(閾値0.55)
正解牌数:1
13
テンプレートマッチングによる検出結果(2)
▪ 牌毎の閾値を設定しようと複数データを識別させてみましたが、そもそも、撮影条件がかなり整っていないと識別は難しそう
⇒完全真上からの撮影、明るさが適切、方向が正しい
逆さま・明るめ・画質悪めの画像(閾値0.4)
正解牌数:0
(閾値0.55で識別0、閾値0.4で上記結果)
かなりいい感じの画像①(閾値0.55)
正解牌数:14牌(100%)
ちょっと斜めからの画像①(閾値0.55)
正解牌数:2
明るめ・画質悪めの画像(閾値0.4)
正解牌数:0
(閾値0.55で識別0、閾値0.4で上記結果)
ちょっと斜めの画像②(閾値0.55)
正解牌数:3
かなり斜め・暗めの画像(閾値0.55)
正解牌数:1
圧倒的イケてなさ
14
テンプレートマッチングがうまくいかなかった理由
出力
誤り先
(テンプレー
ト)
▪ 牌の中に内包関係がある
▪ 牌の輪郭抽出をしたあとのテンプレートマッチングならうまくいくかもしれない
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
15
初期モデル
構築完了
初社内発表
16
助っ人の登場により深層学習(SSD)モデルが誕生
17
みんな大好きSSD
原文:https://arxiv.org/pdf/1512.02325.pdf
論文和訳:https://qiita.com/de0ta/items/1ae60878c0e177fc7a3a
▪ 深層学習の物体検出アルゴリズム
▪ 画像中の「どこに」「何が」あるかを予測する
18
SSDによる検出結果
19
SSDによる検出結果
イケてる
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
20
改良モデル
構築完了
MAX
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
21
???
初社外共有
22
2018年5月21日
東北大学の学生チームが
初心者向け麻雀支援アプリ「JongHelper」を開発
学生向けハッカソン「JPHACKS2017」に出場し、
審査員特別賞の他4つの企業賞を同時受賞
https://mj-news.net/game-app/2018052198280
24
み、皆考えることは同じなんや・・・!
25
焦りはじめ、LINE bot開発に着手
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
26
???
MIN
27
2018年6月27日
KDDIがiOSアプリ「麻雀カメラ」をリリース
28
https://game.watch.impress.co.jp/docs/news/1130791.html
https://news.mynavi.jp/article/20180627-656167/
29
方々からの煽りを受ける
※ ↓本日meetup主催者
※ 本日meetup登壇者 →
30
もうやめて!
とっくにライフはゼロよ・・・
31
現在
▪ LINE bot開発継続中
▪ GDG Dev Fest Tokyo 2018(明後日9/1)に向けて死にそうになりながらデモ作成中
https://aiyprojects.withgoogle.com/vision/
0
10
20
30
40
50
60
70
80
90
100
2017/2
2017/3
2017/4
2017/5
2017/6
2017/8
2017/11
2018/5
2018/6
2018/7
2018/8
2018/8/30
中の人のテンション推移
32
本日
33
まとめと今後
▪ 凹まずに頑張ります
▪ 麻雀PJに興味持ってもらえたら嬉しい
34
ご清聴ありがとうございました
(ご興味ある方、このあとの懇親会で是非)
35
【参考】 学習データの作成
▪ アノテーションは本当に辛い。最低でも数百枚は必要
▪ 34種類の牌画像だけ撮影し、あとはランダムに配置するだけ
牌画像 学習用画像

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Bp meetup mahjong-180830