# Research on Multi-Scale Point Cloud Completion Method Based on Local Neighborhood Dynamic Fusion
## 4 Experiments
### Combined Loss Function  
Point cloud metric indicators are essential evaluation tools that assess the similarity or differences between point cloud data. Commonly used indicators include Chamfer Distance (CD) and Earth Mover's Distance (EMD). The CD indicator is suitable for analyzing the overall point cloud, providing an intuitive measure of the distance between two point clouds. In contrast, the EMD indicator offers a more detailed analysis of local structural differences, though it is computationally more complex. Due to the importance of computational efficiency, this study selected Chamfer Distance (CD) as the evaluation metric for the model's completion performance. Given the computational efficiency of CD, it was preferred over EMD, which requires more extensive calculations. CD is widely adopted in point cloud-related tasks because it effectively reflects the overall differences between point clouds with lower computational cost. Therefore, in this paper, CD was used to quantify the proximity between the generated and real point clouds, serving as a key reference for optimizing the model as follows:  
\[ \begin{split} d_{\text{CD}}(S_{1},S_{2})&=d_{\text{ CD}}(S_{1}\to S_{2})+d_{\text{CD}}(S_{2}\to S_{1})\\ &=\frac{1}{S_{1}}\sum\limits_{x\in S_{1}}\min\limits_{y\in S_{2}} \parallel x-y\parallel_{2}^{2}+\frac{1}{S_{2}}\sum\limits_{x\in S_{2}}\min \limits_{y\in S_{1}}\parallel y-x\parallel_{2}^{2}\end{split}  \tag{9}\]  
We primarily employed the Chamfer Distance (CD) indicator to measure spatial distances between point clouds. To calculate the CD value, the process first computed the Euclidean distance from each point in point cloud \(S_{1}\) to the nearest point in point cloud \(S_{2}\), and vice versa. Then, the average of these distances from both directions was calculated, and the final CD value was obtained by summing these two averages. This method provided an intuitive representation of the overall distance difference between the two point clouds. As seen in Equation (10), the CD (Chamfer Distance) indicator measures the average Euclidean minimum distance between the generated point cloud \(S_{1}\) and the real point cloud \(S_{2}\). In the context of this model, the generator produced three multi-scale outputs, and the total generation loss accounted for the losses across these three scales. Specifically, \(d_{CD1}\), \(d_{CD2}\), and \(d_{CD3}\) represent the losses corresponding to the first, second, and final layers of the generator output, respectively. These losses were calculated by comparing the generated point clouds at each scale with the real point clouds using the CD indicator. Based on the above, the total generation loss \(L_{1}\) of the model can be expressed as follows:  
\[L_{1}=d_{\text{CD1}}\big{(}P_{1},P_{1 gt}\big{)}+\alpha d_{\text{CD2}}\big{(}P_ {2},P_{2 gt}\big{)}+2\alpha d_{\text{CD3}}\big{(}P_{3},P_{3 gt}\big{)} \tag{10}\]  
The expression of the total adversarial loss \(L_{2}\) is shown in formula (11) below:  
\[L_{2}=\sum\log\big{(}D\big{(}P_{gt}\big{)}\big{)}+\sum\log(1-D(T(E(P_{in})))) \tag{11}\]  
In the expression of this loss function, \(P_{in}\) represents the original input defective point cloud, while \(P_{gt}\) refers to the true complete point cloud. It is important to note that the total loss function of the model was derived from the weighted sum of the generation loss \(L_{1}\) and the adversarial loss \(L_{2}\). To enhance the accuracy and stability of the output results, a relatively high number of training epochs were utilized. As the number of epochs increased, the proportion of multi-scale point clouds in the training process also increased. To balance the influence of point clouds at different scales on the total loss and prevent the model from converging to local optima, a dynamic weight \(\alpha\) alpha was introduced to scale the contribution of each loss component in the generation loss.