SlideShare a Scribd company logo
1 of 23
Download to read offline
Free Lunch for Few-shot Learning:
Distribution Calibration
パン@オンライン
書籍情報
n タイトル︓Free Lunch For Few-shot Learning: Distribution Calibration
n ICLR 2021(オーラル)
n 点数︓7,7,7
n この論⽂を端的にいうと︓
n 特徴空間で、⼗分な量の訓練データの分布をもとに、新規クラスのデータ分布を推定する
n 推定されたデータ分布からサンプリングし、ロジスティック回帰したらめっちゃ精度でた
few-shot learning初⼼者なので
間違っていたら教えて下さい
few-shot learningの問題設定
n そもそもfew-shot learningってどんな問題設定なのか︖
n これがわからないと⼿法もよくわからない
n 少ない枚数のデータを使って訓練して、分類するんでしょ︖
n まあ、そうです。
n 各クラス1枚の画像の訓練データだけを使ってテスト時に5種類のどの
クラスに属しているかをあてる
n 無理ゲーw
few-shot learningの問題設定
n ⼀⽅で⼈間は右の画像をそれぞれABCと
名付けたとき、テスト画像がABCのどれ
か、(多分)わかると思う
n これは、ABCの他の例を知っているから
ではない
n ABC以外の種類の動物をいくつも知って
いて、それらがどういった特徴をもって
いると同じクラスであるのかを知ってい
るから
n なので、⼈間と条件をそろえると(︖)、
他の種類のクラスのデータは⼤量につ
かって良い、ということになる
A B C
???
訓練画像
テスト画像
上図のような訓練データは、few-shot learning⽤語で
3way-1shotと呼ぶ
few-shot learningの問題設定
n まとめると、訓練データには2種類ある
n ベースクラスとよばれる⼤量の画像データ(∞-way ∞-shot)
n ノベルクラスからサンプルされる少数の画像データ(N-way K-shot)
n ※ ベースクラスとノベルクラスはかぶりがない
n どうやってテストする︖
n ノベルクラスからサンプルされたデータがN種類のどのクラスであるのかを予測し検証する
n → じゃあ、ベースクラスで学習したモデルを
ノベルクラスのデータを使ってfine-tuningすればいいのでは︕
n ナイーブにはそうで、普通に精度けっこうでる
関連研究︓fine-tuning系
n まず、普通にベースクラスのデータを使って分類器を学習
n その後、最終層の重みだけをノベルクラス⽤に学習する(Baseline)
n 実はこれだけだと対して精度でないが、内積ではなくコサイン距離を使うとけっこう精度で
る(Baseline++)
出典︓A Closer Look at Few-shot Classification(ICLR 2019)
関連研究︓メタラーニング系
n ⼀⽅で、few-shot learningといえば、メタラーニングというイメージの⼈もいるの
ではなかろうか
n ベースクラスからサポートセット・クエリセットと呼ばれる少数のサンプルを何度もと
りだして、学習の仕⽅を学習する
n 具体的な例としてProtoNet(NIPS 2017)を考える
出典︓A Closer Look at Few-shot Classification(ICLR 2019)
関連研究︓ Prototypical Networks for Few-shot Learning
n 例えば3-way 5-shotのサポートセット(S)をベースク
ラスからサンプルし、特徴空間の中⼼点を求める
n なんらかの距離関数を使い、新しいデータ(クエリ
セット)と中⼼点の距離をもとめ、ソフトマックスで
クラスを予測し、学習する
n 上記を何度も繰り返すことで、少数データからクラス
を予測するすべを学ぶ(メタラーニング)
関連研究︓メタラーニング系
n ProtoNet以外にもいろいろメタラーニングのアルゴリズムはあるが、結果を⾒る感じ、結局
ファインチューニングでええやん︖といわれている(出典は下)
出典︓A Closer Look at Few-shot Classification(ICLR 2019)
提案⼿法の仮説
n 最近の流れがわかったということで、今回紹介する論⽂の内容に⼊っていこう
n まず、ベースクラスをもとに学習された特徴空間上のクラスごとの分布を考える
n 右下の表より、ウルフとフォックスは平均・分散ともに似ているが、ビールのボトルに関し
ては平均・分散ともに似ていないことがわかる
n → ノベルクラスの分布は、ベースクラスに
似ているクラスがあれば、それらのクラスの分布で
表現できるのではないか︖
提案⼿法︓なぜノベルクラスの「分布」を考えるのか
n ノベルクラスの少ないサンプルを使って分類器を学習すると、過剰適合してしまうという問
題がある(左図)
n ノベルクラスの分布がわかっていれば、過剰適合することを防ぐことができそう(右図)
提案⼿法︓どうやってノベルクラスの分布を推定するのか︖
n 普通に考えてfew-shotしかないノベルクラスの分布を推定することは無理ゲー
n なので、似ているクラスは特徴空間で分布が似ているという仮説を利⽤する
n まず、ノベルクラスの分布はガウス分布であると仮定
n 次に、クラスごとにベースクラスの平均と
共分散を求める
n ノベルクラスのデータ(!
𝑥)とベースクラスの平均の
距離をもとに、k番⽬までの似ているクラスを選ぶ
n 似ているクラスとノベルクラスのデータを平均して、
ノベルクラスの平均と分散を推定する
提案⼿法︓分布からサンプルしたデータを使って学習
n ノベルクラスのデータは1つだけでなく、
K-shotのときはK個あるので、K個の統計量
が得られる
n yはNクラスの中のあるクラス
n これら全ての統計量から、データをサンプ
リングする
n つまり混合ガウス分布からのサンプリング
n サンプルされたデータと教師yを使って、例
えばロジスティック回帰などで学習する
n もとのfew-shotのデータ( !
𝑆)も使う
提案⼿法︓細かいテクニック・ハイパラ
n ノベルクラスのデータをガウス分布に従うようにするために、Tukey’s Ladder of Powers
Transformation を⾏う
n λ乗するだけ
n 実験ではλ = 0.5
n 分散度合いをヒューリスティクスに決めている︖
n 実験ではα = 0.21 or 0.3
n (αIとか⾜すことはあるけどαを⾜すのか...)
n 何個のベースクラスの分布を利⽤するのか
n 実験では k = 2
n 何個くらいサンプルするのか
n 実験では750くらい
実験︓データセット
n few-shotでよく使われるのはCUB・miniImageNetというデータセット
n この論⽂では上記に加えてtieredImageNetというデータセットも使って検証している
n 昔はオムニグロットとか使われてたイメージだが、精度がサチってきて最近では使われなくなっ
てきたイメージ
n CUB︓
n 200クラスあり、全体で11788サンプル存在し、サイズは84x84x3
n ベースクラス100、検証クラス50、ノベルクラス50
n いろんな⿃が写ってる
n miniImageNet︓
n 100クラスあり、各クラスごとに600サンプル存在し、サイズは84x84x3
n ベースクラス64、検証クラス16、ノベルクラス20
n ILSVRC-12から取り出された
n tieredImageNet︓
n 608クラスあり、各クラス平均的に1281サンプル存在する
n ベースクラス351、検証クラス97、ノベルクラス160
n ILSVRC-12から取り出された
実験︓評価⽅法
n ノベルクラスからサンプルされる訓練データは5way-1shot or 5way-5shotとする
n つまり、訓練データは各クラス1枚か5枚で、5クラス分類をするということ
n もちろんベースクラスは無限に使うことができる
n 上記⼀回だけだと信頼度がなくなるので、10000回繰り返して平均正解率を求める
n テストデータは各訓練データに対し1個︖書いてない
実験︓実装詳細
n ベースクラス使って学習したWideResNetを特徴抽出器として利⽤する
n 最終層⼀層前の特徴を使う
n 活性化関数ReLUの後の特徴を使う
n non-negativeなので、データをλ乗して、ガウシアンっぽくすることが可能
n (ReLUの前を最初から使えばもっとガウシアンっぽくなるのでは︖と思ったが、
まあやってるんだろうな)
n 分類器はscikit-learnのLRやSVMを使う
実験︓定量的結果
n 基本的にかなり強い模様
実験︓サンプルされたデータを可視化
n t-SNEで可視化
n 実際のデータの分布(Query Set)と推定されたデータの分布が似ているので、うまく⾏って
いると⾔いたいらしい
実験︓アブレーション
n λ乗するとめちゃくちゃ精度あがるけど、⽣成サンプル使ってもそこまで精度あがってない
ようにみえる
n WRN28以外のバックボーン使っても、提案⼿法によって精度あがることが確認できる
実験︓その他実験
n ファインチューニングの⼿法にも適⽤できる(それはそう)
n 分布からサンプルされたデータだけを使うより、ノベルクラスから直接得られたサンプルを
使うほうが精度よい
実験︓ハイパラ分析
n クラス数はk=2が⼀番良さそう
n αはデータによる
n バリデーションデータによってハイパラ調整してるっぽい
感想
n 全体としてアイデアは単純で⾯⽩いし、結果も出ているようにみえる
n ただ、精度に⼀番貢献しているのはヒューリスティクス部分なのではないかと思ってる
n Manifold Mixup for Few-shot Learning (WACV 2020)も同じくらい精度でてるけど⽐較していない
のは気になった
n よく読めば理由はわかるかも
n あと、最後の結論にベースクラスとノベルクラスのドメインが異なった場合はfuture workに
するとかいてあり、ベースクラスの分布をもとにノベルクラスの分布が作ることができなく
なるので、それはできないのは当然だなという感じがした
n そういった問題設定を解こうとしている論⽂もいくつかある
n ex) Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformation (ICLR 2020)

More Related Content

More from ぱんいち すみもと (14)

Deep Semi-Supervised Anomaly Detection
Deep Semi-Supervised Anomaly DetectionDeep Semi-Supervised Anomaly Detection
Deep Semi-Supervised Anomaly Detection
 
Anomaly Detection by Latent Regularized Dual Adversarial Networks
Anomaly Detection by Latent Regularized Dual Adversarial NetworksAnomaly Detection by Latent Regularized Dual Adversarial Networks
Anomaly Detection by Latent Regularized Dual Adversarial Networks
 
実装レベルで学ぶVQVAE
実装レベルで学ぶVQVAE実装レベルで学ぶVQVAE
実装レベルで学ぶVQVAE
 
ICLR2020の異常検知論文の紹介 (2019/11/23)
ICLR2020の異常検知論文の紹介 (2019/11/23)ICLR2020の異常検知論文の紹介 (2019/11/23)
ICLR2020の異常検知論文の紹介 (2019/11/23)
 
パンハウスゼミ 異常検知論文紹介 20191005
パンハウスゼミ 異常検知論文紹介  20191005パンハウスゼミ 異常検知論文紹介  20191005
パンハウスゼミ 異常検知論文紹介 20191005
 
Anomaly detection 系の論文を一言でまとめた
Anomaly detection 系の論文を一言でまとめたAnomaly detection 系の論文を一言でまとめた
Anomaly detection 系の論文を一言でまとめた
 
最新の異常検知手法(NIPS 2018)
最新の異常検知手法(NIPS 2018)最新の異常検知手法(NIPS 2018)
最新の異常検知手法(NIPS 2018)
 
Dual dl
Dual dlDual dl
Dual dl
 
Categorical reparameterization with gumbel softmax
Categorical reparameterization with gumbel softmaxCategorical reparameterization with gumbel softmax
Categorical reparameterization with gumbel softmax
 
Domain transfer サーベイ
Domain transfer サーベイDomain transfer サーベイ
Domain transfer サーベイ
 
Intro VAE
Intro VAEIntro VAE
Intro VAE
 
パンでも分かるVariational Autoencoder
パンでも分かるVariational Autoencoderパンでも分かるVariational Autoencoder
パンでも分かるVariational Autoencoder
 
PRML 14章
PRML 14章PRML 14章
PRML 14章
 
PRML 9章
PRML 9章PRML 9章
PRML 9章
 

Recently uploaded

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Free lunch for few shot learning distribution calibration