The Probabilistic Chamfer Distance (PCD) is introduced as a modification to the standard Chamfer distance to improve uniform sampling. It's designed to force the Point Selector to assign high probabilities to points that cover the surface of the point cloud.
From the paper:
The Probabilistic Chamfer Distance (PCD) is introduced as a modification to the standard Chamfer distance to improve uniform sampling. It's designed to force the Point Selector to assign high probabilities to points that cover the surface of the point cloud.
Mathematical Formulation:
The PCD is defined as:
d(P, Ps) = Σy∈Ps p(y) minx∈P ||x - y||² + Σx∈P p(y) miny∈Ps ||x - y||²
Where:
Steps to implement the Probabilistic Chamfer Distance loss:
Define the loss function class: Create a new file
losses/chamfer_distance_loss.py
and define aProbabilisticChamferDistanceLoss
class.Initialize the loss function: The initialization should take any necessary parameters, such as the number of points to sample.
Implement the forward method: This method will compute the actual loss given the input and sampled point sets, along with their probabilities.
Compute the bidirectional distances: Calculate the minimum distances from each point in Ps to P and vice versa.
Weight the distances: Multiply the distances by the corresponding probabilities.
Sum the weighted distances: Add up all the weighted distances to get the final loss value.