Three-dimensional CAD model classification method fusing boundary representation and graph attention mechanism
By integrating boundary representation and graph attention mechanism, the attribute graph and graph neural network are constructed, and the limitations of the three-dimensional CAD model classification algorithm in the existing technology in terms of topological structure and geometric feature capture are solved, and the three-dimensional with high accuracy is achieved CAD model classification.
Patent Information
- Application Number
- CN202410935387.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing three-dimensional CAD model classification and retrieval algorithms have limitations in capturing model topology and geometric features, ignoring the topology information implicitly in the solid model, and only partially representing the topology visible to the model.
Using a three-dimensional CAD model classification method with fusion boundary representation and graph attention mechanism, a property graph is constructed by parsing STEP files based on B-rep, topology and geometric features are extracted using graph neural network, attention mechanism is introduced to evaluate the importance of nodes, and graph volume is constructed The accumulation layer and the improved graph pooling layer generate global feature vectors for classification.
The accuracy of 100% in the TraceParts dataset and 90.4% in the FabWave dataset is achieved, which is better than the baseline algorithm, significantly improving the classification accuracy of the three-dimensional CAD model.
Smart Images

Figure BDA0004941167470000033 
Figure BDA0004941167470000039 
Figure BDA0004941167470000041
Abstract
Description
Technical Field
[0001] The present invention belongs to 3D CAD model classification technology, and in particular to a 3D CAD model classification method integrating B-rep (Boundary Representation) and graph attention mechanism. Background Art
[0002] With the rapid development of computer-aided design and computer vision technology, 3D CAD models have become another important information carrier after text, audio and video. Faced with a huge number of 3D CAD models, it is not realistic to rely solely on manual management and analysis, so automatic model classification and retrieval algorithms have emerged. At the same time, with the rapid growth of the number of 3D CAD models, it provides rich materials for the incremental design of models.
[0003] Research shows that in the process of new product development, about 40% of parts can directly reuse existing designs without modification, about 40% of parts can be obtained based on modifying existing designs, and only about 20% of parts need to be completely designed. This shows that most design work can reuse previous product design knowledge. Therefore, developing efficient classification and retrieval algorithms is the focus of research, which is not only conducive to improving the efficiency of model management, but also greatly promotes the reuse of existing resources in the process of new product design.
[0004] At present, the main advanced methods for 3D CAD model classification and retrieval focus on processing data collected by sensors or post-processing and calculating data, such as point clouds, views, meshes, and voxels. However, these methods often ignore the topological information implicit in the solid model and only partially represent the visible topological structure of the model. How to use a universal and unified 3D model descriptor while retaining accurate topological and geometric information is a problem worth exploring.
[0005] In CAD systems, B-rep is a commonly used geometric modeling method that describes a 3D object by defining the boundaries of an entity. This method contains not only the geometry of the model, but also all the topological information stored during the model creation process. Therefore, CAD format data contains richer information. However, due to the complexity of its data structure, it is difficult to directly input it into a neural network in its original form. Summary of the invention
[0006] Existing 3D CAD model classification and retrieval algorithms have limitations in capturing the topological structure and geometric features of models, often ignoring the topological information implicit in the solid model and only partially representing the visible topological structure of the model. To address the above problems, the present invention provides a 3D CAD model classification method that integrates boundary representation and graph attention mechanism.
[0007] A 3D CAD model classification method integrating boundary representation and graph attention mechanism of the present invention comprises the following steps:
[0008] Step S1: Attribute graph construction based on B-rep.
[0009] Considering that the data comes from different companies and different CAD systems, a neutral CAD file format is used. Among the many neutral CAD formats, STEP (STandards for the Exchange of Product model data) files are currently the most widely used and accepted format. Most CAD software supports importing and exporting STEP files, thereby achieving data interoperability between different systems. In addition, STEP files use precise B-rep representation, which contains geometric entity data, topological entity data, and solid geometric model data.
[0010] Based on B-rep, STEP files of different CAD systems are parsed and converted into a learnable unified attribute graph representation. According to the hierarchical structure of shell-surface-loop-edge-point, the geometric information of the relevant elements constituting the solid model and the topological relationship between them are recorded in detail, specifically:
[0011] Step S11: Initialize the node set V, edge set E and node attribute key set K of the attribute graph, where K contains the type key.
[0012] Step S12: parsing the shell set of the 3D CAD model STEP file to obtain the face set of each shell.
[0013] Step S13: Parse the face set, and perform the following operations on each face: create an attribute key of the face's non-reference parameter and add it to K; add the face and its attribute key-value pair to V; and parse the face's ring set.
[0014] Step S14: parse the ring set and obtain the edge set of each ring.
[0015] Step S15: Parse the edge set and perform the following operations on each edge: create an attribute key of the non-reference parameter of the edge and add it to K; add the edge and its attribute key-value pair to V; add the reference relationship between the face and the edge to E; parse the vertex set of the edge.
[0016] Step S16: Parse the vertex set and perform the following operations on each vertex: create an attribute key of the non-reference parameter of the vertex and add it to K; add the vertex and its attribute key-value pair to V; add the reference relationship between the edge and the vertex to E.
[0017] Step S17: Store the constructed property graph information as a GraphML file; the file defines the nodes, edges, and various property keys of the property graph.
[0018] Step S2: Construct an applicable classification graph neural network model.
[0019] The graph attention pooling network GAPNet (Graph Attention Pooling Network) is constructed. It adopts a hierarchical pooling architecture and gradually reduces the scale of the graph through three pooling modules to extract feature representations at different levels. Each pooling module contains a graph convolution layer and a graph pooling layer, and the output is summarized in the readout layer. By introducing the attention layer, the weighted summation of the features of the three readout layers is achieved. The obtained global feature vector is input to the fully connected layer, which maps it to the predefined category space. The specific neural network model is as follows:
[0020] Graph convolutional layer: Graph convolutional network (GCN) is used to extract attribute graph features and realize end-to-end recognition of attribute graphs.
[0021] Graph pooling layer: Based on the self-attention graph pooling SAGPool (Self-Attention Graph Pooling), the attention mechanism is integrated to comprehensively consider the importance of nodes. It not only includes the global context similarity of node features, but also combines graph convolution to evaluate the topological structure.
[0022] Readout layer: extracts and summarizes feature representations from the pooling module.
[0023] Attention layer: weighted sum of the output features of the three readout layers.
[0024] Fully connected layer: maps the global feature vector to a predefined category space and predicts the classification result.
[0025] Furthermore, in the graph convolution layer, for a given undirected graph G = (V, E), where V contains all N nodes in the graph, v i ∈V, E represents the edge between nodes (v i ,v j )∈E; adjacency matrix The elements in are binary codes or weighted real numbers; the degree matrix D ii =∑ j A ij ; The eigenvector matrix of the node is Where C is the dimension of the feature vector; the graph convolutional layer network is constructed as follows:
[0026] Step S211: Input includes graph adjacency matrix A and node feature matrix H (l) .
[0027] Step S212: In the hidden layer, all nodes aggregate the features of their neighbor nodes.
[0028] Step S213: Obtain output H through activation function (l+1) .
[0029] The feature propagation formula of this layer is as follows:
[0030]
[0031] First, in order to take into account the characteristics of all nodes in the adjacency matrix A, A is added to the identity matrix I to obtain Secondly, in order to avoid the situation where the feature vectors are continuously added when aggregating the features of neighboring nodes, resulting in larger features for nodes with more neighboring nodes, a symmetric normalized Laplace matrix is used, that is, in W (l) represents the weight matrix of the current layer, and σ is a nonlinear activation function, such as ReLU.
[0032] Furthermore, in the graph pooling layer, SAGPool is improved and a graph pooling layer integrating attention mechanism is designed. The generation of graph topology is based on the local structure and feature information of the nodes. The graph pooling layer network is constructed as follows:
[0033] Step S221: Calculate the feature score Z of the node through the attention mechanism g ,in
[0034] The eigenvector matrix of a node is expressed as The nth row h n Represents the feature vector of node n; from this, the global context c of the graph is calculated, which is obtained by the weighted average of the node embeddings, adding a bias term, and then undergoing a nonlinear transformation.
[0035]
[0036] in, is a learnable weight matrix, is a learnable bias term; using the feature vector h of each node in the graph n The similarity with the global context c is used to characterize its attention score.
[0037] Z g =σ(Hc T ) (3)
[0038] Where σ is the sigmoid function; since the attention score of each node is calculated by the inner product of its node feature vector and the global context, nodes that are more similar to the global context will receive higher attention scores.
[0039] Step S222: Use Kipf's graph convolution formula to calculate the node topology score Z t ,in
[0040]
[0041] In the node topology score, is the parameter matrix used to calculate the attention score, and other symbols are the same as those of the graph convolution layer.
[0042] Step S223: The total score of the node is represented as Z, where
[0043] Z=Z g +Z t (5)
[0044] Step S224: Sort by scores and retain the first k nodes with the highest scores to form a mask.
[0045] The pooling ratio k∈(0,1] is a hyperparameter that determines the number of nodes to keep; the indices of the retained nodes constitute the pooling mask.
[0046] idx=top-rank(Z,kN),Z mask =Z idx (6)
[0047] Step S225: retaining the characteristics of the designated nodes and the topological information between these nodes according to the mask.
[0048] According to the mask index, the corresponding feature vectors H′ are extracted from the original feature matrix, and these vectors are multiplied by their corresponding attention coefficients to obtain the feature matrix of the next layer.
[0049] H′=H idx,: ,H out =H′⊙Z mask (7)
[0050] In the original adjacency matrix, the adjacency relationships between these retained nodes are extracted to form the adjacency matrix of the next layer.
[0051] A out =A idx,idx (8)
[0052] Furthermore, in the readout layer, the output of each pooling module is summarized in the readout layer. The calculation process of the readout layer is as follows: N represents the number of nodes, h i represents the feature of the i-th node, and || represents the feature concatenation operation.
[0053]
[0054] Furthermore, in the attention layer, the output features of the three readout layers are weighted and summed, so that the classification model can distinguish the importance of the features of each readout layer, and thus pay more attention to the key features; the attention layer network is constructed as follows:
[0055] Step S241: Perform linear transformation to unify the output features of each readout layer into And concatenate it into
[0056] Step S242: H readouti Substitute into formula (2) to calculate the global context c of the readout layer: readout , where N=3.
[0057] Step S243: H readout Substitute into formula (3) to calculate H readouti With c readout The similarity score of , where σ is the softmax function, ensures that the sum of the attention scores of the three readout layers is 1; so we get H readouti The attention weight α i .
[0058] Step S244: Calculate and obtain the comprehensive descriptor H of the entire image global , which can more accurately reflect the information of the entire graph.
[0059]
[0060] Furthermore, in the fully connected layer, H global Passed to two fully connected layers for further processing to match the number of categories specified by the classification task; the fully connected layer is constructed as follows:
[0061] Step S251: The formula of the first fully connected layer is as follows, where W1 and b1 are the weight matrix and bias term respectively.
[0062] H1=ReLU(W1H global +b1) (11)
[0063] Step S252: The second fully connected layer formula is as follows to generate the classification score, where W2 and b2 are the weight matrix and bias term respectively.
[0064] H2=W2H1+b2(12)
[0065] Step S253: Use log_softmax for classification and output the final prediction result; log is a logarithmic function and exp is an exponential function.
[0066]
[0067] The beneficial technical effects of the present invention compared with the prior art are:
[0068] In view of the limitations of existing 3D CAD model classification algorithms in capturing model topology and geometric features, this paper proposes a method based on attribute graph. Based on B-rep, the STEP file of the 3D CAD model is parsed, and an attribute graph descriptor containing the precise topology and geometric features of the model is constructed. A graph neural network for 3D CAD model classification is constructed based on the attribute graph. In order to improve the representation ability of network features, the graph pooling layer is improved, and the attention mechanism is integrated to evaluate the importance of nodes in two dimensions: topology and geometric features; at the same time, the attention layer is introduced to obtain a global graph representation from the readout layer. Experimental results show that this method outperforms the baseline algorithm, achieving 100% accuracy in the TraceParts dataset and 90.4% accuracy in the FabWave dataset. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 Network architecture for classifying 3D CAD models.
[0070] Figure 2 It is the B-rep representation of the STEP file.
[0071] Figure 3 The content of the GraphML file.
[0072] Figure 4 Constructed for graph convolutional layers.
[0073] Figure 5 Build a network for graph pooling layers. DETAILED DESCRIPTION
[0074] The present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0075] The present invention discloses a 3D CAD model classification method integrating boundary representation and graph attention mechanism. Figure 1 As shown in the figure, we first parse the STEP file of the 3D CAD model based on B-rep and build an attribute graph descriptor containing the precise topology and geometric features of the model. We then build a graph neural network for 3D CAD model classification based on the attribute graph. In order to improve the representation ability of network features, we improve the graph pooling layer and integrate the attention mechanism to evaluate the importance of nodes in two dimensions: topology and geometric features. At the same time, we introduce the attention layer to obtain a global graph representation from the readout layer.
[0076] Example:
[0077] The specific steps include:
[0078] 1. The TraceParts dataset provided by Mandelli et al. and the FabWave dataset, a public dataset of 3D CAD models, are used to evaluate the effectiveness and robustness of the overall method. The TraceParts dataset contains 600 STEP format models, divided into 6 categories. The models come from different companies and cover a variety of modeling processes. The FabWave dataset is provided by the DIME laboratory and contains 4546 STEP format models, divided into 43 categories.
[0079] 2. Parse the STEP file of the 3D CAD model based on B-rep and construct the model attribute diagram, such as Figure 2 Specifically:
[0080] Step S21: Initialize the node set V, edge set E and node attribute key set K of the attribute graph, where K includes the type key.
[0081] Step S22: Parse the shell set of the model STEP file and obtain the face set of each shell.
[0082] Step S23: Parse the face set and perform the following operations on each face: Create an attribute key of the face's non-reference parameter and add it to K; add the face and its attribute key-value pair to V; and parse the face's ring set.
[0083] Step S24: parse the ring set and obtain the edge set of each ring.
[0084] Step S25: Parse the edge set and perform the following operations on each edge: Create an attribute key of the non-reference parameter of the edge and add it to K; add the edge and its attribute key-value pair to V; add the reference relationship between the face and the edge to E; and parse the vertex set of the edge.
[0085] Step S26: Parse the vertex set and perform the following operations on each vertex: Create an attribute key of the non-reference parameter of the vertex and add it to K; add the vertex and its attribute key-value pair to V; add the reference relationship between the edge and the vertex to E.
[0086] Step S27: Store the constructed property graph information as a GraphML file, the content of which is as follows: Figure 3 Table 1 provides detailed statistical information of the graph data format of the TraceParts dataset, including the average number of nodes / edges, the standard deviation of the number of nodes / edges, the maximum number of nodes / edges, and the minimum number of nodes / edges for each type of attribute graph.
[0087] Table 1 TraceParts dataset information
[0088]
[0089] Step S28: Process the two GraphML file data sets. First, summarize the node information in the two data sets into feature vectors with a dimension of 30. Then divide them into training set, validation set and test set in a ratio of 8:1:1. For the FabWave data set, due to the class imbalance problem, the data is first oversampled by randomly copying and randomly modifying samples of the same type, and then divided.
[0090] 3. Complete the construction and training of the classification graph neural network model.
[0091] The classification graph neural network model is specifically:
[0092] Graph convolutional layer: Graph convolutional network (GCN) is used to extract attribute graph features and realize end-to-end recognition of attribute graphs.
[0093] For a given undirected graph G = (V, E), where V contains all N nodes in the graph, v i ∈V, E represents the edge between nodes (v i ,v j )∈E; adjacency matrix The elements in are binary codes or weighted real numbers; the degree matrix D ii =∑ j A ij ; The eigenvector matrix of the node is Where C is the dimension of the feature vector; the graph convolutional layer network is constructed as follows Figure 4 As shown, specifically:
[0094] Step S311: Input includes graph adjacency matrix A and node feature matrix H (l) .
[0095] Step S312: In the hidden layer, all nodes aggregate the features of their neighbor nodes.
[0096] Step S313: Obtain output H through activation function (l+1) .
[0097] The feature propagation formula of this layer is as follows:
[0098]
[0099] First, in order to take into account the characteristics of all nodes in the adjacency matrix A, A is added to the identity matrix I to obtain Secondly, in order to avoid the situation where the feature vectors are continuously added when aggregating the features of neighboring nodes, resulting in larger features for nodes with more neighboring nodes, a symmetric normalized Laplace matrix is used, that is, in W(l) represents the weight matrix of the current layer, and σ is a nonlinear activation function, such as ReLU.
[0100] Graph pooling layer: Based on the self-attention graph pooling SAGPool (Self-Attention Graph Pooling), the attention mechanism is integrated to comprehensively consider the importance of nodes. It not only includes the global context similarity of node features, but also combines graph convolution to evaluate the topological structure.
[0101] To improve SAGPool, a graph pooling layer integrating attention mechanism is designed. The graph topology is generated based on the local structure and feature information of the nodes. The graph pooling layer network is constructed as follows: Figure 5 As shown, specifically:
[0102] Step S321: Calculate the feature score Z of the node through the attention mechanism g ,in
[0103] The eigenvector matrix of a node is expressed as The nth row h n Represents the feature vector of node n; from this, the global context c of the graph is calculated, which is obtained by the weighted average of the node embeddings, adding a bias term, and then undergoing a nonlinear transformation.
[0104]
[0105] in, is a learnable weight matrix, is a learnable bias term; using the feature vector h of each node in the graph n The similarity with the global context c is used to characterize its attention score.
[0106] Z g =σ(Hc T ) (3)
[0107] Where σ is the sigmoid function; since the attention score of each node is calculated by the inner product of its node feature vector and the global context, nodes that are more similar to the global context will receive higher attention scores.
[0108] Step S322: Use Kipf's graph convolution formula to calculate the node topology score Z t ,in
[0109]
[0110] In the node topology score, is the parameter matrix used to calculate the attention score, and other symbols are the same as those of the graph convolution layer.
[0111] Step S323: The total score of the node is represented as Z, where
[0112] Z=Z g +Z t (5)
[0113] Step S324: Sort by scores and retain the first k nodes with the highest scores to form a mask.
[0114] The pooling ratio k∈(0,1] is a hyperparameter that determines the number of nodes to retain; the indices of the retained nodes constitute the pooling mask;
[0115] idx=top-rank(Z,kN),Z mask =Z idx (6)
[0116] Step S325: retaining the characteristics of the designated nodes and the topological information between these nodes according to the mask.
[0117] According to the mask index, the corresponding feature vectors H′ are extracted from the original feature matrix, and these vectors are multiplied by their corresponding attention coefficients to obtain the feature matrix of the next layer.
[0118] H′=H idx,: ,H out =H′⊙Z mask (7)
[0119] In the original adjacency matrix, the adjacency relationships between these retained nodes are extracted to form the adjacency matrix of the next layer.
[0120] A out =A idx,idx (8)
[0121] Readout layer: extracts and summarizes feature representations from the pooling module.
[0122] Attention layer: weighted sum of the output features of the three readout layers.
[0123] Fully connected layer: maps the global feature vector to a predefined category space and predicts the classification result.
[0124] In model classification, accuracy, precision, recall and F1 value are often used as evaluation indicators. When the model's predicted label for a sample is consistent with its true label, the prediction is considered correct. Specifically, accuracy is used to measure the prediction of the overall sample, that is, the ratio of the number of samples C predicted correctly for all categories to the total number of samples T.
[0125]
[0126] For precision, recall, and F1 values, each category needs to be calculated separately. Each category is considered as a positive class, and other categories are considered as negative classes. The multi-classification problem is converted into N binary classification problems, where N represents the number of categories in the data set. Finally, the macro-average method is used to calculate the arithmetic mean of the evaluation indicators of different categories to comprehensively evaluate the performance of the model. Precision measures the proportion of samples predicted as positive by the model that are actually positive; recall measures the ability of the model to successfully predict all positive samples; F1 value is the harmonic average of precision and recall, which comprehensively considers the accuracy and completeness of the classifier.
[0127]
[0128] In formula (15) and (16): TP i (True Positive) indicates the number of positive samples that the model successfully predicts as class i, TN i (True Negative) indicates the number of negative samples that the model successfully predicts as non-i-th class, FP i (False Positive) indicates the number of non-i-th class samples that the model mistakenly predicts as i-th class, FN i (FalseNegative) indicates the number of samples of the i-th category that the model mistakenly predicts as non-i-th category.
[0129] The training parameters are shown in Table 2. The learning rate scheduler uses StepLR. If the current training loss value is greater than the average of the training losses in the previous five epochs, the learning rate will decay according to the preset γ value. The early stopping method is used for the TraceParts dataset and the FabWave dataset after 40 and 80 epochs, respectively. If the verification loss has not improved within the previous 10 epochs, the training is stopped.
[0130] Table 2 Model training parameters
[0131]
[0132] Using the training configuration in Table 2, the two datasets were trained for 40 epochs and 85 epochs respectively. The test results are shown in Table 3.
[0133] Table 3 Model test results
[0134]
[0135] Although the scales of the two datasets are quite different, both are trained with a batch size of 1. GAPNet achieves 100% accuracy on the TraceParts dataset and 90.4% accuracy on the FabWave dataset. In order to comprehensively evaluate the method, seven mainstream 3D model classification methods are selected for comparison, based on point cloud, view, mesh, voxel, and attribute graph.
[0136] PointNet: Proposed in 2016, it directly processes disordered point cloud data and extracts point cloud features through global feature transformation. The number of sampling points is 1024, the initial learning rate is 0.001, and the batch size is 4 to meet the needs of the batch normalization layer.
[0137] PointNet++: Proposed in 2017, it improves PointNet by grouping point clouds to learn local structures. The number of sampling points is 1024, the initial learning rate is 0.001, and the batch size is 4 to meet the needs of the batch normalization layer.
[0138] MVCNN: Proposed in 2015, it uses 12 2D views of each model and extracts the features of each view through a convolutional neural network. The view size is adjusted to 224×224, and the initial learning rate is 5e -5 , the batch size is 1.
[0139] MeshCNN: Proposed in 2019, it represents 3D models as triangular mesh data, with convolution and pooling operators applied to the edges of the triangular mesh. Each model is simplified to 750 edges, with an initial learning rate of 0.0002 and a batch size of 1.
[0140] 3D ShapeNets: Proposed in 2014, it represents a 3D model as a probability distribution of binary variables of a 3D voxel grid. The grid size is 48×48×48.
[0141] GCN: Proposed in 2022, the GCN layer generates node embeddings, and then generates the embedding of the entire graph through the attention mechanism. Using the attribute graph data of this invention, the initial learning rate is 0.0005 and the batch size is 1.
[0142] GSAPool: Proposed in 2020, it uses a weighted summation method to integrate node features and topological structures, relying on manually setting weight parameters. Using the attribute graph data of the present invention, the initial learning rate is 0.0005 and the batch size is 1.
[0143] The performance comparison results of different models on the two datasets are shown in Table 4.
[0144] Table 4 Model performance comparison results
[0145]
[0146] As shown in Table 4, GAPNet achieved the best classification accuracy in both datasets. Compared with methods based on discrete descriptors (such as point clouds, views, meshes, and voxels), methods based on attribute graphs show significant advantages. Since GCN does not have a graph pooling layer, it performs poorly in the FabWave dataset. PointNet++ also achieved a high accuracy rate. One of the reasons is that a larger batch size is used, which improves the effect to a certain extent. However, traditional methods often cannot effectively classify similar samples with similar internal topological structures but large differences in geometric features. In contrast, GAPNet is based on attribute graphs and can more accurately describe the topological structure and geometric features of 3D CAD models, thereby better capturing the intrinsic similarities between similar samples. In addition, the effectiveness of GAPNet is further verified by comparing it with GSAPool, which also evaluates nodes from two dimensions. The classification accuracy of GAPNet without the attention layer on the Fabwave dataset is 90%.
[0147] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although the present invention has been described in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.
Claims
1. A 3D CAD model classification method integrating boundary representation and graph attention mechanism, characterized in that: The following steps are involved: Step S1: constructing a property graph based on B-rep; Based on B-rep, STEP files of different CAD systems are parsed and converted into a learnable unified attribute graph representation. According to the hierarchical structure of shell-surface-loop-edge-point, the geometric information of the relevant elements constituting the solid model and the topological relationship between them are recorded in detail, specifically: Step S11: Initialize the node set V, edge set E and node attribute key set K of the attribute graph, where K includes the type key; Step S12: parsing the shell set of the 3D CAD model STEP file to obtain the face set of each shell; Step S13: Parse the face set, and perform the following operations on each face: create an attribute key of the face's non-reference parameter and add it to K; add the face and its attribute key-value pair to V; parse the face's ring set; Step S14: parse the ring set and obtain the edge set of each ring; Step S15: Parse the edge set, and perform the following operations on each edge: create an attribute key of the non-reference parameter of the edge and add it to K; add the edge and its attribute key-value pair to V; add the reference relationship between the face and the edge to E; parse the vertex set of the edge; Step S16: Parse the vertex set and perform the following operations on each vertex: create an attribute key of the non-reference parameter of the vertex and add it to K; add the vertex and its attribute key-value pair to V; add the reference relationship between the edge and the vertex to E; Step S17: storing the constructed property graph information as a GraphML file; the file defines the nodes, edges and various property keys of the property graph; Step S2: constructing an applicable classification graph neural network model; The graph attention pooling network GAPNet is constructed, which adopts a hierarchical pooling architecture. The scale of the graph is gradually reduced through three pooling modules to extract feature representations at different levels. Each pooling module contains a graph convolution layer and a graph pooling layer, and the output is summarized in the readout layer. By introducing the attention layer, the weighted summation of the features of the three readout layers is achieved. The obtained global feature vector is input to the fully connected layer, which maps it to the predefined category space. The specific neural network model is as follows: Graph convolution layer: Graph convolutional network (GCN) is used to extract attribute graph features and realize end-to-end recognition of attribute graphs. Graph pooling layer: Based on the self-attention graph pooling SAGPool, the attention mechanism is integrated to comprehensively consider the importance of nodes, including the global context similarity of node features and the evaluation of topological structure combined with graph convolution; Readout layer: extracts and summarizes feature representations from the pooling module; Attention layer: weighted sum of the output features of the three readout layers; Fully connected layer: maps the global feature vector to a predefined category space and predicts the classification result.
2. A 3D CAD model classification method integrating boundary representation and graph attention mechanism according to claim 1, characterized in that: In the graph convolution layer, for a given undirected graph G = (V, E), where V contains all N nodes in the graph, v i ∈V, E represents the edge between nodes (v i ,v j )∈E; adjacency matrix The elements in are binary codes or weighted real numbers; the degree matrix D ii =∑ j A ij ; The eigenvector matrix of the node is Where C is the dimension of the feature vector; the graph convolutional layer network is constructed as follows: Step S211: Input includes graph adjacency matrix A and node feature matrix H (l) ; Step S212: In the hidden layer, all nodes aggregate the features of their neighboring nodes; Step S213: Obtain output H through activation function (l+1) ; The feature propagation formula of this layer is as follows: First, in order to take into account the characteristics of all nodes in the adjacency matrix A, A is added to the identity matrix I to obtain Secondly, in order to avoid the situation where the feature vectors are continuously added when aggregating the features of neighboring nodes, resulting in larger features for nodes with more neighboring nodes, a symmetric normalized Laplace matrix is used, that is, in W (l) represents the weight matrix of the current layer, and σ is the nonlinear activation function.
3. A 3D CAD model classification method integrating boundary representation and graph attention mechanism according to claim 2, characterized in that: In the graph pooling layer, SAGPool is improved and a graph pooling layer integrating attention mechanism is designed. The generation of graph topology is based on the local structure and feature information of the nodes. The graph pooling layer network is constructed as follows: Step S221: Calculate the feature score Z of the node through the attention mechanism g ,in The eigenvector matrix of a node is expressed as The nth row h n represents the feature vector of node n; from this, the global context c of the graph is calculated, which is obtained by the weighted average of the node embeddings, adding a bias term, and then undergoing a nonlinear transformation; in, is a learnable weight matrix, is a learnable bias term; using the feature vector h of each node in the graph n The similarity with the global context c is used to characterize its attention score; WITH g =σ(Hc T ) (3) Where σ is the sigmoid function; since the attention score of each node is calculated by the inner product of its node feature vector and the global context, nodes that are more similar to the global context will receive higher attention scores; Step S222: Use Kipf's graph convolution formula to calculate the node topology score Z t ,in In the node topology score, is the parameter matrix used to calculate the attention score, and other symbols are the same as those of the graph convolution layer; Step S223: The total score of the node is represented as Z, where Z=Z g +Z t (5) Step S224: Sort by scores and retain the first k nodes with the highest scores to form a mask; The pooling ratio k∈(0,1] is a hyperparameter that determines the number of nodes to retain; the indices of the retained nodes constitute the pooling mask; idx=top-rank(Z,kN),Z mask =Z idx (6) Step S225: retaining the characteristics of the designated nodes and the topological information between these nodes according to the mask; According to the mask index, the corresponding feature vector H′ is extracted from the original feature matrix, and these vectors are multiplied by their corresponding attention coefficients to obtain the feature matrix of the next layer; H′=H idx,: ,H out =H′⊙Z mask (7) In the original adjacency matrix, the adjacency relations between these retained nodes are extracted to form the adjacency matrix of the next layer; A out =A idx,idx (8)。 4. A 3D CAD model classification method integrating boundary representation and graph attention mechanism according to claim 3, characterized in that: In the readout layer, the output of each pooling module is summarized in the readout layer. The calculation process of the readout layer is as follows: N represents the number of nodes, h i represents the feature of the i-th node, || represents the feature concatenation operation; 5. A 3D CAD model classification method integrating boundary representation and graph attention mechanism according to claim 4, characterized in that: In the attention layer, the output features of the three readout layers are weighted and summed, so that the classification model can distinguish the importance of the features of each readout layer, thereby paying more attention to the key features; The attention layer network is constructed as follows: Step S241: Perform linear transformation to unify the output characteristics of each readout layer into And concatenate it into Step S242: H readouti Substitute into formula (2) to calculate the global context c of the readout layer: readout , where N = 3; Step S243: H readout Substitute into formula (3) to calculate H readouti With c readout The similarity score of , where σ is the softmax function, ensures that the sum of the attention scores of the three readout layers is 1; so we get H readouti The attention weight α i ; Step S244: Calculate and obtain the comprehensive descriptor H of the entire image global , can more accurately reflect the information of the entire graph; 6. A 3D CAD model classification method integrating boundary representation and graph attention mechanism according to claim 5, characterized in that: In the fully connected layer, H global Passed to two fully connected layers for further processing to match the number of categories specified by the classification task; the fully connected layer is constructed as follows: Step S251: The formula of the first fully connected layer is as follows, where W1 and b1 are the weight matrix and bias term respectively; H1=ReLU(W1H global +b1) (11) Step S252: The second fully connected layer formula is as follows to generate the classification score, where W2 and b2 are the weight matrix and bias term respectively; H2=W2H1+b2 (12) Step S253: Use log_softmax to perform classification and output the final prediction result; log is a logarithmic function and exp is an exponential function;
Citation Information
Patent Citations
Three-dimensional point cloud classification method based on graph attention network
CN113592013A
Three-dimensional CAD model retrieval method based on image and attribute graph fusion network
CN115439722A
Lightweight three-dimensional CAD model classification and retrieval method based on graph convolutional network
CN116187200A
Three-dimensional point cloud classification method based on multi-geometry double-edge attention network
CN117392424A
Non-standard part classification and retrieval method based on graph neural network
CN118230049A
Cited By
Boundary representation generation method and system based on graph diffusion and storage medium
CN120724508A
A boundary representation generation method and system based on graph diffusion and a storage medium
CN120724508B
Neural network model-based 3D model scoring method and system, terminal and medium
CN121168536A
