# REGNet: Ray-Based Enhancement Grouping for 3D Object Detection Based on Point Cloud
## 3 Our Approach
### Foreground-Aware Module  
Current sampling methods, such as FPS and KPS, lack consideration for foreground and background information. However, sometimes foreground points and background points can provide different contributions. For example, if too many points are sampled from a chair, it may result in incorrect classification as a table, as shown in Figure 5a. Foreground points provide rich clues about object shape, such as position and orientation information, which are important for 3D object detection tasks. However, it is also unreasonable to completely ignore background points while only considering foreground points. The background points could provide some important contextual information for the final prediction. Most sampling methods, such as FPS employed in the backbone, are class-agnostic. They do not consider foreground and background, but rather randomly sample an initial point from the dataset and iteratively select the furthest point from the previously selected point as the next point in the subset. Although these methods can capture the basic characteristics of the data, they bring about some uncertainty of information since the selection of points is solely based on the properties of the dataset, rather than any specific location information such as foreground and background. This is because the selection is based on the spatial distribution of points and their distance from previously selected points, without considering any class-specific information. Although the FPS method can effectively solve the problem of distinguishing foreground and background information in point cloud sampling, it does not consider the interaction between different foreground and background information. Although foreground and background information is distributed in different locations and expresses different information in the scene, there is still a certain correlation between them. For example, the information around a chair can provide certain background knowledge for the classification of objects within the bounding box. To address the above problem, we propose a foreground-aware module. For simplicity, the point cloud data in this paper are denoted as \(\mathbf{P}=\{\mathbf{p}_{1},\ldots,\mathbf{p}_{N}\}\in\mathcal{R}^{N\times 3}\). To be specific, there are four SA layers in the standard PointNet++. After the first SA layer, the input point cloud is downsampled to \(\mathbf{P}=\{\mathbf{p}_{1},\ldots,\mathbf{p}_{2048}\}\in\mathcal{R}^{2048 \times 3}\) points and corresponding features \(f_{i}^{128}\), where \(i=\{1,2,\ldots,2048\}\). To better separate foreground and background from the obtained point cloud data, this article employs an additional 2-class segmentation network for foreground and background point acquisition. The segmentation network obtains a 2-dimensional score map through a standard softmax network, and the argmax operation can be used to determine the category to which each point belongs. The detail is as follows:  
\[ \begin{split} Seg(p_{i},f_{i}^{128})&=1,if:argmax( softmax(Seg(\cdot)))=1\\ Seg(p_{i},f_{i}^{128})&=0,if:argmax(softmax( Seg(\cdot)))=0\end{split}  \tag{1}\]  
where \(p_{i}\) denotes a point, \(Seg(\cdot)\) denotes a 2-class point cloud segmentation network, and \(f_{i}\in f_{i}^{128}\) is the the point feature corresponding to \(p_{i}\). After the operation noted above, all 2048 points have a label; the point with label 1 is grouped to \(P^{fore}\), and point with label 0 is grouped to \(P^{back}\). Based on these two point clouds, we applied farthest point sampling to the foreground and background sets, respectively, and combined them into the final sample set, as shown below:  
\[P^{fore}=FPS(P^{fore}),P^{back}=FPS(P^{back}) \tag{2}\]  
The next issue is how to combine \(P^{fore}\) and \(P^{back}\) into the final sample set, which is very important. Ref. [34] combines them directly without considering each contribution to the next stage. We propose a weighted map for all 2048 sampled points. Each item in the weighted map denotes the contribution of each point.