Geometric feature recognition method based on graph structure data and neural network

Through the geometric feature recognition method based on graph structure data and neural network, the time-consuming and manpower problems of manual drawing of 2D geometric features are solved, and the geometric features of mechanical parts are quickly extracted, and the automation level of design and manufacturing processes is improved.

CN119942581AInactive Publication Date: 2025-05-06SHANGHAI SHEXU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510028382.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, manual drawing of 2D drawings of three-dimensional geometric features is time-consuming and requires a lot of manpower, and the code composed of logical rules is difficult to cope with changing artificial design features or falling into endless manual coding due to the continuous update of features.

Method used

A geometric feature recognition method based on graph structure data and neural network is adopted. By representing parts as graph structure data, defining faces, concave edges and convex edges, a feature extraction method is constructed, and a graph neural network is used to quickly extract geometric features on mechanical parts.

Benefits of technology

It realizes rapid extraction of geometric features of mechanical parts, reduces the time and labor cost of manual drawing of two-dimensional drawings, can flexibly respond to changes and updates of design features, and improves the automation level of design and manufacturing processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942581A_ABST
    Figure CN119942581A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of artificial intelligence and computer aided design, and provides a geometric feature recognition method based on graph structure data and a neural network, which comprises the following steps: S1, representing a part by graph structure data, representing a mechanical part by graph structure data according to a direction vector, a definition surface, a concave edge and a convex edge, a feature extraction method is constructed; s2, according to the feature extraction method in the S1, constructing samples, and dividing the samples into a support set and a query set; the support set comprises a small number of samples of each category and is used for constructing a prototype; the query set contains more samples and is used for testing the classification performance of the model; and calculating a loss function according to the prediction category and the real category of the samples in the query set, and optimizing parameters of the graph neural network through a back propagation algorithm. According to the existing geometric data and labels of the parts, the neural network can be trained to quickly extract the geometric features on the mechanical parts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence and computer-aided design, and in particular to a geometric feature recognition method based on graph structure data and neural network. Background Art

[0002] Mechanical parts are basic components used in mechanical equipment to complete specific functions. They are essential components of mechanical systems and are usually manufactured and assembled into complete machines or equipment through processing, assembly, etc. Mechanical parts can be made of metal, plastic, ceramic and other materials, and have different shapes, sizes, strengths and precisions according to different usage requirements.

[0003] Mechanical parts are widely used in the fields of mechanical design, manufacturing and processing. Usually, a single mechanical part contains multiple geometric features, which are used to identify the function and processing method of the part, such as grooves, bosses, circular holes, etc. More complex mechanical parts may contain complex geometric features composed of multiple faces.

[0004] The geometric features of mechanical parts usually refer to the shape, size, surface quality, structural characteristics, etc. of the parts, which can be expressed by geometric shapes, dimensioning, symbols, etc. They directly affect the function, processing method and assembly accuracy of the parts. The geometric features determine the function and working performance of the parts. By identifying and designing the correct geometric shapes, the performance and reliability of the parts can be guaranteed. The identification of geometric features can help manufacturing engineers accurately select the appropriate processing technology and formulate detailed processing plans. For complex geometric features, especially curved surfaces and complex hole systems, reasonable path planning is required during CNC machining. By identifying and reasonably designing the geometric features of parts in advance, the errors that may occur in the manufacturing process can be effectively reduced.

[0005] In the process of mechanical parts design and manufacturing, these features often need to be specially marked or drawn separately. Most of the existing drawings are drawn manually through software. Manually drawing two-dimensional drawings of these three-dimensional geometric features is not only time-consuming and requires a lot of manpower, but the code composed of logical rules is difficult to cope with the ever-changing human-designed features, or it falls into endless manual coding work due to the continuous updating of features. Therefore, it is particularly important to develop a set of geometric feature recognition methods that are universal, simple, and sustainable. Summary of the invention

[0006] The purpose of the present invention is to provide a geometric feature recognition method based on graph structure data and neural networks, so as to solve the problem in the prior art that manually drawing two-dimensional drawings of three-dimensional geometric features is not only time-consuming and requires a lot of manpower, but the code composed of logical rules is difficult to cope with the ever-changing human-designed features, or falls into endless manual coding work due to the continuous updating of features.

[0007] To achieve the above object, the present invention provides the following technical solution: In a first aspect, the present invention provides a geometric feature recognition method based on graph structure data and a neural network, comprising the following steps:

[0008] S1, the part is represented by a graph structure data, and the surface, concave edge and convex edge are defined according to the direction vector, and a mechanical part is represented by a graph structure data, so as to construct a feature extraction method;

[0009] S2, construct samples according to the feature extraction method in S1. The samples are divided into support set and query set. The support set contains a small number of samples of each category, which are used to build the prototype; the query set contains more samples, which are used to test the classification performance of the model.

[0010] According to the predicted categories and true categories of the samples in the query set, the loss function is calculated, and the parameters of the graph neural network are optimized through the back propagation algorithm.

[0011] Preferably, the direction vectors of the mid-surface S1 are all directed outwards.

[0012] Preferably, in S1, if the direction vectors of the two surfaces are opposite, they are defined as concave edges, otherwise they are defined as convex edges.

[0013] Preferably, in S1, by sequentially connecting convex edges and concave edges, a graph of simple features can be obtained. For complex geometric features, there are the following three processing methods:

[0014] ① For the subgraph composed of concave edges, one or more extensions based on convex edges are performed, and the faces that have a convex edge connection with the subgraph composed of the red faces are added to the subgraph, thus forming a complex feature composed of all faces. On this basis, another extension based on convex edges is performed to obtain a geometric body;

[0015] ② Connect multiple adjacent subgraphs consisting of only concave edges to obtain a new subgraph;

[0016] ③. Use the above two methods alternately.

[0017] Preferably, the prototype construction method of the support set in S2 is as follows:

[0018] For each category, the mean of the feature vectors of all samples in the support set is calculated to obtain the prototype of the category; this prototype can be regarded as the central representation of the category and is used for subsequent classification tasks.

[0019] Preferably, the method for testing the classification performance of the model by querying the set in S2 is as follows:

[0020] For each sample in the query set, the distance between its feature vector and each category prototype is calculated, and the category with a closer distance is considered to be the predicted category of the sample.

[0021] Preferably, the distance type between the feature vector and each category prototype is Euclidean distance or cosine distance;

[0022] The calculation formula of the Euclidean distance is:

[0023]

[0024] Among them, x1, x2, y1 and y2 are the coordinates of two points in each dimension;

[0025] The calculation formula of the cosine distance is:

[0026] Cosine Distance(A,B)=1-Cosine Similarity(A,B);

[0027] Among them, Cosine Distance(A,B) is the cosine distance, Cosine Similarity(A,B) is the cosine similarity, and A and B are two vectors.

[0028] Preferably, the method of calculating the loss function in S2 is cross entropy loss, and the calculation formula of the cross entropy loss is:

[0029]

[0030] Among them, y i is the one-hot encoding of the true label, It represents the probability that the sample predicted by the model belongs to category i.

[0031] The second aspect of the present invention provides an application of the geometric feature recognition method described in the first aspect of the present invention, and the geometric feature recognition method can assist mechanical industry designers to quickly extract specific geometric features of mechanical parts and generate two-dimensional drawings.

[0032] The present invention has at least the following beneficial effects:

[0033] (1) The present invention provides a geometric feature recognition method based on graph structure data and neural network. According to the existing part geometric data and labels, the neural network can be trained to quickly extract the geometric features on the mechanical parts;

[0034] (2) The present invention provides a geometric feature recognition method based on graph structure data and neural network, which can quickly acquire the ability to recognize new features according to a small sample learning strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic diagram of the concave edge, convex edge and normal vector of the surface of the present invention;

[0036] Figure 2 It is a schematic diagram of the boss feature (represented by the dark surface) of the present invention;

[0037] Figure 3 It is a schematic diagram of the characteristic features of the present invention. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present invention are described clearly and completely below. 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 creative work are within the scope of protection of the present invention.

[0039] Example

[0040] A geometric feature recognition method based on graph structure data and neural network includes the following steps:

[0041] S1, the part is represented by a graph structure data, and the surface, concave edge and convex edge are defined according to the direction vector, and a mechanical part is represented by a graph structure data, so as to construct a feature extraction method;

[0042] S2, construct samples according to the feature extraction method in S1. The samples are divided into support set and query set. The support set contains a small number of samples of each category, which are used to build the prototype; the query set contains more samples, which are used to test the classification performance of the model.

[0043] According to the predicted categories and true categories of the samples in the query set, the loss function is calculated, and the parameters of the graph neural network are optimized through the back propagation algorithm.

[0044] like Figure 1 As shown in the figure, S1 represents the parts as graph structure data. The nodes of the graph are the faces of the geometric body, and the edges of the graph indicate whether there is a common edge between two faces. The edge has concave and convex properties, marking the relationship between two adjacent faces. If the direction vectors of two faces are opposite, it is defined as a concave edge, otherwise it is defined as a convex edge. The direction vector of the face is outward.

[0045] According to this rule, a mechanical part can be represented by a graph structure data, such as Figure 2 As shown in , it can be seen that by connecting convex edges and concave edges in sequence, a graph representation of simple features can be obtained. Figure 2 The middle boss is to break the connection of all convex edges and obtain a sub-graph composed of concave edges (the feature composed of all dark surfaces in the figure). For more complex geometric features, there are three methods:

[0046] 1. For the subgraph composed of concave edges, perform one or more convex edge-based expansions. Figure 3 , add the face that has a convex edge connection with the subgraph formed by the red face into the subgraph, and the following is formed Figure 3 A complex feature composed of all the faces shown in the figure (except the invisible ground). On this basis, another expansion based on convex edges can be obtained Figure 3 The geometry represented in the figure on the right.

[0047] 2. Connect multiple adjacent subgraphs consisting only of concave edges to obtain a new subgraph.

[0048] 3. Use the above two methods alternately.

[0049] S2 trains a graph neural network based on a prototype-based small sample learning strategy. First, the training samples are divided into a support set and a query set; the support set contains a small number of samples of each category, which are used to build the prototype; the query set contains more samples, which are used to test the classification performance of the model.

[0050] For each category, the mean of the feature vectors of all samples in the support set is calculated to obtain the prototype of the category; this prototype can be regarded as the central representation of the category and is used for subsequent classification tasks.

[0051] For each sample in the query set, the distance between its feature vector and each category prototype is calculated, such as the Euclidean distance or cosine distance.

[0052] The category with the closer distance is considered to be the predicted category of the sample. According to the predicted category and the true category of the sample in the query set, the loss function (such as cross entropy loss) is calculated, and the parameters of the graph neural network are optimized through the back propagation algorithm.

[0053] Based on this strategy, only a few samples of new features are needed to form a support set to calculate the prototype of the new feature and update the prototype library. After obtaining a large number of samples, the weights of the model can be updated to obtain better classification results. Based on the small sample learning strategy, the ability to recognize new features can be quickly obtained, thereby significantly improving the efficiency of mechanical parts design and manufacturing.

[0054] Among them, the calculation methods of Euclidean distance, cosine distance and cross entropy loss are as follows:

[0055] ①. The calculation method of Euclidean distance is:

[0056] On a two-dimensional plane, given two points P1(x1,y1) and P2(x2,y2), the Euclidean distance is calculated. The calculation formula for the Euclidean distance is as follows:

[0057]

[0058] Among them, x1, x2, y1 and y2 are the coordinates of two points in each dimension.

[0059] ② The calculation method of cosine distance is:

[0060] The cosine distance is defined by calculating the complement of the cosine similarity, that is:

[0061] Cosine Distance(A,B)=1-Cosine Similarity(A,B);

[0062] Among them, Cosine Distance(A,B) is the cosine distance, and Cosine Similarity(A,B) is the cosine similarity.

[0063] The cosine similarity is calculated as follows:

[0064] Given two vectors A and B, cosine similarity:

[0065]

[0066] Among them, A·B is the dot product of vectors A and B, and the calculation formula is:

[0067]

[0068] ||A||, ||B|| are the modulus lengths of vectors A and B respectively, and the calculation formula is:

[0069]

[0070] Among them, the value range of cosine similarity is [-1,1]:

[0071] 1 means the two vectors are completely similar (same direction);

[0072] 0 means the two vectors are orthogonal (no similarity, the angle is 90°);

[0073] -1 means the two vectors are completely opposite (going in opposite directions).

[0074] The value range of cosine distance is [0,2]:

[0075] 0 means that the two vectors are completely similar;

[0076] 1 means the two vectors are orthogonal (no similarity);

[0077] 2 means the two vectors are completely opposite.

[0078] ③. The calculation method of cross entropy loss is as follows:

[0079] Assume there are C categories, the true label y is a category index (0 to C-1), and the output of the model prediction is the probability distribution of each category The cross entropy loss is then defined as follows:

[0080]

[0081] Among them, y i is the one-hot encoding of the true label, It represents the probability that the sample predicted by the model belongs to category i.

[0082] The cross entropy loss calculates the difference between the probability distribution predicted by the model and the probability distribution of the true label. The goal of the model is to minimize the loss and adjust the model parameters to make the predicted distribution as close to the true label distribution as possible.

[0083] The present invention uses Euclidean distance to effectively measure the geometric distance between samples, while cosine distance is more suitable for measuring the directional similarity between samples. By combining these two distance metrics, the similarity between the feature vector of the sample and the category prototype can be more comprehensively evaluated, thereby improving the accuracy of classification. Cross entropy loss can accurately reflect the difference between the model prediction result and the true label, driving the continuous optimization of the model and improving the recognition effect.

[0084] The present invention represents the topological relationship between the faces and lines of mechanical parts through graph structure data. A specific subgraph represents a specific geometric feature. The geometric features of mechanical parts can be identified, the geometric features of parts can be searched, the geometric features of parts can be quickly learned, and samples can be updated.

[0085] In summary, the geometric feature recognition method based on graph structure data and neural network provided in this embodiment can assist mechanical industry designers to quickly extract specific geometric features of mechanical parts and generate two-dimensional drawings.

[0086] The present invention, by combining the advantages of graph structure data and neural networks, can efficiently and accurately identify geometric features in mechanical parts, thereby significantly improving the level of automation of the design and manufacturing process. Specifically, this method not only reduces the time and labor cost of manually drawing two-dimensional drawings, but also can flexibly respond to the constant changes and updates of design features through an adaptive learning mechanism. In addition, the method of the present invention has strong versatility and scalability, and is suitable for various types of mechanical parts and complex geometric feature recognition tasks. Through practical application verification, this method has shown significant advantages in improving production efficiency, reducing error rates, and optimizing design processes, providing strong technical support for the intelligent development of the machinery industry.

[0087] In practical applications, the method of the present invention can not only be applied to the design and manufacture of mechanical parts, but also be extended to other fields that require geometric feature recognition, such as 3D modeling, reverse engineering, virtual reality, etc. In short, the present invention provides an efficient and intelligent geometric feature recognition method, which provides strong support for the technological progress of the machinery industry and other related fields, and has broad application prospects and significant economic benefits.

[0088] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention.

[0089] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A geometric feature recognition method based on graph structure data and neural network, characterized in that: The following steps are involved: S1, the part is represented by a graph structure data, and the surface, concave edge and convex edge are defined according to the direction vector, and a mechanical part is represented by a graph structure data, so as to construct a feature extraction method; S2, construct samples according to the feature extraction method in S1. The samples are divided into support set and query set. The support set contains a small number of samples of each category, which are used to build the prototype; the query set contains more samples, which are used to test the classification performance of the model. According to the predicted categories and true categories of the samples in the query set, the loss function is calculated, and the parameters of the graph neural network are optimized through the back propagation algorithm.

2. The method for geometric feature recognition based on graph structure data and neural network according to claim 1, characterized in that: The direction vectors of the mid-surface S1 are all stipulated to face outwards.

3. The method for geometric feature recognition based on graph structure data and neural network according to claim 2, characterized in that: In S1, if the direction vectors of the two faces are opposite, it is defined as a concave edge, otherwise it is defined as a convex edge.

4. The method for geometric feature recognition based on graph structure data and neural network according to claim 3, characterized in that: In S1, by sequentially connecting convex edges and concave edges, a graph of simple features can be obtained. For complex geometric features, there are three processing methods: ① For the subgraph composed of concave edges, one or more extensions based on convex edges are performed, and the faces that have a convex edge connection with the subgraph composed of the red faces are added to the subgraph, thus forming a complex feature composed of all faces. On this basis, another extension based on convex edges is performed to obtain a geometric body; ② Connect multiple adjacent subgraphs consisting of only concave edges to obtain a new subgraph; ③. Use the above two methods alternately.

5. The method for geometric feature recognition based on graph structure data and neural network according to claim 1, characterized in that: The prototype construction method of the support set in S2 is as follows: For each category, the mean of the feature vectors of all samples in the support set is calculated to obtain the prototype of the category; this prototype can be regarded as the central representation of the category and is used for subsequent classification tasks.

6. The method for geometric feature recognition based on graph structure data and neural network according to claim 1, characterized in that: The method for testing the classification performance of the model in the query set in S2 is as follows: For each sample in the query set, the distance between its feature vector and each category prototype is calculated, and the category with a closer distance is considered to be the predicted category of the sample.

7. The method for geometric feature recognition based on graph structure data and neural network according to claim 6, characterized in that: The distance type between the feature vector and each category prototype is Euclidean distance or cosine distance; The calculation formula of the Euclidean distance is: Among them, x1, x2, y1 and y2 are the coordinates of two points in each dimension; The calculation formula of the cosine distance is: Cosine Distance(A,B)=1-Cosine Similarity(A,B); Among them, Cosine Distance(A,B) is the cosine distance, Cosine Similarity(A,B) is the cosine similarity, and A and B are two vectors.

8. The method for geometric feature recognition based on graph structure data and neural network according to claim 1, characterized in that: The method of calculating the loss function in S2 is cross entropy loss, and the calculation formula of the cross entropy loss is: Among them, y i is the one-hot encoding of the true label, It represents the probability that the sample predicted by the model belongs to category i.

9. An application of the geometric feature recognition method according to any one of claims 1 to 8, characterized in that: The geometric feature recognition method can assist mechanical industry designers to quickly extract specific geometric features of mechanical parts and generate two-dimensional drawings.