End-to-end CAD drawing rollover method and device based on deep learning

Through the end -to -end method based on deep learning, the existing CAD drawing model turning technology has a long time, poor accuracy, poor accuracy, and weak generalization, and achieved fast and accurate CAD drawing models, which improves the efficiency of molding and the efficiency of modeling and improving the efficiency of modeling and improving the efficiency of modeling. accuracy.

CN119339403AActive Publication Date: 2025-01-21HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411226549.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-01-21
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

The existing CAD drawing mold turning technology takes a long time, has poor accuracy, and is weak generalization, and cannot achieve the end-to-end mold turning process.

Method used

Adopting the end -to -end method based on deep learning, by pre -processing the vector graphic in the CAD drawing into geometric graphics, to build a component prediction model for predicting component vector description, and conduct two -stage training of unsupervised pre -training and fine -tuning fine -tuning. Finally, the training model is used to predict the component vector description and post -processing to ensure accuracy.

Benefits of technology

It achieves fast and accurate mold flipping of CAD drawings, improves the generalization of the model, avoids manual intervention, and significantly improves the efficiency and accuracy of mold flipping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339403A_ABST
    Figure CN119339403A_ABST
Patent Text Reader

Abstract

The invention discloses an end-to-end CAD drawing rollover method and device based on deep learning. The method comprises the steps that vector primitives in a CAD drawing are preprocessed into geometric figures, and an image without a logic level is formed; constructing a component prediction model for predicting component vector description according to the image based on deep learning, and performing two-stage training of unsupervised pre-training and supervised fine tuning on the component prediction model; according to the method, the trained component prediction model is utilized to predict the component vector description, and the predicted component vector description is post-processed to ensure the accuracy of constructing the vector description, so that the technical problems of long time consumption, poor accuracy, weak generalization and incapability of realizing end-to-end existing in the conventional CAD drawing rollover can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of CAD-aided design, and in particular relates to an end-to-end CAD drawing re-molding method and device based on deep learning. Background Art

[0002] In the field of architecture, computer-aided design (CAD) is an indispensable tool that greatly improves the efficiency of design and drafting. CAD software can help designers quickly draw accurate apartment drawings and cabinet drawings, realize the transformation of design concepts into visual results, and reduce the time and labor costs required for traditional hand-drawing.

[0003] However, despite the widespread application of CAD technology, the existing CAD remodeling technology still has some defects. CAD remodeling refers to converting CAD drawings into models, and the entire remodeling process can be understood as two core stages, namely, primitive recognition and construction.

[0004] For element recognition, the current mainstream methods are mainly based on layer conventions and feature recognition. Layer conventions refer to drawing related types of components on the same layer and naming them with specified keywords by agreeing on keywords with the drawing drafter in advance, which is convenient for subsequent extraction. The disadvantage is that for different drawings, the draftsman needs to communicate and confirm the drawing method and keyword naming method in advance, which has poor flexibility. Feature recognition refers to identifying related types of component elements through features such as geometric features, color features, legend features, etc. summarized from experience. The disadvantage is that it relies on the summary of previous drawings by professionals, and has poor versatility. Once a drawing that cannot be covered by the rules appears, the recognition will fail.

[0005] As for construction, the current mainstream approach is to use the annotated results obtained based on primitive recognition and the geometric rules summarized based on a large amount of business experience to perform vector description construction of actual apartment components and cabinet panels.

[0006] It can be seen that the existing recognition methods in the above two stages have the defect of relying on a large amount of manual work and experience summary, which leads to a situation where the results after mold reprinting are quite different from the original CAD drawings and cannot fully meet the requirements for accuracy and details, thus affecting the accuracy and efficiency of subsequent manufacturing and construction.

[0007] Therefore, in view of these defects of existing CAD mold making technology, further technological innovation and improvement are needed to achieve more efficient and accurate mold making of CAD drawings, thereby improving the efficiency and accuracy of the architectural design and manufacturing process. Summary of the invention

[0008] In view of the above, the purpose of the present invention is to provide an end-to-end CAD drawing mold re-production method and device based on deep learning, so as to solve the technical problems of existing CAD drawing mold re-production, such as long time consumption, poor accuracy, weak generalization, and inability to achieve end-to-end.

[0009] To achieve the above-mentioned purpose of the invention, an end-to-end CAD drawing remodeling method based on deep learning is provided in an embodiment, comprising the following steps:

[0010] Preprocess vector graphics elements in CAD drawings into geometric shapes and form images without logical hierarchy;

[0011] A component prediction model is constructed based on deep learning to predict component vector descriptions from images, and the component prediction model is trained in two stages: unsupervised pre-training and supervised fine-tuning.

[0012] The trained component prediction model is used to predict the component vector description, and the predicted component vector description is post-processed to ensure the accuracy of the constructed vector description.

[0013] Preferably, the preprocessing of the vector graphics primitives in the CAD drawing into geometric graphics and forming an image without logical hierarchy includes:

[0014] The three logical levels of layers, blocks and vector primitives contained in the CAD drawings are completely broken up from high to low, and the line segments, compound line segments and surface contour types of the vector primitives are further divided, scaled and approximated as basic geometric figures, and the geometric figures are scaled and drawn to a unified bitmap to form an image without logical hierarchy.

[0015] Preferably, when the component is a housing component, the component prediction model constructed based on deep learning includes a first image encoder, a Deformable-DETR, and a multi-head output layer connected in sequence, wherein the first image encoder includes a pre-trained VIT encoder and a multi-scale image feature construction layer connected in sequence,

[0016] The image is input into the component prediction model. The pre-trained VIT encodes the fixed-resolution feature image and then passes through the multi-scale image feature construction layer to form multi-scale image features. The multi-scale image features are encoded and decoded by Deformable-DETR and then input into the multi-head output layer. The vector description of the household components is predicted in the multi-head output layer, where the vector description of the household components includes the component type, component bounding box, and component vector description parameters.

[0017] Preferably, the component prediction model corresponding to the apartment components is trained in two stages: unsupervised pre-training and supervised fine-tuning, including:

[0018] The unlabeled CAD drawings are preprocessed to perform unsupervised pre-training on the first image encoder in the component prediction model;

[0019] The component prediction model is supervised and fine-tuned after preprocessing with annotated CAD drawings. The loss functions used in supervised fine-tuning include category loss based on component type, parameter regression loss based on component vector description parameters, and bounding box related loss based on component bounding box. At the same time, the optimal bipartite graph matching is performed on the N groups of prediction results output by the component prediction model and the M number of supervision data, and the M groups of matching results are used to calculate the parameter loss, parameter regression loss, and bounding box related loss.

[0020] Preferably, when the component is a house-type component, the predicted component vector description is post-processed to ensure the accuracy of the constructed vector description, including:

[0021] Coordinate system conversion, including converting the coordinates of the vector description of the apartment components back to the original CAD drawing coordinate system;

[0022] Fine-tune the component vector description of the original graphics element, including constructing all graphics elements in the original CAD drawing into an AABB tree, traversing all edges in the apartment component vector description in the original CAD drawing coordinate system, and based on a set threshold, using the AABB tree to search for original graphics elements that exceed the threshold as precise edges in the apartment component vector description.

[0023] Preferably, when the component is a cabinet component composed of a plurality of panels, the component prediction model constructed based on deep learning includes a second image encoder and a text decoder connected in sequence;

[0024] The image is input into the component prediction model, and the image features are extracted by the second image encoder, and the image features are input into the text decoder to predict the bounding box of each panel in turn in an autoregressive manner.

[0025] Preferably, when the component is a cabinet component composed of multiple panels, the predicted component vector description is post-processed to ensure the accuracy of the constructed vector description, including:

[0026] The dependency relationship between two panels is determined based on the contact area between the bounding boxes of the panels, a directed acyclic dependency graph is modeled based on the dependency relationship, and the cabinet model is remodeled based on the dependency graph.

[0027] To achieve the above-mentioned purpose of the invention, an embodiment of the present invention further provides an end-to-end CAD drawing remodeling method based on deep learning, comprising:

[0028] A preprocessing module, which is used to preprocess vector graphics primitives in CAD drawings into geometric graphics and form images without logical hierarchy;

[0029] The model building and training module is used to build a component prediction model for predicting component vector descriptions based on images based on deep learning, and to perform two-stage training of the component prediction model: unsupervised pre-training and supervised fine-tuning:

[0030] The prediction and post-processing module is used to predict the component vector description using the trained component prediction model, and to post-process the predicted component vector description to ensure the accuracy of the constructed vector description.

[0031] To achieve the above-mentioned purpose of the invention, an embodiment further provides a computing device, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the above-mentioned end-to-end CAD drawing remodeling method based on deep learning.

[0032] In order to achieve the above-mentioned purpose of the invention, an embodiment further provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the above-mentioned end-to-end CAD drawing remodeling method based on deep learning is implemented.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] Based on the preprocessing of vector graphics in CAD drawings into geometric figures and forming images without logical hierarchy, a component prediction model for predicting component vector description is constructed and a two-stage training of unsupervised pre-training and supervised fine-tuning is carried out to improve the generalization of the model. The trained component prediction model is then used to predict component vector descriptions, and the predicted component vector descriptions are post-processed to ensure the accuracy of the constructed vector descriptions. In this way, end-to-end CAD drawing remodeling is carried out based on deep learning, which does not rely on manual labor, is time-saving and has high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 It is a flowchart of an end-to-end CAD drawing remodeling method based on deep learning provided by an embodiment;

[0037] Figure 2 It is a schematic diagram of an image without logical hierarchy provided by an embodiment;

[0038] Figure 3It is a structural schematic diagram of a component prediction model corresponding to a household component provided in an embodiment;

[0039] Figure 4 is a schematic structural diagram of a first image encoder provided in an embodiment;

[0040] Figure 5 is a structural schematic diagram of a component prediction model corresponding to a cabinet component provided in an embodiment;

[0041] Figure 6 It is a structural schematic diagram of an end-to-end CAD drawing mold remaking device based on deep learning provided in an embodiment. DETAILED DESCRIPTION

[0042] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0043] The inventive concept of the present invention is: to solve the technical problems of long time consumption, poor accuracy, weak generalization, and inability to achieve end-to-end in the existing CAD drawing mold remodeling, the embodiment of the present invention provides an end-to-end CAD drawing mold remodeling method and device based on deep learning, which uniformly converts CAD drawings of any format into images, and pre-trains the image encoder in an unsupervised manner, and then for downstream tasks, combines the 2D target detection algorithm and the 3D parametric model generation algorithm to perform supervised fine-tuning on the component prediction model, and then organically combines it with the post-processing geometric algorithm to form a new and complete end-to-end vector component mold remodeling solution for CAD drawings.

[0044] like Figure 1 As shown, an end-to-end CAD drawing remodeling method based on deep learning provided by an embodiment includes the following steps:

[0045] S1. Preprocess the vector graphics elements in the CAD drawing into geometric figures and form an image without logical hierarchy.

[0046] In the embodiment, the original CAD drawing includes three different logical levels, which are layers, blocks, and vector primitives from high to low, and the primitive types include line segments, compound line segments, and surface contours. The original CAD drawing is preprocessed to process the vector primitives in the CAD drawing into a format that can be understood by the model, specifically including: completely breaking up the hierarchical layers, blocks, and vector primitives in the CAD drawing, and further segmenting, scaling, and approximating the line segments, compound line segments, and surface contour types of the vector primitives as the basis of geometric figures, and scaling and drawing the geometric figures to a unified bitmap based on a fixed physical to image scaling ratio, so as to form an image without logical levels, such as Figure 2shown.

[0047] S2. Based on deep learning, a component prediction model is constructed to predict component vector descriptions based on images, and the component prediction model is trained in two stages: unsupervised pre-training and supervised fine-tuning.

[0048] In the embodiment, the component prediction model constructed based on deep learning is used to predict the component vector description, the image preprocessed in S1 is input into the component prediction model, and the vector description of the output component is predicted. At the same time, it is limited to the limited CAD drawing data containing supervision information. When training the component prediction model, a two-stage training method of unsupervised pre-training and supervised fine-tuning is adopted. Unsupervised pre-training refers to unsupervised pre-training based on massive unlabeled CAD drawing data, and supervised fine-tuning refers to supervised fine-tuning based on the drawing type using a relatively small amount of labeled CAD drawing data for downstream tasks to obtain the final component prediction model.

[0049] In the embodiment, the components include apartment components and cabinet components. For apartment components, their vector description can be represented by a set of plane curve parameters with component class and thickness attributes, usually using the following three types:

[0050] 1. Straight line segment: starting point, ending point;

[0051] 2. Arc: starting point, end point, convexity;

[0052] 3. Bezier curve: starting point, end point, control point;

[0053] The plane coordinate points of each type of plane curve can be represented by the x-axis offset and y-axis offset (x, y) in the bitmap, and the starting point, end point, and control point are represented as (start_x, start_y), (end_x, end_y), and control point (control_x, control_y), respectively. The convexity is represented as bulge. In addition, an additional parameter parameter_type can be added to distinguish the specific plane curve parameter type. Based on this, a single apartment component can be represented by the following parameters: [class, parameter_type, start_x, start_y, end_x, end_y, thickness, bulge, control_x, control_y]. For an input image, there are multiple apartment components, so the final model output result can be represented as a set of the above parameter representations.

[0054] When constructing the component prediction model corresponding to the apartment components, according to the idea of ​​ensemble prediction, a new model structure VIT-MultiScale-Deformable-DETR was designed as the component prediction model based on the 2D target detection algorithm model Deformable-DETR and the first image encoder composed of the pre-trained Vision Transformer (VIT).

[0055] like Figure 3 As shown, the component prediction model corresponding to the household component includes a first image encoder, a Deformable-DETR, and a multi-head output layer connected in sequence, wherein the first image encoder includes a pre-trained VIT encoder and a multi-scale image feature construction layer connected in sequence, wherein the multi-head output layer can use multiple MLP layers. The pre-processed image is input to the component prediction model, and the feature image of fixed resolution is encoded by the pre-trained VIT and then passed through the multi-scale image feature construction layer to form a multi-scale image feature. The multi-scale image feature is encoded and decoded by Deformable-DETR and then input to the multi-head output layer, and the vector description of the household component is predicted in the multi-head output layer, wherein the vector description of the household component includes the component type, the component bounding box, and the component vector description parameters.

[0056] In the embodiment, the pre-trained VIT encoder included in the first image encoder is used to extract image features. Before being used, the VIT encoder is unsupervisedly pre-trained based on MAE (Masked AutoEncoder) and a large amount of unlabeled CAD drawing data. MAE refers to an unsupervised pre-training method for images, which randomly masks some tokens in the image token sequence and attempts to reconstruct them. The embodiment also draws on the method of Feature Pyramid Network (FPN). The multi-scale image feature construction layer adopts a simple feature pyramid structure. Based on the fixed resolution output of the VIT encoder, multi-scale image features are generated by combining convolution / identity mapping / deconvolution and other methods. Its structure is as follows: Figure 4 shown.

[0057] In the embodiment, the multi-head output layer can adopt three MLP layers, corresponding to three prediction heads, which are responsible for predicting different component categories (class), vector description parameters (parameter) of components, and component bounding boxes (bounding box). Deformable-DETR includes Deformable Transformer Encoder and Deformable Transformer Decoder, and the target query (object queries) is input into the Deformable Transformer Decoder. For each input of an image, the Deformable Transformer Decoder can generate N outputs each time, where N is the same as the number of object queries, and these N outputs are then passed through a group of MLP to output N groups of vector descriptions of household components. It should be noted that in the CAD remodeling application scenario of the present invention, the parameter prediction head inputs the real component vector description, and the present invention retains the bounding box prediction head, whose role is to assist the matching calculation process of the prediction result and GT, and to add an additional supervision item to the loss to help the model converge more stably.

[0058] When the component prediction model is fine-tuned for supervised fine-tuning training, the component prediction model is fine-tuned after preprocessing with annotated CAD drawings, and the loss function used in supervised fine-tuning includes a category loss based on the component type, which can be constructed using a focal loss based on the predicted component category and the component category label, a parameter regression loss based on the component vector description parameter, which can be constructed using the L1 loss constructed using the predicted component vector description parameter and the true value of the component vector description parameter, and a bounding box related loss based on the component bounding box, which can be constructed using the L1loss (regression loss) and iou loss constructed using the predicted bounding box and the true value of the bounding box. On this basis, the predicted vector descriptions of the N groups of household components do not participate in all loss calculations. Specifically, the optimal bipartite graph matching is performed for the N groups of predicted vector descriptions output by the component prediction model and the M number of supervised data, and the category loss, parameter regression loss and bounding box related loss are calculated using the M groups of matching results.

[0059] For cabinet components, each cabinet component is composed of a series of panels. Therefore, when defining the cabinet panels in vector description, the cabinet 3D model can be converted into a bounding box (3D bounding box) expression with panels as the granularity, and then processed into a word sequence after quantization. Specifically, a single panel can be expressed as a subsequence of length 6 [x1, y1, z1, x2, y2, z2], where [x1, y1, z1] jointly describe the coordinates of one corner of the 3D bounding box, and [x2, y2, z2] describes the coordinates of the other corner. The entire cabinet is composed of N panels, which can be described as a sequence of length 6*n [panel 1, panel 2, ..., panel n].

[0060] When constructing the component prediction model corresponding to the cabinet panel, a 3D parametric model generation algorithm is used to construct Figure 5 The component prediction model shown in FIG. 1 specifically includes a second image encoder and a text decoder connected in sequence. The preprocessed image is input to the Figure 5 The component prediction model shown extracts image features through the second image encoder, and inputs the image features into the text decoder to predict the bounding box of each panel in turn in an autoregressive manner, and outputs a word sequence of the three-dimensional structure of the cabinet panel.

[0061] The second image encoder can adopt a pre-trained VIT encoder. The difference from the first image encoder is that the second image encoder does not use a multi-scale image feature construction layer, but only uses a pre-trained VIT encoder to extract image features. Before being applied, the pre-trained VIT encoder is also based on MAE and uses massive unlabeled CAD drawing data to perform unsupervised pre-training of the VIT encoder.

[0062] The text decoder can use Transformer Decoder to predict the next token, and predict the bounding box coordinate attributes of a single panel in turn in the form of autoregression. Before the text decoder is applied, it also needs to be trained in combination with downstream tasks. During the specific training, the entire component prediction model is supervised and fine-tuned together with the pre-trained VIT encoder. The annotated CAD drawings are pre-processed and input into the component prediction model, and supervised training is performed using loss functions such as cross entropy loss.

[0063] S3. Use the trained component prediction model to predict the component vector description, and post-process the predicted component vector description to ensure the accuracy of the constructed vector description.

[0064] In the embodiment, the trained component prediction model is deployed and a visual interactive interface is provided, and then end-to-end CAD drawing re-molding prediction is realized. Specifically, the user uploads the CAD drawing through the visual interactive interface, and the CAD drawing is input into the trained component prediction model after preprocessing, and the component vector description is output through forward reasoning prediction. Specifically, the component prediction model corresponding to the user-type component is used to perform reasoning prediction on the household component, and the component prediction model corresponding to the cabinet component is used to perform reasoning prediction on the cabinet component. Then, the prediction result is post-processed to ensure the accuracy of the vector description, and the accurate vector description is returned to the user.

[0065] The predicted vector description of the apartment components is post-processed for each component at the image scale to ensure the accuracy of the vector description and make it more consistent with the accuracy of the original drawing, including coordinate system conversion and fine-tuning the component vector description of the original primitive. Among them, the coordinate system conversion refers to converting the coordinates of the apartment component vector description back to the original CAD drawing coordinate system; fine-tuning the component vector description of the original primitive includes: constructing all primitives of the original CAD drawing into an AABB tree, traversing all edges in the apartment component vector description in the original CAD drawing coordinate system, and based on the set threshold, using the AABB tree to search for the original primitives that exceed the threshold as the precise edges in the apartment component vector description.

[0066] The predicted vector description of the cabinet components is an expression of a series of panel bounding boxes, without any connection between the panels. To make the prediction results more holistic, the predicted vector description of the cabinet components includes: calculating the contact area between each panel, judging the dependency between two panels based on the contact area between the bounding boxes of the panels, modeling a directed acyclic dependency graph based on the dependency, and remodeling the cabinet model based on the dependency graph.

[0067] like Figure 6 As shown, the embodiment also provides an end-to-end CAD drawing re-molding device based on deep learning, including a preprocessing module 61, a model building and training module 62, and a prediction and post-processing module 63, wherein the preprocessing module 61 is used to preprocess the vector primitives in the CAD drawing into geometric figures and form an image without logical hierarchy; the model building and training module 62 is used to construct a component prediction model for predicting component vector descriptions based on images based on deep learning, and perform two-stage training of unsupervised pre-training and supervised fine-tuning on the component prediction model: the prediction and post-processing module 63 is used to use the trained component prediction model to predict component vector descriptions, and post-process the predicted component vector descriptions to ensure the accuracy of the constructed vector descriptions.

[0068] It should be noted that the end-to-end CAD drawing remolding device based on deep learning provided in the above-mentioned embodiment should be illustrated by the division of the above-mentioned functional modules when remolding CAD drawings. The above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal or server is divided into different functional modules to complete all or part of the functions described above. In addition, the end-to-end CAD drawing remolding device based on deep learning provided in the above-mentioned embodiment belongs to the same concept as the end-to-end CAD drawing remolding method embodiment based on deep learning. The specific implementation process is detailed in the end-to-end CAD drawing remolding method embodiment based on deep learning, which will not be repeated here.

[0069] Based on the same inventive concept, an embodiment further provides a computing device, including a memory and one or more processors, wherein executable code is stored in the memory, and when the one or more processors execute the executable code, the end-to-end CAD drawing remodeling method based on deep learning is implemented, specifically including the following steps:

[0070] S1, preprocessing vector graphics primitives in CAD drawings into geometric figures and forming images without logical hierarchy;

[0071] S2. Building a component prediction model based on deep learning for predicting component vector descriptions from images, and performing two-stage training of the component prediction model, namely, unsupervised pre-training and supervised fine-tuning;

[0072] S3. Use the trained component prediction model to predict the component vector description, and post-process the predicted component vector description to ensure the accuracy of the constructed vector description.

[0073] The computing device provided in the embodiment, in addition to the processor and memory, also includes hardware required for other services such as internal bus, network interface, memory, etc. at the hardware level. The memory is a non-volatile memory, and the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the end-to-end CAD drawing remodeling method based on deep learning described in S1-S3 above. Of course, in addition to the software implementation method, the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0074] Based on the same inventive concept, an embodiment further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned end-to-end CAD drawing remodeling method based on deep learning is implemented, which specifically includes the following steps:

[0075] S1, preprocessing vector graphics primitives in CAD drawings into geometric figures and forming images without logical hierarchy;

[0076] S2. Building a component prediction model based on deep learning for predicting component vector descriptions from images, and performing two-stage training of the component prediction model, namely, unsupervised pre-training and supervised fine-tuning;

[0077] S3. Use the trained component prediction model to predict the component vector description, and post-process the predicted component vector description to ensure the accuracy of the constructed vector description.

[0078] In the embodiment, computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data.

[0079] The end-to-end component re-molding technical solution of the CAD drawing provided in the above embodiment has the following technical effects compared with the existing methods (such as first "vector primitive attribution" and then post-processing construction, first "image segmentation" and then post-processing construction, and construction based on pure business rules, etc.):

[0080] 1. Strong generalization performance: The component prediction models in the present invention are trained based on the paradigm of pre-training and then fine-tuning. A large amount of drawing data is used in the training process, which improves the generalization ability of the model. The recognition ability of drawings that have not been seen in the training stage (new drawings uploaded by users) will be better;

[0081] 2. End-to-end output of component vector description: The present invention allows the component prediction model to directly output the component vector description, successfully avoiding a large amount of post-processing construction logic based on experience summary in existing methods, and only retains a small amount of post-processing logic to fine-tune the model prediction results, making the program more maintainable and time-saving;

[0082] 3. Realize the data flywheel: The vector structure predicted by the component prediction model is the data structure actually generated by the user in a certain tool. That is, the more the user uses the tool, the richer the accumulated data that can be used for training, making it easier to implement model iteration and thus improve recognition capabilities.

[0083] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An end-to-end CAD drawing remodeling method based on deep learning, characterized in that: The following steps are involved: Preprocess vector graphics elements in CAD drawings into geometric shapes and form images without logical hierarchy; A component prediction model is constructed based on deep learning to predict component vector descriptions from images, and the component prediction model is trained in two stages: unsupervised pre-training and supervised fine-tuning. The trained component prediction model is used to predict the component vector description, and the predicted component vector description is post-processed to ensure the accuracy of the constructed vector description.

2. The end-to-end CAD drawing remodeling method based on deep learning according to claim 1 is characterized in that: The process of preprocessing vector graphics elements in the CAD drawing into geometric graphics and forming an image without logical hierarchy includes: The three logical levels of layers, blocks and vector primitives contained in the CAD drawings are completely broken up from high to low, and the line segments, compound line segments and surface contour types of the vector primitives are further divided, scaled and approximated as basic geometric figures, and the geometric figures are scaled and drawn to a unified bitmap to form an image without logical hierarchy.

3. The end-to-end CAD drawing remodeling method based on deep learning according to claim 1 is characterized in that: When the component is a house-type component, the component prediction model constructed based on deep learning includes a first image encoder, a Deformable-DETR, and a multi-head output layer connected in sequence, wherein the first image encoder includes a pre-trained VIT encoder and a multi-scale image feature construction layer connected in sequence, The image is input into the component prediction model. The pre-trained VIT encodes the fixed-resolution feature image and then passes through the multi-scale image feature construction layer to form multi-scale image features. The multi-scale image features are encoded and decoded by Deformable-DETR and then input into the multi-head output layer. The vector description of the household components is predicted in the multi-head output layer, where the vector description of the household components includes the component type, component bounding box, and component vector description parameters.

4. The end-to-end CAD drawing remodeling method based on deep learning according to claim 3 is characterized in that: The component prediction model corresponding to the apartment components is trained in two stages: unsupervised pre-training and supervised fine-tuning, including: The unlabeled CAD drawings are preprocessed to perform unsupervised pre-training on the first image encoder in the component prediction model; The component prediction model is supervised and fine-tuned after preprocessing with annotated CAD drawings. The loss functions used in supervised fine-tuning include category loss based on component type, parameter regression loss based on component vector description parameters, and bounding box related loss based on component bounding box. At the same time, the optimal bipartite graph matching is performed on the N groups of prediction results output by the component prediction model and the M number of supervision data, and the M groups of matching results are used to calculate the parameter loss, parameter regression loss, and bounding box related loss.

5. The end-to-end CAD drawing remodeling method based on deep learning according to claim 1 is characterized in that: When the component is a unit component, the predicted component vector description is post-processed to ensure the accuracy of the construction vector description, including: Coordinate system conversion, including converting the coordinates of the vector description of the apartment components back to the original CAD drawing coordinate system; Fine-tune the component vector description of the original graphics element, including constructing all graphics elements in the original CAD drawing into an AABB tree, traversing all edges in the apartment component vector description in the original CAD drawing coordinate system, and based on a set threshold, using the AABB tree to search for original graphics elements that exceed the threshold as precise edges in the apartment component vector description.

6. The end-to-end CAD drawing remodeling method based on deep learning according to claim 1 is characterized in that: When the component is a cabinet component composed of multiple panels, the component prediction model constructed based on deep learning includes a second image encoder and a text decoder connected in sequence; The image is input into the component prediction model, and the image features are extracted by the second image encoder, and the image features are input into the text decoder to predict the bounding box of each panel in turn in an autoregressive manner.

7. The end-to-end CAD drawing remodeling method based on deep learning according to claim 1 is characterized in that: When the component is a cabinet component composed of multiple panels, the predicted component vector description is post-processed to ensure the accuracy of the constructed vector description, including: The dependency relationship between two panels is determined based on the contact area between the bounding boxes of the panels, a directed acyclic dependency graph is modeled based on the dependency relationship, and the cabinet model is remodeled based on the dependency graph.

8. An end-to-end CAD drawing remodeling method based on deep learning, characterized in that: include: A preprocessing module, which is used to preprocess vector graphics primitives in CAD drawings into geometric graphics and form images without logical hierarchy; The model building and training module is used to build a component prediction model for predicting component vector descriptions based on images based on deep learning, and to perform two-stage training of the component prediction model: unsupervised pre-training and supervised fine-tuning: The prediction and post-processing module is used to predict the component vector description using the trained component prediction model, and to post-process the predicted component vector description to ensure the accuracy of the constructed vector description.

9. A computing device comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the one or more processors execute the executable code, they are used to implement the end-to-end CAD drawing remodeling method based on deep learning as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Vector building drawing based method for reconstructing three-dimensional model

    CN101673410A

  • Industrial defect detection method, device and equipment and readable storage medium

    CN115239638A

  • Method and system for providing three-dimensional computer-aided design (CAD) model in CAD environment

    CN116324783A

  • Bionic product modeling method and system for digital twin driven additive manufacturing

    CN116992516A

  • CAD vector model generation method and device based on building sketch contour sequence

    CN117454495A