CAD drawing intelligent matching method and system based on multi-stage deep learning
Through the multi-stage deep learning method, combined with the YOLOv5 model and the double-head network structure, the limitations of single-stage matching and multi-category imbalance in CAD drawing comparison are solved, and efficient and accurate CAD drawing matching is achieved, suitable for complex engineering applications. .
Patent Information
- Application Number
- CN202411308766.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-03
AI Technical Summary
The prior art has limitations in single-stage image matching, challenges in processing super-large-sized images, problems of multi-category imbalance, lack of fine-grained feature matching capabilities and insufficient ability to process heterogeneous data in CAD drawing comparison, resulting in insufficient matching accuracy. and inefficient, difficult to meet complex engineering needs.
Using a multi-stage deep learning method, a triple data set is constructed through data augmentation and sample balance, combined with YOLOv5 model and sliding window detection and non-maximum suppression technology for object detection, and a double-headed network structure and multiple losses are used. The function performs target matching, uses cosine distance and F1 norm to make matching judgments, and supports processing of multiple data formats.
It realizes high-precision, robustness and efficient CAD drawing matching, avoids redundant detection and missed detection problems, improves the applicability and adaptability of the system, and can handle complex and diverse engineering application scenarios.
Smart Images

Figure CN119251848A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image comparison, and in particular to a method and system for intelligent matching of CAD drawings based on multi-stage deep learning. Background Art
[0002] CAD (computer-aided design) technology has become an indispensable tool in many fields such as industrial manufacturing, architectural design, and electronic circuit design. CAD files are used in design, drawing, analysis, simulation, and manufacturing to ensure accurate presentation from design concept to actual product. However, as the complexity of engineering projects increases, version management, version comparison, and design consistency verification between CAD files have become a critical task. Especially when multiple design teams or cross-domain collaboration are involved, the comparison and review of CAD files becomes more complex and critical.
[0003] Traditional CAD drawing comparison and review methods mainly rely on manual operations or simple geometric comparisons. Manual review usually requires experienced engineers or designers. This method is not only inefficient, but also prone to missed detection or misjudgment. Although the geometric comparison method introduces computer assistance, it is mostly limited to basic shape similarity calculations and is difficult to cope with complex CAD drawing changes. These methods are unable to cope with large-scale, multi-version, and multi-source CAD files and are difficult to meet the needs of modern industry and engineering.
[0004] In recent years, with the development of computer vision technology, automated CAD drawing comparison methods based on image processing have gradually attracted attention. These methods use image processing algorithms, feature extraction technology and machine learning models to compare different versions of CAD drawings to achieve automated and intelligent CAD image review. However, these methods still have the following significant deficiencies in practical applications:
[0005] 1. Limitations of single-stage image matching: Most existing image matching methods use single-stage models, which usually only consider the global or local features of the image. This method is easily affected by deformation, scale change, rotation and other factors when facing complex CAD drawings, resulting in insufficient matching accuracy. In addition, single-stage methods have difficulty processing the fine-grained features of different targets in CAD drawings, especially in multi-target and multi-category scenarios.
[0006] 2. Challenges in processing oversized images: CAD drawings often have ultra-high resolution and ultra-large size, and existing image processing algorithms and models are difficult to apply directly. In object detection in large-size images, traditional global detection methods cannot effectively balance accuracy and efficiency, and simple local detection methods (such as sliding window detection) are prone to introduce redundant detection and missed detection problems during splicing and global processing, further affecting the accuracy of detection and matching.
[0007] 3. Multi-class imbalance problem: In CAD drawings, objects of different categories usually have highly unbalanced distributions. For example, in a complex electronic circuit design drawing, some components (such as capacitors and resistors) appear much more frequently than other components. Existing image processing and machine learning methods find it difficult to maintain high matching and classification accuracy when the sample category distribution is severely unbalanced.
[0008] 4. Lack of fine-grained feature matching capabilities: CAD drawings contain a lot of detailed information, such as line thickness, annotation position, font style, etc. Existing methods often only focus on geometric features or shape features and lack the ability to effectively process these details. Therefore, it is impossible to accurately judge the consistency of drawings in scenarios with large differences in details.
[0009] 5. Insufficient ability to process heterogeneous data: In actual engineering applications, CAD files are in various formats, including vector formats (such as DWG, DXF), image formats (such as PNG, JPG), and even document formats such as PDF. Existing technologies can usually only process one or several of these formats, and lack the ability to uniformly process multiple formats, which affects the applicability of the automated drawing review system.
[0010] In addition, most of the current technical solutions are tool-based products, which make it difficult to achieve full process automation from data processing, detection to matching and analysis, and the degree of intelligence is limited, which restricts end-to-end intelligent image review. Especially in cross-domain applications, existing technologies cannot meet diverse and personalized needs. Summary of the invention
[0011] The purpose of the present invention is to overcome the technical problems existing in the prior art and provide a CAD drawing intelligent matching method and system based on multi-stage deep learning to achieve intelligent matching and judgment of two or more CAD images of any different formats.
[0012] The objective of the present invention is achieved through the following technical solutions:
[0013] In a first aspect, a CAD drawing intelligent matching method based on multi-stage deep learning is provided, comprising the following steps:
[0014] S1, load and preprocess CAD drawings, and construct triple datasets through data enhancement and sample balancing techniques;
[0015] S2. Build a target detection model and a target matching model, and use the triplet data set to train the target detection model and the target matching model; wherein the target detection model adopts the YOLOv5 model, and combines the sliding window detection and non-maximum suppression technology to detect the CAD drawings; the target matching model adopts a dual-head network structure;
[0016] S3. Use the trained target detection model and target matching model to match the CAD drawings to be identified.
[0017] In some embodiments, the data enhancement in step S1 includes random rotation, translation, scaling, cropping, and color jittering.
[0018] In some embodiments, the sample balancing technique in step S1 includes:
[0019] The data is balanced by synthetic minority class oversampling and random undersampling techniques.
[0020] In some embodiments, the training of the target detection model in step S2 includes:
[0021] Sliding window detection: The oversized CAD image is divided into multiple small windows, and each small window is input into the YOLOv5 model for detection with a suitable size;
[0022] Local non-maximum suppression and global non-maximum suppression: First, local non-maximum suppression is performed in each sliding window to suppress redundant detections within the window; then the detection results of all sliding windows are merged globally, and global non-maximum suppression is performed to remove overlapping targets.
[0023] In some embodiments, the training of the target matching model in step S2 includes:
[0024] Use a combination of various loss functions for matching.
[0025] Preferably, the multiple loss functions include triplet loss, ArcFace loss, NTXent loss, category-sensitive cross entropy loss, knowledge distillation loss, BYOL self-supervised learning loss, and network parameter L2 regularization loss.
[0026] In some embodiments, step S3 specifically includes:
[0027] Cosine distance and F1 norm are used for matching judgment.
[0028] In the second aspect, a CAD drawing intelligent matching system based on multi-stage deep learning is provided, comprising:
[0029] The dataset construction module is used to load and preprocess CAD drawings and construct triple datasets through data enhancement and sample balancing techniques;
[0030] A model building module is used to build a target detection model and a target matching model, and use a triplet data set to train the target detection model and the target matching model; wherein the target detection model adopts a YOLOv5 model, and combines sliding window detection and non-maximum suppression technology to detect CAD drawings; the target matching model adopts a dual-head network structure;
[0031] The CAD matching module is used to match the CAD drawings to be identified using the trained target detection model and target matching model.
[0032] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the CAD drawing intelligent matching methods is implemented.
[0033] In a fourth aspect, a CAD drawing intelligent matching device is provided, comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, and when the processor executes the computer instructions, any one of the CAD drawing intelligent matching methods described above is executed.
[0034] It should be further explained that the technical features corresponding to the above options can be combined or replaced with each other to form a new technical solution if there is no conflict.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] (1) The present invention solves many difficult problems in the prior art in CAD image review and matching by innovatively combining sliding window detection with global NMS, a dual-head network architecture, a combination of multiple loss functions, and efficient reasoning and matching judgment, and provides an efficient and intelligent solution for practical industrial and engineering applications.
[0037] (2) Multi-stage detection and matching mechanism: Through the combination of sliding window detection, local NMS and global NMS, the processing problem of oversized CAD images is solved, high-precision target detection and matching is achieved, and the redundant detection and missed detection problems in traditional methods are avoided.
[0038] (3) Efficient matching of dual-head network structure: The present invention adopts a dual-head network structure to process position matching and category matching independently, so that category information does not interfere with position matching. At the same time, category information is used to assist matching decisions, thereby improving the matching accuracy and robustness of the system.
[0039] (4) Combination optimization of multiple loss functions: By combining multiple loss functions (such as triplet loss, self-supervised learning loss, distillation loss, ArcFace loss, etc.), the model's feature expression ability, matching accuracy and classification performance are comprehensively improved, especially when dealing with complex samples and class imbalance.
[0040] (5) Efficient knowledge distillation and model lightweighting: Through knowledge distillation technology, the high-performance features of the teacher network are transferred to the student network, realizing the lightweight design of the model, so that the system can still maintain efficient reasoning performance in a resource-constrained environment.
[0041] (6) Optimal matching judgment guided by F1 norm: The present invention uses F1 norm to calculate the optimal matching threshold to ensure the accuracy and stability of the matching results, especially to achieve a good balance between recall rate and precision rate.
[0042] (7) Versatility and scalability: The system supports the processing of multiple data formats (such as PDF, images, and vector graphics), adapts to the needs of multi-source heterogeneous data, has good versatility and scalability, and is suitable for a variety of industrial and engineering application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flow chart of a CAD drawing intelligent matching method based on multi-stage deep learning shown in an embodiment of the present invention;
[0044] Figure 2 The structure and training diagram of a dual-head image matching network shown in an embodiment of the present invention;
[0045] Figure 3 The ultra-large CAD image matching and review process is shown in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention is clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various configurations. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0047] It should be noted that the defects existing in the solutions in the above-mentioned prior art are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above-mentioned problems and the solutions proposed in the embodiments of the present application for the above-mentioned problems below should all be the contributions made by the inventor to the present application in the process of invention and creation, and should not be understood as technical contents known to technical personnel in this field.
[0048] In view of the technical problems pointed out in the background technology, the embodiments provided by the present invention are as follows:
[0049] In an exemplary embodiment, a CAD drawing intelligent matching method based on multi-stage deep learning is provided, referring to Figure 1 , including the following steps:
[0050] S1, load and preprocess CAD drawings, and construct triple datasets through data enhancement and sample balancing techniques;
[0051] S2. Build a target detection model and a target matching model, and use the triplet data set to train the target detection model and the target matching model; wherein the target detection model adopts the YOLOv5 model, and combines the sliding window detection and non-maximum suppression technology (NMS) to detect the CAD drawings; the target matching model adopts a dual-head network structure;
[0052] S3. Use the trained target detection model and target matching model to match the CAD drawings to be identified.
[0053] Specifically, data preprocessing is an important basis of the method, which directly affects the robustness and generalization ability of the model. In view of the characteristics of CAD drawings, the present invention proposes the following processing method in step S1:
[0054] 1.CLAHE (Adaptive Histogram Equalization): It highlights the detailed features in the image by enhancing the local contrast of the image.
[0055] 2. Data enhancement: Generate diverse training data through various means including random rotation, translation, scaling, cropping, color jittering, etc.
[0056] 3. Sample balance and complex data set construction: Use SMOTE (synthetic minority oversampling technology) and RandomUnderSampler (random undersampling technology) to balance the data to avoid the impact of class imbalance during model training.
[0057] Through the above steps, the system generates a high-quality and balanced dataset, providing a solid foundation for subsequent model training.
[0058] Furthermore, the YOLOv5 model is used to perform multi-target detection on CAD images. When processing oversized images, an innovative multi-stage detection method is adopted:
[0059] 1. Sliding window detection: The oversized CAD image is divided into multiple small windows, and each small window is input into the YOLOv5 model for detection with a suitable size. The detection results include the target location and confidence score.
[0060] 2. Local NMS and global NMS: First, local NMS is performed in each sliding window to suppress redundant detections in the window. Then, the detection results of all sliding windows are merged globally, and global NMS is performed to remove overlapping targets. The specific explanation is as follows:
[0061] Assume that the image size is W×H, the sliding window size is w×h, and the sliding step size is s x and y The sliding window moves on the image according to the following formula:
[0062] x i =i·s x ,y j =j·s y
[0063] Where i, j are integers such that 0≤x i ≤Ww and 0≤y j ≤Hh. For each sliding window detection result D k After local NMS processing, it is transformed in the global coordinate system and finally fused through global NMS to obtain the global detection result D final .
[0064] The innovative combination of sliding window detection and global NMS technology in target detection ensures accurate recognition of targets in very large images. Sliding window detection enables the model to process very large images, while global NMS avoids misjudgment caused by overlapping detection.
[0065] Furthermore, the target matching model adopts a dual-head network structure, which improves the recognition and matching capabilities of the model by combining position matching and category matching. A variety of loss functions are used in the matching process. The specific steps are as follows:
[0066] 1. Two-head network architecture: The model structure includes a position matching branch and a category matching branch. After the input image is extracted through the convolution layer, the matching feature vector and category prediction are output respectively.
[0067] 2. Triplet Loss with Hard Negative Mining: used for position matching, measures the similarity between samples by cosine distance, and combines the hard example mining strategy to optimize the feature vector so that the distance between positive samples is minimized and the distance between negative samples is maximized:
[0068] L triplet =max(0,cos(f a ,f n )-cos(f a ,f p)+margin)
[0069] 3. ArcFace loss: used for category matching. By introducing angle intervals, it enhances the aggregation of similar samples in high-dimensional space and optimizes the accuracy of category prediction:
[0070]
[0071] 4. NTXent loss: used in the contrastive learning stage to optimize feature distribution and enhance the distinction between different categories. This loss adjusts the feature distribution through a temperature scaling mechanism to make the distance between similar samples as close as possible:
[0072]
[0073] 5. Category-sensitive cross entropy loss: This is used in the category matching stage to address the category imbalance problem and ensure that the model remains robust even when the category distribution is imbalanced:
[0074]
[0075] 6. Knowledge distillation loss: During the student network training phase, the knowledge of the teacher network is transferred to the student network through knowledge distillation of the final output logits and feature vectors, achieving lightweight model while maintaining high performance:
[0076]
[0077] 7. BYOL self-supervised learning loss: used for feature extraction of the teacher network, enhancing the expressiveness of unlabeled data through self-supervised learning and improving the generalization performance of the model:
[0078]
[0079] 8. Network parameter L2 regularization loss: used to suppress the overfitting problem of complex networks during complex task training:
[0080] L L2 =λ∑k‖θ k || 2
[0081] Finally, we get the comprehensive loss used by the teacher model:
[0082] L teacher =α1L triplet +α2L Arcface +α3L NTXent +α4L CE +α5L BYOL +α6L L2
[0083] The comprehensive loss used by the student model is:
[0084] L student =α1L triplet +α2L Arcface +α3L NTXent +α4L CE +α5L distill +α6L L2
[0085] Through the combined effect of multiple losses, the accuracy and stability of the matching model are significantly improved. Triplet loss and ArcFace loss ensure the accuracy of position matching and category matching, while BYOL and NTXent losses enhance the robustness and versatility of features. Knowledge distillation loss effectively realizes the knowledge transfer between the teacher-student network, making the lightweight model have high performance.
[0086] Furthermore, the reasoning process is implemented in step S3. In the reasoning stage, the extracted feature vector is input into the matching judgment module, and the cosine distance and F1 norm are used to make the final matching judgment, which specifically includes:
[0087] 1. Cosine distance calculation: The system uses cosine distance as a matching metric to determine the similarity of two targets:
[0088]
[0089] 2. Calculation of the optimal matching threshold: In order to determine the best matching threshold, the system calculates the F1 norm of positive and negative samples and selects the optimal threshold to ensure the accuracy and stability of the matching results:
[0090]
[0091] The present invention solves many difficult problems in the prior art in CAD image review and matching by innovatively combining sliding window detection with global NMS, a dual-head network architecture, a combination of multiple loss functions, and efficient reasoning and matching judgment, and provides an efficient and intelligent solution for practical industrial and engineering applications.
[0092] In some examples, a training process of a two-head matching network is given based on the above method. In this example, the two-head matching network adopts a teacher-student architecture, combines multiple loss functions, and improves the performance of the student model through a knowledge distillation strategy. Figure 2 As shown. During the training process, the teacher network and the student network are trained using the following loss functions:
[0093] 1. Teacher network loss function:
[0094] Triplet loss with hard example mining: By optimizing the similarity of feature vectors, it ensures that samples of the same class are closer and samples of different classes are farther away.
[0095] BYOL self-supervised loss minimizes the mean square error loss of two different transform graphs derived from the same source image by the network model, and strengthens the network's ability to learn the intrinsic features of the image.
[0096] ArcFace loss: By introducing angle intervals, the aggregation of similar samples in high-dimensional space is enhanced.
[0097] NTXent loss: Optimizing feature distribution via a temperature scaling mechanism in contrastive learning.
[0098] Category-sensitive cross entropy loss: introduces category weights to enhance the robustness of the model in the case of unbalanced samples.
[0099] L2 regularization loss: suppress overfitting by performing L2 regularization on model parameters.
[0100] 2. Student network loss function:
[0101] The loss is the same as the teacher network, but the BYOL self-supervised loss is not used and the distillation loss is added.
[0102] Distillation loss: includes logits distillation and feature vector distillation, ensuring that the student network acquires the knowledge of the teacher network while maintaining high efficiency and light weight.
[0103] In other examples, based on the above method, the overall matching process of the CAD super-large image is given. For the matching task of super-large CAD images, the present invention designs a complete set of processes that can efficiently and accurately detect and match the components in the super-large image. Figure 3 The process is divided into the following key steps:
[0104] 1. Extra-large image acquisition: First, obtain two extra-large CAD images.
[0105] 2. Dual image size alignment: The two images are aligned in size by letterbox filling to ensure that the subsequent matching steps can be performed at a uniform scale.
[0106] 3. Sliding window detection: The aligned image is divided into blocks for detection using a sliding window method to ensure that the target in each local area can be effectively detected.
[0107] 4. Global coordinate recovery and NMS: The global coordinates of the local targets detected by sliding window are restored, and redundant detection boxes are removed through global non-maximum suppression (NMS).
[0108] 5. Dual-image component position matching based on the Hungarian algorithm: The component positions in the two images are matched using the weighted Hungarian algorithm to obtain possible matching pairs.
[0109] 6. Matching network component matching based on cosine distance: The above matching pairs are further verified using a double-headed matching network, and the matching score is calculated using the cosine distance.
[0110] 7. Similarity analysis and difference analysis: Perform similarity analysis and difference analysis on all matching pairs, and finally output the results and generate a JSON file.
[0111] In another exemplary embodiment, based on the same inventive concept as the above method embodiment, a CAD drawing intelligent matching system based on multi-stage deep learning is provided, comprising:
[0112] The dataset construction module is used to load and preprocess CAD drawings and construct triple datasets through data enhancement and sample balancing techniques; construct a balanced and diverse training dataset;
[0113] A model building module is used to build a target detection model and a target matching model, and use a triplet data set to train the target detection model and the target matching model; wherein the target detection model adopts the YOLOv5 model, and combines sliding window detection and non-maximum suppression technology to detect CAD drawings and process oversized images; the target matching model adopts a dual-head network structure to achieve accurate position matching and category matching of the target;
[0114] The CAD matching module is used to match the CAD drawings to be identified using the trained target detection model and target matching model. It optimizes feature extraction and matching decisions through multiple loss functions, and uses cosine distance and F1 norm for final matching judgment.
[0115] It should be noted that each module of the system implements the functions corresponding to each step in the above method, which will not be described in detail here.
[0116] In another exemplary embodiment, based on the same inventive concept as the above method embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the CAD drawing intelligent matching method provided in the embodiment of the present invention is implemented. Based on such an understanding, the technical solution of this embodiment is essentially or partly contributed to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0117] In another exemplary embodiment, based on the same inventive concept as the above-mentioned method embodiment, a CAD drawing intelligent matching device is provided, including a memory and a processor, the memory stores computer instructions that can be executed on the processor, and the processor executes the CAD drawing intelligent matching method provided by the embodiment of the present invention when running the computer instructions.
[0118] The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
[0119] Embodiments of the subject matter and functional operations described in this specification may be implemented in: tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode and transmit information to a suitable receiver device for execution by the data processing device.
[0120] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application-specific integrated circuits), and the apparatus can also be implemented as special purpose logic circuits.
[0121] Processors suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, just to name a few.
[0122] It should be understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0123] The above specific implementation methods are detailed descriptions of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions and substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A CAD drawing intelligent matching method based on multi-stage deep learning, characterized in that: The following steps are involved: S1, load and preprocess CAD drawings, and construct triple datasets through data enhancement and sample balancing techniques; S2. Build a target detection model and a target matching model, and use the triplet data set to train the target detection model and the target matching model; wherein the target detection model adopts the YOLOv5 model, and combines the sliding window detection and non-maximum suppression technology to detect the CAD drawings; the target matching model adopts a dual-head network structure; S3. Use the trained target detection model and target matching model to match the CAD drawings to be identified.
2. According to claim 1, a CAD drawing intelligent matching method based on multi-stage deep learning is characterized in that: The data enhancement in step S1 includes random rotation, translation, scaling, cropping and color jittering.
3. According to claim 1, a CAD drawing intelligent matching method based on multi-stage deep learning is characterized in that: The sample balancing technique in step S1 includes: The data is balanced by synthetic minority class oversampling and random undersampling techniques.
4. The CAD drawing intelligent matching method based on multi-stage deep learning according to claim 1 is characterized in that: The target detection model is trained in step S2, including: Sliding window detection: The oversized CAD image is divided into multiple small windows, and each small window is input into the YOLOv5 model for detection with a suitable size; Local non-maximum suppression and global non-maximum suppression: First, local non-maximum suppression is performed in each sliding window to suppress redundant detections within the window; then the detection results of all sliding windows are merged globally, and global non-maximum suppression is performed to remove overlapping targets.
5. The CAD drawing intelligent matching method based on multi-stage deep learning according to claim 1 is characterized in that: The target matching model is trained in step S2, including: Use a combination of various loss functions for matching.
6. The CAD drawing intelligent matching method based on multi-stage deep learning according to claim 5 is characterized in that: The multiple loss functions include triplet loss, ArcFace loss, NTXent loss, category-sensitive cross entropy loss, knowledge distillation loss, BYOL self-supervised learning loss, and network parameter L2 regularization loss.
7. The CAD drawing intelligent matching method based on multi-stage deep learning according to claim 1 is characterized in that: The step S3 specifically includes: Cosine distance and F1 norm are used for matching judgment.
8. A CAD drawing intelligent matching system based on multi-stage deep learning, characterized in that: include: The dataset construction module is used to load and preprocess CAD drawings and construct triple datasets through data enhancement and sample balancing techniques; A model building module is used to build a target detection model and a target matching model, and use a triplet data set to train the target detection model and the target matching model; wherein the target detection model adopts a YOLOv5 model, and combines sliding window detection and non-maximum suppression technology to detect CAD drawings; the target matching model adopts a dual-head network structure; The CAD matching module is used to match the CAD drawings to be identified using the trained target detection model and target matching model.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the CAD drawing intelligent matching method described in any one of claims 1 to 7 is implemented.
10. A CAD drawing intelligent matching device, comprising a memory and a processor, wherein the memory stores computer instructions that can be run on the processor, characterized in that: When the processor runs the computer instructions, it executes the CAD drawing intelligent matching method described in any one of claims 1-7.
Citation Information
Cited By
Small-size and conventional target joint detection method and device based on YOLOv5
CN121458713A
A small size and general target joint detection method and device based on YOLOv5
CN121458713B
CAD drawing equipment type identification method and system based on embedded model
CN121884385A
A CAD drawing device type identification method and system based on an embedding model
CN121884385B