Sunday, July 18, 2021

Mask R-CNN(三):Illustrated

 Mask R-CNN(三):Illustrated

2021/05/26

-----


-----


https://pixabay.com/zh/photos/personnel-men-women-transport-86426/

-----


Modified from # A Survey of Deep Learning-based Object Detection

說明:

兩階段物件偵測演算法,以 Faster R-CNN 為代表。

-----


Modified from # R-CNN

說明:

先用 SS 建議的 2000 個左右的建議框,每個建議框用 CNN 抽取特徵。然後對每一類進行 SVM 判別。

-----


# SPPNet

說明:

SPPNet 的 RoI Pooling 主要用來解決 crop 與 warp 兩個問題。

-----


# SPPNet

說明:

ROI 之後進行 Spatial Pyramid Pooling。

-----


Modified from # Fast R-CNN

說明:

先用 CNN 抽取特徵。然後把 SS 提供的 2000 個建議框,用 SPPNet 的 RoI 框住特徵圖,然後用 CNN 進行分類與回歸。

-----


# Faster R-CNN

說明:

k anchor boxes, k = 9。

2k scores, 2 = positive and negative。

4k coordinates, 4 = (x, y, w, h) x y 中心點,w h 寬高。

a box-regression layer (reg) 回歸。

a box-classification layer (cls) 分類。

最後一層的特徵圖,每個點(錨點),有三個 scale、每個 scale,有三種框。每個框預測有物件或沒物件。一共 18 種預測。種類參考本張圖。大小參考下一張圖。

-----


# Faster R-CNN

說明:

「全部 anchors 拿去訓練太多了,訓練程序會在合適的 anchors 中隨機選取 128 個 postive anchors + 128 個 negative anchors 進行訓練。」

https://zhuanlan.zhihu.com/p/31426458

-----


Modified from # A Survey of Deep Learning-based Object Detection

說明:

複習。

-----


說明:

RoI Pooling 的缺點,取樣的數目不平均,量化後有少許誤差。

https://zhuanlan.zhihu.com/p/73113289

-----


Figure 3. RoIAlign: The dashed grid represents a feature map, the solid lines an RoI (with 22 bins in this example), and the dots the 4 sampling points in each bin. RoIAlign computes the value of each sampling point by bilinear interpolation from the nearby grid points on the feature map. No quantization is performed on any coordinates involved in the RoI, its bins, or the sampling points.

圖 3. RoIAlign:虛線網格表示特徵圖,實線表示 RoI(在本例中為 2×2 個 bin),點表示每個 bin 中的 4 個採樣點。 RoIAlign 從特徵圖上的附近網格點通過雙線性插值計算每個採樣點的值。 不對 RoI、其 bin 或採樣點中涉及的任何坐標執行量化。

# Mask R-CNN 草稿

說明:

論文的說明。

-----


Modified from # Mask R-CNN 草稿

說明:

依部落格文章,特徵圖網格的中心點為紅點 P。RoI Pooling 使用紅點。RoI Align 則由紅點計算出使用點的實際值。

https://zhuanlan.zhihu.com/p/73113289

-----


Modified from # Mask R-CNN 草稿

說明:

先計算下中

下左 Q11 (x1, y1)

下右 Q21 (x2, y1)

下中 R1 (x, y1)


再計算上中

上左 Q12 (x1, y2)

上右 Q22 (x2, y2)

上中 R2 (x, y2)


由下中與上中計算出中

下中 R1 (x, y1)

上中 R2 (x, y2)

中 P (x, y)

https://zhuanlan.zhihu.com/p/73113289

-----


說明:

公式。可想像一個三維空間,y = y1 與 y = y2 的例子。越靠近參考點,質越接近參考點。

https://zhuanlan.zhihu.com/p/73113289

-----


# multi-task deep neural networks

說明:

Mask R-CNN 流程圖。

-----


# Mask-refined R-CNN

說明:

Head 為 FPN,參考原論文的討論。

-----


# Mask R-CNN 草稿

說明:

Mask R-CNN 流程圖。

-----


# Mask R-CNN 草稿

說明:

x4 是做四次卷積。80 是 COCO 的類別數。

-----


# LeNet。

圖十六,梯度下降法。

說明:

梯度下降的更新公式。從 k - 1 到 k 是一次更新的過程。偏導數的符號,代表對每個不同的權重 W 都要做梯度下降。epsilon 是一個常數,代表一定步長。固定步長是最簡單的梯度下降法。由於直接對 Error Function 直接求導數不容易,所以會利用反向傳播法,計算對某一層的梯度(多變數。如果是單變數則稱為導數)。計算每一層的導數,將路徑裡的導數相乘與相加,則得到所需要的梯度。若梯度皆小於 1,則有可能梯度消失。若梯度皆大於 1,則有可能梯度爆炸。

-----



# Deep Learning。

說明:

左圖是典型的神經網路。f 是激活函數。右圖是反向傳播的展開,可參考下一張圖會更清楚。

-----


Modified from # Deep Learning。

說明:

一個三層的範例。

-----

說明:

Max Pooling 要記錄位置,以便傳遞梯度。

平均池化可以視為一個函數,每個係數是 1 / n。最大池化可以視為一個 f(x) = x,在最大點,其他點則是 f(x) = 0。

https://blog.csdn.net/Jason_yyz/article/details/80003271

https://www.brilliantcode.net/1326/backpropagation-1-gradient-descent-chain-rule/

https://www.brilliantcode.net/1381/backpropagation-2-forward-pass-backward-pass/

https://www.brilliantcode.net/1527/backpropagation-3-n-layer-neural-networks/

https://www.brilliantcode.net/1670/convolutional-neural-networks-4-backpropagation-in-kernels-of-cnns/

https://www.brilliantcode.net/1748/convolutional-neural-networks-5-backpropagation-in-feature-maps-biases-of-cnns/

https://www.brilliantcode.net/1781/convolutional-neural-networks-6-backpropagation-in-pooling-layers-of-cnns/

-----


Modified from # Mask R-CNN 草稿

說明:

在某些網誌的說明裡,紅點是特徵圖某個網格的中心。

https://zhuanlan.zhihu.com/p/73113289

-----


說明:

RoI Pooling 的反向傳播

RoI Align 的反向傳播


xi:池化前特徵圖上的像素點。

yrj:池化後的第 r 個候選區域的第 j 個點。


最大池化,梯度傳給最大點。RoI Align,梯度傳給距離小於 1 的點。Δw 與 Δh 越小,則該原始點的比重與梯度越大。

https://zhuanlan.zhihu.com/p/73113289

-----

# Mask R-CNN

He, Kaiming, et al. "Mask r-cnn." Proceedings of the IEEE international conference on computer vision. 2017.

https://openaccess.thecvf.com/content_ICCV_2017/papers/He_Mask_R-CNN_ICCV_2017_paper.pdf

# Mask R-CNN 草稿

https://arxiv.org/abs/1703.06870


# A Survey of Deep Learning-based Object Detection

Jiao, Licheng, et al. "A survey of deep learning-based object detection." IEEE Access 7 (2019): 128837-128868.

https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=8825470


# R-CNN

Girshick, Ross, et al. "Rich feature hierarchies for accurate object detection and semantic segmentation." Proceedings of the IEEE conference on computer vision and pattern recognition. 2014.

https://www.cv-foundation.org/openaccess/content_cvpr_2014/papers/Girshick_Rich_Feature_Hierarchies_2014_CVPR_paper.pdf


# SPPNet

He, Kaiming, et al. "Spatial pyramid pooling in deep convolutional networks for visual recognition." european conference on computer vision. Springer, Cham, 2014.

https://arxiv.org/pdf/1406.4729.pdf


# Fast R-CNN

Girshick, Ross. "Fast R-CNN." Proceedings of the IEEE international conference on computer vision. 2015.

http://openaccess.thecvf.com/content_iccv_2015/papers/Girshick_Fast_R-CNN_ICCV_2015_paper.pdf


# Faster R-CNN

Ren, Shaoqing, et al. "Faster R-CNN: Towards real-time object detection with region proposal networks." Advances in neural information processing systems. 2015.

http://papers.nips.cc/paper/5638-faster-r-cnn-towards-real-time-object-detection-with-region-proposal-networks.pdf


# multi-task deep neural networks

Bienias, Lukasz T., et al. "Insights into the behaviour of multi-task deep neural networks for medical image segmentation." 2019 IEEE 29th International Workshop on Machine Learning for Signal Processing (MLSP). IEEE, 2019.

https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=8918753&casa_token=Z-wFnXbg5bAAAAAA:lqbt_k7DnXj1n-PtfCdU5gikPHiWvi2_tzOEvP5hnMJXy_tCWOo73KVi-RhDErQkyDGMQUb-&tag=1


# Mask-refined R-CNN

Zhang, Yiqing, et al. "Mask-refined R-CNN: A network for refining object details in instance segmentation." Sensors 20.4 (2020): 1010.

https://pdfs.semanticscholar.org/e0a7/a65db2b2ed5d65d4c39baf3b860d961e0389.pdf


# Deep Learning

LeCun, Yann, Yoshua Bengio, and Geoffrey Hinton. "Deep learning." nature 521.7553 (2015): 436-444.

https://www2.cs.duke.edu/courses/spring19/compsci527/papers/Lecun.pdf


# LeNet。被引用 31707 次。經典的卷積神經網路,主要比 HDR 多了全連接層。

LeCun, Yann, et al. "Gradient-based learning applied to document recognition." Proceedings of the IEEE 86.11 (1998): 2278-2324.

http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf

-----

No comments: