2022年1月17日 星期一

論文筆記:D2-Net: A Trainable CNN for Joint Description and Detection of Local Features

本文介紹的 D2-Net [1] 用一個類神經網路同時兼具 feature detector 與 feature descriptor 的功能。相較於傳統方法的 detect-then-describe,本文的方法為 detect-and-describe,目的是讓特徵點的位置更穩定。

以下為本文的架構圖:

D2-Net

輸入的圖片經過類神經網路後變成一個 \(w \times h \times n\) 的 tensor,w 與 h 為圖片的大小,n 是 descriptor 的維度。而右邊的圖為 feature detector 的示意圖:使用 soft-NMS 找出在同一個特徵平面上的局部最大值,再利用 ratio-to-max 找出再所有特徵平面上的局部最大值,把這兩部分合起來即得到 soft detection score \(s_{ij}\)。計算的式子如下: \[ \alpha_{ij}^k = \frac{exp(D_{ij}^k)}{\sum_{(i',j')\in N(i,j)exp(D_{i'j'}^k)}} \\ \beta_{ij}^k=D_{ij}^k/\underset{t}{max}\ D_{ij}^t \\ \gamma_{ij}=\underset{k}{max}\ (\alpha_{ij}^k\beta_{ij}^k) \\ s_{ij}=\frac{\gamma_{ij}} {\sum_{(i',j')}\gamma_{i'j'}} \]

Loss function

本文的 loss function 分成兩部分:

D2-Net loss function

前半段為 normalize 後的 soft detection score 相乘,第二部分 \(m(p(c), n(c))\) 的定義如下: \[ m(c) = max(0, M+p(c)^2-n(c)^2) \\ p(c)=\left \| \mathbf{d}_A^1-\mathbf{d}_B^2 \right \|_2 \\ n(c) = min( \left \| \mathbf{d}_A^1-\mathbf{d}_{N_2}^2 \right \|_2, \left \| \mathbf{d}_{N_1}^1-\mathbf{d}_B^2 \right \|_2 ) \]其中 \(p(c)\) 為正樣本的 loss function,\(n(c)\) 為負樣本的 loss function。

參考資料

[1] D2-Net: A Trainable CNN for Joint Description and Detection of Local Features

沒有留言:

張貼留言