A CAD drawing device type identification method and system based on an embedding model

By constructing a general embedding model and vector database, the scalability and small sample adaptability issues of CAD drawing equipment type identification methods are solved, achieving efficient, flexible, and accurate equipment type identification, thereby improving the efficiency and accuracy of engineering design.

CN121884385BActive Publication Date: 2026-06-09POWERCHINA JIANGXI ELECTRIC POWER ENGINEERING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
POWERCHINA JIANGXI ELECTRIC POWER ENGINEERING CO LTD
Filing Date
2026-03-23
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing methods for identifying equipment types in CAD drawings have significant shortcomings in terms of scalability, adaptability to small samples, and data cost control, and cannot meet the actual needs of the engineering design field for efficient, flexible, and accurate identification.

Method used

A general embedding model containing feature extraction structure and auxiliary head structure is constructed. It is trained using a CAD equipment dataset and a device image template library is selected to generate a vector database, enabling automated identification of device types and supporting dynamic expansion and accuracy in small sample scenarios.

Benefits of technology

It enables rapid device identification across projects and standards, reduces annotation costs and iteration cycles, improves identification efficiency and accuracy, and reduces omissions caused by human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884385B_ABST
    Figure CN121884385B_ABST
Patent Text Reader

Abstract

The application discloses a CAD drawing equipment type identification method and system based on an embedded model, relates to the technical field of equipment type identification, and comprises the following steps: constructing a CAD equipment dataset; constructing a general embedded model comprising a feature extraction structure and an auxiliary head structure, and training the general embedded model by using the CAD equipment dataset; screening various types of equipment image templates to construct a CAD equipment template library, embedding all images in the template library into a vector set by using the trained general embedded model, and importing the vector set into a vector database; inputting a CAD equipment image to be identified into the trained general embedded model to obtain a corresponding embedded vector; calculating the similarity between the embedded vector of the CAD equipment image to be identified and the vector set in the vector database, and determining the most matched equipment type. The application solves the problem of obvious defects of the CAD drawing equipment type identification method in the prior art in terms of scalability, small sample adaptability and data cost control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of equipment type identification technology, and in particular to a method and system for identifying equipment types in CAD drawings based on an embedded model. Background Technology

[0002] In fields such as power engineering and building construction, CAD drawings serve as the core carrier of equipment layout and design schemes. Identifying the various equipment types contained within them is a crucial prerequisite for downstream tasks such as drawing-assisted modeling and intelligent review. With the deep application of intelligent technology in engineering design, the traditional method of relying on manual identification of equipment types in CAD drawings is no longer sufficient to meet the demands for efficient modeling and accurate review. In the 3D modeling scenario of a substation's overall layout plan, designers need to spend a significant amount of time manually verifying equipment information and modeling each item, often facing pressure from tight deadlines. Furthermore, in the review of electrical primary equipment layout drawings, manually comparing the specifications, quantities, and layout consistency of equipment between the material list and the drawings is not only time-consuming and labor-intensive but also prone to omissions due to human error, affecting design accuracy. Therefore, achieving automated and high-precision identification of equipment types in CAD drawings has become a core requirement for improving the efficiency and quality of engineering design.

[0003] To address the aforementioned issues, existing technologies have proposed various AI-based schemes for identifying or retrieving equipment from CAD drawings. For example, by selecting positive and negative samples of similar and dissimilar types, a dual-branch deep convolutional network is used to learn the commonalities and differences between devices, and then spatial mapping is used to obtain matching results; alternatively, the CLIP algorithm is employed to automatically classify basic electrical primitives; or the ViT model is used as a feature extractor to extract features from 20 perspectives of a 3D model, which are then combined with a trained BERT model to obtain a global comprehensive feature vector, thereby matching similar 3D models.

[0004] However, existing technical solutions still have significant limitations in practical engineering applications and are difficult to meet the needs of use in complex scenarios:

[0005] First, existing methods all rely on large-scale labeled samples of fixed categories for model training. When a new device category needs to be added, a complete dataset containing both new and old samples must be reconstructed, and the model must be retrained or fine-tuned. This not only results in long model iteration cycles and an inability to adapt to cross-project and cross-standard device recognition needs in a timely manner, but also makes it difficult to form stable and universal semantic representations, thus limiting generalization ability.

[0006] Secondly, in engineering practice, CAD drawing samples for some special equipment (such as customized electrical equipment) are extremely scarce. Often only 1-2 high-quality drawings can be obtained. Existing supervised learning methods require a large amount of training data. Under small or extremely small sample conditions, the discriminative power of feature extraction decreases significantly, leading to a sharp decrease in equipment recognition accuracy and unreliable recognition results.

[0007] Third, the model training of existing methods relies on large-scale consistent labeled data. When adding new device categories, a new round of manual labeling is required, which is not only time-consuming and costly, but also places strict requirements on the professional ability of the labelers and the consistency of the labeling, further limiting the practical application of the technology.

[0008] In summary, existing methods for identifying equipment types in CAD drawings have significant shortcomings in terms of scalability, adaptability to small samples, and data cost control. They cannot fully meet the actual needs of the engineering design field for efficient, flexible, and accurate identification. There is an urgent need for an identification method that can overcome the above-mentioned technical bottlenecks. Summary of the Invention

[0009] In view of this, the purpose of the present invention is to provide a method and system for identifying equipment type in CAD drawings based on an embedded model, which aims to solve the problem that existing methods for identifying equipment type in CAD drawings have obvious defects in terms of scalability, small sample adaptability and data cost control, and cannot fully meet the actual needs of the engineering design field for efficient, flexible and accurate identification.

[0010] This invention proposes a method for identifying equipment type in CAD drawings based on an embedded model, the method comprising:

[0011] Build a CAD equipment dataset;

[0012] A general embedding model containing a feature extraction structure and an auxiliary head structure is constructed, and the general embedding model is trained using the CAD equipment dataset;

[0013] A CAD equipment template library is constructed by selecting image templates of various equipment categories. All images in the template library are then embedded into a vector set using a trained general embedding model and imported into a vector database.

[0014] Input the CAD device diagram to be identified into the trained general embedding model to obtain the corresponding embedding vector;

[0015] Calculate the similarity between the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, and determine the most matching device type based on the similarity result.

[0016] Furthermore, in the above-mentioned CAD drawing equipment type identification method based on embedding models, the step of constructing the CAD equipment dataset includes:

[0017] Import the pre-collected substation plan diagrams into CAD design software;

[0018] Iterate through all the equipment in the collected drawings, group each equipment component into blocks, and label the equipment blocks according to the equipment type;

[0019] Traverse all equipment sets in the drawing. DS For equipment sets DS Each component is first calculated to have its bounding box. The viewport is then set to be isolated according to the bounding box size and rendered in the center, generating a centered image containing only that device. I Export device image set IS Data cleaning was performed on the image set IS to remove duplicate and low-quality samples, resulting in a CAD equipment image dataset.

[0020] Furthermore, in the above-mentioned CAD drawing equipment type identification method based on an embedded model, the step of analyzing the image set... IS The steps for performing duplicate sample search, deleting duplicate and low-quality samples to clean the data and obtain the CAD equipment dataset include:

[0021] Extract image category information and group the image set according to category. IS The image is divided into G device subsets SIS, where G is the number of device categories. The ORB algorithm is used to detect key points in all images of the subset SIS, and the flannMatch algorithm is used to match the key points.

[0022] Assumption and Images and Key points If the number of matching points between images is , then when If a value is found to be non-repeating, it is considered a duplicate image; otherwise, it is considered a duplicate image. , These are different images from a subset of the same device;

[0023] Low-quality samples include mislabeled and multi-device combination labels. Mislabeled means that the actual category of the equipment is inconsistent with the labeled category. Multi-device combination means that different categories of equipment are in the same image.

[0024] Furthermore, in the above-mentioned CAD drawing equipment type identification method based on the embedding model, the feature extraction structure is used to extract the low-level texture information and deep abstract semantics of the input image and output a feature vector.

[0025] The feature extraction structure is linearly composed of Convolution Conv, Normalization BN, Activation Function ReLU, Max Pooling MaxPool, and Basic Feature Extraction Module BssicBlock.

[0026] The feature extraction behavior is denoted as The embedding process can then be represented as:

[0027] ;

[0028] In the formula, This represents the output embedding vector, where I is the input image;

[0029] The auxiliary head structure is used to assist in model optimization and consists of a weight matrix W.

[0030] Furthermore, the above-described method for identifying equipment type in CAD drawings based on an embedding model further includes, before the step of training the general embedding model using the CAD equipment dataset:

[0031] Data augmentation is performed on the images in the CAD equipment dataset, wherein the data augmentation includes random flipping, random grayscale, and random scaling;

[0032] The step of training the general embedding model using the CAD equipment dataset includes:

[0033] The Arcface loss is used to guide model weight updates, defined as follows:

[0034] ;

[0035] ;

[0036] In the formula, N For the sample size, This indicates the total number of categories involved in the current calculation. m It is an additive angle (hyperparameter). Represents the natural index. This indicates traversing all categories except the current one. i All other categories besides s As a scale factor, Auxiliary head weight matrix W The Middle i Column vectors of a class The weight vector representing the non-target category and the feature vector of the same sample. The included angle, express and eigenvectors The angle between classes is increased by increasing the angle between classes, which forces the model to bring intra-class features closer together and increases inter-class differences.

[0037] Furthermore, in the above-mentioned CAD drawing equipment type identification method based on embedding models, the steps of selecting equipment image templates of each category to construct a CAD equipment template library, embedding all images in the template library into a vector set through a trained general embedding model, and importing the vector set into a vector database include:

[0038] Filter image templates for each category of equipment, build a CAD template library TS, embed all images in the template library TS into a vector set TVS, and import them into a vector database;

[0039] in, ,in, For the Gth class of templates, , From subset The selected template images have at least one template of each type, where z is the total number of templates;

[0040] When a new device category is introduced, a typical image of that category is added to the template library and a corresponding embedding vector is generated;

[0041] Template screening methods include element commonality screening and element difference screening;

[0042] Common element screening methods include: for a certain equipment category If its typical instances generally contain a set of key components:

[0043] ;

[0044] Set template The elements contained are Then its feature coverage rate is defined as:

[0045] ;

[0046] When building a template library, prioritize retaining Images exceeding a threshold are used as templates to ensure the structural integrity and robustness of intra-class representations;

[0047] The factor difference screening method includes: for any two different categories and Let the typical element sets of the two be respectively and Then, the inter-class feature distinguishability is defined as:

[0048] ;

[0049] when When the value is close to 1, retain the corresponding template.

[0050] Furthermore, in the above-mentioned method for identifying equipment types in CAD drawings based on embedding models, the step of calculating the similarity between the embedding vector of the CAD equipment drawing to be identified and the vector set in the vector database, and determining the most matching equipment type based on the similarity result, includes:

[0051] Vector similarity is achieved through a function To measure the performance, assuming the final matched device is j, then: In the formula, These represent the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, respectively. Indicates the maximum similarity. For similarity threshold, Operations represent operations on vectors sim Sort the data in descending order and map it back to the original indices, then return the top k largest values. and their corresponding subscripts When the maximum similarity is greater than the threshold, j This indicates the most similar device; otherwise, no match was found.

[0052] Another object of the present invention is to provide a CAD drawing equipment type identification system based on an embedded model, the system comprising:

[0053] Build modules are used to construct CAD equipment datasets;

[0054] The training module is used to construct a general embedding model that includes a feature extraction structure and an auxiliary head structure, and to train the general embedding model using the CAD device dataset;

[0055] The filtering module is used to filter image templates of various categories to build a CAD equipment template library, and to embed all images in the template library into a vector set through a trained general embedding model and import them into a vector database.

[0056] The recognition module is used to input the CAD equipment drawing to be recognized into the trained general embedding model to obtain the corresponding embedding vector.

[0057] The matching module is used to calculate the similarity between the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, and to determine the most matching device type based on the similarity result.

[0058] Another object of the present invention is to provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0059] Another object of the present invention is to provide an electronic device including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the method described above.

[0060] This invention constructs a CAD equipment dataset and cleans it to retain valid samples; it constructs a general embedding model containing feature extraction and auxiliary head structures, and trains it using the CAD equipment dataset; it selects image templates for each category of equipment to construct a CAD equipment template library, embeds all images in the template library into vector sets using the trained general embedding model, and imports these vector sets into a vector database; it inputs the CAD equipment image to be identified into the trained general embedding model to obtain the corresponding embedding vector; it calculates the similarity between the embedding vector and the vector set in the vector database to determine the best-matching equipment type. The constructed CAD equipment template library supports dynamic expansion. When adding a new equipment category, it is not necessary to rebuild a complete dataset containing both new and old samples; only typical images of that category need to be added to the template library, and the corresponding embedding vectors generated by the trained general embedding model need to be stored in the vector database. No model retraining or fine-tuning is required, enabling rapid adaptation to cross-project and cross-standard equipment recognition. This approach addresses the need for a stable and universal semantic representation, significantly improving generalization and versatility. The universal embedding model possesses a feature extraction structure and an auxiliary head structure. After training with a CAD equipment dataset, it exhibits strong generalization and semantic abstraction capabilities. Even with only 1-2 high-quality equipment templates, it can effectively capture key geometric and structural features of the equipment, generating discriminative feature vectors and ensuring accuracy and reliability in small-sample scenarios. Adding new equipment categories eliminates the need for large-scale manual annotation; only a few typical images are required for template expansion and vector generation, significantly reducing annotation costs and shortening iteration cycles, while avoiding stringent reliance on annotation consistency. Through automated dataset construction, model training, vector embedding, and similarity matching processes, automated identification of equipment types in CAD drawings is achieved, eliminating the need for manual verification or modeling. This significantly improves the efficiency of drawing-assisted modeling and intelligent review, reduces omissions caused by human error, and ensures design accuracy. This approach solves the significant deficiencies of existing CAD drawing equipment type identification methods in terms of scalability, small-sample adaptability, and data cost control, failing to fully meet the practical needs of engineering design for efficient, flexible, and accurate identification. Attached Figure Description

[0061] Figure 1 This is a flowchart of the CAD drawing equipment type identification method based on an embedded model in the first embodiment of the present invention;

[0062] Figure 2 This is a structural block diagram of the CAD drawing equipment type identification system based on an embedded model in the third embodiment of the present invention.

[0063] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0064] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0065] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0067] Example 1

[0068] Please see Figure 1 The figure shows a method for identifying CAD drawing equipment type based on an embedded model in the first embodiment of the present invention, the method including steps S10 to S14.

[0069] Step S10: Construct a CAD equipment dataset.

[0070] The main steps in constructing the CAD equipment dataset include importing floor plans, labeling equipment, exporting CAD equipment images, and data cleaning. Details are as follows:

[0071] Import floor plans: Import the pre-collected various substation floor plans into the CAD design software;

[0072] Equipment Labeling: Traverse all equipment in the drawing, group each equipment component into blocks, and label the equipment block name according to the equipment type. The naming rule is "number + type", for example, 2-110kV incoming GIS, 3-10kV capacitor. The number is a unique ID for the equipment block in this drawing; duplicates are not allowed within the same drawing, but duplicate numbers are permitted across different drawings.

[0073] Exporting CAD device images: Traversing the entire device set DS of the drawing. D represents a single device component, and N represents the total number of devices. For each component D, its bounding box is first calculated. An isolation viewport is then set according to the bounding box size, and the component is rendered in the center, generating a centered image I containing only that device. The device image set IS is then exported. And name them according to the rule of "UUID + number + type".

[0074] Data cleaning includes removing duplicate and low-quality samples. Specifically:

[0075] Duplicate image search: Extract image category information and divide the IS into G device subsets SIS according to the category, i.e. Where G is the number of equipment categories, , They are the same type of device; the ORB algorithm is used to detect keypoints in all images of a subset of SIS, and the FLANNMatch algorithm is used to match the keypoints; assuming and Images and Key points If the number of matching points between images is , then when If the image is not repeated, it is considered a non-repeating image; otherwise, it is considered a duplicate image.

[0076] Low-quality samples include incorrect labeling and multiple device combinations. "Incorrect labeling" means that the actual category of the equipment is inconsistent with the labeled category. "Multiple device combinations" means that different categories of equipment are in the same image.

[0077] Step S11: Construct a general embedding model that includes a feature extraction structure and an auxiliary head structure, and train the general embedding model using the CAD device dataset.

[0078] For example:

[0079] The feature extraction structure is used to extract low-level texture information and deep abstract semantics from the input image and output a feature vector. The overall structure consists of a linear combination of Convolution (Conv), Normalization (BN), ReLU activation function, Max Pooling (MaxPool), and the basic feature extraction module BssicBlock. The feature extraction behavior is denoted as... The embedding process can then be represented as:

[0080] ;

[0081] In the formula This represents the output embedding vector, where I is the input image;

[0082] The auxiliary head structure, used to assist model optimization, mainly consists of a weight matrix W.

[0083] Specifically, before the step of training the general embedding model using the CAD equipment dataset, the method further includes:

[0084] Data augmentation is performed on the images in the CAD equipment dataset, wherein the data augmentation includes random flipping, random grayscale, and random scaling;

[0085] The step of training the general embedding model using the CAD equipment dataset includes:

[0086] The Arcface loss is used to guide model weight updates, defined as follows:

[0087] ;

[0088] ;

[0089] In the formula, N For the sample size, This indicates the total number of categories involved in the current calculation. m It is an additive angle (hyperparameter). Represents the natural index. This indicates traversing all categories except the current one. i All other categories besides s As a scale factor, Auxiliary head weight matrix W The Middle i Column vectors of a class The weight vector representing the non-target category and the feature vector of the same sample. The included angle, express and eigenvectors The angle between classes is increased by increasing the angle between classes, which forces the model to bring intra-class features closer together and increases inter-class differences.

[0090] Step S12: Select image templates for each category of equipment to construct a CAD equipment template library. Embed all images in the template library into a vector set using a trained general embedding model and import them into a vector database.

[0091] Specifically, image templates for each category of equipment are selected, a CAD template library TS is constructed, all images in the template library TS are embedded into a vector set TVS, and then imported into a vector database.

[0092] Step S13: Input the CAD device drawing to be identified into the trained general embedding model to obtain the corresponding embedding vector.

[0093] Among them, the general embedding model has mastered the generation logic from CAD equipment drawings to embedding vectors. After obtaining the CAD equipment drawing, the general embedding model can accurately generate the corresponding embedding vector.

[0094] Step S14: Calculate the similarity between the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, and determine the most matching device type based on the similarity result.

[0095] Vector similarity is achieved through a function. To measure the performance, assuming the final matched device is j, then: In the formula, These represent the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, respectively. Indicates the maximum similarity. For similarity threshold, Operations represent operations on vectors sim Sort the data in descending order and map it back to the original indices, then return the top k largest values. and their corresponding subscripts When the maximum similarity is greater than the threshold, j This indicates the most similar device; otherwise, no match was found.

[0096] In summary, the CAD drawing equipment type identification method based on embedding models in the above embodiments of the present invention constructs a CAD equipment dataset and cleans it to retain valid samples; constructs a general embedding model including feature extraction structure and auxiliary head structure, and trains it using the CAD equipment dataset; selects equipment image templates for each category to construct a CAD equipment template library, embeds all images in the template library into vector sets using the trained general embedding model, and imports them into a vector database; inputs the CAD equipment drawing to be identified into the trained general embedding model to obtain the corresponding embedding vector; calculates the similarity between the embedding vector and the vector set in the vector database and determines the best matching equipment type. The constructed CAD equipment template library supports dynamic expansion. When adding a new equipment category, it is not necessary to rebuild a complete dataset containing both new and old samples; only typical images of that category need to be added to the template library and the corresponding embedding vectors generated by the trained general embedding model need to be stored in the vector database. No retraining or fine-tuning of the model is required. This technology rapidly adapts to cross-project and cross-standard device identification needs, forming a stable and universal semantic representation that significantly improves generalization and versatility. The universal embedding model possesses feature extraction and auxiliary head structures, and after training with a CAD device dataset, it exhibits strong generalization and semantic abstraction capabilities. Even with only 1-2 high-quality device templates, it can effectively capture key geometric and structural features of the device, generating discriminative feature vectors to ensure accuracy and reliability in small-sample scenarios. Adding new device categories eliminates the need for large-scale manual annotation; only a few typical images are required for template expansion and vector generation, significantly reducing annotation costs and shortening iteration cycles, while avoiding stringent reliance on annotation consistency. Through automated dataset construction, model training, vector embedding, and similarity matching processes, it achieves automated identification of device types in CAD drawings, eliminating the need for manual verification or modeling. This significantly improves the efficiency of drawing-assisted modeling and intelligent review, reduces omissions caused by human error, and ensures design accuracy. It addresses the significant deficiencies in existing CAD drawing device type identification methods regarding scalability, small-sample adaptability, and data cost control, failing to fully meet the practical needs of engineering design for efficient, flexible, and accurate identification.

[0097] Example 2

[0098] This embodiment also proposes a method for identifying the equipment type of CAD drawings based on an embedded model. The difference between the method for identifying the equipment type of CAD drawings based on an embedded model in this embodiment and the method for identifying the equipment type of CAD drawings based on an embedded model in Embodiment 1 is as follows:

[0099] When a new device category is introduced, a typical image of that category is added to the template library and a corresponding embedding vector is generated;

[0100] Template screening methods include element commonality screening and element difference screening;

[0101] Common element screening methods include: for a certain equipment category If its typical instances generally contain a set of key components:

[0102] ;

[0103] Set template The elements contained are Then its feature coverage rate is defined as:

[0104] ;

[0105] When building a template library, prioritize retaining Images exceeding a threshold are used as templates to ensure the structural integrity and robustness of intra-class representations;

[0106] The factor difference screening method includes: for any two different categories and Let the typical element sets of the two be respectively and Then, the inter-class feature distinguishability is defined as:

[0107] ;

[0108] when When the value is close to 1, retain the corresponding template.

[0109] When a new device category is introduced, only the typical images of that category need to be added to the template library and the corresponding embedding vectors generated; there is no need to retrain the embedding model.

[0110] Template filtering aims to reduce the number of matches, speed up retrieval, and improve the real-time performance of the algorithm. Filtering methods are divided into element commonality filtering and element difference filtering.

[0111] The element commonality screening method aims to improve the template library's coverage of the structural integrity of devices within a class. Its core idea is: for a given device category... If its typical instances generally contain a set of key components:

[0112] ;

[0113] For example, a transformer typically includes an oil conservator, radiator, bushings, and body, then the template library belongs to... The candidate templates should cover as much as possible High-frequency elements in. Set a template. The elements contained are Then its feature coverage rate is defined as:

[0114] ;

[0115] When building a template library, prioritize retaining High-resolution images are used as templates to ensure the structural integrity and robustness of intra-class representations. The more comprehensive the feature coverage, the higher the model's tolerance to interference such as partial missing parts of drawings and simplifications in drawing, and the significantly enhanced recognition stability.

[0116] The element difference screening rule focuses on improving the separability between categories and avoiding confusion and misjudgment caused by similar graphic elements. Its principle is: for any two different categories... and The factor diversity should be maximized. Let the typical factor sets of the two be respectively... and Then, the inter-class feature distinguishability is defined as:

[0117] ;

[0118] when When the value is close to 0, it indicates that the two categories have a high degree of overlap in their element composition and extremely low distinguishability. For example, both "building" and "low-voltage switchgear" may be represented by a single rectangular element in CAD drawings, and their element set is both {rectangular outline}, leading to... In this situation, forcibly retaining both as independent categories would significantly increase the risk of semantic confusion in the embedding space. Therefore, the element difference screening method suggests that if a template cannot effectively distinguish neighboring categories through element combination, it should be merged into a main category with clearer semantics, or removed from the template library, to ensure the clarity of the discrimination boundary and the recognition accuracy of the overall classification system.

[0119] In summary, the CAD drawing equipment type identification method based on embedding models in the above embodiments of the present invention constructs a CAD equipment dataset and cleans it to retain valid samples; constructs a general embedding model including feature extraction structure and auxiliary head structure, and trains it using the CAD equipment dataset; selects equipment image templates for each category to construct a CAD equipment template library, embeds all images in the template library into vector sets using the trained general embedding model, and imports them into a vector database; inputs the CAD equipment drawing to be identified into the trained general embedding model to obtain the corresponding embedding vector; calculates the similarity between the embedding vector and the vector set in the vector database and determines the best matching equipment type. The constructed CAD equipment template library supports dynamic expansion. When adding a new equipment category, it is not necessary to rebuild a complete dataset containing both new and old samples; only typical images of that category need to be added to the template library and the corresponding embedding vectors generated by the trained general embedding model need to be stored in the vector database. No retraining or fine-tuning of the model is required. This technology rapidly adapts to cross-project and cross-standard device identification needs, forming a stable and universal semantic representation that significantly improves generalization and versatility. The universal embedding model possesses feature extraction and auxiliary head structures, and after training with a CAD device dataset, it exhibits strong generalization and semantic abstraction capabilities. Even with only 1-2 high-quality device templates, it can effectively capture key geometric and structural features of the device, generating discriminative feature vectors to ensure accuracy and reliability in small-sample scenarios. Adding new device categories eliminates the need for large-scale manual annotation; only a few typical images are required for template expansion and vector generation, significantly reducing annotation costs and shortening iteration cycles, while avoiding stringent reliance on annotation consistency. Through automated dataset construction, model training, vector embedding, and similarity matching processes, it achieves automated identification of device types in CAD drawings, eliminating the need for manual verification or modeling. This significantly improves the efficiency of drawing-assisted modeling and intelligent review, reduces omissions caused by human error, and ensures design accuracy. It addresses the significant deficiencies in existing CAD drawing device type identification methods regarding scalability, small-sample adaptability, and data cost control, failing to fully meet the practical needs of engineering design for efficient, flexible, and accurate identification.

[0120] Example 3

[0121] Please see Figure 2 The figure shows a CAD drawing equipment type identification system based on an embedded model proposed in the third embodiment of the present invention. The system includes:

[0122] Module 100 is used to build the CAD equipment dataset;

[0123] Training module 200 is used to construct a general embedding model that includes a feature extraction structure and an auxiliary head structure, and to train the general embedding model using the CAD device dataset;

[0124] The filtering module 300 is used to filter image templates of various categories of equipment to build a CAD equipment template library, and to embed all images in the template library into a vector set through a trained general embedding model and import them into a vector database.

[0125] The recognition module 400 is used to input the CAD equipment drawing to be recognized into the trained general embedding model to obtain the corresponding embedding vector.

[0126] The matching module 500 is used to calculate the similarity between the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, and to determine the most matching device type based on the similarity result.

[0127] The functions or operation steps implemented by the above modules are largely the same as those in the above method embodiments, and will not be repeated here.

[0128] Example 4

[0129] In another aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method described in any one of Embodiments 1 to 2 above.

[0130] Example 5

[0131] In another aspect, the present invention provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of any one of the methods described in Embodiments 1 to 2 above.

[0132] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0133] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0134] More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable storage media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0135] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0136] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0137] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for identifying equipment type in CAD drawings based on an embedded model, characterized in that, The method includes: Build a CAD equipment dataset; A general embedding model containing a feature extraction structure and an auxiliary head structure is constructed, and the general embedding model is trained using the CAD equipment dataset; A CAD equipment template library is constructed by selecting image templates of various equipment categories. All images in the template library are then embedded into a vector set using a trained general embedding model and imported into a vector database. Input the CAD device diagram to be identified into the trained general embedding model to obtain the corresponding embedding vector; Calculate the similarity between the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, and determine the most matching device type based on the similarity result, specifically including: Vector similarity is achieved through a function To measure the performance, assuming the final matched device is j, then: In the formula, These represent the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, respectively. Indicates the maximum similarity. For similarity threshold, Operations represent operations on vectors sim Sort the data in descending order and map it back to the original indices, then return the top k largest values. and their corresponding subscripts When the maximum similarity is greater than the threshold, j This indicates the most similar device; otherwise, no match was found. The steps of constructing a CAD equipment template library by selecting equipment image templates of each category, embedding all images in the template library into a vector set using a trained general embedding model, and importing the vector set into a vector database include: Filter image templates for each category of equipment, build a CAD template library TS, embed all images in the template library TS into a vector set TVS, and import them into a vector database; in, ,in, For the Gth class of templates, , From subset The selected template images must have at least one template of each type; When a new device category is introduced, a typical image of that category is added to the template library and a corresponding embedding vector is generated; Template screening methods include element commonality screening and element difference screening; Common element screening methods include: for a certain equipment category If its typical instances generally contain a set of key components: ; Where z is the total number of templates; Set template The elements contained are Then its feature coverage rate is defined as: ; When building a template library, prioritize retaining Images exceeding a threshold are used as templates to ensure the structural integrity and robustness of intra-class representations; The factor difference screening method includes: for any two different categories and Let the typical element sets of the two be respectively and Then, the inter-class feature distinguishability is defined as: ; when When the value is close to 1, retain the corresponding template.

2. The method for identifying equipment type in CAD drawings based on an embedded model according to claim 1, characterized in that, The steps for constructing the CAD equipment dataset include: Import the pre-collected substation plan diagrams into CAD design software; Iterate through all the equipment in the collected drawings, group each equipment component into blocks, and label the equipment blocks according to the equipment type; Traverse all equipment sets in the drawing. DS For equipment sets DS Each component is first calculated to have its bounding box. The viewport is then set to be isolated according to the bounding box size and rendered in the center, generating a centered image containing only that device. I Export device image set IS Data cleaning was performed on the image set IS to remove duplicate and low-quality samples, resulting in a CAD equipment image dataset.

3. The method for identifying equipment type in CAD drawings based on an embedded model according to claim 2, characterized in that, The image set IS The steps for performing duplicate sample search, deleting duplicate and low-quality samples to clean the data and obtain the CAD equipment dataset include: Extract image category information and group the image set according to category. IS The image is divided into G device subsets SIS, where G is the number of device categories. The ORB algorithm is used to detect key points in all images of the subset SIS, and the flannMatch algorithm is used to match the key points. Assumption and Images and Key points If the number of matching points between images is , then when If a value is found to be non-repeating, it is considered a duplicate image; otherwise, it is considered a duplicate image. , These are different images from a subset of the same device; Low-quality samples include mislabeled and multi-device combination labels. Mislabeled means that the actual category of the equipment is inconsistent with the labeled category. Multi-device combination means that different categories of equipment are in the same image.

4. The method for identifying equipment type in CAD drawings based on an embedded model according to claim 1, characterized in that, The feature extraction structure is used to extract the low-level texture information and deep abstract semantics of the input image and output a feature vector. The feature extraction structure is linearly composed of Convolution Conv, Normalization BN, Activation Function ReLU, Max Pooling MaxPool, and Basic Feature Extraction Module BasicBlock. The feature extraction behavior is denoted as The embedding process is then represented as: ; In the formula, This represents the output embedding vector, where I is the input image; The auxiliary head structure is used to assist in model optimization and consists of a weight matrix W.

5. The method for identifying equipment type in CAD drawings based on an embedded model according to claim 1, characterized in that, The step of training the general embedding model using the CAD equipment dataset includes the following prior steps: Data augmentation is performed on the images in the CAD equipment dataset, wherein the data augmentation includes random flipping, random grayscale, and random scaling; The step of training the general embedding model using the CAD equipment dataset includes: The Arcface loss is used to guide model weight updates, defined as follows: ; ; In the formula, N For the sample size, This indicates the total number of categories involved in the current calculation. m As an additive angle, Represents the natural index. This indicates traversing all categories except the current one. i All other categories besides s As a scale factor, Auxiliary head weight matrix W The Middle i Column vectors of a class The weight vector representing the non-target category and the feature vector of the same sample. The included angle, express and eigenvectors The angle between classes is increased by increasing the angle between classes, which forces the model to bring intra-class features closer together and increases inter-class differences.

6. A CAD drawing equipment type identification system based on an embedded model, characterized in that, The system is used to implement the CAD drawing equipment type identification method based on an embedded model as described in any one of claims 1 to 5, the system comprising: Build modules are used to construct CAD equipment datasets; The training module is used to construct a general embedding model that includes a feature extraction structure and an auxiliary head structure, and to train the general embedding model using the CAD device dataset; The filtering module is used to filter image templates of various categories to build a CAD equipment template library, and to embed all images in the template library into a vector set through a trained general embedding model and import them into a vector database. The recognition module is used to input the CAD equipment drawing to be recognized into the trained general embedding model to obtain the corresponding embedding vector. The matching module is used to calculate the similarity between the embedding vector of the CAD device drawing to be identified and the vector set in the vector database, and to determine the most matching device type based on the similarity result.

7. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 5.

8. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor, when executing the program, implements the steps of the method as described in any one of claims 1 to 5.