Three-dimensional part retrieval method and system based on graph similarity search
By constructing an edge-face connectivity graph and a graph attention network ranking model, the 3D data of CAD models is directly processed, solving the problems of information loss and difficulty in capturing topological relationships in existing technologies, and achieving efficient and accurate 3D part retrieval.
Patent Information
- Application Number
- CN202511779387.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-11-28
AI Technical Summary
Existing technologies cannot fully utilize the geometric and design semantic information of computer-aided design (CAD) models and struggle to capture explicit topological relationships, resulting in low efficiency in 3D part retrieval.
A graph similarity-based search method is adopted. By constructing an edge-face connectivity graph and using the graph editing distance matrix as a supervision signal, a graph attention network ranking model is trained to directly process the 3D data of CAD models, avoiding information loss caused by data transformation and achieving self-supervised learning.
It achieves efficient and accurate 3D part retrieval, avoids reliance on manual annotation, improves the retrieval efficiency and accuracy of large-scale CAD libraries, and ensures the interpretability of retrieval results.
Smart Images

Figure CN121542482A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer graphics, specifically a method and system for retrieving three-dimensional parts based on graph similarity search. Background Technology
[0002] With the deepening of industrial digitalization, computer-aided design (CAD) technology has become a core tool for product development, leading to an explosive growth in the number of 3D CAD models. Against this backdrop, how to efficiently and accurately retrieve target parts from a vast model library to support design reuse, variant design, and knowledge mining has become a key challenge in the engineering field.
[0003] Early CAD part retrieval methods primarily relied on keyword-based or manually labeled systems. These methods not only required extensive and tedious manual intervention but were also limited by subjectivity and inconsistencies in terminology, making them unsuitable for efficient retrieval. Subsequently, researchers shifted to content-based retrieval techniques, initially relying mainly on manually designed geometric features such as boundary representations, constructing solid geometry, and shape distribution. However, these manually designed features have limited ability to represent and generalize complex 3D structures, often resulting in retrieval accuracy that falls short of practical requirements.
[0004] In recent years, the rise of deep learning has brought new breakthroughs to 3D model retrieval. Methods based on 3D deep learning and those based on multi-view rendering combined with 2D convolutional neural networks have emerged, but these methods suffer from a fundamental drawback: they typically rely on representations derived from 3D sensor data, such as point clouds, voxels, or meshes. To apply these methods, the native CAD model must be converted from parametric formats to these representations, a process that leads to the loss of crucial parametric geometric features and complete design semantic information. In other words, there is a fundamental information gap in reconstructing CAD models from point clouds or voxels. Furthermore, these methods lack the ability to model the explicit topological connections of CAD models, which are crucial for capturing design intent. Summary of the Invention
[0005] This application provides a 3D part retrieval method based on graph similarity search, which solves the technical problems of existing technologies that cannot fully utilize the geometric and design semantic information of CAD and are difficult to capture and display topological relationships, resulting in low retrieval efficiency.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, a method for retrieving 3D parts based on graph similarity search is provided, including: Acquire the 3D data of parts from computer-aided design CAD models and construct a training dataset; An edge-face connection diagram is constructed based on the three-dimensional data of the part, wherein the edge-face connection diagram uses curved surfaces as nodes and curves as edges; Calculate the graph edit distance (GED) matrix for all edge-face connectivity graphs in the training dataset, and use it as a supervision signal; The ranking model is trained based on the GED matrix, mapping the edge-face connectivity graph to the latent space, and constructing a part vector database based on the output graph-level embedding vectors; the ranking model is constructed based on a graph attention network. The CAD part to be queried is input into the trained sorting model to obtain the feature vector, and the nearest neighbor search is performed in the part vector database to return the similar part results.
[0007] Based on the above technical solutions, this application proposes a novel paradigm for 3D part retrieval based on graph similarity search, integrating graph structure modeling and self-supervised ranking learning. This effectively overcomes the reliance of existing technologies on data conversion and manual annotation, achieving efficient and accurate part retrieval at the native semantic level of CAD. Specifically, the advantages of this method are reflected in three aspects: First, by directly constructing an edge-face connection graph with surfaces as nodes and curves as edges based on the 3D data of CAD parts, this method can natively understand and utilize the precise geometric features and topological connections contained in the CAD model, avoiding the loss of design semantic information caused by converting it into intermediate forms such as point clouds or voxels, thus ensuring retrieval accuracy from the data source. Second, it innovatively uses the graph edit distance matrix as a supervision signal to train the ranking model based on graph attention networks, constructing a high-quality self-supervised learning framework. It does not require any expensive and subjective manual annotation, but drives model learning through the inherent differences in the graph structure itself, enabling the model to transform the complex graph similarity comparison problem into an efficient feature vector similarity calculation problem in the latent space. Finally, once the ranking model is trained and the part vector database is built, for a new query request, the system only needs to perform one efficient forward inference and vector nearest neighbor search to quickly return the result, which greatly improves the practicality and efficiency of large-scale CAD library retrieval.
[0008] Furthermore, the construction of the edge-face connection diagram based on the three-dimensional data of the part includes: The STEP file of the part's 3D data is parsed using an open-source geometry kernel engine. Each surface of the part's 3D data is defined as a graph node, and the curve generated by the intersection of two surfaces is defined as the edge connecting the graph nodes, resulting in an undirected edge-face connection graph. Uniform sampling is performed on the parameter domain of surfaces and curves to form grid points; Based on the grid points, the graph nodes of the edge-face connection graph are represented as two-dimensional vectors of surface features, and the edges are represented as one-dimensional vectors of curve features; Based on the one-dimensional and two-dimensional vectors, a one-dimensional convolutional neural network is used to encode the graph nodes, and a two-dimensional convolutional neural network is used to encode the edges, outputting the final node features and edge features. The edge-face connection graph is updated based on the node features and variable features.
[0009] Further, calculating the graph edit distance (GED) matrix for all edge-face connectivity graphs in the training dataset includes: The graph edit distance between every two distinct edge-face connected graphs in the training dataset is calculated by traversing the dataset. The graph edit distance is defined as the minimum total cost required to transform the first edge-face connected graph into the second edge-face connected graph through node or edge insertion, deletion, and replacement operations. Based on the graph edit distance, an N×N dimensional matrix is constructed to obtain the graph edit distance (GED) matrix; where N is the number of edge-face connected graphs.
[0010] Furthermore, after obtaining the GED matrix, the method further includes serializing and persistently storing the identifier index of the edge-face connection graph in a one-to-one correspondence with the GED matrix, so as to decouple the graph editing distance calculation from the model training process.
[0011] Further, training the ranking model based on the GED matrix includes: An end-to-end deep neural network is constructed as a ranking model; the ranking model includes a graph encoder and a projection head, which are used to extract features and learn representations from the input edge-face connectivity graph, and output a ranking vector consistent with the graph edit distance order; Using the GED matrix as a supervision signal, the training dataset is input into the ranking model, and the model is trained by optimizing the ranking loss function; the optimized ranking loss function is used to ensure that the ranking order predicted by the model for candidate parts in the latent space is consistent with the actual ranking order based on the GED matrix. After training is complete, the parameters of the trained graph encoder are saved for subsequent inference applications.
[0012] Furthermore, the optimized sorting loss function is: ;in, This is the actual sorting order obtained by sorting the graphs from smallest to largest based on the edit distance. The predicted score of the candidate part ranked kth in the real ranking data is calculated by the cosine similarity between the query vector and the vector of the candidate part. The query vector is a feature vector randomly selected in each training batch.
[0013] Furthermore, the ranking model is constructed based on a graph attention network, including: The graph encoder of the ranking model is composed of stacked multi-layer graph attention networks. It captures the multi-level topological relationships between nodes in the graph through message passing and node aggregation mechanisms to obtain the features of all nodes. The global pooling function is used to aggregate the features of all nodes to generate a graph-level embedding vector; The projector of the sorting model is a feedforward neural network that maps the graph-level embedding vectors to the sorting latent space.
[0014] Further, the nearest neighbor search in the part vector database includes: The CAD part to be queried is input into the trained image encoder to obtain the query vector; Calculate the cosine similarity between the vector to be queried and all vectors in the parts vector library; All parts in the parts vector library are sorted in descending order based on the calculated cosine similarity values to obtain the sorted list; Return the K parts with the highest values in the sorted list as the search results.
[0015] Furthermore, the 3D part retrieval method does not require any manually labeled data during training and retrieval, and completes the training of the ranking model through the self-supervised signal provided by the graph editing distance.
[0016] Secondly, a 3D parts retrieval system based on graph similarity search is provided, comprising: a data preprocessing module, a feature extraction module, a model training module, and a query retrieval module; wherein, The data preprocessing module is used to acquire the three-dimensional data of the parts in the computer-aided design CAD model and to construct a training dataset. The feature extraction module is used to construct an edge-face connection graph based on the three-dimensional data of the part, and calculate the graph edit distance (GED) matrix of all edge-face connection graphs in the training dataset as a supervision signal; wherein the edge-face connection graph uses surfaces as nodes and curves as edges; The model training module is used to train a ranking model based on the GED matrix, map the edge-face connectivity graph to the latent space, and construct a part vector database based on the output graph-level embedding vectors; the ranking model is constructed based on a graph attention network. The query and retrieval module is used to input the CAD part to be queried into the trained sorting model, obtain the feature vector, perform a nearest neighbor search in the part vector database, and return similar part results.
[0017] Compared with the prior art, the beneficial effects of this application are: This application directly parses STEP files and constructs edge-face connectivity graphs using an open-source geometry kernel engine, avoiding the information loss issues caused by converting CAD models into point clouds or meshes from the source. This ensures that key parametric features such as surface equations and constraint relationships are fully preserved, laying a data foundation for high-precision retrieval. Furthermore, the graph edit distance, a graph structure similarity metric with clear physical meaning, is transformed into a supervisory signal for training the ranking model. This not only eliminates the reliance on manual annotation and achieves high-quality self-supervised learning, but also makes the entire retrieval system interpretable, as its retrieval criteria are directly related to the editing operations on the graph structure, better aligning with the reliability requirements of decision-making in practical engineering.
[0018] At the technical implementation level, the proposed solution demonstrates high efficiency optimization and practicality. By pre-compiling and persistently storing the computationally intensive GED matrix, decoupling from the model training process is achieved, avoiding repetitive calculations in each training iteration and greatly improving overall training efficiency. The ranking model adopted is built with a graph attention network as its core, which can accurately capture the complex multi-level topological relationships between face and edge nodes in the part drawing through a message passing mechanism, thereby gaining a deep understanding of the part's design intent. Finally, the entire retrieval process is cleverly transformed into vector similarity comparison in the latent space. Through efficient cosine similarity calculation and nearest neighbor search, it enables rapid query response when facing large-scale CAD libraries, transforming the complex graph structure matching problem into an efficient vector retrieval operation, combining retrieval accuracy and application efficiency. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A system architecture diagram of a 3D parts retrieval system based on graph similarity search provided in this application embodiment; Figure 2 A flowchart illustrating a three-dimensional part retrieval method based on graph similarity search provided in an embodiment of this application; Figure 3 A flowchart illustrating another 3D part retrieval method based on graph similarity search provided in this application embodiment; Figure 4 This is a schematic diagram of the construction edge-face connection diagram provided in an embodiment of this application; Figure 5A flowchart illustrating another 3D part retrieval method based on graph similarity search provided in this application embodiment; Figure 6 This is a flowchart illustrating another three-dimensional part retrieval method based on graph similarity search provided in an embodiment of this application. Detailed Implementation
[0021] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0022] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0023] The 3D part retrieval method based on graph similarity search provided in this application embodiment can be applied to, for example... Figure 1 The illustrated 3D parts retrieval system based on graph similarity search, such as... Figure 1 As shown, the system includes: a data preprocessing module, a feature extraction module, a model training module, and a query and retrieval module; among which, The data preprocessing module is used to acquire the 3D data of parts from the computer-aided design CAD model and to construct a training dataset; The feature extraction module is used to construct the edge-face connection graph based on the 3D data of the part, and calculate the graph edit distance (GED) matrix of all edge-face connection graphs in the training dataset as a supervision signal; the edge-face connection graph uses surfaces as nodes and curves as edges; The model training module is used to train a ranking model based on the GED matrix, map the edge-face connectivity graph to the latent space, and construct a part vector database based on the output graph-level embedding vectors; the ranking model is built based on a graph attention network. The query and retrieval module is used to input the CAD part to be queried into the trained sorting model, obtain the feature vector, perform a nearest neighbor search in the part vector database, and return similar part results.
[0024] To address the fundamental information gap in point cloud / voxel reconstruction of CAD models, the lack of explicit topological connections making it difficult to capture design intent, the difficulty in obtaining annotations through supervised learning, and the poor retrieval performance due to the reliance on large amounts of data in contrastive learning, this application provides a 3D part retrieval method based on graph similarity search. This method includes: Acquire the 3D data of parts from computer-aided design CAD models and construct a training dataset; A surface-edge connection diagram is constructed based on the 3D data of the part, where the surface-edge connection diagram uses curved surfaces as nodes and curves as edges; Calculate the graph edit distance (GED) matrix for all edge-face connected graphs in the training dataset, and use it as a supervision signal; The ranking model is trained based on the GED matrix, mapping the edge-face connectivity graph to the latent space, and constructing a part vector database based on the output graph-level embedding vectors; the ranking model is constructed based on a graph attention network. The CAD part to be queried is input into the trained sorting model to obtain the feature vector, and the nearest neighbor search is performed in the part vector database to return the similar part results.
[0025] Based on this, this application does not require conversion of CAD model format, can avoid loss of parametric features, has low memory consumption and strong interpretability of search results, and can achieve efficient and accurate 3D part retrieval without manual annotation, which meets the needs of actual engineering scenarios.
[0026] like Figure 2 As shown in the embodiment of this application, a three-dimensional part retrieval method based on graph similarity search is provided, including: S1. Obtain the 3D data of the parts from the computer-aided design CAD model and construct a training dataset.
[0027] The 3D data for parts must be selected in a format that preserves geometric and topological information. Mainstream formats include STEP (Standard for the Exchange of Product Data) and IGES (Initial Graphics Exchange Specification) under the Brep boundary representation format. These two formats are compatible with mainstream CAD software such as SolidWorks, AutoCAD, and UG, and can completely store the relationships and parametric features of surfaces, curves, and vertices, providing a foundation for subsequent topology analysis. When constructing the training dataset, basic data screening must be performed first, removing files with corrupted formats or incomplete geometric information to ensure the validity of the input data.
[0028] In some implementations, data sources can include publicly available engineering datasets, enterprise historical design databases, or standard part models generated in batches using CAD software. Data filtering can be automated by using existing format validation tools to identify invalid files. If the data volume exceeds 1,000, Python scripts can be written to execute the filtering process in batches, improving efficiency.
[0029] It is important to note that the diversity of part types in the training dataset is crucial to ensuring the generalization ability of the subsequent model. If only a single type of part is included, the model will overlearn the structural features of that type of part, resulting in a significant drop in accuracy when retrieving other parts such as box-type and plate-type parts. Therefore, the dataset should cover at least three typical engineering part types, and the difference in the number of parts of each type should not exceed 30%.
[0030] S2. Construct a surface connection diagram based on the 3D data of the part, where the surface connection diagram uses curved surfaces as nodes and curves as edges.
[0031] The core function of the edge-face connection diagram is to make the topological relationships of the CAD model explicit. By mapping the structural logic of the part through the "surface-curve" association, it solves the problem of lacking topological connection relationships and difficulty in capturing design intent in existing technologies. The construction process requires first using a geometric modeling kernel to parse the surface and curve elements in the part's 3D data, and then establishing the dependency relationship between them.
[0032] In some implementations, feature extraction of surfaces and curves can be performed using existing manual feature extraction methods without relying on deep learning encoders: surface features may include surface type, surface area, and surface boundary length; curve features may include curve type, curve length, and curve curvature range; if the part structure is simple, elements with similar features can be categorized to simplify the complexity of the graph structure.
[0033] It should be noted that the topological integrity of the edge-face connectivity graph directly affects the accuracy of subsequent similarity calculations. If surface-curve associations are missed during parsing, isolated nodes or dangling edges will appear in the graph, leading to deviations in the graph editing distance calculation. Therefore, after parsing, the association coverage must be verified using a topology verification tool, requiring a coverage rate of ≥98%.
[0034] S3. Calculate the graph edit distance (GED) matrix of all edge-face connected graphs in the training dataset, and use it as a supervision signal.
[0035] Graph Edit Distance (GED) is a classic metric for measuring the similarity of graph structures. It is defined as the sum of the minimum editing operations required to transform one graph into another; the lower the cost, the higher the similarity between the two graphs. A matrix composed of the GED values of all edge-connected graphs can be used as a supervisory signal for ranking models.
[0036] In some implementations, GED calculations can employ existing classical approximation algorithms: For simple part diagrams with fewer than 30 nodes (such as bolts and washers), a graph matching approximation method based on BFS (Breadth-First Search) can be used to quickly calculate the editing cost by traversing the nodes of two graphs and matching similar features. For complex part diagrams with 30-100 nodes (such as gearbox housings), a simplified layout mapping method based on the Hungarian algorithm can be used to obtain approximate GED values by optimizing the node matching cost matrix.
[0037] It should be noted that the precise calculation of GED is an NP-hard (Non-deterministic Polynomial time-hard) problem, meaning that the computation time increases exponentially with the number of graph nodes. Therefore, approximation algorithms must be used. However, approximation algorithms need to balance accuracy and efficiency: if the algorithm is too simplified, the GED value deviation will be greater than 10%, losing the effectiveness of the supervisory signal; if the algorithm is too complex, the matrix calculation for 1000 graphs will take more than 24 hours, making it unsuitable for engineering scenarios. Therefore, an appropriate algorithm should be selected based on the graph size.
[0038] S4. Train a sorting model based on the GED matrix, map the edge-face connection graph to the latent space, and construct a part vector database based on the output graph-level embedding vector.
[0039] The ranking model is based on a graph neural network. Its core objective is to transform the edge-face connected graph into low-dimensional, dense graph-level embedding vectors, so that the distance ranking of vectors in the latent space is consistent with the true similarity ranking reflected by the GED matrix—the smaller the vector distance, the smaller the GED value of the corresponding part diagram and the higher the similarity. A graph neural network is used to build the model because existing graph neural networks can simultaneously capture the topological relationships and element features of the graph, avoiding the defect of focusing only on geometric features and ignoring topological features.
[0040] In some implementations, the ranking model can adopt existing mainstream graph neural network architectures. For example, GCN (Graph Convolutional Network) is good at aggregating local features through adjacency matrices and is suitable for parts with regular structures; GIN (Graph Isomorphism Network) distinguishes different graph structures by iteratively updating node features and is suitable for irregularly shaped parts.
[0041] It is important to note that regularization techniques must be used during model training to avoid overfitting. Overfitting manifests as a model achieving a ranking accuracy >95% on the training set, but an accuracy <60% on new part drawings. This is because the model overlearns local details of the training set images rather than general features. Common regularization techniques include Dropout, L2 regularization, and early stopping strategies, which can be used in combination in practice.
[0042] S5. Input the CAD part to be queried into the trained sorting model to obtain the feature vector, and perform a nearest neighbor search in the part vector database to return the similar part results.
[0043] In some implementations, the CAD parts to be queried need to undergo preprocessing to ensure they are homogenized with the training data, guaranteeing that their format, topological integrity, and geometric scale are consistent with the training dataset constructed by S1. After preprocessing, the edge-face connectivity graph of the parts is transformed into low-dimensional dense feature vectors using a trained ranking model. Then, relying on a part vector database, a similarity measurement algorithm is used to calculate the similarity between feature vectors, and the candidate parts with the highest similarity are selected and returned.
[0044] It should be noted that homogenization in preprocessing is a key prerequisite for retrieval accuracy. If the part to be queried is not processed according to the format and scale standard of S1, it will cause the distribution of feature vectors and training sample vectors in the database to be offset. For example, the unnormalized vector of a large-sized part will be abnormally far from the vector of a small-sized similar part, directly reducing the retrieval accuracy. Existing CAD data processing tools (such as CAD Exchanger and ParaSolid) can stably reproduce the preprocessing effect of S1, avoiding the errors caused by independent development.
[0045] Based on the above technical solutions, this application provides a 3D part retrieval method based on graph similarity search, which can not only cover the engineering needs of multiple fields such as mechanical manufacturing, aerospace, and automotive parts, but also effectively solve the core problems of geometric information gap, lack of topological relationship, difficulty in supervised annotation, and low retrieval efficiency in the prior art, providing a technical solution with strong universality and high practicality for 3D part retrieval.
[0046] In one possible implementation of this application embodiment, the above-mentioned S1 can be specifically implemented by the following S101, S102 and S103, which are described in detail below: S101. Determine the format standard and data source of the part's three-dimensional data, and screen out the CAD original files that meet the requirements.
[0047] The 3D data of the parts can be stored in the Brep (boundary representation) format, which can completely preserve the core geometric information and topological relationships of the CAD model. In this embodiment, the STEP (Standard for the Exchange of Product Data) type file is preferred as input data because it is a common CAD data exchange standard in the engineering field and its compatibility covers mainstream CAD software.
[0048] In some implementation methods, data sources can be divided into two categories: one is the enterprise's internal historical design database, which needs to filter valid design files from the past 5-10 years and exclude files whose formats have become invalid due to version iterations; the other is publicly available engineering datasets, such as PartNet and STEP-NC datasets, which need to be obtained in batches through data interfaces and duplicate or low-quality samples need to be filtered out. For Brep files that are not in STEP format (such as IGES format), open-source format conversion tools can be used to unify the format.
[0049] It should be noted that, compared with point cloud and voxel formats, the Brep format does not require the conversion of CAD models through a "sampling-reconstruction" process, thus avoiding the loss of parametric features. This is a core prerequisite for the subsequent construction of an accurate edge-face connectivity graph. If non-Brep format data is used, it will directly lead to incomplete extraction of topological relationships in step S2, affecting the accuracy of the retrieval results.
[0050] S102. Perform data cleaning and topology integrity verification on the filtered CAD files to remove invalid data.
[0051] The core objective of data cleaning is to exclude files with incomplete geometric information or abnormal topological relationships, ensuring that each CAD model input into the training dataset can be correctly parsed into an edge-face connection graph in subsequent steps. Topological integrity verification focuses on verifying whether the "face-edge-vertex" association logic is closed-loop. For example, a complete cuboid should contain 6 faces, 12 edges, and 8 vertices, and each face should be associated with 4 edges.
[0052] In some implementations, open-source geometry kernel engines (Open CASCADE Technology) can be used to achieve automated cleaning and verification, specifically including: 1. Call the kernel's BRepCheck_Analyzer module to traverse and check the topology of each STEP file, and output exception types such as "missing face" and "edge not associated with vertex". 2. Minor anomalies in files (such as unannotated edge attributes on a single face) are repaired using the kernel's BRepBuilderAPI_MakeFace module; 3. Files with severe anomalies (such as those with more than 30% of faces having no associated edges) will be directly removed; 4. Establish a cleaning log to record the "verification result - processing method - final status" of each file for easy traceability later.
[0053] S103. Divide the training dataset into structural parts and perform preprocessing to ensure data diversity and suitability.
[0054] The dataset construction needs to meet the requirements of part type diversity and subsequent model training adaptability. The former requires coverage of typical part types in the engineering field, such as shafts, boxes, plates, and disks, to avoid model overfitting caused by single-type data. The latter requires adjusting the dataset size according to the training batch requirements of the sorting model, and can optionally perform unified preprocessing.
[0055] In some implementations, preprocessing may include the following steps: (1) Based on the design attributes of the CAD file, the parts are divided into k categories, and the proportion p of each category is calculated. i (i=1,2,...,k), by supplementing or cropping the sample, the difference in the proportion of each category does not exceed 10%; (2) Read the length unit in the CAD file and convert it to millimeters (mm) commonly used in engineering; and normalize the geometric dimensions of the parts.
[0056] (3) Divide the dataset. If the sample size is large (e.g., more than 5,000), it can be divided into a training subset and a validation subset in a 9:1 ratio. The validation subset is used to evaluate the training effect of the ranking model in the subsequent step S4.
[0057] Furthermore, to quantify the diversity of the dataset, a formula for calculating the entropy of part type distribution is introduced: ;in, Let H represent the sample proportion of the i-th type of parts. The value of H ranges from [0, log2k]. The closer H is to log2k, the more uniform the distribution of data types and the better the diversity.
[0058] It should be noted that although this application does not have mandatory requirements for data augmentation strategies, unit unification and scale normalization can avoid the model becoming size-sensitive due to differences in size magnitude, thereby improving the generalization ability during retrieval; while the calculation of distribution entropy provides a quantitative basis for the diversity of the dataset, avoiding biased learning of the model due to the excessive proportion of a certain type of part.
[0059] Based on the above technical solution, S1 provides a high-quality, highly diverse, and highly adaptable CAD data foundation for S2 to construct the edge-face connection diagram, S3 to calculate the GED matrix, and S4 to train the sorting model, ensuring the accuracy and reliability of the 3D part retrieval method from the data source.
[0060] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, the above S2 can be implemented through the following S201, S202 and S203, which are explained in detail below: S201: Based on an open-source geometric kernel, it parses Brep format CAD files, extracts the topological relationships between surfaces and curves, and constructs an undirected graph framework.
[0061] In this context, nodes of an undirected graph are predefined as surfaces in a CAD model, and edges are predefined as curves formed by the intersection of two surfaces.
[0062] In some implementations, the Open CASCADE Technology (OCC) geometry kernel can be used to complete automated parsing and topology extraction. The specific process is as follows: 1. Call the OCC's BRepTools::Read module to read the STEP file and load the CAD model as a kernel-recognizable TopoDS_Shape topology object; 2. Use the TopExp_Explorer tool to traverse the two types of topological elements, TopAbs_FACE (surface) and TopAbs_EDGE (curve), and assign a unique ID (such as F01, F02...) to each surface and a unique ID (such as E01, E02...) to each curve. 3. Call the BRepTopAdaptor_FClass2d module to determine if each curve is the intersection of two surfaces: If curve E belongs to surface F... i and surface F j Then, establish F in the undirected graph. i With F j The edge between them, and the attribute of the edge associated with the ID of curve E; 4. Special cases (such as "virtual edges" formed by a surface being tangent to itself, and isolated surfaces) are marked. Virtual edges are not included in the edge set, and isolated surfaces are retained as nodes.
[0063] It should be noted that the accuracy of topological relationships directly determines the validity of the edge-face connectivity graph. For example, if face-edge associations are missed, isolated nodes or missing edges will appear in the graph structure, which will lead to deviations in the subsequent graph edit distance (GED) calculation. Therefore, after parsing, the topological integrity needs to be verified a second time using BRepCheck_Analyzer to ensure that the edge-face association coverage is ≥99%.
[0064] S202. Calculate the original geometric features of the surface and curve, and generate feature vectors through parameter domain sampling.
[0065] In this process, the nodes (surfaces) and edges (curves) of the edge-face connection graph need to carry geometric feature information to distinguish different structures. This step calculates the core features through the geometric kernel and transforms the continuous features into discrete vectors through uniform sampling in the parameter domain, providing structured input for subsequent encoding.
[0066] In some implementations, such as Figure 4 As shown, the calculation process for the original geometric features includes: (1) Calculation of original features of the surface Uniform sampling is performed on the UV parameter domain of the surface (U∈[0,1], V∈[0,1]), with the number of sampling points set to N, resulting in the UV coordinates of N sampling points {(u1,v1),(u2,v2),…,(u N ,v N )}; For each sampling point, the mean curvature (H) and Gaussian curvature (K) are calculated using the Geom_Surface module of OCC. The mean curvature reflects the local unevenness of the surface, while the Gaussian curvature reflects the overall bending trend of the surface. Arrange the (H,K) pairs of N sampling points in UV order to form the original feature vector of the surface, which has a dimension of N×2, as expressed by the formula: ;in, The original feature vector of the surface. , Let be the average curvature and Gaussian curvature of the i-th sampling point, respectively.
[0067] (2) Calculation of the original characteristics of the curve
[0068] Uniform sampling is performed on the parameter domain (t∈[0,1]) of the curve, with the number of sampling points set to M, resulting in the parameter coordinates {t1,t2,…,t} of the M sampling points. M}; For each sampling point, the radius of curvature (R) is calculated using the Geom_Curve module of OCC, reflecting the degree of curvature of the curve; Arrange the radii of curvature of the M sampling points in parameter order to form the original feature vector of the curve, which has a dimension of M×1, and is expressed by the formula: ;in, R is the original eigenvector of the curve. i Let be the radius of curvature of the i-th sampling point.
[0069] S203. Use a convolutional neural network of the corresponding dimension to encode the original features and generate the final attributes of graph nodes and edges.
[0070] Among them, the two-dimensional original feature vector (N×2) of the surface and the one-dimensional original feature vector (M×1) of the curve need to be compressed and abstracted by a convolutional network to transform the high-dimensional discrete vector into low-dimensional, dense semantic features, which serve as the final attributes of the edge-face connection graph nodes and edges, and adapt to the input requirements of the subsequent graph attention network (GAT).
[0071] In some implementations, a surface 2D convolutional encoder and a curve 1D convolutional encoder are used to compress, abstract, and unify the two-dimensional original geometric feature vectors of the surface and the one-dimensional original geometric feature vectors of the curve, generating the final semantic features of graph nodes and edges that are adapted to the subsequent graph attention network. The surface 2D convolutional encoder targets the original features of the surface, employing two 2D convolutional layers to progressively extract local geometric correlation features. Then, a global average pooling layer compresses the high-dimensional feature map into fixed-dimensional surface node features. Let the original surface feature vector be S, and the encoded node features be h. v Then the two-dimensional encoding formula is: ,in, , These are the 1st and 2nd layer 2D convolution operations, respectively. For activation function, This is a global average pooling operation; The curve 1D convolutional encoder uses two 1D convolutional layers to capture the curvature trend of the curve, and then compresses it into fixed-dimensional curve edge features through a global average pooling layer. Let the original feature vector of the curve be C, and the encoded feature be h. e Then the one-dimensional encoding formula is: ,in, , These are the 1D convolution operations for the first and second layers, respectively.
[0072] The processing of both types of encoders preserves the core geometric properties of surfaces and curves while transforming discrete original features into low-dimensional dense semantic vectors. This avoids a decrease in the efficiency of subsequent graph structure learning due to inconsistent or redundant feature dimensions, and provides structured input for the fusion of topological relationships and geometric features of edge-face connection graphs.
[0073] Based on the above technical solution, S2 extracts topological relationships, calculates original features, and encodes convolutional features to completely transform the geometric information and structural logic of the CAD model into a semantically connected edge-face graph. This graph retains the parametric features of the Brep format (such as surface curvature and curve radius) and explicitly expresses topological connections (such as face-edge adjacency) through graph structure. This provides quantifiable and comparable graph data for S3 to calculate the GED matrix, and provides structured input adapted to the GAT network for S4 to train the ranking model. From the perspective of data form conversion, it solves the problems of lost topological relationships and uninterpretable features in existing technologies.
[0074] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 5 As shown, the above S3 can be implemented through the following S301, S302 and S303, which are explained in detail below: S301. Calculate the graph edit distance (GED) of any two edge-face connected graphs using an efficient approximation algorithm.
[0075] Among them, graph edit distance (GED) is a core indicator for measuring the structural similarity of two graphs, defined as "the distance between two graphs edited by the graph edit distance". i Convert to graph G j The total cost of the minimum required editing operations (insertion, deletion, and replacement of nodes / edges). Since exact calculation of GED is an NP-hard problem, this step requires an approximate algorithm to balance computational accuracy and efficiency, providing a feasible GED solution for large-scale training datasets.
[0076] In some implementations, GED approximation calculations can be performed based on the PyGEDLib open-source framework. The specific process and cost definitions are as follows: First, the edge-face connection graph constructed by S2 is converted into the Graph format supported by PyGEDLib, where the node type is labeled as surface and the edge type is labeled as curve; Next, a dynamic cost based on feature similarity is used to define the cost of the editing operation, and the specific formula is as follows: The cost function for node replacement is: ,in Cosine similarity; The cost function for edge replacement cost is: ; Since insertion or deletion operations completely change the graph structure, the cost of inserting or deleting a node or edge is fixed at 1. Then, the PyGEDLib's ged::approximation::AStar algorithm is called to explore graph G. i With G jThe suboptimal mapping relationship is used to output the minimum total editing cost as an approximate GED value, expressed by the formula: ;in, It is a set of editing operations (including insertion, deletion, and replacement). Let x and y be the operation type, x and y be the operation objects (nodes or edges), and c(·) be the cost of the corresponding operation. This represents taking the minimum total cost among all possible operations.
[0077] S302. Traverse the training dataset and construct an N×N symmetric GED matrix.
[0078] The training dataset contains N edge-face connection graphs, denoted as G0, G1, ..., G... n-1 This step requires traversing all graph pairs (G). i G j ) Calculate the GED value, utilizing the symmetry of GED (d ij =d ji ) and self-distance is zero (d ii =0) Construct a symmetric matrix to fully encapsulate the pairwise similarity relationships of the graph structure within the training set.
[0079] In some implementations, an upper triangular traversal can be used to optimize and reduce computation. The specific process is as follows: 1. Initialize an N×N dimensional all-zero matrix M; 2. Traverse index i from 0 to N-1, and for each i, traverse index j from i+1 to N-1; 3. Use the approximation algorithm of S301 to calculate d. ij Assign the value M[i][j]=d ij ; 4. Assign values M[j][i]=d using symmetry. ij ; 5. Keep M[i][i]=0.
[0080] This optimization algorithm can reduce the computational cost from N² to N(N-1) / 2 times. When N=1000, the computational cost is reduced from 1... The next drop was ~5×1 This time, efficiency is increased by 50%.
[0081] In some implementations, the elements of the GED matrix are defined by the following formula: ,and Where M is an N×N dimensional GED matrix, and M[i][j] represents graph G i The row / column indices of the matrix correspond one-to-one with the identifiers (IDs) of the graphs in the training set, corresponding to the approximate GED values of graph G=j.
[0082] S303. Persistently store the GED matrix and graph identifier index to decouple computation from training.
[0083] Among them, the GED calculation in S301-S302 is a computationally intensive task. If the calculation is repeated for each model training, the efficiency will be severely reduced. This step saves the GED matrix and graph identifier index (the mapping relationship between graph ID and matrix row / column index) as a structured file through persistent storage, so as to realize one calculation and multiple uses, and provide a supervision signal for quick access to the model training in S4.
[0084] In some implementations, the GED matrix file is stored in NumPy array format, and the graph identifier index file is stored in CSV format. After saving, the files are read for verification, and the symmetry of the matrix is calculated. Ensure the data is not corrupted and the symmetry must be ≤1e-5.
[0085] Based on the above technical solution, S3 solves the technical problems of large computational overhead of GED and difficulty in obtaining supervision signals in the prior art by using GED approximation calculation, symmetric matrix construction and persistent storage. The final output GED matrix becomes the key supervision signal for learning distance to maintain embedding in S4, ensuring that the ordering relationship of vector distance in the latent space is consistent with the true similarity of the graph structure, thus laying the foundation for high-precision retrieval.
[0086] In one possible implementation of this application embodiment, the above-mentioned S4 specifically includes the following S401 to S403: S401. Architecture design and parameter initialization of the sorting model.
[0087] The ranking model is an end-to-end deep neural network, which consists of two core parts: a graph encoder backbone network and a projection head auxiliary training module. The graph encoder is responsible for extracting multi-level topological and geometric features from the edge-face connected graph and generating graph-level embedding vectors. The projection head is responsible for nonlinearly mapping the embedding vectors to a latent space suitable for ranking learning. The two work together to achieve accurate conversion from graph structure to vector representation.
[0088] In some implementations, the network structure of the ranking model includes: (1) Graphic encoder The graph encoder employs a three-layer graph attention network (GAT), which uses an attention mechanism to focus on key nodes and edges, capturing the local and global relationships of the graph structure. The specific design of each layer is as follows: First, the edge-to-surface connection graph output by S2 is received using the input layer; Then, multi-head attention is used to calculate the attention matrix to improve feature robustness. The formula for calculating the node attention weights in layer GAT is: ;in, Let be the attention score of node i to node j in layer l. For attention weight vectors, The linear transformation matrix of the node features. The edge feature weight vector; This represents vector concatenation. For the first Embedding of layer node i The edge features between nodes i and j; The attention weights are normalized. Let i be the set of neighboring nodes of node i; Then, the embeddings of node i in the l-th layer are obtained by weighting and summing the results according to the attention weights. ; After embedding the output nodes of the three-layer GAT, the average pooling method is used to summarize them into a graph-level embedding vector. The formula is as follows: Where V is the total number of nodes in the edge-face connection graph. is the embedding of node i from the output of the third layer GAT, and g is the graph-level embedding vector.
[0089] (2) Projector head
[0090] The projection head is a small feedforward neural network (MLP) used to map graph-level embedding vectors to the latent space, and its structure may include: First layer: Input dimension 128 → Output dimension 256, activation function ReLU, weight initialization uses He normal distribution; Second layer: Input dimension 256 → Output dimension 256, no activation function, weight initialization uses Xavier normal distribution.
[0091] S402, Definition of Training Objectives and Optimization of Ranking Loss.
[0092] Because the absolute value of GED fluctuates greatly and regression is prone to deviate from the retrieval requirements, the training objective of the model is not to regress the GED value, but to learn the distance-preserving embedding—to make the cosine similarity ranking of vectors in the latent space consistent with the ranking of the GED matrix calculated by S3; the training uses ranking loss as the optimization objective and the GED matrix as the supervision signal.
[0093] In some implementations, the training process and loss calculation details are as follows: Each training iteration samples one query sample G from the training set. q and n candidate samples (G1, G2, ..., G n (n=5~10), forming one batch; Based on the GED matrix, the candidate samples are sorted in ascending order of GED to obtain the true ranking. ; Input all samples in the batch into the model to obtain their respective latent vectors. Then, the cosine similarity between the query vector and each candidate vector is calculated as the prediction score: ;in, For G i Compared to G q The predicted scores are used to determine the similarity; higher scores indicate higher similarity. The predicted ranking is then obtained by sorting the predicted scores. .
[0094] The ranking loss of a ranking model aims to minimize the deviation between the predicted and actual rankings, and is expressed by the following formula: ;in, The predicted score of the k-th candidate sample in the true permutation is... ; First item The second item is used to encourage samples with high true similarity to the actual sample to have higher prediction scores. This is used to suppress excessively high predicted scores for samples with low actual similarity, ensuring the correct sorting order; the smaller L is, the more consistent the predicted arrangement is with the actual arrangement.
[0095] It should be noted that ranking loss, compared to regression losses such as mean squared error (MSE), is more in line with the core needs of retrieval scenarios: retrieval focuses on the relative similarity order between samples, rather than the absolute value of similarity; if MSE is used to regress GED, the model is prone to bias towards samples with large GED due to the difference in the range of GED values, thus reducing retrieval accuracy.
[0096] S403. Model training completed and part vector database constructed.
[0097] After training, only the graph encoder is retained (the projection head is a training auxiliary module and does not need to be used during inference). The graph encoder is used to generate graph-level embedding vectors of all edge-face connection graphs in the training set, and a high-efficiency retrieval part vector database is constructed.
[0098] In some implementations, the specific process of step S403 is as follows: After training, discard the MLP parameters of the projection head and save only the parameters of the graph encoder in the PyTorch ".pth" file format, which includes the weights of the GAT layer, attention vectors, edge feature weights, etc. Then load the saved graph encoder, input multiple test edge-face connection graphs, and verify whether the error between the output graph-level embedding vector and the vector at the end of training is less than 1e-5, to ensure that the parameters are not corrupted. Next, iterate through all N edge-face connection graphs in the training set, input them one by one into the saved graph encoder, and output graph-level embedding vectors; associate each vector with the corresponding CAD file identifier to form a "vector-identifier" mapping table; Finally, the FAISS (Facebook AI Similarity Search) library was used to build a vector index, selecting the "IVF_FLAT" index type: Cluster the graph-level embedded vectors and construct an inverted index; associate the vectors with a "vector-identifier" mapping table and save the index file; Finally, 100 query vectors were randomly selected to test whether the retrieval response time was ≤50ms and the recall rate was ≥95%.
[0099] It should be noted that there are two reasons for saving only the graph encoder: First, the role of the projection head is to map the graph-level embedding vectors to the latent space suitable for the ranking loss. After training, the graph encoder has learned enough similarity features, and the graph-level embedding vectors directly output can meet the retrieval requirements. Second, discarding the projection head can reduce the model storage volume, which meets the requirements of lightweight inference.
[0100] Based on the above technical solution, S4 learns the distance-preserving embedding from the edge-face connected graph to the low-dimensional latent space through a ranking model built on a graph attention network (GAT). This ensures that the cosine similarity ranking of any two part graph embedding vectors in the latent space is highly consistent with the ranking of the real graph structure similarity defined by the graph edit distance (GED) matrix. No additional manual annotation is required; model training can be completed using the natural supervision signal provided by the GED matrix. This avoids the drawbacks of traditional supervised learning, such as high manual annotation costs and scarce labeled samples, and comparative learning, which relies on large amounts of data. It achieves a paradigm innovation in 3D part retrieval, moving from complex graph structure similarity calculation to efficient vector retrieval. It transforms the originally NP-hard graph edit distance calculation into a low-complexity vector similarity comparison. The resulting part vector database can store the graph-level embedding vectors of all parts in the training set, providing a structured and highly compatible vector data foundation for the subsequent part retrieval in S5. It supports millisecond-level nearest neighbor search, ensuring the efficiency of the retrieval process and the accuracy of similarity results.
[0101] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 6 As shown, the above S5 specifically includes the following S501 to S503: S501. Perform format unification and topology integrity preprocessing on the CAD parts to be queried.
[0102] The CAD parts to be queried may come from different engineering scenarios, with differences in format or topological integrity. They need to be preprocessed to be transformed into valid data of the same origin as the training data in S1 and the edge-face connection graph in S2, so as to avoid feature extraction errors due to data format or topological deviations. The core of the preprocessing includes two steps: format unification and topology verification. The same preprocessing method as step S1 is used to ensure that the part data input to subsequent steps meets the input requirements of the graph encoder.
[0103] S502. Generate the graph-level embedding vector of the part to be queried based on the trained graph encoder.
[0104] The core of this step is to reuse the graph encoder trained and saved by S4, and transform the edge-face connection graph of the part to be queried after preprocessing by S501 into a graph-level embedding vector with the same dimension as the training data, so as to realize the mapping from the part to be queried to the vector representation and provide input for subsequent vector retrieval.
[0105] In some implementations, the vector generation process includes three sub-steps: edge-face connectivity graph construction, graph encoder invocation, and vector normalization. The specific operation steps are shown in S2-S5.
[0106] S503. Perform a nearest neighbor search in the part vector database and return the results sorted by similarity.
[0107] This step utilizes the part vector database built by S403. By calculating the similarity between the query feature vector and all training sample vectors in the database, the candidate parts with the highest similarity are selected and returned in descending order of similarity, providing engineers with a reference for design reuse.
[0108] In some implementations, the search and result return process specifically includes: 1. Similarity Calculation: Cosine similarity is used as the metric to calculate the query feature vector z. q With the sample vector z in the database i The similarity of (i=1,2,...,N, where N is the number of training samples) is calculated using the following formula: ;because and After L2 normalization, the formula can be simplified to: (i.e., vector dot product), with a value range of [-1, 1] - the larger the value, the higher the graph structure similarity between the two parts, corresponding to a smaller GED value in S3; 2. Top-K Filtering: The number of returned results, K, is set according to engineering requirements. Results are sorted in descending order of similarity to select the Top-K candidate samples. Simultaneously, reliability is enhanced through reverse verification using GED values—the GED values of the corresponding image of the queried part and the Top-K candidate sample images are extracted from the GED matrix stored in S3. If the similarity of a candidate sample is ≥0.7 but its GED value is >1.5 times the average GED value of the training set, it is judged as "false similarity" and removed, replaced by the next high-similarity sample. 3. Enhanced Results: To facilitate understanding by engineers, the returned results include part identifiers (such as STEP file names) and similarity scores, along with additional structural feature descriptions—automatically generated by parsing the node / edge features of the edge-surface connection graph, such as the number of surface types and the distribution of curve curvature.
[0109] Based on the above technical solutions, S5 balances retrieval speed and scenario adaptability through vector retrieval technology, covering different retrieval needs such as regular parts, irregular parts, and small-batch and large-scale operations. This step connects the technical chain of S1-S4, ultimately solving the problems of slow retrieval speed, uninterpretable results, and poor adaptability in existing technologies. It provides an efficient, accurate, and easy-to-use solution for 3D part retrieval in fields such as mechanical design and aerospace, meeting the needs of actual engineering scenarios.
[0110] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0111] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and modifications.
Claims
1. A three-dimensional part retrieval method based on graph similarity search, characterized in that, The method comprises the following steps: obtain the three-dimensional data of a part from a computer-aided design (CAD) model, and build a training data set; build an edge-face connection graph based on the three-dimensional data of the part, wherein the edge-face connection graph takes a curved surface as a node and a curve as an edge; calculate a graph edit distance (GED) matrix of all edge-face connection graphs in the training data set as a supervision signal; train a ranking model based on the GED matrix, map the edge-face connection graph to a hidden space, and build a part vector database according to the output graph-level embedding vector; the ranking model is built based on a graph attention network; input a CAD part to be queried into the trained ranking model to obtain a feature vector, and perform a nearest neighbor search in the part vector database to return a similar part result.
2. The three-dimensional part retrieval method based on graph similarity search according to claim 1, wherein, The step of building an edge-face connection graph based on the three-dimensional data of the part comprises the following steps: use an open-source geometry kernel engine to parse a STEP file of the three-dimensional data of the part, define each curved surface of the three-dimensional data of the part as a graph node, define a curve generated by the intersection of two curved surfaces as an edge connecting the graph nodes, and obtain an undirected edge-face connection graph; uniformly sample the parametric domain of the curved surface and the curve to form a grid point; according to the grid point, represent a graph node of the edge-face connection graph as a two-dimensional vector of a curved surface feature, and represent an edge as a one-dimensional vector of a curve feature; according to the one-dimensional vector and the two-dimensional vector, encode the graph node using a one-dimensional convolutional neural network, and encode the edge using a two-dimensional convolutional neural network, and output the final node feature and edge feature; update the edge-face connection graph according to the node feature and the edge feature.
3. The three-dimensional part retrieval method based on graph similarity search according to claim 1, wherein, The step of calculating a graph edit distance (GED) matrix of all edge-face connection graphs in the training data set comprises the following steps: calculate the graph edit distance between each two different edge-face connection graphs in the training data set; the graph edit distance is defined as the minimum total cost required to transform a first edge-face connection graph into a second edge-face connection graph through node or edge insertion, deletion or replacement operations; based on the graph edit distance, build an N×N matrix to obtain a graph edit distance (GED) matrix; wherein N is the number of edge-face connection graphs.
4. The three-dimensional part retrieval method based on graph similarity search according to claim 3, wherein, After obtaining the GED matrix, the method further comprises the following steps:
5. The three-dimensional part retrieval method based on graph similarity search according to claim 1, wherein, index the edge-face connection graph with the GED matrix one by one, and then perform serialization and persistent storage to decouple the graph edit distance calculation and the model training process. The step of training a ranking model based on the GED matrix comprises the following steps: build an end-to-end deep neural network as a ranking model; the ranking model comprises a graph encoder and a projection head, which are used for feature extraction and representation learning of the input edge-face connection graph, and output a ranking vector consistent with the graph edit distance order; input the training data set into the ranking model with the GED matrix as a supervision signal, and train the model by optimizing a ranking loss function; the optimization of the ranking loss function is used to make the model keep the predicted ranking order of the candidate part consistent with the real ranking order based on the GED matrix in the hidden space; 6. The three-dimensional part retrieval method based on graph similarity search according to claim 5, wherein, The optimization ranking loss function is: ; wherein, is the real arrangement order obtained from small to large according to the graph edit distance, is the predicted score of the ranking model for the candidate part ranked in the kth position in the real arrangement data, and the predicted score is calculated by the cosine similarity of the query vector and the vector of the candidate part. The query vector is a feature vector randomly selected in each training batch.
7. The three-dimensional part retrieval method based on graph similarity search according to claim 1, wherein, after the training is completed, save the parameters of the trained graph encoder for subsequent inference applications. The step of building the ranking model based on a graph attention network comprises the following steps: The graph encoder of the ranking model is stacked by a multi-layer graph attention network, and a multi-level topological relationship between nodes in the graph is captured by a message passing and node aggregation mechanism to obtain all node features; A global pooling function is used to aggregate all node features to generate a graph-level embedding vector; The projection head of the ranking model is a feedforward neural network that maps the graph-level embedding vector to a ranking hidden space.
8. The three-dimensional part retrieval method based on graph similarity search according to claim 1, wherein, The nearest neighbor search in the part vector database includes: Input the CAD part to be queried into the trained graph encoder to obtain a query vector; Calculate the cosine similarity of the query vector and all vectors in the part vector library; According to the calculated cosine similarity value, all parts in the part vector library are arranged in descending order to obtain a ranking list; Return the K parts with the highest values in the ranking list as the retrieval result.
9. The three-dimensional part retrieval method based on graph similarity search according to claim 1, wherein, The method does not require any manually labeled data in the training and retrieval process, and the training of the ranking model is completed by the self-supervised signal provided by the graph edit distance.
10. A three-dimensional part retrieval system based on graph similarity search, characterized by, It includes: A data preprocessing module, a feature extraction module, a model training module, and a query retrieval module; wherein The data preprocessing module is used to obtain the three-dimensional data of the parts of the computer-aided design (CAD) model and construct a training data set; The feature extraction module is used to construct an edge-face connection graph based on the three-dimensional data of the parts and calculate the graph edit distance (GED) matrix of all edge-face connection graphs in the training data set as a supervision signal; wherein the edge-face connection graph takes a surface as a node and a curve as an edge; The model training module is used to train a ranking model based on the GED matrix, map the edge-face connection graph to a hidden space, and construct a part vector database according to the output graph-level embedding vector; the ranking model is constructed based on a graph attention network; The query retrieval module is used to input the CAD part to be queried into the trained ranking model to obtain a feature vector, and perform a nearest neighbor search in the part vector database to return similar part results.
Citation Information
Patent Citations
Three-dimensional CAD model similar structure retrieval method based on local feature expression
CN115170842A
Molecular formula retrieval method for graph similarity calculation based on context attention
CN118213013A
Graph similarity search method based on sub-graph matching
CN119415744A
System and method for optimized evolutionary neural architecture search
US20250131285A1
Cited By
Data feature extraction method and system for aero-engine component characteristic map
CN122332931A