## 2 Framework of Training Network for an Imbalanced Point Cloud
### Hybrid-Sampling
#### 2.1.4 Proposed Hybrid-Sampling  
The experiments using Naive Bayes and C5.0 in Reference [40] demonstrated that oversampling and undersampling had equivalent effects on performance. In Reference [41], it was reported that oversampling was more robust than undersampling. In contrast, experiments conducted using C4.5 decision trees by [PERSON] [42] and other research [43; 44] indicated that undersampling had a more pronounced effect than oversampling. In general, undersampling is preferred instead of oversampling when dealing with large amounts of data [45].  
[PERSON] et al. [46] demonstrated that combining oversampling of the minority class with undersampling of the majority class could improve classifier performance (in ROC) to a greater degree than could be achieved by only undersampling the majority class. In intensive experiments, [PERSON] et al. [47] demonstrated that hybrid-sampling can often outperform single sampling methods. They reported that oversampling, followed by undersampling was slightly more effective than the inverse. Table 1 presents a comparison of the methods described in Reference [46; 47].  
The proposed hybrid-sampling method involved oversampling, followed by undersampling. The proposed scheme differs from previous hybrid-sampling methods by the way that majority data  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Method** & **Rank of Performance** \\ \hline ROS & IV \\ RUS & III \\ RUS-ROS & II \\ ROS-RUS & I \\ \hline \hline \end{tabular}
\end{table}
Table 1: Rank of sampling methods according to performance. Random Over-Sampling (ROS) is oversampling method, Random Under-Sampling (RUS) is under sampling method, RUS-ROS is method of undersampling then oversampling, and ROS-RUS is method of oversampling and then undersampling.  
is mixed with minority data and shuffled to create a new representative dataset. After upsampling, the minority data undergoes shuffling with the majority data, all of which is then downsampled to make it compatible with the network input. Unlike previous methods, the ratio of minority to majority data after balancing is not a fixed value, but rather oscillates slightly in accordance with the shuffling process to make it more varied.  
The pseudocode of the proposed algorithm is presented as Algorithm 1. The point cloud of the background is isolated from the lists of point sets and labels. The point cloud of the background is assigned a label value of 1, whereas the point clouds of objects are assigned labels values of \(>\)1. The indices of objects and that of the background are derived separately. The indices of objects are then duplicated according to a sampling ratio input by an expert in the field, where the sampling ratio is determined by the degree of data imbalance of datasets; to be less dependent on the ratio, we propose the balanced focus loss function in the next subsection. The new set of object indices is concatenated to the indices of the background and then shuffled. Finally, the shuffled set is separated from the last part, and the first part is kept as the selected part. From this selected index, we obtain a set of points with a set of corresponding labels as training data for the network.  
```
1:A list of points \(Points\), a list of labels \(Labels\) that are imbalanced, and an integer value of sampling factor \(n\_sampling\), and an integer value of number of points \(n\_points\).
2:New list of points \(Points\) and new list of labels \(Labels\) that are already sampled.
3:Initialization :
4:\(ObjIndices\leftarrow\)\(argwhere(labels>1)\)
5:\(BgrIndices\leftarrow\)\(argwhere(labels=1)\)
6:\(Choices\leftarrow[]\)
7:\(LOOP\) Process
8:for\(i\gets 2\to n\_sampling\)do
9:\(Stack(Choices,ObjIndices)\)
10:endfor
11:\(Stack(Choices,BgrIndices)\)
12:\(Shuffle(Choices)\)
13:\(Choices\gets Choices[:n\_points]\)
14:\(Points\gets Points[:n\_points]\)
15:\(Labels\gets Labels[:n\_points]\)
16:return\(Points,Labels\)
```  
**Algorithm 1** Algorithm for hybrid-sampling algorithm to sample point clouds.