Feature extraction method and system of three-dimensional CAD model, and electronic equipment

By generating new descriptors and specific neural networks for feature extraction of three-dimensional CAD models, the problems of information loss and poor multi-task learning in the existing technology are solved, and high-precision semantic segmentation and instance segmentation are achieved, which improves the accuracy of feature recognition.

CN120451960APending Publication Date: 2025-08-08MISUMI (CHINA) PRECISION MASCH TRADING CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510637883.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The feature recognition technology of the existing three-dimensional CAD model has problems such as information loss, poor multi-task learning effect and limited network depth in complex scenarios, making it difficult to achieve high-precision semantic segmentation and instance segmentation.

Method used

By generating geometric attribute adjacency graphs, expanding the proximity matrix and the face-to-face shortest path edge chain matrix, combining processing feature recognition neural networks for feature extraction, dynamically computing encoding weights using the converter framework and gated network to realize semantic segmentation and instance segmentation.

Benefits of technology

It improves the accuracy of feature extraction of three-dimensional CAD models, avoids information loss in data conversion, improves the negative transfer problem of multi-task learning, and improves the feature recognition accuracy in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451960A_ABST
    Figure CN120451960A_ABST
Patent Text Reader

Abstract

The invention provides a feature extraction method and system for a three-dimensional CAD model and electronic equipment, and the method comprises the steps: a data processing step: generating a corresponding geometric attribute adjacency graph, an extended adjacency matrix, a spatial position matrix and a surface-surface shortest path side chain matrix based on the data of the three-dimensional CAD model; and a feature extraction step: performing semantic segmentation and instance segmentation on the processing features of the three-dimensional CAD model through a processing feature recognition neural network based on the geometric attribute adjacency graph, the extended adjacency matrix, the spatial position matrix and the surface-surface shortest path side chain matrix so as to perform feature extraction. By means of the mode, the geometric attribute adjacency graph and the novel descriptor are generated after the three-dimensional CAD model is recoded, information of the three-dimensional CAD model is prevented from being lost, and information integrity during data conversion is guaranteed. Semantic segmentation and instance segmentation are carried out on a geometric attribute adjacency graph and a novel descriptor through a specific neural network model, and the accuracy of feature extraction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of feature extraction, and in particular to a feature extraction method for a three-dimensional CAD (Computer Aided Design) model, a feature extraction system for a three-dimensional CAD model, and electronic equipment. Background Art

[0002] Feature recognition (FR) is a key step in Computer-Aided Process Planning (CAPP). It identifies machining features from 3D CAD models that can be used by Computer-Aided Manufacturing (CAM) systems. Accurate machining feature recognition is crucial for generating feasible machining plans and optimizing manufacturing processes. Therefore, feature recognition has become a key research area in manufacturing automation.

[0003] Existing feature recognition technologies are mainly divided into two categories: rule-based methods and learning-based methods. Rule-based methods pre-establish matching rules based on the manifestation of each feature. However, in the case of complex, intersecting or large structural components, the geometric shape and topological relationship of individual features vary greatly. Rule-based methods can only define rules for some heterogeneous situations of a single feature and cannot define universal rules for all possible heterogeneous situations of a single feature. Learning-based methods use an end-to-end training process to obtain the mapping between processing features and their corresponding underlying representations. They use a large number of training samples to effectively capture and process complex heterogeneous features, avoiding the laborious rule-making. However, current learning-based methods still have some defects.

[0004] First, due to their high complexity and irregularity, 3D CAD models cannot be directly fed into neural networks. Therefore, the CAD data needs to be converted into an intermediate representation before being fed into the network. The converted data structures can be divided into two categories: one is an intermediate representation such as point cloud, image, triangular mesh, or voxel, and the other is a geometric attribute adjacency graph. Point cloud, image, triangular mesh, voxel and other representations lose a large amount of topological structure information, geometric detail information, and attribute information in the original data during the conversion process, so the recognition and segmentation accuracy in feature recognition tasks is not high. The method of converting to the geometric attribute adjacency graph can retain most of the geometric and topological information, which has certain advantages over the former method. However, due to the inherent properties of the geometric attribute adjacency graph, the problem of global and local topological and geometric detail loss still exists. In the scenario of complex CAD data, the detailed information lost in the geometric attribute adjacency graph makes it difficult to improve the accuracy of feature recognition tasks.

[0005] Secondly, most existing processing feature recognition methods are limited to a single task and can only achieve semantic segmentation of features (such as distinguishing feature categories), but lack support for instance segmentation (such as identifying different individual features in the same category), which makes it difficult to meet the needs of actual industrial scenarios; a small number of methods can achieve both semantic segmentation and instance segmentation at the same time, but use a traditional multi-task learning framework, which uses a shared encoder to process input information and the same feature encoding for multiple different tasks. This method will cause the model to tend to improve the performance of tasks that are easier or more frequent, and reduce the performance of other tasks, resulting in multi-task learning being less effective than single-task models.

[0006] Finally, existing processing feature recognition networks basically use traditional message passing neural networks (MPNNs) for feature extraction. Although this type of method is very effective in specific tasks, due to its inherent defects such as limited receptive field and network depth, MPNN's feature extraction ability in complex CAD scenarios is slightly behind, which limits the further improvement of task accuracy. Summary of the Invention

[0007] In response to the above problems, the present invention provides a feature extraction method for a 3D CAD model, a feature extraction system for a 3D CAD model, and an electronic device to at least solve some of the problems in the prior art.

[0008] A first aspect of the present invention provides a feature extraction method for a three-dimensional CAD model, comprising: a data processing step, generating a corresponding geometric attribute adjacency graph, an extended proximity matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix based on the data of the three-dimensional CAD model; and a feature extraction step, performing semantic segmentation and instance segmentation on the processing features of the three-dimensional CAD model based on the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix, and the face-to-face shortest path edge chain matrix through a processing feature recognition neural network to perform feature extraction.

[0009] Through the above method, a geometric attribute adjacency graph and a new descriptor composed of an extended adjacency matrix, a spatial position matrix and a face-to-face shortest path edge chain matrix are generated according to the 3D CAD model. This solves the problem in the existing technology that the geometric attribute adjacency graph lacks a complete detailed description of topological and geometric information, avoids the loss of data information of the 3D CAD model during the data conversion process, ensures the integrity of the data information, and facilitates the accurate extraction of features.

[0010] Optionally, in the data processing step: the extended proximity matrix includes the shortest paths of adjacent faces in the face adjacency graph; the spatial position matrix includes the frequency of the ratio of each point pair within a preset interval, the point pairs are a preset number of point pairs selected from adjacent faces, and the ratio of the point pairs is the ratio of the Euclidean distance of the point pairs to the diagonal length of the bounding box of the three-dimensional CAD model; the face-to-face shortest path edge chain matrix includes the edge chains corresponding to the shortest paths between adjacent faces and the weighted sum of the features of each edge on the edge chain.

[0011] Through the above methods, three new descriptors expressing topological and geometric detail information are added on the basis of the geometric attribute adjacency graph to ensure the information integrity of 3D CAD model data.

[0012] Optionally, the feature extraction step includes: feature encoding of a geometric attribute adjacency graph, an extended proximity matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix through a feature encoder; obtaining task-specific features through a task-specific encoder; obtaining shared features of multiple tasks through a shared task encoder; and generating an aggregated feature vector by aggregating shared features and task-specific features through the weights output by the gating network.

[0013] Through the above method, the shared task encoding and multiple specific task encodings are clearly separated. For each specific task, a gating network is used to dynamically calculate the encoding weights of the shared task encoder and the specific task encoder, effectively avoiding harmful parameter interference between specific tasks and improving the negative transfer problem of multi-task learning.

[0014] Optionally, the processing feature recognition neural network includes a multi-task segmentation head, and the feature extraction step includes: using the multi-task segmentation head to perform semantic segmentation and instance segmentation on the aggregated feature vector, semantic segmentation is used to distinguish the feature type of the processing features of the three-dimensional CAD model, and instance segmentation is used to distinguish the feature instances of the processing features of the three-dimensional CAD model; determining feature parameters based on the processing features, and calculating and extracting feature parameters based on the feature instances and feature types of the segmented three-dimensional CAD model.

[0015] In the above manner, the multi-task segmentation head can segment the feature types and feature instances of the machining features of the 3D CAD model, thereby predicting the feature type of each face and the faces belonging to the same feature instance.

[0016] Optionally, the feature extraction method of the three-dimensional CAD model also includes: a labeling data set definition step, defining the feature type and morphological variants of the processing feature according to the feature morphology of multiple three-dimensional CAD models; a labeling data set construction step, labeling each processing feature based on the feature type, feature instance and each face of each three-dimensional CAD model to form a labeling data set to train a processing feature recognition neural network.

[0017] Through the above method, each processing feature is numbered and labeled, and the processing feature recognition neural network is trained through the labeled data set, which is conducive to improving the recognition and segmentation accuracy of the processing feature recognition neural network for processing features.

[0018] Optionally, in the feature extraction step, the specific task encoder and the shared task encoder are implemented based on the transformer framework.

[0019] In this way, the converter framework is integrated into the feature learning of 3D CAD models, which improves the ability of the processing feature recognition neural network to extract the full and local topological geometric features of complex 3D CAD models.

[0020] The second aspect of the present invention provides a feature extraction system for a three-dimensional CAD model, comprising: a data processing module for generating a corresponding geometric attribute adjacency graph, an extended proximity matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix based on the data of the three-dimensional CAD model; a feature extraction module for performing semantic segmentation and instance segmentation of the processing features of the three-dimensional CAD model based on the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix, and the face-to-face shortest path edge chain matrix through a processing feature recognition neural network to perform feature extraction.

[0021] Through this approach, the data processing module generates a geometric adjacency graph and novel descriptors based on the 3D CAD model, preventing loss of 3D CAD model information and ensuring the integrity of the model during data conversion. Simultaneously, the feature extraction module uses a specific neural network model to perform semantic segmentation and instance segmentation on the processed features of the geometric adjacency graph and novel descriptors, improving feature extraction accuracy.

[0022] Optionally, the feature extraction module includes: a feature encoder for performing feature encoding on the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix, and the face-face shortest path edge chain matrix;

[0023] Task-specific encoder, used to obtain task-specific features;

[0024] A shared task encoder for obtaining shared features across multiple tasks; and

[0025] The gating network is used to output weights to aggregate shared features and task-specific features to generate an aggregated feature vector.

[0026] Through the above method, the feature extraction system clearly separates the shared task encoding and multiple specific task encodings. For each specific task, a gating network is used to dynamically calculate the encoding weights of the shared task encoder and the specific task encoder, effectively avoiding harmful parameter interference between specific tasks and improving the negative transfer problem of multi-task learning.

[0027] Optionally, the feature extraction module further includes: a multi-task segmentation head for performing semantic segmentation and instance segmentation on the aggregated feature vector, wherein the semantic segmentation is used to distinguish feature types of the 3D CAD model, and the instance segmentation is used to distinguish feature instances of the 3D CAD model.

[0028] In the above manner, the feature extraction system can predict the feature type of each face and the faces belonging to the same feature instance based on the multi-task segmentation head, thereby improving the efficiency of extracting and calculating processing features.

[0029] A third aspect of the present invention provides an electronic device having a computer program stored therein. When the computer program is executed by a processor of the electronic device, the above-mentioned feature extraction method of the three-dimensional CAD model is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 Flowchart of a feature extraction method for a 3D CAD model in an embodiment of the present invention.

[0031] Figure 2 This is another flow chart of the feature extraction method of a 3D CAD model in an embodiment of the present invention.

[0032] Figure 3 Flowchart of the data preprocessing steps in an embodiment of the present invention.

[0033] Figure 4 Flowchart of data processing steps in an embodiment of the present invention.

[0034] Figure 5 Flowchart of feature extraction steps in an embodiment of the present invention.

[0035] Figure 6 Schematic diagram of the structure of the feature extraction system in an embodiment of the present invention.

[0036] Figure 7 Schematic diagram of another structure of the feature extraction system in an embodiment of the present invention.

[0037] Figure 8 Schematic diagram of the segmentation step in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0039] <First embodiment>

[0040] Figure 1 Flowchart of the feature extraction method of the 3D CAD model in the embodiment of the present invention. Figure 1 The first embodiment of the present invention provides a feature extraction method for a three-dimensional CAD model, including a data processing step S1 and a feature extraction step S2.

[0041] Data processing step S1: Generate the corresponding geometric attribute adjacency graph, extended adjacency matrix, spatial position matrix and face-to-face shortest path edge chain matrix based on the data of the three-dimensional CAD model.

[0042] Feature extraction step S2: Through the processing feature recognition neural network, the processing features of the 3D CAD model are semantically segmented and instance segmented based on the geometric attribute adjacency graph, extended proximity matrix, spatial position matrix and face-to-face shortest path edge chain matrix to perform feature extraction.

[0043] Through this approach, a geometric adjacency graph and a novel descriptor composed of an extended adjacency matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix are generated from the 3D CAD model. This addresses the existing problem of the geometric adjacency graph lacking a complete and detailed description of topological and geometric information. This prevents the loss of 3D CAD model data during data conversion, ensuring data integrity and facilitating accurate feature extraction. Furthermore, a specific neural network model is used to perform semantic segmentation and instance segmentation on the geometric adjacency graph and novel descriptor based on processing features, meeting the requirements for feature recognition and segmentation in practical applications and further improving feature extraction accuracy.

[0044] <Second embodiment>

[0045] Figure 2 FIG. 1 is another flow chart of a feature extraction method for a 3D CAD model according to an embodiment of the present invention. Figure 2 The second embodiment of the present invention provides a feature extraction method for a three-dimensional CAD model, including a data preprocessing step S01, a data processing step S02 and a feature extraction step S03.

[0046] Data preprocessing step S01: reading the STEP file and performing data verification and standardization on the data of the 3D CAD model in the B-Rep format.

[0047] Since the original 3D CAD model data from the industry often has various problems, such as: empty files, file opening errors, errors in the topology and geometric structure of the 3D model, 3D model origin offset, closed rotation periodic surfaces divided into two halves, etc., it is impossible to perform feature recognition directly on the original 3D CAD model data.

[0048] Through the above method, it is possible to detect and eliminate data of 3D CAD models with format and content errors, avoid situations where data has format errors, content errors or data is difficult to process, facilitate subsequent processing of 3D CAD model data, and improve data processing efficiency.

[0049] Figure 3 FIG. 1 is a flow chart of the data preprocessing step S01 in an embodiment of the present invention. Figure 2 , and refer to Figure 3 , the data preprocessing step S01 may include the following steps S011-S013.

[0050] Topological and geometric finiteness checking step S011: checking whether the topological type of the 3D CAD model is TopoDS_Solid, and checking whether the geometric shape of the 3D CAD model is a manifold and closed.

[0051] Three-dimensional coordinate normalization step S012: The three-dimensional CAD model is translated to the coordinate origin and scaled as a whole to a bounding box of size 1*1*1.

[0052] Periodic surface merging step S013: merging the periodic surfaces of the three-dimensional CAD model that are divided into two halves into a complete surface, wherein the complete surface can be a closed rotation surface, a cylindrical surface, a spherical surface, etc., which is not limited in the present invention.

[0053] Through the above method, after the topological type and geometric shape of the 3D CAD model are inspected, the 3D coordinate normalization and periodic surface merging are performed, and the data of the 3D CAD model is standardized to provide standardized data, facilitate data maintenance and improve data scalability, thereby improving the quality of the 3D CAD model data.

[0054] Data processing step S02: converting the B-Rep data processed by the data preprocessing S01 into a data format that is convenient for processing by the feature recognition neural network.

[0055] B-Rep data is a precise representation widely used in CAD, used to fully record the geometric and topological information of 3D shapes. Geometric information refers to the size, position, and shape of entities, such as point coordinates and edge and face parameters. Topological information refers to the internal connections between entities. However, due to the high complexity and irregularity of B-Rep data structures, existing learning-based feature recognition methods cannot directly input B-Rep data into neural networks and require conversion to other formats.

[0056] This embodiment converts the B-Rep data processed by the data preprocessing step S01 into the form of a geometric attribute adjacency graph. The geometric attribute adjacency graph can encode the topological information, geometric information and derived extended attributes in the B-Rep, and can be used as the input of the neural network. However, this format lacks a more detailed and complete description of the topological and geometric information. Therefore, this method proposes a new topological and geometric description method based on the geometric attribute adjacency graph, and adds three types of descriptors that express topological and geometric detail information.

[0057] Figure 4 FIG. 1 is a flow chart of the data processing step S02 in an embodiment of the present invention. Figure 2 , and refer to Figure 4 , the data processing step S02 may include the following steps S021 - S024 .

[0058] The step S021 of generating a geometric attribute adjacency graph includes topology information encoding S0211, geometric information encoding S0212 and extended attribute encoding S0213.

[0059] Among them, the topology information encoding step S0211: convert the topological structure of the three-dimensional CAD model (i.e., the three-dimensional shape) into the form of a face adjacency graph, where each face in the three-dimensional shape corresponds to each graph node in the face adjacency graph, and each edge in the three-dimensional shape corresponds to an edge in the face adjacency graph that links the corresponding nodes.

[0060] The specific operation is to traverse all the solid faces of the 3D CAD model in B-Rep format and construct a graph structure based on the adjacency relationship between the faces. Each face in the 3D CAD model uniquely corresponds to a node in the graph structure. If two faces are adjacent in the 3D shape, there is a line connecting the two nodes in the corresponding graph structure. Therefore, the nodes of the constructed graph structure correspond one-to-one with the faces in the 3D shape, and the lines in the graph structure correspond one-to-one with the edges in the 3D shape.

[0061] Geometric shape encoding step S0212: The geometric shape of the 3D CAD model is uniformly discretized in one-dimensional and two-dimensional directions to form discrete points, and local features such as the 3D coordinates, unit curve tangent vector and / or unit surface normal vector of each discrete point are calculated.

[0062] Since the geometric information of three-dimensional shapes is represented by curves and surfaces defined by parametric equations, it is difficult to input into neural networks. Therefore, it needs to be converted into discrete structures that can be understood by the processing feature recognition neural network.

[0063] The specific operations are as follows: traverse the physical surface corresponding to each node in the graph structure, evenly divide each surface into N grids in the UV coordinate axis direction, and finally obtain N*N discretized grid points of the surface, which are embedded in the graph structure as the geometric attributes of the node; traverse the physical edge corresponding to each connection in the graph structure, evenly divide each edge into N grids in the U axis direction, and finally obtain N discretized grid points of the edge, which are embedded in the graph structure as the geometric attributes of the connection.

[0064] Extended attribute encoding step S0213: Calculate the extended attributes of faces and edges based on the three-dimensional CAD model and merge them into the geometric attribute adjacency graph, wherein the geometric attribute adjacency graph is generated based on the face adjacency graph, discrete points and extended attributes. The extended attributes of the face include: the type of face (plane, cylinder, cone, etc.), area, center of mass of the face, and number of rings of the face. The extended attributes of the edge include: the type of edge (straight line, circle, ellipse, etc.), length of the edge, convexity of the edge, and dihedral angles of adjacent faces of the edge.

[0065] The specific operations are as follows: based on the geometric shape encoding, the physical surface corresponding to each node in the graph structure and the physical edge corresponding to each connection line are traversed to determine the type of surface (plane, cylinder, cone, etc.), calculate the area size, the coordinates of the center of mass of the surface, and the number of rings of the surface, and embed this information into the graph structure as extended attributes of the node; determine the type of edge (straight line, circle, ellipse, etc.) and the concave and convex attributes, calculate the length of the edge and the dihedral angle of the adjacent faces of the edge, and embed this information into the graph structure as extended attributes of the connection line.

[0066] Generate an extended proximity matrix step S022: For any two faces, the corresponding elements in the extended proximity matrix are the shortest paths between the two faces in the face adjacency graph, which are used to represent the proximity relationship.

[0067] Generate spatial position matrix step S023: For any two faces, randomly select 512 point pairs, calculate the ratio of the Euclidean distance of each point pair to the diagonal length of the entire 3D shape bounding box, and since all ratios are in the interval [0,1], divide the interval [0,1] into 64 intervals evenly, count the frequencies of the above 512 ratios in the 64 intervals, and finally obtain the spatial position matrix D∈Z F×F×64 , where F is the number of faces.

[0068] Generate face-face shortest path edge chain matrix Step S024: For any two faces, find the shortest path between the two faces and record the edge chain {e ij,1 ,e ij,2 ,…,e ij,N}, the shortest path edge chain matrix D∈ is obtained by performing weighted sum calculation on each edge in the edge chain

[0069] Z F×F×64 , where F is the number of faces.

[0070] Through the above method, the topological structure, geometric shape and extended attributes of the 3D CAD model are encoded separately and then merged into a geometric attribute adjacency graph and three new descriptors (i.e., extended proximity matrix, spatial position matrix and face-to-face shortest path edge chain matrix). This facilitates the flexible processing of different numbers of entities in the 3D CAD model while avoiding the loss of the topological information, geometric information and attribute information of the 3D CAD model.

[0071] Figure 5 Flowchart of feature extraction step S03 in an embodiment of the present invention. Figure 6 FIG. 1 is a schematic diagram of the structure of the feature extraction system in an embodiment of the present invention. Figure 2 , and refer to him Figure 5 and Figure 6 ,The processed feature recognition neural network includes a feature encoder, a shared task encoder, a ,specific task encoder and a multi-task segmentation head.

[0072] Feature extraction step S03: Use the self-trained processing feature recognition neural network to perform processing feature recognition on the data processed in step S02, and extract feature parameters based on the recognized feature instances and feature types. Specifically, the feature extraction step can include the following steps S030-S033.

[0073] Model training step S030: Analyze a large amount of 3D CAD model data and construct a labeled data set, and perform model training on the labeled data set to obtain a processing feature recognition neural network.

[0074] It should be noted that the processing feature recognition neural network used in the feature extraction step S03 in this embodiment is a specific neural network model. The existing open source three-dimensional CAD model data sets are all synthetic data. There is a large deviation between the synthetic data and the real data in the industry in terms of shape and feature distribution. It is necessary to define and build your own data set for model training. In addition, most of the existing three-dimensional data annotation tools are oriented to data formats such as point clouds and triangular meshes, which cannot meet the requirements. Therefore, the processing feature recognition neural network in this embodiment applies a new data annotation method for three-dimensional CAD models based on the B-Rep format, that is, the feature extraction step S03 of the three-dimensional CAD model in this embodiment also includes a model training step S030. The model training step S030 can further include the following steps.

[0075] (1) The step of defining the labeled dataset is to analyze the types and morphologies of machining features of a large number of real 3D CAD model data in the industry, and define multiple categories of machining feature types and morphological variants of each type according to the machining feature morphology.

[0076] (2) The step of constructing the annotation dataset is to annotate each machining feature based on the feature type, feature instance, and each face of each 3D CAD model to form an annotation dataset. For example, data of thousands of 3D CAD models are selected, and the files are opened using the 3D mapping software SolidWorks. All machining features in the 3D shape are manually traversed, and each face of each machining feature is annotated according to the rule of "feature type number + instance number + face number".

[0077] (3) Running the self-developed visualization code module can simultaneously present the feature types of faces represented by different colors in the three-dimensional shape in the annotation dataset definition step and the instance labels represented by an undirected connection graph in the node graph in the annotation dataset construction step. Based on the two, the correctness of the annotation content is checked. If there is a annotation error, return to the previous step (i.e., the annotation dataset construction step) for modification to ensure that the final annotation data has correct semantic labels and instance labels.

[0078] (4) Run the self-developed annotation parsing code module to generate the required dataset in a specific format: the 3D CAD data is stored in step format, and the label file is stored in JSON format. The two file names correspond one to one. The label file records the semantic labels stored in the dictionary format in the annotation dataset definition step and the instance labels stored in the N*N link matrix format in the annotation dataset construction step.

[0079] (5) Read the data and corresponding labels of the above-mentioned 3D CAD model, train the semantic segmentation and instance segmentation models until convergence, and obtain a special model for processing feature recognition.

[0080] By analyzing the data definition feature types and their morphological variations of a large number of real 3D CAD models, a 3D annotation tool chain is developed and connected. The 3D drawing software SolidWorks is used to annotate the type and instance attributes of each feature. A visualization code module is developed and used to intuitively present the feature types and feature instances of the annotated data, thereby checking the validity and integrity of the annotation content. An annotation parsing code module is developed and used to parse and convert annotations into a custom JSON format.

[0081] By using this method, each processing feature is numbered and labeled. Training the processing feature recognition neural network using the labeled dataset helps improve the neural network's recognition and segmentation accuracy. Furthermore, the annotation parsing code module verifies the correctness of the labeled dataset's content, ensuring the validity and accuracy of its feature types and instances, facilitating subsequent semantic and instance segmentation.

[0082] Aggregate feature generation step S031: Aggregate the data processed in step S02 into an aggregate feature vector based on the feature encoder, the specific task encoder, the shared task encoder, and the gating network. Specifically, the aggregate feature generation step S031 may include the following steps:

[0083] Step S0311: feature encoding is performed on the geometric attribute adjacency graph, the extended adjacency matrix, the spatial position matrix, and the face-face shortest path edge chain matrix through a feature encoder.

[0084] The specific operation is as follows: Geometric information encoding includes two parts: discrete representation of surfaces and discrete representation of curves. A 2D CNN consisting of convolutional layers, pooling layers, and fully connected layers is used to process the discrete representation of surfaces. That is, CNN is used to process geometric information encoding to obtain 128-dimensional surface geometric features. A 1D CNN consisting of convolutional layers, pooling layers, and fully connected layers is used to process the discrete representation of curves to obtain 128-dimensional edge geometric features.

[0085] Extended attribute encoding includes two parts: extended attribute representation of surfaces and extended attribute representation of curves. The embedding layer processes the type of face, number of face rings, number of adjacent faces, type of edge, and convexity of the edge. The linear layer processes the area size, edge length, and dihedral angle of adjacent faces of the edge. The extended attributes of each face or edge are encoded as 32-dimensional features, which are finally aggregated with the face and edge geometric features to form 256-dimensional face feature vectors and 256-dimensional edge feature vectors respectively.

[0086] The embedding layer is used to process the three types of neighbor relationship matrices: the extended neighbor matrix, the spatial position relationship matrix, and the face-face shortest path edge chain matrix, all of which are encoded as N face ×N face ×64-dimensional features.

[0087] Step S0312: Acquire specific task features through a specific task encoder.

[0088] Step S0313: Acquire shared features of multiple tasks through a shared task encoder.

[0089] Step S0314: Generate an aggregated feature vector by aggregating the shared features and the specific task features output by the gating network.

[0090] Figure 7 FIG. 1 is another structural diagram of a feature extraction system according to an embodiment of the present invention. Figure 6 , and refer to Figure 7 , the shared task encoder in step S0313 and the specific task encoder in step S0312 are both based on the converter framework, which is different from the traditional multi-task learning framework. The traditional multi-task learning framework focuses on the processing of high-frequency tasks in multi-tasks and reduces the processing of low-frequency tasks, resulting in poor multi-task learning results or even lower results than the single-task model.

[0091] The feature extraction system in the embodiment of the present invention is composed of three encoding modules, two of which are specific task encoding modules (i.e., specific task encoders), corresponding to the subsequent semantic segmentation and instance segmentation tasks respectively, and the other is a multi-task shared encoding module (i.e., shared task encoder). Each encoding module is a graph converter, which consists of 6 layers of converter blocks, each layer including 16 self-attention modules and a feedforward neural network (FNN). The feature encoding of all nodes obtained in the previous step S0311 is fused with the neighboring relationship encoding as the network input, and the shared feature N of multiple tasks is obtained through the shared encoding module. face ×256, and at the same time obtain its own specific task feature N through the specific task encoding module face×256, finally, the shared features and the specific task features are aggregated through the weights output by the gating network to obtain the feature representation N of all graph nodes face ×256.

[0092] Unlike the traditional multi-task learning framework that directly aggregates shared feature vectors and specific task feature vectors, the present invention uses a gating network to dynamically calculate the aggregation weights of the shared task encoder and the specific task encoder, and selectively aggregates the shared feature vectors and the specific task feature vectors. The gating network uses the feature encoding of all nodes obtained in the previous step S0311 as the network input, and calculates the aggregation weights through the GCN layer, linear layer and SoftMax layer group, thereby achieving efficient fusion of shared knowledge and specific task knowledge. In the above manner, the shared task encoding and multiple specific task encodings are clearly separated. For each specific task, the gating network is used to dynamically calculate the aggregation weights of the shared task encoder and the specific task encoder, which effectively avoids harmful parameter interference between multiple specific tasks and improves the negative transfer problem of multi-task learning. At the same time, the converter framework is integrated into the feature learning of the 3D CAD model. Compared with the message passing neural network (MPNN) with limited receptive field and limited network depth, the processing feature recognition neural network in this embodiment is formed based on the above-mentioned converter framework and graph attention mechanism, which broadens the receptive field and network depth of the neural network, and improves the processing feature recognition neural network's ability to extract all and local topological geometric features of complex 3D CAD models.

[0093] Figure 8 Schematic diagram of the segmentation step S032 in the embodiment of the present invention. Figure 7 , and refer to Figure 8 , Segmentation step S032: Use a multi-task segmentation head to perform semantic segmentation and instance segmentation on the aggregated feature vector generated in the aggregated feature generation step S031. The multi-task segmentation head includes a semantic segmentation head and an instance segmentation head. The semantic segmentation head is used to distinguish the feature types of the processing features of the 3D CAD model, and the instance segmentation head is used to distinguish the feature instances of the processing features of the 3D CAD model.

[0094] Specifically, the input of the semantic segmentation head is the semantic segmentation task feature vector N face ×256, the semantic task head is a SoftMax classifier, output N face ×C-dimensional vector (N face : the number of faces, C: the number of feature types), which indicates the confidence that each face belongs to each feature type, thereby predicting the processing feature type of each face.

[0095] The input of the instance grouping head is the feature vector N obtained by aggregating the instance segmentation task feature vector and the semantic segmentation head vector. face ×384, where the semantic segmentation head vector N face ×128 is obtained by converting the output vector of the semantic segmentation head through MLP (Multi-Layer Perceptron), thereby establishing a semantic connection between the two task heads. The input feature vector is converted into two N face ×128-dimensional nodes represent vectors, and the two vectors are combined using the dot product to output an N face ×N face The link score matrix of the matrix, the element in the i-th row and j-th column represents the confidence that the i-th face and the j-th face belong to the same feature instance. After processing, the final result of instance segmentation can be obtained, thereby predicting which faces belong to the same feature instance.

[0096] Through this approach, the multi-task segmentation head can segment the feature types and feature instances of machining features in 3D CAD models, predicting the feature type of each face and the faces belonging to the same feature instance, thereby improving the efficiency of machining feature extraction and calculation. Furthermore, the semantic connection between the semantic segmentation head and the instance segmentation head indicates cross-task knowledge transfer and improves the robustness of the model.

[0097] Extraction step S033: determining feature parameters based on the processing features, and calculating and extracting feature parameters based on the feature instances and feature types of the three-dimensional CAD model segmented in the segmentation step S032.

[0098] Specifically, the corresponding feature parameters are extracted based on the feature instances and types identified in the recognition step S031 and the segmentation step S032. First, the feature parameters that affect the feature processing quotation (such as length, width, height, diameter, curvature, volume, surface area, processing direction, etc.) are defined using prior knowledge of processing. Then, based on the morphological distribution of each type of processing feature, a corresponding feature parameter calculation algorithm is designed and developed to provide a numerical basis for subsequent processing price calculation, processing technology planning, etc.

[0099] The specific operation of the extraction step S033 is described below with an example.

[0100] Taking a circular blind hole as an example, based on prior machining knowledge, the characteristic parameters of a circular blind hole are defined as the hole radius, hole depth, and machining direction. The hole radius is obtained from the geometric properties of the cylindrical surface, and the hole depth is calculated by projecting the cylindrical surface onto the cylinder's central axis. The machining direction is the direction of the cylinder's central axis.

[0101] Taking plane chamfering as an example, based on prior knowledge of machining, the characteristic parameters of plane chamfering are defined as the long side length, short side length, and normal direction. The long and short side lengths are calculated by the boundary length of the plane's projection in UV space, and the normal direction is obtained from the plane's geometric properties.

[0102] Taking the chamfer of a conical surface as an example, based on prior knowledge of machining, the characteristic parameters of a conical chamfer are defined as the outer radius, semi-apex angle, chamfer height, and chamfer center angle. The outer radius and semi-apex angle are derived from the geometric properties of the conical surface. The chamfer height is calculated by projecting the conical surface onto the center axis of the cone. The chamfer center angle is calculated from the length of the U-axis boundary of the surface projected in UV space.

[0103] Taking a rectangular through-hole as an example, based on prior knowledge of machining, the characteristic parameters of a rectangular through-hole are defined as length, width, height, and machining direction. The machining direction is calculated by taking the cross product of the normal vectors of any pair of adjacent faces. The height is calculated by projecting all faces onto the machining direction. The length and width are calculated by projecting all faces onto a plane perpendicular to the machining direction.

[0104] In this way, the features of the geometric attribute adjacency graph are extracted according to the graph encoder, and then the extracted features are input into the multi-task segmentation head, so that the multi-task segmentation head can segment the feature types and feature instances of the processing features of the 3D CAD model, thereby predicting the feature type of each face and the faces belonging to the same feature instance. Finally, the segmented features are passed into the processing feature parameter calculation module to obtain the final processing feature parameters.

[0105] <Third embodiment>

[0106] refer to Figure 6 The third embodiment of the present invention provides a feature extraction system for a three-dimensional CAD model, including: a data processing module for generating a corresponding geometric attribute adjacency graph, an extended proximity matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix based on the data of the three-dimensional CAD model; a feature extraction module for performing semantic segmentation and instance segmentation on the processing features of the three-dimensional CAD model based on the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix, and the face-to-face shortest path edge chain matrix through a processing feature recognition neural network to perform feature extraction.

[0107] Through this approach, the data processing module generates a geometric adjacency graph and novel descriptors based on the 3D CAD model, preventing loss of 3D CAD model information and ensuring the integrity of the model during data conversion. Simultaneously, the feature extraction module uses a specific neural network model to perform semantic segmentation and instance segmentation on the processed features of the geometric adjacency graph and novel descriptors, improving feature extraction accuracy.

[0108] refer to Figure 7 The feature extraction module includes: a feature encoder for encoding the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix and the face-face shortest path edge chain matrix; a specific task encoder for obtaining specific task features; a shared task encoder for obtaining shared features of multiple tasks; and a gating network for outputting weights to aggregate shared features and specific task features to generate an aggregated feature vector.

[0109] Through the above method, the feature extraction system clearly separates the shared task encoding and multiple specific task encodings. For each specific task, a gating network is used to dynamically calculate the encoding weights of the shared task encoder and the specific task encoder, effectively avoiding harmful parameter interference between specific tasks and improving the negative transfer problem of multi-task learning.

[0110] like Figure 6 As shown, the feature extraction module also includes: a multi-task segmentation head for performing semantic segmentation and instance segmentation on the aggregated feature vector, where the semantic segmentation is used to distinguish the feature types of the 3D CAD model, and the instance segmentation is used to distinguish the feature instances of the 3D CAD model.

[0111] In the above manner, the feature extraction system can predict the feature type of each face and the faces belonging to the same feature instance based on the multi-task segmentation head, thereby improving the efficiency of extracting and calculating processing features.

[0112] <Fourth embodiment>

[0113] A fourth embodiment of the present invention provides an electronic device having a computer program stored therein. When the computer program is executed by a processor of the electronic device, the above-mentioned feature extraction method of the three-dimensional CAD model is implemented.

[0114] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A feature extraction method for a 3D CAD model, characterized in that: include: A data processing step, generating a corresponding geometric attribute adjacency graph, an extended adjacency matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix based on the data of the three-dimensional CAD model; as well as The feature extraction step performs semantic segmentation and instance segmentation on the processing features of the three-dimensional CAD model based on the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix and the face-to-face shortest path edge chain matrix through a processing feature recognition neural network to perform feature extraction.

2. The feature extraction method of a 3D CAD model according to claim 1, wherein: In the data processing steps: The extended proximity matrix includes the shortest paths between adjacent faces in the face adjacency graph; The spatial position matrix includes a frequency of a ratio of each point pair within a preset interval, the point pairs being a preset number of point pairs selected from adjacent faces, the ratio of the point pairs being a ratio of a Euclidean distance of the point pairs to a diagonal length of a bounding box of the three-dimensional CAD model; The face-to-face shortest path edge chain matrix includes edge chains corresponding to the shortest paths between adjacent faces and the weighted sum of the features of each edge in the edge chains.

3. The feature extraction method of a three-dimensional CAD model according to claim 1 or 2, characterized in that: The feature extraction step comprises: Performing feature encoding on the geometric attribute adjacency graph, the extended adjacency matrix, the spatial position matrix, and the face-face shortest path edge chain matrix through a feature encoder; Obtain task-specific features through task-specific encoders; Obtaining shared features for multiple tasks through a shared task encoder; and The shared features and the specific task features are aggregated by the weights output by the gating network to generate an aggregated feature vector.

4. The feature extraction method of a three-dimensional CAD model according to any one of claim 3, characterized in that: The processing feature recognition neural network includes a multi-task segmentation head, The feature extraction step comprises: performing semantic segmentation and instance segmentation on the aggregated feature vector using the multi-task segmentation head, wherein the semantic segmentation is used to distinguish feature types of the 3D CAD model, and the instance segmentation is used to distinguish feature instances of the 3D CAD model; Feature parameters are determined based on the processing features, and feature parameters are calculated and extracted based on the feature instances and feature types of the segmented three-dimensional CAD model.

5. The feature extraction method of a 3D CAD model according to claim 1, wherein: Also includes: a step of defining a labeling data set, defining the feature type and morphological variations of the processing feature according to the feature morphologies of the plurality of three-dimensional CAD models; The step of constructing an annotation data set is to annotate each processing feature based on the feature type, the feature instance and each face of each three-dimensional CAD model to form an annotation data set to train the processing feature recognition neural network.

6. The feature extraction method of a 3D CAD model according to claim 3, wherein: In the feature extraction step, the specific task encoder and the shared task encoder are implemented based on a transformer framework.

7. A feature extraction system for a 3D CAD model, characterized in that: include: A data processing module is used to generate a corresponding geometric attribute adjacency graph, an extended proximity matrix, a spatial position matrix, and a face-to-face shortest path edge chain matrix based on the data of the three-dimensional CAD model; A feature extraction module is used to perform semantic segmentation and instance segmentation on the processing features of the three-dimensional CAD model based on the geometric attribute adjacency graph, the extended proximity matrix, the spatial position matrix and the face-to-face shortest path edge chain matrix through a processing feature recognition neural network to perform feature extraction.

8. The feature extraction system of a 3D CAD model according to claim 7, wherein: The feature extraction module includes: A feature encoder, configured to perform feature encoding on the geometric attribute adjacency graph, the extended adjacency matrix, the spatial position matrix, and the face-face shortest path edge chain matrix; Task-specific encoder, used to obtain task-specific features; A shared task encoder for obtaining shared features across multiple tasks; and The gating network is used to output weights to aggregate the shared features and the specific task features to generate an aggregated feature vector.

9. The feature extraction system of a 3D CAD model according to claim 8, wherein: The feature extraction module also includes: A multi-task segmentation head is used to perform semantic segmentation and instance segmentation on the aggregated feature vector, wherein the semantic segmentation is used to distinguish the feature types of the 3D CAD model, and the instance segmentation is used to distinguish the feature instances of the 3D CAD model.

10. An electronic device, characterized in that: The electronic device stores a computer program, and when the computer program is executed by the processor of the electronic device, the feature extraction method of the three-dimensional CAD model according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Process feature recognition method and device, equipment, storage medium and program product

    CN121030966A

  • Complex heterogeneous molded surface three-dimensional vision measurement method and system

    CN121191155A

  • Complex heterogeneous surface three-dimensional vision measurement method and system

    CN121191155B

  • CAD model visual fusion feature extraction method and system of optimal feature perspective

    CN121746876A

  • A method and system for extracting features of a CAD model visual fusion feature of an optimal feature view angle

    CN121746876B