論文|CIA-SSD: Confident IoU-Aware Single-Stage Object Detector From Point Cloud

IoUの分析とDI-NMSについて興味あるから記録を取ります。


##Network structure
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/650544/46a8c0cb-4088-2e0d-318a-8e4905753274.png)
(a) voxelization
(b) spconvとz方向のconcatenationでBEV特徴マップを取得。SECONDとほぼ同じです。
(c) Spatial-Semantic Feature Aggregation。サイズが小さいがチャンネル数が多いシマンテックブランチをつけます。注意力(d)のようなやり方で融合します。
(e) ―普通のclassification, pose, direction loss以外にiouの予測を追加。confidenceを修正できます。
　 ―後処理にDI-NMSを使用。

##IoU-aware confidence rectification module
alleviate the misalignment between the localization accuracy and classification confidence without having an additional network stage
###Problem Analysis
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/650544/101b26ae-7969-b9f7-f0c3-a10624b9fb82.png)
**real IoU**: the IoU computed between the anchor-based predicted bounding box and its nearest ground-truth box
**predicted IoU**: the **network-predicted IoU** on the corresponding anchor-based predicted bounding box

+ high predicted IoUs often associate with high real IoUs
+ if an anchor feature leads to precise regression, the feature should also predict high IoU with high certainty, as the feature already contains sufficient location information.

###Goal
+ suppress the uncertainties of low-IoU predictions and further augment the discrimination between low-IoU and high-IoU predictions

###Solution
1. introduce the rectification item $g = i^\beta$. (figure (a) -> (b)).
+ rectify the classification score the Confidence Function $f=c*g$. (c: the classification score of the predicted bounding box)　予測iouが低い奴のスコアを下げます。

実現：convを一層加えて、iouを予測します。計算量への影響が小さいです。

コード確認必要：
*During the training, we train the IoU prediction branch simultaneously with the bounding box regression and classification branches and detach the predicted bounding boxes from the computation graph in the IoU predictions to avoid the gradients to back-propagate from the IoU prediction loss to the bounding box regressions. Only in the testing, wemake use of the Confidence Function to rectify the classification score and produce the rectified classification confidence f for use in the following NMS process.*

##Distance-Variant IoU-Weighted NMS
###Problem Analysis
遠いところのポイントがスパースのため、物体へのスコアが低くなります。
以下の状況は頻発している：
(i) strong oscillations on the regressed bounding boxes 
(ii) redundant false-positive predictions 
###Goal
控えます。
###Solution
距離を考える。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/650544/452b6ea8-41d2-9ab1-ebdf-41fa01f33a03.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/650544/31d05b32-acb4-01c4-9e59-5617d9dc01e9.png)

(Step 1-2) calculate the L2 distance between the BEV centers of each pair of anchor and predicted box, and take the distance offset to refine the confidence; 
offsetが大きいだと、スコアが下がる。
(Step 5-7) select box $c'$ with the highest classification confidence and find indices of its overlapped boxes $L'$ filtered with an IoU threshold, in which $c'$ and $L'$  are the candidate box and indices of auxiliary boxes, respectively. 
Next, calculate acumulative sum of products between the IoU predictions ofthe auxiliary boxes and their real IoUs with the candidate box, in which we design the cumulative sum to filter redundant (zero-IoU) false positives; 
(iii) use a Gaussian weighted average to obtain a smooth regression from the auxiliary boxes.