The framework of the proposed attention-enhanced feature-based point-cloud completion network for precision parts is illustrated in
Figure 1. The overall architecture consists of a curvature-weighted sampling module, a multi-scale feature extraction module based on a spatial attention mechanism (S-MSFE), a multi-stage decoder, an adversarial generation module, and a loss function. In the encoder stage, the curvature-weighted sampling feature extraction module and spatial attention mechanism were introduced to extract both local and global features from the incomplete input point cloud, followed by multilevel feature fusion. The multiscale features extracted by the encoder are then passed to the decoder, which performs hierarchical and progressive prediction of the missing regions in the point cloud based on the encoded multilevel features. Finally, the adversarial generation module discriminates the refined predicted point cloud to produce a final complete and detailed reconstruction. The following sections provide detailed descriptions of each module.
2.1. Curvature-Weighted Sampling Module (CW-FPS)
In the point cloud input module, traditional networks typically employ Farthest Point Sampling (FPS) to obtain three sets of raw point cloud data at different resolutions. However, FPS tends to lose local geometric features, making it difficult to meet the high-precision sampling requirements of precision parts. To address this issue, this study proposes a curvature-weighted farthest-point sampling (CW-FPS) method. A flowchart of this algorithm is shown in
Figure 2. This method integrates the curvature information of each point and assigns corresponding weights, prioritizing sampling points in high-curvature regions (such as edges and corners). As a result, the CW-FPS can more effectively preserve the geometric details of the precision parts.
Specifically, the process involves the following steps:
- (1)
Curvature Calculation. First, for each point in the point cloud, the K-Nearest Neighbors (KNN) algorithm is used to determine its local neighborhood. The covariance matrix of the neighboring point set is then calculated as follows.
where
is the number of points within the neighborhood. This article sets the number of nearest neighbors k = 30 in the experiment, and
represents the centroid of the neighborhood points. To enhance the sensitivity of curvature to subtle geometric changes, this paper introduces a curvature weight factor α = 0.8 when constructing KNN graphs, which is used to adjust the relative importance of distance and curvature in nearest neighbor selection. This value is determined through grid search on the validation set and can effectively improve feature discrimination.
The covariance matrix
is then decomposed into eigenvalues, yielding three eigenvalues. For
, the curvature
of
is given by:
- (2)
Curvature Normalization and Weight Assignment. The calculated curvature was then normalized into a weight , scaled to the range
where
and
are the maximum and minimum curvature values, respectively, within the entire neighborhood point cloud.
- (3)
Initialise the selected point set. Point , which is farthest from the centroid of the point cloud, is chosen as the initial sampling point set .
- (4)
Iterative sampling. First, we initialize a distance array , where stores the minimum Euclidean distance from the point to the current sampled set .
where
represents the Euclidean distance from the current point
to all points in the sampled set
.
Next, calculate the weighted distance
for each point
.
where
is the curvature weighting factor that controls the degree of influence of the curvature on the sampling process.
Subsequently, the point with the maximum weighted distance is selected and added to the sampled set , and the sampled set is updated.
- (5)
Termination conditions. Determine whether the number of sampled points in set , has reached the target number N. If so, output the final sampled point set ; otherwise, repeat Step (4) until the number of sampled points in reaches the target N, and outputs the final sampled point set .
Figure 3 shows a comparison between the downsampling effects of the traditional FPS method and the proposed CW-FPS algorithm on an airplane model from the ShapeNet-Part dataset. Compared with traditional FPS sampling, the proposed CW-FPS algorithm samples more points in key regions such as the fuselage and wings, resulting in a clearer overall contour. By incorporating local curvature information into the distance metric of traditional farthest point sampling in a weighted form, the method maintains a relatively uniform spatial distribution of the point cloud, while adaptively adjusting the sampling density of different feature regions according to the curvature (local geometric complexity). This achieves an evolution from “uniform sampling” to “feature-sensitive sampling.”
2.2. Multi-Scale Feature Extraction Module Based on Spatial Attention Mechanism (S-MSFE)
The function of the feature extractor is to extract both local and global features from the incomplete point cloud input and map them into shape encoding. This module comprises two components: a Local Feature Extraction (LFE) unit and a Global Feature Extraction (GFE) unit. The complete structure of the multiscale feature-extraction module is shown in
Figure 4.
For global features, this study draws inspiration from the dynamic graph convolution (EdgeConv) concept in the DGCNN. The detailed structure is shown in
Figure 4. At each layer, the algorithm recalculates the neighborhood relationships between points based on the high-dimensional feature output from the previous layer.
Specifically, if the output of the layer is represented as , then an N-nearest neighbor graph is constructed in the feature space using the algorithm. The vertex set represents the points in the point cloud, whereas the edge set consists of directed edges. For example, the edge from point to its nearest neighbors is denoted as . For each directed edge , the edge feature is defined as , where is a nonlinear function parameterized by the learnable parameter. Subsequently, for each point, the edge features of all the associated edges are aggregated channel-wise using an aggregation function, yielding a new feature representation for that point: . Subsequently, the multilevel edge features obtained through the four layers of edge convolutions were concatenated. Global max pooling (MaxPool) and global average pooling (AvgPool) were then applied to these concatenated features. The outputs from both pooling operations were concatenated to form the final global feature vector.
For local features, this study draws on the CMLP module from PF-Net and introduces a Spatial Attention Block (SAB) to apply spatial attention weighting to the features at each layer, thereby enhancing key features.
Figure 5 illustrates the schematic of the spatial attention mechanism. Although point clouds are disordered, they can be transformed into structured feature representations by constructing local neighborhoods such as K-nearest neighbors. The spatial attention mechanism (SAB) in this network acts on the structured feature map extracted by hierarchical convolution. SAB aggregates the responses of different channels to the same spatial position (corresponding to local regions in the point cloud) by performing max pooling and average pooling on feature maps in the channel dimension, generating attention weights that reflect the importance of each local region. This enables the network to adaptively enhance its focus on high curvature structures such as edges and channels, while suppressing flat or noisy areas. Therefore, SAB essentially recalibrates the features that represent three-dimensional local geometric relationships in the feature space through learned spatial weights, effectively capturing the structural information that is crucial for point cloud completion. By combining the structured convolutions of the CMLP with the spatial attention mechanism, this method significantly improves the ability of the model to perceive local geometric structures and extract critical features.
First, a series of two-dimensional convolutional layers (Conv2d) and batch normalization layers (BatchNorm2d) were used to extract the convolutional features at different levels, encoding each point into five levels: 64, 128, 256, 512, and 1024. For the feature map output from a given convolutional layer, both max-pooling and average-pooling operations are performed. Subsequently, the results from these two pooling operations are concatenated along the channel dimension to form a new tensor that fuses the two distinct statistical features. A convolutional layer is then applied to this concatenated feature, reducing the number of channels to one. A sigmoid activation function is then applied to generate a spatial attention matrix, where each element’s value between 0 and 1 represents the weight assigned to the corresponding spatial location in the original feature map. This spatial attention matrix was multiplied element-wise with the original input feature map, thereby enhancing the key features of the local geometric structure. Finally, following the CMLP processing philosophy, the last four layers underwent max pooling to obtain multidimensional feature vectors , where . The pooled features were then concatenated to form a combined latent feature vector of dimension 1920. This latent feature vector, containing both high- and low-level features, serves as the final local feature vector.
After extracting local and global features at different scales through the LFE and GFE units, respectively, the features are added together and then passed through a fully connected layer to obtain the final feature vector.
In the multi-scale feature extraction module based on a spatial attention mechanism (S-MSFE), each module first performs feature fusion and dimensionality reduction within the module after independently extracting local features (LFE) and global features (GFE). Specifically, the local feature extraction unit outputs a 1920-dimensional combined feature vector, while the global feature extraction unit outputs a 512-dimensional feature vector; The two are concatenated in the channel dimension to form a 2432-dimensional intermediate fusion feature. Subsequently, the feature undergoes nonlinear transformation and compression through a fully connected layer (with an output dimension of 64), extracting the rich information of each S-MSFE module into a compact 64-dimensional representation. Three parallel S-MSFE modules in the encoder each output a 64-dimensional feature vector. Next, feature fusion is performed between modules: these three 64-dimensional vectors are concatenated in the feature dimension to form a 192-dimensional fused feature that aggregates information from different scales and receptive fields. Finally, these 192-dimensional features are fed into a multi-layer perceptron (MLP) for final deep integration and dimension regularization. The MLP structure is “input (192), connected layer (512, ReLU), fully connected layer (256, ReLU) and output (256)”, ultimately generating a 256-dimensional global feature encoding, which is passed to the decoder as the output of the encoder.
2.3. Multi-Stage Decoder
Traditional decoders typically generate point clouds directly through fully connected layers or deconvolution networks. However, this approach often fails to fully leverage the feature information extracted by the encoder. The decoder component in this study draws inspiration from the pyramid-based decoder concept of PF-Net, adopting a multistage decoding method. It first produces a coarse and sparse point set, and then progressively refines these point sets to more accurately complete the incomplete point cloud.
Specifically, we first defined three fully connected layers with distinct output dimensions:
,
, and
, with output dimensions of 1024, 512, and 256, respectively. Then, the final feature vector extracted by the encoder is successively passed through these three fully connected layers for dimensionality reduction, yielding three sub-feature vectors,
,
, and
, with feature dimensions of 1024, 512, and 256, respectively. These were used for phased point-cloud generation. During decoding, the network employs a multistage generation strategy, from coarse to fine. This process begins with the deepest subfeature
, which predicts an initial coarse point cloud
through a fully connected layer. This serves as the skeleton for completing the point cloud, where
denotes the number of points output by the layer. Subsequently, the sub-feature uses each point in the
as the center point for the relative coordinate calculations. Through operations including convolution, feature concatenation, and tensor reconstruction, a denser medium-resolution point cloud
. Similarly, sub-feature
utilizes a medium-resolution point cloud
to generate the final point cloud
. The entire workflow is illustrated in
Figure 6 below, where “linear” denotes the fully connected layer, and CFT encompasses operations including convolution, feature concatenation, and tensor reconstruction.
2.4. Adversarial Generative Module
In the structure of a Generative Adversarial Network (GAN), there are generally two subnetworks: a generator and a discriminator. The preceding encoding and decoding processes constitute a generator. The discriminator in this study is designed based on the GAN framework while incorporating a Biased Attention Block (BAB) that introduces a bias matrix derived from geometric information. This enhances the sensitivity of the discriminator to geometric structural differences in point clouds, thereby improving its overall performance. The complete structure of the discriminator module is shown in
Figure 7, where linear denotes a fully connected layer.
First, the final point cloud generated by the decoder and the ground truth point cloud were simultaneously input into the discriminator, where their depth features were extracted at multiple scales. Subsequently, these features underwent sequential weighted adjustments using BAB. Specifically, for each point of , its neighborhood was selected using K-Nearest Neighbors (KNN). The relative positions between and other points within the neighborhood are then computed. These relative positions were mapped through a multilayer perceptron to yield the corresponding geometric biases. Based on these geometric biases, a biased attention weight matrix is calculated. For the query vector and key vector , the biased attention weight is , where is the feature dimension of the key vector used to scale the dot product result to stabilize gradients. Next, the attention scores were normalization , and the normalized attention weights were applied to weight the sum of the value vector , yielding the modified feature .
The multiscale features refined by the BAB module are concatenated along the channel dimension to form a fused feature representation. The multi-scale features corrected by the BAB module are concatenated in the channel dimension to form a fused feature representation. The core innovation of the BAB module lies in the geometric bias obtained by calculating the local geometric relationships of points through relative coordinates, which is then explicitly injected into the calculation of attention weights. The traditional self-attention mechanism mainly relies on feature similarity, while the geometric bias term introduced by BAB modulates the attention weights simultaneously by feature similarity and local spatial structure similarity. For areas with unreasonable or defective structures in the generated point cloud, there will be significant differences in the geometric relationship between the generated point cloud and the real point cloud in the corresponding local area, resulting in abnormal changes in the attention weights at that location. This design greatly enhances the sensitivity of the discriminator to subtle geometric differences between generated point clouds and real point clouds, enabling it to distinguish authenticity not only from overall features but also from local structural consistency.
Finally, the fused features undergo nonlinear transformation and dimension reduction through multiple fully connected layers, outputting a one-dimensional scalar that represents a binary classification result indicating whether the input point cloud is “real” or “generated.”
2.5. Loss Function
This study employs the Chamfer Distance (CD) as the loss function of the network. The Chamfer Distance measures the similarity between two point clouds by calculating the sum of the average minimum distances from each point in a point cloud to its nearest point on the other. It quantifies the difference between the predicted and ground-truth point clouds, and by minimizing this difference, the model’s ability to fit the data is progressively improved.
Assuming that
represents the point cloud completed by the network and
is the corresponding ground truth point cloud, with
and
denoting any points in
and
, respectively, the calculation formula for CD is as follows.
A smaller chamber distance indicates better completion performance for the missing parts, whereas a larger value suggests poorer completion quality. Because the decoder used in this study produces multi-stage outputs, the Chamfer Distances between the completed point clouds at three different resolutions and their corresponding ground truth point clouds are weighted and summed. Therefore, the Chamfer loss function of the proposed network, denoted as
, is defined as follows.
where
,
, and
represent the fine point
, sub-fine point
, and skeletal point
, respectively, along with their corresponding ground truth point clouds
,
, and
;
denotes the weighting coefficient
, respectively.
In the adversarial generation module, the discriminator computes the loss between its output and corresponding labels to determine the authenticity of the generated results. Therefore, the primary purpose of introducing the adversarial loss function is to minimize the generator’s loss, encouraging it to produce samples that increasingly resemble real samples, thereby enhancing the discriminator’s ability to distinguish between real and generated samples.
where
denotes the discriminator’s output, with the inputs being the true point
of the missing portion and the predicted completion value
for a point
in the point cloud to be completed.
represents the size of the point cloud.
The Chamfer loss function and the adversarial loss function together form a joint loss function that is used to optimize the model parameters collaboratively:
where
denotes the Chamfer Distance (CD) loss function,
represents the adversarial loss function, and
represents the loss function weighting coefficient.