0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

論文まとめ:Visual Identification of Individual Holstein-Friesian Cattle via Deep Metric Learning

Posted at

はじめに

Computers and Electronics in Agricultureから以下の論文
[1] W. Andrew, et. al. "Visual Identification of Individual Holstein-Friesian Cattle via Deep Metric Learning" Computers and Electronics in Agriculture 185, 106133
のまとめ

arXiv:
https://arxiv.org/abs/2006.09205

Github:
https://github.com/CWOA/MetricLearningIdentification
-> pytorch

この分野の第1人者であるAndrew氏の直近の論文。

概要

  • ホルスタインの体の白黒模様から個体識別をするしくみ
  • メトリクス学習し、未知(open-set)のホルスタインに対してはlatentベースでマッチングする

これまでのAndrew氏の手法は、学習したIDに対して推定するものであったが、今回は未知のIDに対しても使えるようになった。

モデルの全体像

以下がモデルの全体像。

CWOA_img00.png

(1)左下ホルスタインが映った画像に対し、その上、yolo-v3等で牛の領域をdetectする。

(2)切り取った矩形領域に対し、ResNet等でembedする。学習時はこれに対しメトリクス学習を行う。

(3)推論時は推定した複数のlatentに対し、k近傍法でそれらのIDが一致するか否かを判断する。

新たに作成したdataset OpenCows2020に関して

まず、このdatasetはこちら
https://research-information.bris.ac.uk/en/datasets/opencows2020
からフリーで入手できる。

以下、概要

  • 牛舎内、及び野外の2つのシーンがあり、いずれも上部から撮影されている
  • 3,707枚の画像において6,917頭のホルスタインがアノテーションされている
  • detection用に矩形がアノテーションされているが、頭部と尻尾は矩形領域から外している
  • 牛のIDもアノテーションされている
  • 全体を8:1:1に分け、training, validation, testとしている
  • 20枚以上写っている牛のみIDとして採用している
  • 46の個体があり、1個体あたり平均103枚程度写っている

以下が画像全体のサンプル。

W_Andrew2020_img02.png

以下が矩形領域のサンプル。

W_Andrew2020_img04.png

ID識別部分の学習

ネットワーク構造

上述したように、ネットワークのアーキテクチャはResNet-50。

loss

triplet loss。

$x_a$ :アンカーのデータ
$x_p$ ;aと同じID(positive)の別のinstanceのデータ
$x_n$ :aと異なるID(negative)のデータ
として、まずベースはこれ。

\mathbb{L}_{TL} = \max (0, d(x_a, x_p) - d(x_a, x_n) + \alpha) \tag{1}

ただし、これは以下の図の右部分

W_Andrew2020_img10.png

のようないわゆる margin problem を引き起こす。この図ではpositiveとnegativeはちゃんと $\alpha$ のマージンが取られているが(つまり(1)式を満たすが)、anchorとpositiveとは近くならない。

そこで以下のような改良版も提案されている。

\mathbb{L}_{RTL} = d(x_a, x_p) +\frac{1}{d(x_a, x_n)} \tag{2}

これだとanchorとpositiveを近くすると同時にanchorとnegativeを遠くできる。

これに softmax loss を加えると精度がよくなることが知られている。よって本手法でのlossは(2)式に softmax loss を加え、

\mathbb{L}_{softmax + RTL} = \mathbb{L}_{softmax} + \lambda \cdot \mathbb{L}_{RTL} \tag{3}

とする。

実験と結果

定量的評価

OpenCows2020を用いた先行研究がないため、Lossを比較した。

W_Andrew2020_img12.png

グラフの横軸はvalidation data、もしくはtest dataの割合。

赤点線がtriplet lossのみ、黄緑点線が式(2)、緑点線はsoftmax+triplet loss、青点線は本論文提案のsoftmax + 式(2)。

提案手法が右側test dataに対して最も精度がよい。

embeddingをt-sneで可視化。

こちらもlossごとに可視化。

W_Andrew2020_img17.png

微妙だが、右下の提案手法lossが最も分けられてる感じか?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?