Optical rotating scanning point cloud artifact removal method based on 7d relative position attention

By constructing a 7D relative position attention network model, the 7D local neighborhood patches of point cloud data are explicitly modeled, which solves the robustness problem of composite artifacts in optical rotation scanning and achieves efficient artifact removal and point cloud data quality improvement.

CN122265085APending Publication Date: 2026-06-23CHINA UNIV OF PETROLEUM (EAST CHINA)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA UNIV OF PETROLEUM (EAST CHINA)
Filing Date
2026-05-25
Publication Date
2026-06-23

Smart Images

  • Figure CN122265085A_ABST
    Figure CN122265085A_ABST
Patent Text Reader

Abstract

This invention provides a point cloud artifact removal method based on 7D relative position attention, relating to the field of 3D point cloud data processing. Specifically, it includes: constructing a point cloud dataset for training an artifact detection model; extracting 7D local neighborhood patches, including coordinates, normal vectors, and curvature features, from each point in the point cloud dataset to form a training patch set; constructing an artifact detection model based on a 7D relative position attention network; for the actual measured point cloud data containing artifacts to be processed, obtaining the 7D local neighborhood patches for each point and acquiring the artifact confidence probability corresponding to each point; setting a threshold based on the artifact confidence probability, removing artifact points with probabilities higher than the threshold, and retaining the target object point cloud, thus completing the point cloud artifact removal. The technical solution of this invention overcomes the problem in existing technologies that have limited sensitivity to the local geometric structure of artifacts and insufficient robustness when processing diverse composite artifacts generated by optical rotation scanning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of three-dimensional point cloud data processing, and specifically to an optical rotation scanning point cloud artifact removal method based on 7D relative position attention. Background Technology

[0002] Key components such as aerospace engine bladed disks, automotive transmission valve bodies, and complex cavities in defense and military industries are characterized by narrow spaces and large depth-to-width ratios. Optical rotating scanning measurement systems utilize slender probes with embedded optical fibers and mirrors to penetrate deep into the cavity and acquire three-dimensional point cloud data of the measured surface through rotating scanning. This is an important means of achieving precision measurement of such components.

[0003] In actual measurement, installation deviations cause the light emission point and direction of the probe to deviate from the ideal coordinate system, and the error motion of the rotating probe also introduces system noise. These factors result in a large number of composite artifacts in the collected point cloud data, typically manifested as dense "endcap"-shaped point clusters caused by fixtures, broken small cylindrical surfaces caused by end-face reflections, large-scale ring-shaped point clouds exceeding the main body area caused by flange reflections, and background clutter without backlight caused by local occlusions. These artifacts are spatially intertwined with the target main body point cloud, severely interfering with the accurate calculation of subsequent geometric dimensions and form and position tolerances. Traditional point cloud denoising methods mostly rely on the statistical characteristics of the Euclidean distance between neighboring points to remove outliers. This type of method is effective for sparsely distributed random noise, but for dense artifacts with similar density and compact structure to the main body (such as large-sized reflective rings and end-face reflective layers), due to their lack of significant difference in distance distribution from the main body point cloud, they are often difficult to separate effectively, easily leading to incomplete denoising or misjudging the edges of the main body as noise. Furthermore, traditional methods rely solely on coordinate information, neglecting key features describing local geometry such as normal vectors and curvature, resulting in insufficient spatial context awareness of artifacts with complex structures. In recent years, deep learning-based point cloud processing methods have seen some development, but most existing networks only use three-dimensional coordinates as input, leading to a single dimension of feature representation. Conventional self-attention mechanisms only calculate content relevance, failing to explicitly model the relative spatial relationships between points, resulting in limited sensitivity to the local geometric structure of artifacts and insufficient robustness when dealing with diverse composite artifacts generated by optical rotation scanning.

[0004] Therefore, there is a need for an optical rotation scanning point cloud artifact removal method based on 7D relative position attention that can robustly identify and remove complex and diverse artifacts caused by optical system reflections, probe motion errors, etc., and significantly improve the quality of point cloud data. Summary of the Invention

[0005] The main objective of this invention is to provide an optical rotation scanning point cloud artifact removal method based on 7D relative position attention, in order to solve the problem that the existing technology has limited sensitivity to the local geometric structure of artifacts and is still not robust enough when dealing with the diverse composite artifacts generated by optical rotation scanning.

[0006] To achieve the above objectives, this invention provides an optical rotation scanning point cloud artifact removal method based on 7D relative position attention, specifically including the following steps: S1. Construct a point cloud dataset for training the artifact detection model; for each point in the point cloud dataset, extract a 7-dimensional local neighborhood patch including coordinates, normal vectors, and curvature features to form a training patch set.

[0007] S2. Construct an artifact detection model based on a 7D relative position attention network. The artifact detection model includes: an interconnected 7D spatial transformation network module, a point cloud feature extraction encoder module, a relative position self-attention module, and an artifact binary classification module. The training patch set generated in step S1 is used to complete the training of the artifact detection model.

[0008] S3. For the measured point cloud data containing artifacts to be processed, obtain the 7-dimensional local neighborhood patch of each point and input it into the trained artifact detection model to obtain the artifact confidence probability corresponding to each point.

[0009] S4. Set a threshold based on the confidence probability of the artifacts, filter the original point cloud data point by point, remove artifact points with a probability higher than the threshold, retain the point cloud of the target object, and complete the point cloud artifact removal.

[0010] Furthermore, step S1 specifically includes the following steps: S1.1 uses parametric equations to generate clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns, and thread heights, which serve as the main point cloud; and uses scripts to simulate and inject common composite artifacts in optical measurements on the cloud surface and surrounding areas of the main point cloud to generate a point cloud dataset.

[0011] S1.2, assign the label "1" to all injected artifact points and the label "0" to the original main points. For each point in the point cloud dataset... With a preset radius Search point The spatial neighborhood is normalized to include a fixed number of [data / elements] through sampling or interpolation. a piece of dough For the first piece of dough Feature vector of points Defined as: ; in, For coordinate components; Let be the normal vector, satisfying The curvature was estimated through principal component analysis. Calculated using the eigenvalue ratio of the local neighborhood covariance matrix: ; in, These are the three eigenvalues ​​of the neighborhood point covariance matrix.

[0012] Further, step S1.1, which uses parametric equations to generate clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns, and thread heights as the main point cloud, specifically includes the following steps: S1.1.1, the coordinates of any point on the cylindrical helix are given by the parametric equations: ; in, For radius, For pitch, The angle is the rotation angle.

[0013] S1.1.2, For the thread model, a tooth profile function is superimposed on the cylindrical helix. : ; in, For the actual polar diameter, Based on the radius of the basic cylinder This refers to the thread height.

[0014] Furthermore, the composite artifacts in step S1 include: end face reflective disk, large-scale flange reflective ring, L-shaped structure artifact, non-reflective background ring, and broken cylinder artifact, and each point is assigned a binary label indicating whether it is an artifact; during the artifact injection process, artifact points located outside the range of the main point cloud are adaptively generated by calculating the bounding box scale of the main point cloud to simulate the structured noise that exceeds the range in optical rotation scanning measurement.

[0015] Furthermore, step S2 specifically includes the following steps: S2.1, the 7D spatial transformation network module is used to transform the input feature vector. Perform spatial alignment to predict a 3×3 transformation matrix. and the transformation matrix Coordinates and normal vectors acting simultaneously on the surface : ; ; in, Original coordinates The original normal vector, The transformation matrix is ​​the prediction matrix. and These are the spatially aligned versions. and .

[0016] After spatial alignment transformation, the 7D patches are reassembled to obtain the aligned patches. ; For the aligned points , The aligned normal vector; For the curvature of the point cloud.

[0017] S2.2, the point cloud feature extraction encoder module, is used to progressively map the input 7-dimensional features to a high-dimensional feature space, obtaining the output features of the point cloud feature extraction encoder module. , The feature channel dimension is used; the point cloud feature extraction encoder module includes multiple one-dimensional convolutional layers, and the following operations are performed in each one-dimensional convolutional layer: ,in, For one-dimensional convolution, For batch normalization, The activation function; the output features of the point cloud feature extraction encoder module. Represented as: ; in, This represents the overall feature matrix of a local point cloud patch.

[0018] Furthermore, the transformation matrix The result is obtained after one-dimensional convolution and fully connected layers, expressed by the formula: ; in, This represents multi-layer one-dimensional convolution. Indicates a fully connected layer. It is the identity matrix. This represents the max pooling layer.

[0019] Furthermore, step S2 also includes the following steps: S2.3, Coordinates after spatial alignment transformation The input relative position self-attention module first generates the query through a 1×1 convolution. ,key Sum matrix: , , ; in, These are learnable convolutional weights.

[0020] S2.4, Calculate the content attention score matrix : .

[0021] S2.5, to explicitly model the spatial relationships between points, calculate the relative position offset matrix; for any two points and relative position vector for: .

[0022] S2.6, input the relative position vector into a multilayer perceptron consisting of two fully connected layers. Generate position offset scalar The position offset scalars between all point pairs constitute the position offset matrix. : ; in, This is the weight matrix. For activation function, For bias vectors, An MLP module for processing spatial location information.

[0023] S2.7, add the content attention score matrix to the position bias matrix, and then... The function yields the final attention weight matrix. : ; in, It is an exponential function; For point Point Content attention score, For point and points Positional offset between them.

[0024] S2.8 uses attention weights to perform a weighted summation of the value matrix and adds the original features as a residual connection to obtain the enhanced features. : ; in, for The transpose of .

[0025] Furthermore, step S2 also includes the following steps: S2.9, following the relative position self-attention module, uses one-dimensional convolution to further extract high-level semantics and then compresses them into a global feature vector through global max pooling. : .

[0026] S2.10, the artifact binary classification module consists of stacked fully connected layers, receiving global feature vectors. After undergoing dimensionality reduction through 512-dimensional and 256-dimensional features, the final output is a one-dimensional logistic value, which is then mapped to artifact probability using the Sigmoid function. : ; in, It is the Sigmoid activation function. and These are the weight vector and bias matrix of the output layer, respectively.

[0027] Furthermore, the loss function for training the artifact detection model in step S2 is: ; in, For batch size, For real labels, This is used to predict probabilities for the artifact detection model.

[0028] The present invention has the following beneficial effects: 1. The point cloud artifact removal method based on a 7D relative position attention network proposed in this invention effectively enhances the perception of the spatial structural features of composite artifacts by fusing coordinate, normal, and curvature joint encoding with a relative position attention mechanism, and significantly improves the recognition accuracy of dense structure artifacts.

[0029] 2. This invention, through a systematic structured artifact simulation data generation process, enables the training of a model with strong robustness to real industrial scanning scenarios without relying on large amounts of hard-to-obtain, labeled experimental data. This training strategy effectively reduces data acquisition costs while ensuring the model's generalization performance on experimental data. Attached Figure Description

[0030] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1A flowchart of an optical rotation scanning point cloud artifact removal method based on 7D relative position attention according to the present invention is shown.

[0031] Figure 2 This is an example diagram of structured artifact data used to train an artifact detection model in an embodiment of the present invention.

[0032] Figure 3 This is a visualization comparison of point clouds before and after artifact removal in an embodiment of the present invention. Detailed Implementation

[0033] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0034] like Figure 1 The illustrated optical rotation scanning point cloud artifact removal method based on 7D relative position attention includes the following steps: S1. Construct a point cloud dataset for training the artifact detection model; for each point in the point cloud dataset, extract a 7-dimensional local neighborhood patch including coordinates, normal vectors, and curvature features to form a training patch set.

[0035] S2. Construct an artifact detection model based on a 7D relative position attention network. The artifact detection model includes: an interconnected 7D spatial transformation network module, a point cloud feature extraction encoder module, a relative position self-attention module, and an artifact binary classification module. The training patch set generated in step S1 is used to complete the training of the artifact detection model.

[0036] S3. For the measured point cloud data containing artifacts to be processed, obtain the 7-dimensional local neighborhood patch of each point and input it into the trained artifact detection model to obtain the artifact confidence probability corresponding to each point.

[0037] S4. Set a threshold based on the confidence probability of the artifacts, filter the original point cloud data point by point, remove artifact points with a probability higher than the threshold, retain the point cloud of the target object, and complete the point cloud artifact removal.

[0038] Specifically, step S1 includes the following steps: S1.1 uses parametric equations to generate clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns, and thread heights, which serve as the main point cloud; and uses scripts to simulate and inject common composite artifacts in optical measurements on the cloud surface and surrounding areas of the main point cloud to generate a point cloud dataset.

[0039] S1.2, assign the label "1" to all injected artifact points and the label "0" to the original main points. For each point in the point cloud dataset... With a preset radius (like Search point (multiplied by the model's circumsphere radius) The spatial neighborhood is normalized to include a fixed number of [data / elements] through sampling or interpolation. a piece of dough The feature channel dimension of this patch is 7, and it is composed of three parts. For the first feature channel in the patch... Feature vector of points Defined as: ; in, These are coordinate components, which are processed by subtracting the coordinates of the center point to achieve local coordinate normalization. Let be the normal vector, satisfying The curvature was estimated using principal component analysis (PCA). Calculated using the eigenvalue ratio of the local neighborhood covariance matrix: ; in, These are the three eigenvalues ​​of the neighborhood point covariance matrix.

[0040] It is worth emphasizing that the 7-dimensional feature channels employed in this invention have an inseparable synergistic effect. If only the first 3 dimensions of coordinate information are used, the network is highly prone to misjudging large artifact rings. This is because artifact rings (such as flange reflective rings) have a high degree of coordinate continuity with the cylindrical end face of the solid body in spatial distribution—both exhibit a regular ring arrangement, and the artifact rings are often attached near the end face of the main body. Based solely on coordinate information, the network struggles to effectively distinguish between "artifact rings exceeding the radius of the main body" and "the edge of the main body end face."

[0041] However, when normal and curvature features are introduced, the fundamental difference between them at the differential geometry level is explicitly revealed: the normal vector of the point cloud on the main surface is usually parallel to the axis and uniformly distributed, and the curvature transitions smoothly at the edges; while the artifact rings generated by optical reflection, due to stray light or secondary reflection, have disordered normal vector directions and no physical correspondence with the normal vector of the real surface, and the curvature value exhibits a sharp jump at the artifact boundary. Therefore, the joint input of 7-dimensional features enables the network to accurately capture the geometric discontinuity between the artifact and the real surface from the perspectives of first-order differential (normal) and second-order differential (curvature), which is impossible for traditional methods that rely solely on coordinate information.

[0042] Specifically, step S1.1, which uses parametric equations to generate clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns, and thread heights as the main point cloud, includes the following steps:

[0043] S1.1.1, the coordinates of any point on the cylindrical helix are given by the parametric equations: ; in, For radius, For pitch, The angle is the rotation angle.

[0044] S1.1.2, For the thread model, a tooth profile function is superimposed on the cylindrical helix. : ; in, This is the actual polar radius (actual radius). The radius of the base cylinder (the radius of the thread base). The thread height (or thread depth).

[0045] By adjusting the radius pitch The number of loops and sampling density are used to generate a large number of main point cloud samples with different shapes.

[0046] Specifically, the composite artifacts in step S1 include: end face reflection disk, large-scale flange reflection ring, L-shaped structure artifact, non-reflective background ring, and broken cylinder artifact, and each point is assigned a binary label indicating whether it is an artifact; during the artifact injection process, artifact points located outside the range of the main point cloud are adaptively generated by calculating the bounding box scale of the main point cloud to simulate the structured noise that exceeds the range in optical rotation scanning measurement.

[0047] To address common artifact types in optical rotational scanning measurements, various noise injection strategies were designed. It is important to emphasize that the parameters for simulating artifact generation in this invention are not arbitrarily set random values, but are strictly derived based on the physical imaging mechanism of the optical rotational scanning measuring instrument and the probe structure dimensions.

[0048] Specifically: (1) Radius range of large-scale reflection rings (2.0 to 3.0 times the subject radius): This parameter is derived from the ratio of the distance from the probe's exit point to the reflector to the measurement range in the optical rotating scanning system. When the measurement beam encounters a highly reflective flange end face or fixture edge in a narrow space, the secondary reflection path is much greater than the primary reflection, causing the spatial point resolved by the system to be located outside the actual object boundary. Based on the geometric relationship between the maximum measurable depth of field calibrated by the system and the probe extension length, the probability of artifact points appearing at approximately 2 to 3 times the subject radius is the highest. Therefore, this range is used as the main generation interval for large-scale artifact rings in the script.

[0049] (2) Radius range of the end face reflector (1.2 to 1.5 times the main body radius): This parameter corresponds to the spherical aberration effect caused by the spherical protective glass at the top of the probe. When the beam passes through the edge of the protective glass at a large incident angle, the change in refractive index causes the reflected light signal to diffuse at the edge, manifesting as a thin layer of point cloud attached to the outer side of the end face. The extension range of this thin layer is usually no more than 0.5 times the main body radius, so it is set to a radius range of 1.2 to 1.5 times.

[0050] (3) XY extension range of L-shaped structure artifacts (2.2 to 3.0 times the body radius): This parameter simulates the local occlusion effect at the edge of the fixture or measuring platform. When the probe is rotated to a specific angle, the outgoing beam may sweep across the edge of the fixture, producing a discontinuous point cloud that is approximately a straight line. Depending on the relative position of the typical fixture and the workpiece under test, this artifact usually extends to a space more than twice the radius of the body periphery.

[0051] (4) Radius of the broken cylinder artifact (0.3 to 0.5 times the main body radius): This parameter simulates the artifact generated by the local scattering center in the narrow cavity. When the light beam shines on the tiny protrusions or attached particles on the inner wall, a small-sized scattering cone is generated, which appears as an incomplete thin cylindrical surface in the point cloud. Through the parameter settings driven by the above physical mechanism, the simulated artifacts generated by this invention closely approximate the output characteristics of a real optical rotating scanning measuring instrument in terms of morphology, scale, and distribution, thereby ensuring that the model can be seamlessly transferred to real industrial measurement scenarios after training on simulated data, and has extremely strong generalization ability and robustness. Therefore, this invention provides a data augmentation strategy based on physical imaging laws.

[0052] Through parameter settings driven by the aforementioned physical mechanisms, the simulated artifacts generated by this invention closely approximate the output characteristics of a real optical rotating scanning measuring instrument in terms of morphology, scale, and distribution. This ensures that the model, after being trained on simulated data, can be seamlessly transferred to real industrial measurement scenarios, exhibiting strong generalization ability and robustness. Therefore, this invention provides a data augmentation strategy based on physical imaging principles.

[0053] Step S1 constructs a synthetic point cloud dataset for training the artifact detection model; the synthetic point cloud dataset generates main point clouds with different geometric parameters through a parameterized script, and simulates the injection of composite artifact point clusters in the outer periphery and end face regions of the main point cloud, assigning a binary label of whether or not an artifact is present to each point; for each point in the point cloud, a 7-dimensional local neighborhood patch containing coordinates, normal vectors and curvature features is extracted to form a training patch set.

[0054] Step S1 uses parametric equations to generate clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns, and thread heights, which serve as the main point cloud. For the main point cloud, a script simulates the injection of common composite artifacts in optical measurement on its end face and surrounding area, including end face reflecting disks, large-scale flange reflective rings, L-shaped structure artifacts, non-reflective background rings, and broken cylinder artifacts, and assigns a binary label to each point to indicate whether it is an artifact. During the artifact injection process, by calculating the bounding box scale of the main point cloud, artifact points located outside the main range are adaptively generated to simulate the structured noise beyond the measurement range that occurs in optical rotational scanning measurement.

[0055] Specifically, step S2 includes the following steps: S2.1, the 7D spatial transformation network module is used to transform the input feature vector. Perform spatial alignment to predict a 3×3 transformation matrix. and the transformation matrix Coordinates and normal vectors acting simultaneously on the surface : ; ; in, Original coordinates The original normal vector, The transformation matrix is ​​the prediction matrix. and These are the spatially aligned versions. and .

[0056] After spatial alignment transformation, the 7D patches are reassembled to obtain the aligned patches. ; For the aligned points , The aligned normal vector; For the curvature of the point cloud.

[0057] S2.2, the point cloud feature extraction encoder module, is used to progressively map the input 7-dimensional features to a high-dimensional feature space, obtaining the output features of the point cloud feature extraction encoder module. , In this embodiment, the feature channel dimension is used. The point cloud feature extraction encoder module includes multiple one-dimensional convolutional layers, and performs the following operations in each one-dimensional convolutional layer: ,in, For one-dimensional convolution, For batch normalization, The activation function; the output features of the point cloud feature extraction encoder module. Represented as: ; in, This represents the overall feature matrix of a local point cloud patch.

[0058] Specifically, the 7D spatial transformation network module (STN7D) in step S2 is used to align the input patches and eliminate feature distribution differences caused by different scanning poses. It predicts a 3×3 transformation matrix through a series of one-dimensional convolutions and fully connected layers. Transformation matrix The result is obtained after one-dimensional convolution and fully connected layers, expressed by the formula: ; in, This represents multi-layer one-dimensional convolution. Indicates a fully connected layer. The identity matrix ensures that the initial transformation approximates the identity mapping. This represents the max pooling layer.

[0059] Specifically, step S2 also includes the following steps: S2.3, Coordinates after spatial alignment transformation The input relative position self-attention module first generates the query through a 1×1 convolution. ,key Sum matrix: , , ; in, These are learnable convolutional weights.

[0060] S2.4, Calculate the content attention score matrix : .

[0061] S2.5, to explicitly model the spatial relationships between points, calculate the relative position offset matrix; for any two points and relative position vector for: .

[0062] S2.6, input the relative position vector into a multilayer perceptron consisting of two fully connected layers. Generate position offset scalar The position offset scalars between all point pairs constitute the position offset matrix. : ; in, This is the weight matrix. For activation function, For bias vectors, An MLP module for processing spatial location information.

[0063] S2.7, add the content attention score matrix to the position bias matrix, and then... The function yields the final attention weight matrix. : ; in, It is an exponential function; For point Point Content attention score, For point and points Positional offset between them.

[0064] S2.8 uses attention weights to perform a weighted summation of the value matrix and adds the original features as a residual connection to obtain the enhanced features. : ; in, for The transpose of .

[0065] The relative position self-attention mechanism introduced in this invention naturally possesses an inductive bias towards large-scale global structures, which is crucial for artifact detection. Conventional convolution operations are limited by fixed local receptive fields. Even with the expansion of the receptive range through stacking multiple layers, their modeling of spatial relationships between distant points remains implicit and inefficient. However, artifacts generated by optical rotation scanning often exhibit globally regular geometric structures—for example, end-face reflectors appear as complete disks, large-sized reflective rings appear as concentric rings spanning the entire body scale, and L-shaped artifacts appear as right-angled arrangements spanning several times the radius of the body.

[0066] This invention, through steps S2.6 and S2.7, explicitly encodes the relative coordinates between any two points as an attention bias, enabling the artifact detection model to calculate the point... When considering the characteristics of a point, one can directly "see" all other points in the neighborhood relative to it. The spatial location of the artifact is determined and weighted differently based on the learned spatial patterns. For example, for a point located on a large artifact ring, the artifact detection model can learn the spatial prior that "other points on the same circumference as this point and equidistant from the center should receive high attention weights." This direct perception of the global structure allows the relative position self-attention module to keenly capture the concentric circle distribution pattern of the artifact ring and distinguish it from the helical asymptotic distribution pattern of the main thread.

[0067] Specifically, step S2 also includes the following steps: S2.9, following the relative position self-attention module, uses one-dimensional convolution to further extract high-level semantics and then compresses them into a global feature vector through global max pooling. : .

[0068] S2.10, the artifact binary classification module consists of stacked fully connected layers, receiving global feature vectors. After undergoing dimensionality reduction through 512-dimensional and 256-dimensional features, the final output is a one-dimensional logistic value, which is then mapped to artifact probability using the Sigmoid function. : ; in, It is the Sigmoid activation function. and These are the weight vector and bias matrix of the output layer, respectively.

[0069] Specifically, the loss function for training the artifact detection model in step S2 is: ; in, For batch size, For real labels, (0 represents the main point, 1 represents the artifact point). Predict probabilities for the artifact detection model. Update network parameters using the Adam optimizer until the loss function converges.

[0070] The invention will now be described in detail with reference to specific experiments:

[0071] In step S1, the construction of the synthetic dataset is specifically as follows: S1.1, run the parameterized generation script to generate the main point cloud. For a smooth cylindrical spiral point cloud, the formula is used. Generate, radius The pitch varies in increments of 0.5 within the range of 4.0 to 6.0. The parameters were varied in step size of 0.05 within the range of 0.15 to 0.45, and the number of revolutions varied in step size of 10 within the range of 30 to 100. The number of sampling points per revolution was set to 100, 200, and 300 respectively, generating hundreds of samples through parameter cross-combination. For the thread point cloud, for the thread model, a tooth profile function was superimposed on the cylindrical helix, with tooth heights of 0.5 and 1.0, and tooth spacings of 1.0 and 2.0. The remaining parameter ranges were consistent with those of the cylindrical helix, generating approximately 960 thread samples. All main point clouds were sampled from the farthest point, selecting 10,000 points, and then center-aligned and scaled.

[0072] The artifact injection script was run to simulate four types of composite artifacts. (1) End face reflection artifacts: solid disk-shaped point clusters were generated on the outer side of both ends of the main body along the axis. The radius of the disk was 1.2 to 1.5 times the radius of the main body, and the number of points was 150 to 400. At the same time, small-radius tubular reflection rings were generated. The ring radius was 0.4 to 0.6 times the radius of the main body, with 5 to 10 sub-rings and 200 to 400 points per ring. (2) Large-scale reflection artifacts: ring point clouds were generated at a height of 0.01 to 0.45 times the height of the main body above the top of the main body. The ring radius was 1.2 to 3.0 times the radius of the main body (of which the probability of 2.1 to 3.0 times the radius of the main body was 30%), and the number of points was 300 to 600. At the same time, L-shaped structure artifacts were generated. The extension length in the XY direction was 2.2 to 3.0 times the radius of the main body, and the number of layers was 5 to 10. (3) No backlight background points: Sparse random points are generated on the outer side of the end face within a range of 0.01 to 0.1 times the height of the main body, with a radial distribution of 2.0 to 3.0 times the radius of the main body. (4) Fractured cylinder artifact: A thin cylindrical surface is generated above the main body, with a radius of 0.3 to 0.5 times the radius of the main body, with 15 layers, and random fracture gaps of 0.8 to 2.0 radians on the circumference of each layer.

[0073] S1.2, assign a label "1" to all injected artifact points and a label "0" to the original main points. Using each point as the center, search for neighboring points within a radius of 0.05 times the radius of the model's circumsphere, sampling up to a fixed number of 500 points, according to the formula: Extract 7-dimensional feature vectors to form a training patch set.

[0074] In step S2, the construction and training of the artifact detection model are specifically as follows: S2.1, Construct a 7-dimensional spatial transformation network module. This module contains three layers of one-dimensional convolutions (output channels 64, 128, and 1024), which, after max pooling, predict the 3×3 transformation matrix through three fully connected layers (1024→512→256→9). According to the formula Calculate and according to the formula ; The coordinates and normal vectors in the patch are acted on simultaneously.

[0075] S2.2, Construct the point cloud feature extraction encoder module. It consists of two one-dimensional convolutional layers (64 and 128 output channels), each followed by batch normalization and ReLU activation, according to the formula... The 7-dimensional features are gradually mapped to a 128-dimensional space.

[0076] S2.3, Construct a relative position self-attention module. Generate the query matrix through 1×1 convolution. (Channel 32), Key Matrix (Channel 32) Sum Matrix (Channel 128), according to the formula Calculate the content attention score. Simultaneously, calculate the relative position vectors between points, generating spatial biases using two fully connected layers (3→32→32), and then applying the formula... and Attention weights are obtained through fusion, according to the formula. Output enhancement features.

[0077] S2.4, Construct an artifact binary classification module. The enhanced features are upscaled to 1024 dimensions via one-dimensional convolution and max-pooled, then processed through three fully connected layers (1024→512→256→1) according to the formula: The artifact probability is output using the Sigmoid function. Dropout regularization with a dropout probability of 0.3 is used in the fully connected layer.

[0078] S2.5, Train the artifact detection model. According to the formula: The cross-entropy loss for binary classification was calculated using the Adam optimizer with an initial learning rate of 0.001 and a batch size of 32. Figure 2 The following is an example of structured artifact data used to train the artifact detection model in this embodiment of the invention. 80% of the dataset is used as the training set and 20% as the validation set. The training is iterated until the validation set loss converges.

[0079] In step S3, artifact detection is performed on the measured point cloud. The measured point cloud collected by the optical rotation scanning measuring instrument is input, and 7-dimensional patches are extracted point by point according to the same parameters as training (neighborhood radius 0.05 times the circumscribed sphere radius, number of sampling points 500). The patches are then input into the trained network, and the artifact probability value of each point is output.

[0080] In step S4, according to the formula: A threshold of 0.5 is set to filter out points with a probability higher than the threshold, retaining the target main point cloud to complete artifact removal. The output set is a clean point cloud. The input set is the original point cloud.

[0081] Figure 3 This paper presents a comparison of the artifact removal results before and after applying the method of this invention to the measured point cloud of a sealing groove of an aero-engine. It is evident that the annular artifact on the end face and the reflective interference from the side flanges are completely removed, while the details of the main thread profile remain intact.

[0082] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for removing artifacts from optical rotating scanning point clouds based on 7D relative position attention, characterized in that, Specifically, the steps include the following: S1. Construct a point cloud dataset for training the artifact detection model; for each point in the point cloud dataset, extract a 7-dimensional local neighborhood patch including coordinates, normal vector and curvature features to form a training patch set. S2, construct an artifact detection model based on a 7D relative position attention network. The artifact detection model includes: an interconnected 7D spatial transformation network module, a point cloud feature extraction encoder module, a relative position self-attention module, and an artifact binary classification module. The training patch set generated in step S1 is used to complete the training of the artifact detection model. S3. For the measured point cloud data containing artifacts to be processed, obtain the 7-dimensional local neighborhood patch of each point and input it into the trained artifact detection model to obtain the artifact confidence probability corresponding to each point. S4. Set a threshold based on the confidence probability of the artifacts, filter the original point cloud data point by point, remove artifact points with a probability higher than the threshold, retain the point cloud of the target object, and complete the point cloud artifact removal.

2. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 1, characterized in that, Step S1 specifically includes the following steps: S1.1, clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns and thread heights are generated using parametric equations as the main point cloud; the composite artifacts commonly seen in optical measurement are simulated and injected into the cloud surface and surrounding area of ​​the main point cloud using a script to generate a point cloud dataset; S1.2, assign the label "1" to all injected artifact points and the label "0" to the original subject points. For each point in the point cloud dataset... With a preset radius Search point The spatial neighborhood is normalized to include a fixed number of [data / elements] through sampling or interpolation. a piece of dough For the first piece of dough Feature vector of points Defined as: ; in, For coordinate components; Let be the normal vector, satisfying The curvature was estimated through principal component analysis. Calculated using the eigenvalue ratio of the local neighborhood covariance matrix: ; in, These are the three eigenvalues ​​of the neighborhood point covariance matrix.

3. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 2, characterized in that, Step S1.1, which uses parametric equations to generate clean thread point clouds and smooth cylindrical helical point clouds with different radii, pitches, number of turns, and thread heights as the main point cloud, specifically includes the following steps: S1.1.1, the coordinates of any point on the cylindrical helix are given by the parametric equations: ; in, For radius, For pitch, The rotation angle; S1.1.2, For the thread model, a tooth profile function is superimposed on the cylindrical helix. : ; in, For the actual polar diameter, Based on the radius of the basic cylinder This refers to the thread height.

4. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 2, characterized in that, The composite artifacts in step S1 include: end face reflection disk, large-scale flange reflection ring, L-shaped structure artifact, non-reflective background ring and broken cylinder artifact, and each point is assigned a binary label indicating whether it is an artifact; during the artifact injection process, artifact points located outside the range of the main point cloud are adaptively generated by calculating the bounding box scale of the main point cloud to simulate the structured noise that exceeds the range in optical rotation scanning measurement.

5. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 1, characterized in that, Step S2 specifically includes the following steps: S2.1, the 7D spatial transformation network module is used to transform the input feature vector. Perform spatial alignment to predict a 3×3 transformation matrix. and the transformation matrix Coordinates and normal vectors acting simultaneously on the surface : ; ; in, Original coordinates The original normal vector, The transformation matrix is ​​the prediction matrix. and These are the spatially aligned versions. and ; After spatial alignment transformation, the 7D patches are reassembled to obtain the aligned patches. ; For the aligned points , The aligned normal vector; For point cloud curvature; S2.2, the point cloud feature extraction encoder module, is used to progressively map the input 7-dimensional features to a high-dimensional feature space, obtaining the output features of the point cloud feature extraction encoder module. , The feature channel dimension is used; the point cloud feature extraction encoder module includes multiple one-dimensional convolutional layers, and the following operations are performed in each one-dimensional convolutional layer: ,in, For one-dimensional convolution, For batch normalization, The activation function; the output features of the point cloud feature extraction encoder module. Represented as: ; in, This represents the overall feature matrix of a local point cloud patch.

6. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 5, characterized in that, Transformation matrix The result is obtained after one-dimensional convolution and fully connected layers, expressed by the formula: ; in, This represents multi-layer one-dimensional convolution. Indicates a fully connected layer. It is the identity matrix. This represents the max pooling layer.

7. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 5, characterized in that, Step S2 also includes the following steps: S2.3, Coordinates after spatial alignment transformation The input relative position self-attention module first generates the query through a 1×1 convolution. ,key Sum matrix: , , ; in, Learnable convolutional weights; S2.4, Calculate the content attention score matrix : ; S2.5, to explicitly model the spatial relationships between points, calculate the relative position offset matrix; for any two points and relative position vector for: ; S2.6, input the relative position vector into a multilayer perceptron consisting of two fully connected layers. Generate position offset scalar The position offset scalars between all point pairs constitute the position offset matrix. : ; in, This is the weight matrix. For activation function, For bias vectors, An MLP module for processing spatial location information; S2.7, add the content attention score matrix to the position bias matrix, and then... The function yields the final attention weight matrix. : ; in, It is an exponential function; For point Point Content attention score, For point and points Positional offset between them; S2.8 uses attention weights to perform a weighted summation of the value matrix and adds the original features as a residual connection to obtain the enhanced features. : ; in, for The transpose of .

8. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 7, characterized in that, Step S2 also includes the following steps: S2.9, following the relative position self-attention module, uses one-dimensional convolution to further extract high-level semantics and then compresses them into a global feature vector through global max pooling. : ; S2.10, the artifact binary classification module consists of stacked fully connected layers, receiving global feature vectors. After undergoing dimensionality reduction through 512-dimensional and 256-dimensional features, the final output is a one-dimensional logistic value, which is then mapped to artifact probability using the Sigmoid function. : ; in, It is the Sigmoid activation function. and These are the weight vector and bias matrix of the output layer, respectively.

9. The optical rotation scanning point cloud artifact removal method based on 7D relative position attention as described in claim 1, characterized in that, The loss function for training the artifact detection model in step S2 is: ; in, For batch size, For real labels, This is used to predict probabilities for the artifact detection model.