Unsupervised three-dimensional CAD model retrieval method based on boundary representation
By applying the data enhancement methods of graph comparison learning, edge mediator centering and feature mask in three-dimensional CAD model retrieval, combined with the negative sample sampling strategy of beta mixed model, the problem of unsupervised three-dimensional CAD model retrieval is solved, and efficient and accurate retrieval effect is achieved.
Patent Information
- Application Number
- CN202510361362.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-06-27
AI Technical Summary
The prior art is difficult to achieve efficient and accurate classification and retrieval of three-dimensional CAD models without the need for large amounts of labeled data, especially in boundary representation (B-rep) data, and research is still relatively limited.
Using graph contrast learning (GCL) combined with Edge Betweenness Centrality (EBC) and Feature Masking, an unsupervised three-dimensional CAD model retrieval method based on boundary representation is designed through the negative sample sampling strategy of Beta Mixture Model (BMM).
The structured understanding and generalization ability of the CAD model is improved, the impact of false negatives on retrieval accuracy is reduced, more efficient CAD model retrieval is achieved, and the dependence on manual labeled data is reduced.
Smart Images

Figure CN120216715A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer-aided applications, and specifically to an unsupervised three-dimensional CAD model retrieval method based on boundary representation. Background Art
[0002] Three-dimensional CAD models play a crucial role in the product development process of modern manufacturing enterprises and are widely used in multiple industries such as aviation, automotive, mold processing, and machinery manufacturing. Research shows that approximately 75%-80% of new part designs reuse historical data through variant design or adaptive design, while only 20%-25% of parts need to be completely redesigned. Therefore, efficient CAD model retrieval is crucial for improving design efficiency, reducing redundant work, and promoting innovation. However, different from standardized components, CAD models in the industrial field usually have strong industry-specificity, and the classification standards adopted by different enterprises and industries are not unified, lacking a general classification system, resulting in great challenges in the management and retrieval of CAD models. In addition, the annotation process of CAD data is complex, time-consuming, and laborious. Due to the subjectivity and diversity of the classification of CAD models, it is difficult to form a unified annotation standard, resulting in extremely high acquisition costs for high-quality annotated data, further limiting the applicability of supervised learning-based CAD model classification and retrieval methods. Therefore, how to achieve efficient and accurate three-dimensional CAD model classification and retrieval without a large amount of annotated data has become an important technical problem that urgently needs to be solved in the CAD field.
[0003] In past research, various methods have been proposed in the field of CAD model retrieval, which can be mainly divided into traditional methods, supervised learning methods, and unsupervised learning methods.
[0004] Traditional methods are based on geometric feature matching technology and perform matching by extracting features such as the geometric shape and surface type of CAD models. Such methods are computationally efficient, but have limitations in dealing with models with complex topological structures and small morphological changes, and it is difficult to accurately distinguish similar but functionally different CAD models.
[0005] Supervised learning methods use neural network models such as Convolutional Neural Network (CNN) and Graph Neural Networks (GNN) to extract features from CAD models. Although these methods have achieved good results in some downstream tasks, they highly rely on large-scale and high-quality manually annotated data. Due to the non-uniformity of data annotation standards, the annotation process is time-consuming, laborious, and costly, restricting the wide application of this method in actual industrial scenarios.
[0006] Unsupervised learning methods utilize techniques such as autoencoders and contrastive learning to extract features from CAD models, reducing the dependence on manually labeled data and improving the adaptability and generalization ability of the models. However, existing research mainly focuses on CAD models represented by point clouds and meshes, while the research on boundary representations (B-rep) remains relatively limited. As a widely used modeling method in CAD design, B-rep can accurately describe complex geometric shapes and topological features and has important application value in industrial manufacturing.
[0007] Therefore, there is an urgent need for a new method to design an efficient unsupervised feature learning mechanism for B-rep data and optimize data augmentation and representation learning strategies to improve the accuracy and generalization ability of CAD model retrieval. Summary of the Invention
[0008] In view of the deficiencies of the prior art, the present invention combines graph contrastive learning (GCL) to design an unsupervised 3D CAD model retrieval method based on boundary representation. This method performs data augmentation through edge betweenness centrality (EBC) and feature masking to enhance the topological and feature expression capabilities of the model, and introduces a negative sample sampling strategy based on the beta mixture model (BMM) to reduce the impact of false negative samples on the retrieval accuracy, thereby improving the representation ability and retrieval effect of the model.
[0009] To achieve the above object, the specific technical solutions adopted by the present invention are as follows:
[0010] An unsupervised 3D CAD model retrieval method based on boundary representation, comprising the following steps:
[0011] Step 1: First, obtain a data set, which includes several CAD models in STEP format and is divided into a training set and a test set according to a certain proportion;
[0012] Step 2: By extracting the topological relationship and geometric features of the CAD model, where the topological relationship refers to the adjacency relationship between faces in the CAD model, and the geometric features include attribute information such as the type of face and the normal vector, construct a boundary representation attribute graph;
[0013] Step 3: Construct and train an unsupervised learning model based on boundary representation, where the unsupervised learning model based on boundary representation includes a data augmentation network, a feature extraction network, and a negative sample sampling network;
[0014] The training method of the unsupervised learning model based on boundary representation is as follows:
[0015] Step 3-1: First, convert the CAD model to be retrieved into a boundary representation attribute graph according to the method in Step 2.
[0016] Step 3-2: The data augmentation network performs data augmentation on the boundary representation attribute graph through an edge perturbation strategy based on edge betweenness centrality.
[0017] Step 3-3: Extract the topological relationship and geometric features of the original boundary representation attribute graph and its corresponding augmented boundary representation attribute graph through the feature extraction network, so as to learn high-dimensional feature representations.
[0018] Step 3-4: Model the similarity distribution between positive and negative samples through the negative sample sampling network, and calculate the probability that a negative sample is a true negative through posterior probability to eliminate the influence of false negatives.
[0019] Step 4: Apply the pre-trained unsupervised learning model based on boundary representation for CAD model retrieval.
[0020] Preferably, in Step 2, the method for constructing the boundary representation attribute graph is as follows: First, parse the STEP file of the CAD model, and extract the topological information and geometric features of the CAD model by the method described in the patent [Method for lightweight 3D CAD model classification and retrieval based on graph convolutional network]. The topological relationship refers to the adjacency relationship between faces in the CAD model. The geometric features include the type of face, the normal vector of the face, the tangent vector of the face, the type of edge, the direction of the edge, and the length of the edge. Take the type of face, the normal vector of the face, and the tangent vector of the face as node features, and take the type of edge, the direction of the edge, and the length of the edge as edge features, and then obtain the boundary representation attribute graph.
[0021] Preferably, in Step 3-2, the edge perturbation strategy of edge betweenness centrality:
[0022] First, define that edge betweenness centrality represents the number of shortest paths along edges between node pairs in the graph, where the shortest path refers to the path with the smallest distance between any two nodes. The calculation formula of edge betweenness centrality is as follows:
[0023]
[0024] Among them, σ(s,t) represents the total number of shortest paths from node s to node t, and σ(s,t|e) represents the total number of shortest paths passing through edge e. In the boundary representation attribute graph, remove the edge with the highest edge betweenness centrality value. The generated augmented graph is denoted as G′=(V,E′), where V is the set of nodes and E′ refers to the set of edges.
[0025] Preferably, in step 3-2, a masking process is further performed on the enhanced graph representation denoted as G′=(V,E′).
[0026] Preferably, the feature extraction network uses a graph homogeneous network as the encoder and optimizes the features through a contrastive learning mechanism.
[0027] Preferably, in step 3-3, first, the original boundary representation attribute graph and its corresponding enhanced boundary representation attribute graph are input into the graph homogeneous network to obtain the embedding representation of each node, and a readout function is used to convert all the node embedding information into the embedding representation of the entire graph;
[0028] Then, two projection heads composed of two-layer perceptron models are used to map the embedding representation of the graph into different vector spaces to calculate its contrastive loss.
[0029] Preferably, the readout function is implemented by average pooling, and its calculation formula is as follows:
[0030] H = GIN(X,A), Z = Readout(H)
[0031] H′ = GIN(X′,A′), Z′ = Readout(H′)
[0032] Where GIN(·) refers to the graph homogeneous network, H and H′ represent node embeddings, Z and Z′ represent the embedding representations of the graph, X and X′ represent the node feature matrices of the original graph and the enhanced graph after masking respectively, and A and A′ represent the adjacency matrices of the original graph and the enhanced graph after edge perturbation respectively.
[0033] Preferably, the conversion method of the projection head is as follows:
[0034] U = σ(g1(Z,ψ1)), V = σ(g2(Z′,ψ2))
[0035] Where σ(·) is a non-linear activation function, g1 and g2 are two projection heads with biases ψ1 and ψ2 respectively.
[0036] Preferably, the contrastive loss uses the InfoNCE loss to optimize the similarity of positive and negative samples, and the overall objective of the contrastive loss is to maximize the average mutual information of all positive sample pairs.
[0037] Preferably, the negative sample sampling network adopts a negative sample sampling strategy based on the beta mixture model.
[0038] Preferably, the negative sample sampling strategy based on the beta mixture model models the similarity distribution of positive and negative samples, dynamically calculates the probability that each negative sample is a true negative sample, and adjusts the weight of the negative sample in the contrast loss based on this probability.
[0039] The present invention has the following characteristics and beneficial effects:
[0040] 1. The present invention first applies an unsupervised learning framework to the retrieval of CAD models with boundary representations, and uses a graph homogeneous network to learn the high-dimensional feature representation of the B-rep attribute graph, improving the ability to structurally understand CAD models.
[0041] 2. The present invention proposes a data augmentation method combining edge betweenness centrality and feature masking, which enhances the generalization ability of the model while retaining key topological information, enabling it to more effectively adapt to complex CAD structures.
[0042] 3. The present invention introduces a negative sample sampling strategy based on the beta mixture model, optimizes the calculation of the contrast loss by calculating the probability that a negative sample is a true negative, reduces the impact of false negatives on model training, and improves the retrieval effect.
[0043] 4. By comparison with state-of-the-art methods, it improves the mAP and F1 scores in an unsupervised environment, reduces the dependence on manually labeled data, and achieves more efficient CAD model retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flowchart of the specific operation process of the present invention, showing the complete process from data processing to final CAD model retrieval.
[0045] Figure 2 is the overall architecture diagram of the model of the present invention, including a data augmentation module, a feature extraction module based on contrast learning, and a negative sample sampling module based on BMM.
[0046] Figure 3 is a sample diagram of the dataset of the present invention, showing CAD model examples in the private dataset and public dataset used for training and testing of the present invention.
[0047] Figure 4 is the retrieval result diagram of the present invention, showing the application effect of the method of the present invention in the retrieval task in an unsupervised scenario.
[0048] Figure 5 is the visualization result of the dimensionality reduction of the feature representation generated by the model by t-SNE of the method of the present invention, and at the same time compares the feature distribution of other methods. DETAILED DESCRIPTION OF THE INVENTION
[0049] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0050] An unsupervised 3D CAD model retrieval method based on boundary representation, as Figure 1 shown, includes the following steps:
[0051] Step 1: First, obtain a data set, which includes several CAD models in STEP format and is divided into a training set and a test set according to a ratio.
[0052] Specifically, in this embodiment, the data set includes a private data set BRepCAD30 and a public data set FabWave. Among them, the BRepCAD30 data set is provided by industrial enterprises and contains 10,365 CAD part models, covering 30 different categories of industrial parts; the FabWave data set is a publicly available B-rep industrial part data set, containing 4,475 CAD models, involving 45 different categories of part designs, and has high diversity and generalization ability. The present invention divides the data set into a training set and a test set according to a ratio of 8:2, where 80% of the data is used for unsupervised training, and the GIN encoder is used to learn the embedded representation of the CAD model under the condition of no labels; 20% of the data is used for classification and retrieval tasks in the test phase to evaluate the generalization ability and retrieval performance of the model.
[0053] Step 2: By extracting the topological relationship and geometric features of the CAD model, construct a boundary representation attribute graph. The topological relationship refers to the adjacency relationship between faces in the CAD model, and the geometric features include the type of face, the normal vector of the face, the tangent vector of the face, the type of edge, the direction of the edge, and the length of the edge.
[0054] It should be noted that the geometric features include the type of face, the normal vector of the face, the tangent vector of the face, the type of edge, the direction of the edge, and the length of the edge. The type of face, the normal vector of the face, and the tangent vector of the face are used as node features, and the type of edge, the direction of the edge, and the length of the edge are used as edge features, so as to obtain a boundary representation attribute graph.
[0055] Specifically, in this embodiment, to adapt to the feature learning of the graph neural network, the present invention uses B-rep (Boundary Representation) as the representation method of the CAD model and converts it into a B-rep attribute graph. First, parse the STEP (Standard for the Exchange of Product Model Data) file of the CAD model to extract the topological structure information of the CAD model. Subsequently, calculate geometric features such as the type of face, the normal vector of the face, the type of edge, and the length of the edge, and use this information as the features of the nodes and edges in the graph B-rep attribute graph to improve the expression ability of the CAD model structure information. After obtaining the B-rep attribute graph, we use G=(V, E) to represent the graph, where V represents a set of N nodes and E is the set of edges. The adjacency matrix of the graph is A∈{0, 1} N×N , and the node feature matrix is X∈R N×d , where x i ∈R d is the feature vector of v i , with a dimension of d. If the edge (v i , v j )∈E, then A ij = 1.
[0056] Step 3, construct and train an unsupervised learning model based on boundary representation. The unsupervised learning model based on boundary representation includes a data augmentation network, a feature extraction network, and a negative sample sampling network;
[0057] Specifically, as Figure 2 shown, the data augmentation network generates B-rep attribute graphs from different perspectives through edge perturbation and feature masking, improving the generalization ability of the model and making it more robust to adapt to the structural changes of the CAD model. The feature extraction network based on contrast learning uses a graph homogeneous network to encode the B-rep attribute graph and uses the contrast learning mechanism to enable the model to distinguish different CAD models while maintaining the feature consistency of different views of the same CAD model. The negative sample sampling network based on BMM calculates the authenticity of negative samples through the beta mixture model, reducing the interference of false negative samples on model training, thereby improving the accuracy and stability of retrieval.
[0058] In this embodiment, during training, the feature dimension of the GIN (Graph Isomorphism Network) encoder is set to 256, the feature masking rate is set to 0.3, the edge perturbation rate is set to 0.1, and the number of network layers is set to 2. All experiments are run on an NVIDIA RTX 4090 graphics card, implemented based on the PyTorc framework, and the Adam optimizer is used for model training. During the training process, the learning rate is set to 0.01, the batch size is 128, and the number of training epochs is 20. At the same time, according to the same training method, the present invention trains multiple mainstream graph contrast learning methods and point cloud autoencoder methods proposed in recent years, and these methods are all cutting-edge methods published in top conferences or journals in recent years.
[0059] A further setting of this embodiment, the training method of the unsupervised learning model based on boundary representation is:
[0060] Step 3-1: First, convert the CAD model to be retrieved into a boundary representation attribute graph according to the method of Step 2;
[0061] Step 3-2: The data augmentation network performs data augmentation on the boundary representation attribute graph through the edge perturbation strategy of edge betweenness centrality.
[0062] Specifically, based on the converted B-rep attribute graph, a multi-level data augmentation strategy is performed on the data, aiming to improve the generalization ability of the model to the B-rep structure, so that it can adapt to geometric transformations and topological changes of different CAD models. Specifically, different from the existing method of achieving topological enhancement through simple random perturbation, the present invention proposes a topological enhancement strategy based on edge betweenness centrality. Edge betweenness centrality represents the number of shortest paths along edges between node pairs in a graph, where the shortest path refers to the path with the smallest distance between any two nodes. The formula for edge betweenness centrality is as follows:
[0063]
[0064] Among them, σ(s,t) represents the total number of shortest paths from node s to node t, and σ(s,t|e) represents the total number of shortest paths passing through edge e. In the B-rep attribute graph, each edge is associated with its corresponding EBC value. Edges with higher EBC values usually connect different community structures. Based on this characteristic, the present invention selects to remove the edge with the highest EBC value, and the generated enhanced graph is denoted as G′=(V,E′), where the number of edges between communities decreases, and the edges within the community are more compact. This operation can effectively reveal the potential semantic structure in the graph and at the same time more clearly retain the geometric information contained in the topological structure.
[0065] On this basis, the present invention further performs masking processing on the features of the B-rep attribute graph. Specifically, a mask vector m∈{0,1} is randomly sampledN Hide node features, that is, set some node feature values to 0. Each element in the mask m is sampled from the Bernoulli distribution Ber(1 - p mask ), where the hyperparameter p mask is the feature dropout rate. Therefore, the enhanced node feature matrix can be expressed as:
[0066]
[0067] where represents element-wise multiplication, X′ is the enhanced node feature matrix, and X is the original feature matrix. Through random masking, the model's robustness to local features can be effectively enhanced, enabling it to focus more on key topological information without over-relying on specific geometric features.
[0068] Step 3-3: Extract the topological information and geometric features of the original boundary representation attribute graph and its corresponding enhanced boundary representation attribute graph through the feature extraction network, thereby learning high-dimensional feature representations.
[0069] Specifically, on the basis of data augmentation in Step 3-2, GIN (Graph Isomorphism Network) is used as the encoder, and combined with the contrastive learning mechanism to optimize the feature representation ability. GIN captures the topological and geometric features of the B-rep attribute graph through multi-layer message passing, enabling the structural information of different CAD models to be effectively extracted. In the present invention, the B-rep attribute graph and its corresponding enhanced view are input into the GIN encoder to obtain the embedding representation of each node. Then, a readout function (ReadoutFunction) is used to convert all the node embedding information into the embedding representation of the entire graph. Usually, this readout function is implemented through average pooling (Average Pooling), and its calculation formula is as follows:
[0070] H = GIN(X, A), Z = Readout(H)
[0071] H′ = GIN(X′, A′), Z′ = Readout(H′)
[0072] where GIN(·) refers to the graph isomorphism network, H and H′ represent node embeddings, Z and Z′ represent the embedding representations of the graph, X and X′ respectively represent the node feature matrices of the original graph and the enhanced graph after masking, and A and A′ respectively represent the adjacency matrices of the original graph and the enhanced graph after edge perturbation. Subsequently, in this embodiment, two projection heads g1 and g2 are used to map Z and Z′ into different vector spaces to calculate their contrastive loss. The conversion formula of the projection head is as follows:
[0073] U = σ(g1(Z, ψ1)), V = σ(g2(Z′, ψ2))
[0074] where σ(·) is a non-linear activation function. The projection head consists of a simple two-layer perceptron model with biases ψ1 and ψ2.
[0075] To optimize the feature representation, in this embodiment, the InfoNCE (Information Noise-Contrastive Estimation) loss is adopted to optimize the similarity between positive and negative samples, enabling the model to autonomously learn more discriminative CAD structure features in an unsupervised environment. The positive sample pair (u i , v i ) has the following calculation formula for the InfoNCE loss:
[0076]
[0077] where u i and v i represent the graph representations of the i-th model in each batch, τ is the temperature parameter, and sim(·) represents the cosine similarity calculation. The overall objective of the contrastive loss is to maximize the average mutual information of all positive sample pairs:
[0078]
[0079] The present invention improves the feature discrimination ability of the model by maximizing the similarity between views of the same CAD model while minimizing the similarity between views of different CAD models, thereby enhancing the accuracy and generalization ability of unsupervised 3D CAD model retrieval.
[0080] Step 3-4: Model the similarity distribution between positive and negative samples through the negative sample sampling network, and calculate the probability that a negative sample is a true negative through posterior probability to eliminate the influence of false negatives;
[0081] Specifically, in this embodiment, based on step 3-3, the present invention further introduces a negative sample sampling strategy based on the BMM (Beta Mixture Model). The selection of negative samples is crucial for the training effect of contrastive learning. In traditional contrastive learning frameworks, negative samples are usually selected by random sampling, but this method may introduce false negative samples, that is, some negative samples actually belong to the same category as the query model, resulting in misclassification of the model and affecting the retrieval performance. To solve this problem, the present invention models the similarity distribution between positive and negative samples, dynamically calculates the probability that each negative sample is a true negative sample, and adjusts the weight of the negative sample in the contrastive loss based on this probability, thereby reducing the interference of false negative samples and improving the retrieval accuracy of the model.
[0082] The probability density function (PDF) of the beta distribution is defined as follows:
[0083]
[0084] where α and β are the parameters of the beta distribution, and Γ(·) is the gamma function. After obtaining the embeddings of the samples, the present invention calculates the similarity between sample pairs through cosine similarity:
[0085]
[0086] where ||·||2 represents the L2 norm of the vector. The present invention uses a two-component beta mixture model to model the distribution of negative samples to distinguish true negative samples and false negative samples. On the similarity matrix s, the probability density function of BMM is defined as:
[0087] p(s) = λ1Beta(s|α1,β1) + λ2Beta(s|α2,β2)
[0088] where λ1 and λ2 are the mixing coefficients. We regard the distribution with a larger λ value after fitting as the true negative sample distribution; the distribution with a smaller λ value is regarded as the false negative sample distribution because the anchor and the false negative share the same class and they are usually more similar to each other. To optimize the parameters of BMM, the present invention uses the Expectation Maximization (EM) algorithm for iterative optimization. In the E step, the BMM parameters are fixed, and the responsibility degrees of the samples belonging to each distribution are calculated using Bayes' rule, that is, the probabilities that the sample is a true negative sample or a false negative sample:
[0089]
[0090] Then the weighted average and variance are calculated to estimate the parameters of the two beta distributions:
[0091]
[0092] where B represents the total number of samples in the batch. In the M step, the parameters of the beta distribution are updated using the method of moments:
[0093]
[0094] After completing the BMM fitting, the present invention calculates the probability that each negative sample is a true negative sample through the posterior probability, and then calculates the weight of the negative sample in the loss function:
[0095]
[0096] where s ik represents the similarity between the anchor sample u i and its negative sample v k p(c|s ik) represents the probability that a negative sample is a true negative sample. During training, the present invention weights the negative samples according to the value of w(i,k) and weights the losses between views (u i , v k ) and within views (u i , u k ) in the InfoNCE loss, enabling the model to pay more attention to true negative samples while reducing the impact of false negative samples. The optimized contrast loss is defined as:
[0097]
[0098] The total weighted contrast loss is:
[0099]
[0100] Step 4: Apply the pre-trained unsupervised learning model based on boundary representation for CAD model retrieval. Specifically, use the GIN encoder to extract the B-rep attribute graph feature representation of the test samples according to the method in Step 3-3, embed it into a unified feature space, calculate the similarity scores between the query sample and the remaining CAD models in the database based on cosine similarity, and select several models with the highest similarity scores as the retrieval results.
[0101] Based on the above-mentioned unsupervised 3D CAD model retrieval method based on boundary representation provided in this embodiment, the following comparative examples are further provided in this embodiment:
[0102] Test the trained unsupervised retrieval model based on B-rep and the mainstream methods in multiple comparative experiments on BRepCAD30 (private dataset) and Fabwave (public dataset), and evaluate the classification and retrieval performance of the model through the F1 score and mAP. In the retrieval task, the present invention uses mAP (top-k average precision) as the performance evaluation index, calculates the retrieval precision of the test samples at different k values, where mAP (top-50) evaluates a wider matching precision, and mAP (top-10) focuses on a higher-precision retrieval effect. During the retrieval process, the feature representations of all test samples are extracted by the GIN encoder, and the nearest neighbor search is performed based on cosine similarity, and the most similar CAD models are selected for matching, and finally the average precision is calculated. In the classification task, the present invention additionally trains a linear classifier, inputs the embedded representation of the test data into the classifier for class prediction, and evaluates the classification performance of the model through the F1 score. The F1 score comprehensively measures the precision and recall of the model, and can comprehensively reflect the classification ability of the model under unsupervised feature learning.
[0103]
[0104] Table 1 shows the results of the comparative experiments of the present invention with state-of-the-art methods on a private dataset. Through two evaluation metrics, mAP and F1 score, the performance advantages of the present invention on the private dataset are verified.
[0105]
[0106]
[0107] Table 2 shows the results of the comparative experiments of the present invention with state-of-the-art methods on a public dataset, demonstrating the generality and generalization ability of the present invention on the public dataset.
[0108] The performance comparison of the method of the present invention on the BRepCAD30 and Fabwave test sets is shown in Tables 1-2. The experimental results show that, compared with existing methods (such as GraphCL, JOAO, SimGRACE, AutoGCL, Point-MAE, etc.), the present invention achieves better performance in both retrieval tasks (mAP top-50 and mAP top-10) and classification tasks (F1 score) metrics. Among them, on the BRepCAD30 dataset, the method of the present invention reaches 84.51% and 94.67% in the mAP (top-50) and mAP (top-10) metrics respectively, and 94.67% in the F1 score metric, all higher than other comparative methods. The experimental results on the FabWave dataset also show that the method of the present invention achieves higher retrieval accuracy and classification performance in all evaluation metrics, further verifying the effectiveness and generalization ability of the method in the unsupervised 3D CAD model feature learning task.
[0109]
[0110] Table 3 shows the results of the ablation experiments of the present invention after removing different modules, analyzing the influence of key modules such as EBC and negative sample optimization of BMM on the model retrieval performance, and verifying the contribution of each module in the overall model.
[0111] In addition, to verify the contributions of the edge perturbation based on EBC and the negative sample sampling strategy based on BMM in the method of the present invention, we conducted ablation experiments on the BRepCAD30 test set, as shown in Table 3. The experimental results show that after removing the EBC and BMM modules, the model performance decreases significantly, where mAP (top-50) drops to 78.32%, mAP (top-10) drops to 90.51%, and the F1 score drops to 91.84%. When only using the EBC or BMM module, the model performance improves, but still does not reach the effect of the complete method of the present invention. After combining the EBC and BMM modules, the model performs best in all metrics, further demonstrating the importance of EBC data augmentation and BMM negative sample optimization in the method of the present invention.
[0112] To further verify the effectiveness of the method of the present invention in the CAD model retrieval task, a visual analysis of the retrieval results of the model on the BRepCAD30 test set was carried out. After the model training was completed, the embedding representations of the test set samples were generated using the optimal model, and 10 CAD models were randomly selected as query samples and retrieved. For each query sample, the top 10 models with the highest cosine similarity in the embedding space were selected as the retrieval results and sorted from left to right according to the similarity scores to evaluate the matching accuracy and class consistency of the model in an unsupervised environment. As Figure 4 shown, the retrieval results marked by the green boxes represent retrieval diversity, showing CAD models that maintain a high degree of similarity with the query samples in key geometric and topological features but have certain variations in local structures. For example, in the gear model in the first row, the retrieval result in the second green box adds a central boss with an axial stepped transition. Similarly, in the nut model in the second row, the retrieval result marked by the second green box has a reduced axial stretch compared to the query sample, adopts a thin-wall structure transformation, and omits the internal thread. The retrieval visualization results show that the method of the present invention can not only accurately match CAD designs that are topologically similar to the query samples, but also maintain the diversity of the retrieval results to a certain extent.
[0113] In addition, to more deeply analyze the performance of different methods in the latent feature space of CAD models, this study used the t-SNE method to reduce the dimensionality of the embedding representations of the test set, as Figure 5As shown. The visualization results show that there are significant differences in the feature distributions among different methods. Some benchmark methods (such as GraphCL, Point-MAE, etc.) show blurred class boundaries and a large number of overlapping feature points of different classes in the t-SNE results, which may lead to cross-class matching during retrieval, affecting the discriminative ability and generalization ability of the model. In contrast, the method of the present invention can effectively map CAD models to the latent feature space, forming tight class clusters, making samples of the same class close to each other, while the inter-class boundaries are clearly visible, showing strong discrimination ability.
[0114] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions in the specification are only preferred examples of the present invention and are not used to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. An unsupervised 3D CAD model retrieval method based on boundary representation, characterized in that: The steps include: Step 1: First, a data set is obtained, wherein the data set includes a number of CAD models in STEP format and is divided into a training set and a test set in proportion; Step 2: construct a boundary representation attribute graph by extracting the topological relationship and geometric features of the CAD model, wherein the topological relationship refers to the adjacency relationship between faces in the CAD model, and the geometric features include the type of face, the normal vector of the face, the tangent vector of the face, the type of edge, the direction of the edge, and the length of the edge; Step 3: construct and train an unsupervised learning model based on boundary representation, wherein the unsupervised learning model based on boundary representation includes a data enhancement network, a feature extraction network, and a negative sample sampling network; The training method of the unsupervised learning model based on boundary representation is: Step 3-1, first convert the CAD model to be retrieved into a boundary representation attribute graph according to the method of step 2; Step 3-2, the data enhancement network performs data enhancement on the boundary representation attribute graph through an edge perturbation strategy based on edge betweenness centrality; Step 3-3, extracting the topological relationship and geometric features of the original boundary representation attribute graph and its corresponding enhanced boundary representation attribute graph through the feature extraction network, thereby learning high-dimensional feature representation; Step 3-4, modeling the similarity distribution between positive samples and negative samples through the negative sample sampling network, calculating the probability that a negative sample is a true negative through the posterior probability, and eliminating the influence of false negatives; Step 4: Apply the pre-trained boundary representation-based unsupervised learning model for CAD model retrieval.
2. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 1, characterized in that: In step 2, the method for constructing a boundary representation attribute graph is: first parse the STEP file of the CAD model, extract the topological information and geometric features of the CAD model, use the type of face, the normal vector of the face and the tangent vector of the face as node features, and use the type of edge, the direction of the edge and the length of the edge as edge features, thereby obtaining a boundary representation attribute graph.
3. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 1, characterized in that: In step 3-2, the edge perturbation strategy based on edge betweenness centrality is: First, we define edge betweenness centrality to represent the number of shortest paths along the edges between pairs of nodes in the graph, where the shortest path refers to the path with the shortest distance between any two nodes. The edge betweenness centrality calculation formula is as follows: Among them, σ(s, t) represents the total number of shortest paths from node s to node t, σ(s, t|e) represents the total number of shortest paths passing through edge e. In the boundary representation attribute graph, the edge with the highest edge betweenness centrality value is removed, and the generated enhanced graph is represented as G′=(V, E′), where V is the set of nodes and E′ refers to the set of edges.
4. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 3, characterized in that: The step 3-2 further includes performing mask processing on the enhanced graph represented as G′=(V, E′).
5. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 1, characterized in that: The feature extraction network adopts a graph homogeneity network as an encoder and performs feature optimization through a contrastive learning mechanism.
6. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 5, characterized in that: In step 3-3, firstly, the original boundary representation attribute graph and its corresponding enhanced boundary representation attribute graph are input into the graph homogeneity network to obtain the embedding representation of each node, and a readout function is used to convert all node embedding information into the embedding representation of the entire graph; Then, two projection heads consisting of two-layer perceptron models are used to project the embedded representation of the graph into different vector spaces to calculate its contrastive loss.
7. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 6, characterized in that: The readout function is implemented by average pooling, and its calculation formula is as follows: H=GIN(X,A),Z=Readout(H) H′=GIN(X′,A′),Z′=Readout(H′) Here, GIN(·) refers to a graph homogeneous network, H and H′ represent node embeddings, Z and Z′ represent graph embedding representations, X and X′ represent the node feature matrices of the original graph and the enhanced graph after masking, respectively, and A and A′ represent the adjacency matrices of the original graph and the enhanced graph after edge perturbation, respectively.
8. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 7, characterized in that: The conversion method of the projection head is as follows: U=σ(g1(Z,ψ1)),V=σ(g2(Z′,ψ2)) where σ(·) is a nonlinear activation function, g1 and g2 are two projection heads with biases ψ1 and ψ2 respectively.
9. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 6, characterized in that: The contrast loss uses InfoNCE loss to optimize the similarity of positive and negative samples. The overall goal of the contrast loss is to maximize the average mutual information of all positive sample pairs.
10. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 1, characterized in that: The negative sample sampling network adopts a negative sample sampling strategy based on a Beta mixture model.
11. The unsupervised 3D CAD model retrieval method based on boundary representation according to claim 10, characterized in that: The negative sample adoption strategy based on the Beta mixture model dynamically calculates the probability that each negative sample is a true negative sample by modeling the similarity distribution of positive samples and negative samples, and adjusts the weight of the negative sample in the contrast loss based on the probability.
Citation Information
Cited By
Three-dimensional part retrieval method based on self-supervised graph representation learning
CN122019822A