SlideShare uma empresa Scribd logo
1 de 44
Deep Reinforcement Learning
for Imbalanced Classification
Table of Contents
1. 背景
2. 関連手法
3. 手法
a. Imbalanced Classification Markov Decision Process
b. Reward function for imbalanced data classification
c. DQN based imbalanced classification algorithm
4. 実験条件
5. 実験結果
2
背景
3
データはインバランスなケースが多い
▸ クラス分類においてクラスのデータ分布は不均一であることが多い
▸ 深層強化学習をインバランスなデータに適用するケースは少ない
▹ 深層強化学習を用いてインバランスなデータに対する識別精度の
高いモデル作成を試みる
▹ 報酬の設計を変更することでインバランスなデータの学習を
可能にする
● * ここからはデータ数が少ないクラスのデータをマイノリティクラス、
データ数が多いクラスをマジョリティクラスと表記
● * Deep Q networkはDQNと表記
4
関連手法
5
インバランスなデータに対する手法
▸ データレベルの手法
▹ マイノリティクラス:オーバーサンプル
▹ 手法:SMOTE
▹ 線形補完により新しいサンプルを生成する手法
▹ 欠点:オーバーフィット
▹ マジョリティクラス:アンダーサンプル
▹ 手法: NearMiss
▹ Nearest neighbor法で距離が近いサンプルのみ残す手法
▹ 欠点:情報落ち
6
:
インバランスなデータに対する手法
▸ アルゴリズムレベルの手法
▹ Cost sensitive learning
▹ マイノリティクラスの識別成果をlossで高く評価する
▹ Ensemble Learning
▹ 個別の識別器で学習して投票もしくは組み合わせにより良い
精度のものを選択
▹ Decision threshold adjustment
▹ 学習はインバランスなデータ。評価の際に閾値を設定して評
価
7
手法
8
手法
▸ Imbalanced Classification Markov Decision Process
▹ 強化学習の枠組みで適用できる形にするため、学習データを連続
的に得られるMarkov Decision Processの形で提供してインバラン
スな識別器を学習
▸ Reward function for imbalanced data classification
▹ インバランスなデータを学習するための報酬設計
▸ DQN based imbalanced classification algorithm
▹ DQNに基づいたインバランスなデータに対する識別器の学習のア
ルゴリズム
9
Imbalanced Classification
Markov Decision Process
10
Imbalanced Classification Markov Decision Process
▸ State
▹ 得られる学習データのサンプル
▹ ステップごとに学習データサ
ンプルが与えられる
▸ Action
▹ 識別器が予測した識別結果
▸ Reward
▹ Stateに対するActionによって得られ
る報酬。マイノリティクラスの報酬
が高くなるように設計
▸ Transition probability
▹ 次にどのような学習データが得られ
るかの確率(学習データは順番通り
に得られるのであまり寄与しない)
11
Imbalanced Classification Markov Decision Process
▸ Discount factor
▹ 未来の報酬に対するディスカウント
要素
▸ Episode
▹ どの時点で学習を終了させるかを決
めています
▹ 全データもしくはマイノリテ
ィクラスを誤分類で終了
▸ Policy
▹ 識別器
▹ 学習パラメータθを用いて表
すと となる
12
Reward function for imbalanced
data classification
13
インバランスなデータに対する報酬
予測したラベルとデータのラベルが同一の場合は正の報酬を与え、異なる
場合は負の報酬を与える。
: マイノリティクラスのデータ
: マジョリティクラスのデータ
: データの正解ラベル
: 識別器が予測した結果
: 1であればマイノリティとマジョリティを同一として扱うので1以下
実験では調整して評価しているが の時が精度が良かった。
14
DQN based imbalanced
classification algorithm
15
Deep Q-learning for Imbalanced Classification
Markov Decision Process
準備
学習サンプルsに対して識別器 の予測結果aの予測確率は下記のように表
せる。
予測結果と学習データのラベルが同一の際の累積報酬は下記のように表せ
る。
16
Deep Q-learning for Imbalanced Classification
Markov Decision Process
準備
学習データと識別器の予測結果から得られる累積報酬の期待値をQ関数とし
て設定
ベルマン方程式から累積報酬を分解。現在までの報酬と未来の報酬に分解
17
Deep Q-learning for Imbalanced Classification
Markov Decision Process
準備
累積報酬を最大にするような識別器 は理想的なQ*関数を解くことによ
って得られる。Q*関数を最大にするような識別結果と識別器の予測結果が
一致した場合は1、それ以外は0
理想的なQ*関数は上記より書き換え
18
Deep Q-learning for Imbalanced Classification
Markov Decision Process
準備
Q関数はDQNの登場によって高次元で扱えるようになっているのでDQNの学
習に必要なLossを設計
はQ関数のターゲットとなる値で下記のように定義。terminalは終了するか
どうか。終了する場合は未来の結果は考慮しない
19
Deep Q-learning for Imbalanced Classification
Markov Decision Process
準備
パラメータθでロス関数を微分した結果は下記。
20
Influence of reward function:
インバランスなデータにおける報酬関数
Q関数のターゲットとなる がマジョリティクラスとマイノリティクラスで
異なる。 はindicator関数で予測結果とデータのラベルが同一の場合に1にな
る。
21
Influence of reward function:
インバランスなデータにおける報酬関数
Q関数の微分はマイノリティクラスとマジョリティクラスで下記のようにな
る。
22
Influence of reward function:
インバランスなデータにおける報酬関数
式11を式13に、式12を式14に代入し、それぞれを足して1つのロス関数にまと
める
23
Algorithm
● 初期の設定
○ 学習データと何エピソード行うか設
定
○ バッチサイズ分確保するExperience
replay memoryを初期化
○ 学習パラメータをランダムに初期化
○ シミュレーション環境変数を初期化
24
Algorithm
● 学習処理
○ データをシャッフル
○ 学習データを取得
○ 学習データから予測結果を取得
○ STEP関数に予測結果とラベルを与え
る。報酬と終了すべきかどうか返却
■ STEP関数の説明は後述
○ Experience replay memoryに学習サン
プル、予測結果、報酬、次の学習サ
ンプル、終了フラグをセット
○ Experience replay memoryから学習サ
ンプル、予測結果、報酬、次の学習
サンプル、終了フラグをランダムに
取得
25
Algorithm
● 学習処理
○ ターゲットの を設定
■ Terminal = True
● 報酬を設定
■ Terminal = False
● 報酬と未来の報酬を設
定
○ Q関数のターゲットとQ関数からロ
ス関数を設定し学習
○ Terminal = Trueで学習終了
26
Algorithm
● STEP関数
○ terminalはFalseに設定
○ 学習データがマイノリティなデータ
とマジョリティなデータで報酬が変
更される
○ マイノリティなデータで識別結果が
ミスすればterminalをTrueにしてその
エピソードの学習を終了する
27
実験条件
28
比較手法
● DNN
○ 特に工夫をしていない深層学習モデル
● ROS
○ マイノリティクラスにオーバーサンプルを使用
● RUS
○ マジョリティクラスにアンダーサンプルを使用
● MFE
○ Mean false error をロス関数に使用
● CSM
○ マイノリティクラスの誤分類を過大評価
29
比較手法
● DTA
○ 学習時は何もせず、テストの際にクラスごとに優先付けを行う
30
評価方法
● ポジティブとネガティブの2値の評価
● G-mean 解説動画 https://www.youtube.com/watch?v=_UdGUULKN-E
● F-measure
https://en.wikipedia.org/wiki/Sensitivity_and_specificity#Sensitivity
31
データセット
● IMDB
○ 映画のテキストデータセット。ポジティブ、ネガティブのラベル
が付いている。ポジティブレビューをポジティブクラス
● MNIST
○ 2をポジティブクラス。他はネガティブクラス
● Fashion-Mnist
○ 10カテゴリのファッションデータ
● Cifar10
32
データセット
33
● Fashion MNIST
○ (1)
■ Positive: T-Shirt, Pullover
■ Negative: Trouser, Dress
○ (2)
■ Positive: Coat, Sandal, Shirt
■ Negative: Sneaker, Bag, Ankle boot
● Cifar10
○ (1)
■ Positive: automobile
■ Negative: cat, deer, dog, frog
○ (2)
■ Positive: horse
■ Negative: ship, truck
ネットワークアーキテクチャ テキストデータ
34
ネットワークアーキテクチャ 画像データ
35
パラメータ
● ε-greedy法ε: 1.0-> 0.01
● Replay memory: 50000
● Optimizer: Adam
● 学習率: 0.00025
● バッチサイズ: 64
● 報酬率: 0.1
36
実験結果
37
通常の深層学習と本手法の比較
38
インバランス率を変えた時のG-Mean
39
インバランス率を変えた時のF-measure
40
マイノリティクラスの報酬率を変えた時のG-
Mean 同一データセット
41
マイノリティクラスの報酬率を変えた時のG-
Mean 異なるデータセット
42
参考
43
References
44
▸ Deep Reinforcement Learning for
Imbalanced Classification

Mais conteúdo relacionado

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
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...
 

Deep reinforcement learning for imbalanced classification

Notas do Editor

  1. Icon free http://www.flaticon.com/ イラストや http://www.irasutoya.com/ ぱくたそ https://www.pakutaso.com/ http://www.slidescarnival.com/ja/%E3%82%A6%E3%82%A3%E3%83%AA%E3%82%A2%E3%83%A0%E3%81%AE%E3%83%97%E3%83%AC%E3%82%BC%E3%83%B3%E3%83%86%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88/1705
  2. 時系列の予測ではなく分類に向いている
  3. 時系列の予測ではなく分類に向いている
  4. 時系列の予測ではなく分類に向いている
  5. 時系列の予測ではなく分類に向いている
  6. 時系列の予測ではなく分類に向いている
  7. 時系列の予測ではなく分類に向いている
  8. 時系列の予測ではなく分類に向いている
  9. G-mean: “True positive rate” and “True negative rate” 正しくクラスを当てられた割合、正しく不正解なクラスを当てられた割合
  10. \begin{eqnarray*} \tilde{y}_T &=& F(y_1,....y_{T-1}, \vec{x}_1,...\vec{x}_T) \\ &=& \vec{v}^T_y(\vec{W}_y[\vec{d}_T;\vec{c}_T] + \vec{b}_w) + b_v \end{eqnarray*}