SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
Semantic Instance Segmentation
with a Discriminative Loss Function
東京大学大学院
情報理工学系研究科
電子情報学専攻
M2 谷合 廣紀
書誌情報
• 論文名
• Semantic Instance Segmentation with a Discriminative Loss Function
• 著者
• Bert De Branbandere, Davy Neven, Luc Van Gool (KU leuven)
• arXiv
• https://arxiv.org/abs/1708.02551
• CVPR2017 workshop
どんな内容?
• Instance Segmentationのための損失関数である
Discriminative Lossの提案
• 既存のSemantic Segmentation用のネットワークを使うことができる
• Object proposalやBounding boxを使わない手法
• 同じ種類の物体がたくさんある場合に強い
背景
Instance Semmentation すごい…
From https://github.com/facebookresearch/Detectron
でもこんな画像に対しては?
From https://molcyt.org/2013/12/19/insitu/
現実世界では
• 世の中Bounding Boxで囲める物体ばかりではない
• 実務では1種類の物体がたくさんあって、それらを区別したいときも多い
• 医療画像における染色体や細胞核の画像
• 工場のベルトコンベアで流れてくる物体
手法
基本となるアイデア
• ネットワークはピクセルごとに
n次元の特徴ベクトルを出力する
• 入力が(256, 256, 3)のRGB画像で
nを16とすると、出力は(256, 256, 16)
• ネットワークはこの特徴ベクトルが
次のような性質をもつように学習を行う
• 同じインスタンスに属する特徴ベクトルは
近い場所にある
• 異なるインスタンスに属する特徴ベクトルは
遠い場所にある
基本となるアイデア
• そのような特徴ベクトルを出力できるようになれば
後処理の段階でクラスタリングをすることで
Instance Segmentationを実行できる!
• そんな特徴ベクトルを学習するための損失関数が
Discriminative Loss
Discriminative Lossの3つの要素
• Variance term
• 同じインスタンスに属する特徴ベクトルが近づくようにする引力
• Distance term
• 異なるインスタンスに属する特徴ベクトルが遠ざかるようにする斥力
• Regularization term
• ベクトルの正則化のための原点方向への弱い引力
Variance term
• 特徴ベクトル𝑥𝑖とクラスタの中心𝜇 𝑐の距離に対してのLoss
• [𝑥]+はmax(0, 𝑥)を表す
• 特徴ベクトル𝑥𝑖とクラスタの中心𝜇 𝑐の距離が
𝛿 𝑣以下になれば損失は発生しない
Distance term
• 異なる2つのクラスタの中心𝜇 𝑐𝐴, 𝜇 𝑐𝐵間の距離に対してのLoss
• [𝑥]+はmax(0, 𝑥)を表す
• 中心間の距離が
2𝛿 𝑑以下になれば損失は発生しない
Regularization term
• 特徴ベクトルに対する正則化のためのLoss
Discriminative Loss
• Discriminative Lossはこれらの重みづけ和
• 論文での値はそれぞれ
𝛼 = 1, 𝛽 = 1, 𝛾 = 0.001
学習経過
学習結果の一例
• Synthetic Scattered Sticks Dataset
• この論文のオリジナルのデータセット?
• Bounding Boxベースだと難しいタスク
実装
実装方針
• PyTorchで実装
• 既に実装例あり:
https://github.com/Wizaron/instance-segmentation-pytorch
• 環境がPython2
• 微妙に実装が間違っている気がする…
• というわけで、上記コードを大いに参考にしつつ自分で再実装:
https://github.com/nyoki-mtl/pytorch-discriminative-loss
• Synthetic Scattered Sticks Datasetも実装
• このDatasetに対して学習と推論をした
DiscriminativeLoss
• 論文のパラメタをデフォルト引数に
• ロスの計算はforwardで呼び出される
• input
• ネットワークの出力
• (batch, height, width, feature)
• featureは特徴ベクトルの次元数
• target
• ラベル
• (batch, height, width, max_n_clusters)
• max_n_clustersはインスタンス数の最大値
_discriminative_loss
• Discriminative Lossの本体
• 各ロスの重み付き和を返す
_cluster_means
• クラスタの中心を計算
𝜇 𝑐 =
1
𝑁𝑐
𝑖=1
𝑁 𝑐
𝑥𝑖
_variance_term
• 各クラスタの中心への引力
_distance_term
• クラスタ間の中心の斥力
_regularization_term
• クラスタの大きさを小さくするための
弱い引力
Synthetic Scattered Sticks Dataset
• OpenCVで適当な場所に長方形を描画するだけ
• 重なった場合、あとから描画される長方形のほうが上
UNet
• Semantic Segmentationで
よく使われるネットワーク構造
• 今回は入力が256*256
• 出力は最終層直前で分岐させて
2つの出力を出している
• SemanticSegmentation用に
256*256*2 (背景+物体)
損失関数はSoftmax
• 特徴ベクトル用に
256*256*16
損失関数は
Discriminative Loss
Clustering
• 今回Synthetic Scattered Sticksの棒の数は8個で固定していて
クラスタ数が既知なためKMeansを使った
• クラスタ数が未知の場合はMeanShiftを使うといいらしい
詳しくは論文を参照してください
結果
問題点
• 出力は次の3つが揃ってはじめてうまくいく
• 物体領域(Semantic Segmentation)
• 各ピクセルの特徴ベクトル
• 何個のインスタンスが写っているか
• インスタンス数を間違えると悲惨
まとめ
• Discriminative Lossはピクセルごとに特徴ベクトルを出力するように
学習するための損失関数
• 既存のSemantic Segmentationのネットワーク構造を使うことができる
• Bounding Boxベースでないため、Synthetic Scattered Sticks のような
データに対してInstance Segmentationを行うことができる
• 綺麗に出力を得るためには、物体領域とインスタンス数の情報も必要

Contenu connexe

Tendances

Tendances (20)

Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
 
【メタサーベイ】数式ドリブン教師あり学習
【メタサーベイ】数式ドリブン教師あり学習【メタサーベイ】数式ドリブン教師あり学習
【メタサーベイ】数式ドリブン教師あり学習
 
猫でも分かるVariational AutoEncoder
猫でも分かるVariational AutoEncoder猫でも分かるVariational AutoEncoder
猫でも分かるVariational AutoEncoder
 
Anomaly detection 系の論文を一言でまとめた
Anomaly detection 系の論文を一言でまとめたAnomaly detection 系の論文を一言でまとめた
Anomaly detection 系の論文を一言でまとめた
 
【メタサーベイ】Video Transformer
 【メタサーベイ】Video Transformer 【メタサーベイ】Video Transformer
【メタサーベイ】Video Transformer
 
[DL輪読会]相互情報量最大化による表現学習
[DL輪読会]相互情報量最大化による表現学習[DL輪読会]相互情報量最大化による表現学習
[DL輪読会]相互情報量最大化による表現学習
 
Transformerを多層にする際の勾配消失問題と解決法について
Transformerを多層にする際の勾配消失問題と解決法についてTransformerを多層にする際の勾配消失問題と解決法について
Transformerを多層にする際の勾配消失問題と解決法について
 
You Only Look One-level Featureの解説と見せかけた物体検出のよもやま話
You Only Look One-level Featureの解説と見せかけた物体検出のよもやま話You Only Look One-level Featureの解説と見せかけた物体検出のよもやま話
You Only Look One-level Featureの解説と見せかけた物体検出のよもやま話
 
ディープラーニングを用いた物体認識とその周辺 ~現状と課題~ (Revised on 18 July, 2018)
ディープラーニングを用いた物体認識とその周辺 ~現状と課題~ (Revised on 18 July, 2018)ディープラーニングを用いた物体認識とその周辺 ~現状と課題~ (Revised on 18 July, 2018)
ディープラーニングを用いた物体認識とその周辺 ~現状と課題~ (Revised on 18 July, 2018)
 
[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...
[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...
[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...
 
Curriculum Learning (関東CV勉強会)
Curriculum Learning (関東CV勉強会)Curriculum Learning (関東CV勉強会)
Curriculum Learning (関東CV勉強会)
 
[DL輪読会]GQNと関連研究,世界モデルとの関係について
[DL輪読会]GQNと関連研究,世界モデルとの関係について[DL輪読会]GQNと関連研究,世界モデルとの関係について
[DL輪読会]GQNと関連研究,世界モデルとの関係について
 
【DL輪読会】NeRF-VAE: A Geometry Aware 3D Scene Generative Model
【DL輪読会】NeRF-VAE: A Geometry Aware 3D Scene Generative Model【DL輪読会】NeRF-VAE: A Geometry Aware 3D Scene Generative Model
【DL輪読会】NeRF-VAE: A Geometry Aware 3D Scene Generative Model
 
【DL輪読会】Efficiently Modeling Long Sequences with Structured State Spaces
【DL輪読会】Efficiently Modeling Long Sequences with Structured State Spaces【DL輪読会】Efficiently Modeling Long Sequences with Structured State Spaces
【DL輪読会】Efficiently Modeling Long Sequences with Structured State Spaces
 
Semantic segmentation
Semantic segmentationSemantic segmentation
Semantic segmentation
 
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
 
最適輸送の解き方
最適輸送の解き方最適輸送の解き方
最適輸送の解き方
 
【DL輪読会】High-Resolution Image Synthesis with Latent Diffusion Models
【DL輪読会】High-Resolution Image Synthesis with Latent Diffusion Models【DL輪読会】High-Resolution Image Synthesis with Latent Diffusion Models
【DL輪読会】High-Resolution Image Synthesis with Latent Diffusion Models
 
実装レベルで学ぶVQVAE
実装レベルで学ぶVQVAE実装レベルで学ぶVQVAE
実装レベルで学ぶVQVAE
 
深層生成モデルと世界モデル
深層生成モデルと世界モデル深層生成モデルと世界モデル
深層生成モデルと世界モデル
 

Similaire à [DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function

mi-8. 人工知能とコンピュータビジョン
mi-8. 人工知能とコンピュータビジョンmi-8. 人工知能とコンピュータビジョン
mi-8. 人工知能とコンピュータビジョン
kunihikokaneko1
 
関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)
関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)
関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)
Akisato Kimura
 

Similaire à [DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function (20)

Object Detection & Instance Segmentationの論文紹介 | OHS勉強会#3
Object Detection & Instance Segmentationの論文紹介 | OHS勉強会#3Object Detection & Instance Segmentationの論文紹介 | OHS勉強会#3
Object Detection & Instance Segmentationの論文紹介 | OHS勉強会#3
 
[DL Hacks]OCNet: Object Context Networkfor Scene Parsing
[DL Hacks]OCNet: Object Context Networkfor Scene Parsing[DL Hacks]OCNet: Object Context Networkfor Scene Parsing
[DL Hacks]OCNet: Object Context Networkfor Scene Parsing
 
GENESIS: Generative Scene Inference and Sampling with Object-Centric Latent R...
GENESIS: Generative Scene Inference and Sampling with Object-Centric Latent R...GENESIS: Generative Scene Inference and Sampling with Object-Centric Latent R...
GENESIS: Generative Scene Inference and Sampling with Object-Centric Latent R...
 
[DL輪読会]STORM: An Integrated Framework for Fast Joint-Space Model-Predictive C...
[DL輪読会]STORM: An Integrated Framework for Fast Joint-Space Model-Predictive C...[DL輪読会]STORM: An Integrated Framework for Fast Joint-Space Model-Predictive C...
[DL輪読会]STORM: An Integrated Framework for Fast Joint-Space Model-Predictive C...
 
[DL輪読会]M2Det: A Single-Shot Object Detector based on Multi-Level Feature Pyra...
[DL輪読会]M2Det: A Single-Shot Object Detector based on Multi-Level Feature Pyra...[DL輪読会]M2Det: A Single-Shot Object Detector based on Multi-Level Feature Pyra...
[DL輪読会]M2Det: A Single-Shot Object Detector based on Multi-Level Feature Pyra...
 
050830 openforum
050830 openforum050830 openforum
050830 openforum
 
mi-8. 人工知能とコンピュータビジョン
mi-8. 人工知能とコンピュータビジョンmi-8. 人工知能とコンピュータビジョン
mi-8. 人工知能とコンピュータビジョン
 
関西Cvprml勉強会2017.9資料
関西Cvprml勉強会2017.9資料関西Cvprml勉強会2017.9資料
関西Cvprml勉強会2017.9資料
 
CVPR2018 参加報告(速報版)2日目
CVPR2018 参加報告(速報版)2日目CVPR2018 参加報告(速報版)2日目
CVPR2018 参加報告(速報版)2日目
 
[DL輪読会]GENESIS: Generative Scene Inference and Sampling with Object-Centric L...
[DL輪読会]GENESIS: Generative Scene Inference and Sampling with Object-Centric L...[DL輪読会]GENESIS: Generative Scene Inference and Sampling with Object-Centric L...
[DL輪読会]GENESIS: Generative Scene Inference and Sampling with Object-Centric L...
 
[DL Hacks] Objects as Points
[DL Hacks] Objects as Points[DL Hacks] Objects as Points
[DL Hacks] Objects as Points
 
関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)
関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)
関西CVPRML勉強会 2012.2.18 (一般物体認識 - データセット)
 
EfficientDet: Scalable and Efficient Object Detection
EfficientDet: Scalable and Efficient Object DetectionEfficientDet: Scalable and Efficient Object Detection
EfficientDet: Scalable and Efficient Object Detection
 
CVPR2017 参加報告 速報版 本会議 1日目
CVPR2017 参加報告 速報版 本会議 1日目CVPR2017 参加報告 速報版 本会議 1日目
CVPR2017 参加報告 速報版 本会議 1日目
 
[DL輪読会]Freehand-Sketch to Image Synthesis 2018
[DL輪読会]Freehand-Sketch to Image Synthesis 2018[DL輪読会]Freehand-Sketch to Image Synthesis 2018
[DL輪読会]Freehand-Sketch to Image Synthesis 2018
 
分散表現を用いたリアルタイム学習型セッションベース推薦システム
分散表現を用いたリアルタイム学習型セッションベース推薦システム分散表現を用いたリアルタイム学習型セッションベース推薦システム
分散表現を用いたリアルタイム学習型セッションベース推薦システム
 
[DL輪読会]Meta-Learning Probabilistic Inference for Prediction
[DL輪読会]Meta-Learning Probabilistic Inference for Prediction[DL輪読会]Meta-Learning Probabilistic Inference for Prediction
[DL輪読会]Meta-Learning Probabilistic Inference for Prediction
 
Deep learningの概要とドメインモデルの変遷
Deep learningの概要とドメインモデルの変遷Deep learningの概要とドメインモデルの変遷
Deep learningの概要とドメインモデルの変遷
 
Depth Prediction Without the Sensors: Leveraging Structure for Unsupervised L...
Depth Prediction Without the Sensors: Leveraging Structure for Unsupervised L...Depth Prediction Without the Sensors: Leveraging Structure for Unsupervised L...
Depth Prediction Without the Sensors: Leveraging Structure for Unsupervised L...
 
[DL輪読会]Objects as Points
[DL輪読会]Objects as Points[DL輪読会]Objects as Points
[DL輪読会]Objects as Points
 

Plus de Deep Learning JP

Plus de Deep Learning JP (20)

【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
 
【DL輪読会】事前学習用データセットについて
【DL輪読会】事前学習用データセットについて【DL輪読会】事前学習用データセットについて
【DL輪読会】事前学習用データセットについて
 
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
 
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
 
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
 
【DL輪読会】マルチモーダル LLM
【DL輪読会】マルチモーダル LLM【DL輪読会】マルチモーダル LLM
【DL輪読会】マルチモーダル LLM
 
【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
 【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo... 【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
 
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
 
【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?
 
【DL輪読会】Hopfield network 関連研究について
【DL輪読会】Hopfield network 関連研究について【DL輪読会】Hopfield network 関連研究について
【DL輪読会】Hopfield network 関連研究について
 
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
 
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
 
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
 
【DL輪読会】"Language Instructed Reinforcement Learning for Human-AI Coordination "
【DL輪読会】"Language Instructed Reinforcement Learning  for Human-AI Coordination "【DL輪読会】"Language Instructed Reinforcement Learning  for Human-AI Coordination "
【DL輪読会】"Language Instructed Reinforcement Learning for Human-AI Coordination "
 
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
 
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
 
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
 
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
 
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
 
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
 

[DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function