Method and device for converting CAD drawing into IFC file and medium
By converting CAD drawings into IFC files through large language models and fine-tuning technology, the problem of separation between two-dimensional CAD and BIM models is solved, efficient information synchronization and conversion is achieved, operational complexity and costs are reduced, and engineering collaboration efficiency is improved.
Patent Information
- Application Number
- CN202510717600.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-16
AI Technical Summary
In traditional architectural design, two-dimensional CAD drawings are separated from BIM models, and design changes need to be manually synchronized across multiple software programs, which is inefficient and prone to human errors. BIM software is expensive and complex to operate, and IFC file processing consumes a lot of memory and has a slow response.
A large language model is combined with the construction engineering industry knowledge base, image recognition module and fine-tuning model. By identifying CAD drawings, a component identification list in Json format is generated and converted into an IFC format file. Supervised learning is used to optimize the model recognition accuracy and achieve lossless transmission of geometric models and attribute information.
It achieves fast and reliable conversion from CAD drawings to IFC files, breaks through the barriers between different software, ensures the synchronization of design information throughout the entire life cycle, reduces costs, avoids human operational errors and memory usage issues of BIM software, and improves processing efficiency.
Smart Images

Figure CN120654281A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of software development and architectural design technology, and in particular to a method, device, and medium for converting CAD drawings into IFC files. Background Art
[0002] In traditional architectural design workflows, 2D CAD drawings and BIM models are disconnected. Design changes require manual synchronization across multiple software packages, which is inefficient and prone to human error. Furthermore, BIM software's high cost and complex operation hinder its widespread adoption in engineering applications. Furthermore, professional BIM software often faces issues such as high memory usage and slow response times when processing IFC files.
[0003] IFC (Industry Foundation Classes), as a common open standard format in the construction industry, can break through the barriers of different two-dimensional CAD software and BIM tools, and achieve lossless transmission of geometric models and attribute information, thereby eliminating the problem of repeated export / import of multiple software due to format incompatibility in traditional workflows. At the same time, IFC format files not only contain geometric data (such as building structures, piping systems, etc.), but also carry non-geometric information such as materials, parameters, and equipment properties to form an extensible information model containing full life cycle data. In addition, based on IFC format files, BIM models can be viewed directly in the CAD environment, and operations such as model review and data extraction can be completed without relying on professional BIM software, thereby improving engineering collaboration efficiency. Currently, there is no effective software or tool for converting CAD to IFC format in the existing technology.
[0004] Based on this, there is an urgent need to study a technology that can convert CAD drawings into IFC format models to ensure that design information is synchronized in real time throughout the entire life cycle of the building and reduce problems such as human operational errors. Summary of the Invention
[0005] In order to solve at least one of the technical problems mentioned in the background technology, the present application provides a method, device and medium for converting CAD drawings into IFC files.
[0006] This application is implemented through the following technical solutions:
[0007] A method for converting a CAD drawing into an IFC file, comprising:
[0008] Based on the large language model, combined with the construction engineering industry knowledge base, image recognition module and fine-tuning model, an initial large model suitable for engineering drawing is established;
[0009] Using the initial large model to identify the CAD drawing, and outputting a component identification list in Json format;
[0010] Proofread the component recognition list to check whether the recognition accuracy reaches the expected value. If not, mark the error sample control and feed it back to the fine-tuning model, perform supervised learning on the fine-tuning model, thereby optimizing the initial large model, and return to the previous step for iterative optimization until the recognition accuracy reaches the expected value, thereby obtaining the optimized large model;
[0011] Use the optimized large model to identify the CAD drawings to be identified and generate a component identification list in Json format;
[0012] The component data in the component identification list in the Json format is converted into a corresponding IFC format file.
[0013] In some embodiments, in the initial large model:
[0014] The image recognition module converts the CAD drawings into text data and inputs the text data into the large language model;
[0015] The large language model determines the component identification list output in Json format based on the text data and the construction engineering industry knowledge base;
[0016] The fine-tuning model is used to fine-tune the parameters of the large language model to optimize the large language model and improve the recognition accuracy.
[0017] In some embodiments, the large language model adopts the Deepseek large language model; the image recognition module adopts the OCR recognition model; the fine-tuning model adopts a low-rank adaptation structure to replace the target layer in the large language model and incrementally update the weights; the construction engineering industry knowledge base includes engineering drawings and specification documents, as well as field practice data.
[0018] In some implementations, the construction engineering industry knowledge base creation and loading process includes:
[0019] Clean and structure engineering drawings, specification documents, and field practice data related to the construction industry, extract key information, and convert it into a standard text format;
[0020] Use vectorization tools to convert text into high-dimensional vectors and store them in a vector database;
[0021] Calling the large language model and configuring an embedding model to support vector retrieval;
[0022] And / or, the mounting process of the fine-tuning model includes:
[0023] Injecting a low-rank adaptation structure into the target convolutional layer of the large language model;
[0024] Initialize low-rank matrices, including random initialization and zero initialization;
[0025] In the subsequent iterative optimization process: forward propagation, the low-rank adaptation increment term is superimposed on the original convolutional layer output; back propagation, only the parameters of the fine-tuning model are updated, the original parameters of the large language model remain frozen, and the gradient calculation only acts on the low-rank matrix; after training is completed, the increment is merged with the original weight;
[0026] And / or, the working process of the image recognition module includes:
[0027] Extract vector data: parse DXF / DWG files of CAD drawings, extract basic geometric information, and retain attribute information;
[0028] Converting the vector data into a rasterized image by using a coordinate mapping technique, and generating a coordinate comparison table;
[0029] Spatially match the recognized text area coordinates with the original vector coordinates of the CAD drawing to establish the association between the text annotation and the graphic component;
[0030] Perform structured recognition on table areas in CAD drawings and accurately extract key information;
[0031] Dynamic threshold segmentation algorithm is used to eliminate watermark interference in CAD drawings.
[0032] In some embodiments, further comprising:
[0033] The configuration of the intelligent agent is dynamically modified by fine-tuning the parameters of the model.
[0034] In some embodiments, the component identification list is proofread to check whether the identification accuracy reaches the expected value, and if not, an error sample control mark is performed and fed back to the fine-tuning model, including:
[0035] By comparing the component identification list in the Json format output by the initial large model with the original CAD drawing, the component data in the component identification list is located to see if they are consistent with the corresponding original data. If they are inconsistent, they are marked as errors, and the recognition accuracy is calculated based on the marking results;
[0036] If the recognition accuracy is lower than the expected value, an error sample data set is created. Each sample data in the data set consists of an error mark, a Json format error output of the component recognition list, and a Json format correct output obtained based on the original CAD drawing. The Json format correct output is obtained by processing and converting the original CAD drawing.
[0037] The error sample data set is divided into a training set and a validation set according to a preset ratio;
[0038] The sample data in the error sample data set is vectorized and encoded to generate a feature matrix for so-called fine-tuning model training.
[0039] In some embodiments, the calculation of the recognition accuracy rate based on the labeling results includes:
[0040] By querying the IFC dictionary library of the construction engineering industry, the parameter list of each component is obtained;
[0041] According to business needs, a weight system is selected from a pre-established weight system, and the weight ratio of the parameters of each component is determined according to the selected weight system;
[0042] The parameters of each component are matched one by one to obtain the weight of each parameter. The weights of all parameters of each component are statistically calculated using the cosine similarity weighted score matching method to obtain the final score of the component as the recognition accuracy.
[0043] The calculation process of the pre-similarity weighted score matching method is as follows: the original vector of each parameter is multiplied by its corresponding weight element by element and then accumulated, and the directional consistency of the weighted vector is calculated.
[0044] In some embodiments, converting the component data in the component identification list in the Json format into a corresponding IFC format file includes:
[0045] Use open source tool chains to convert component data in Json format into ifcJson format data, and convert ifcJson format data into IFC format data;
[0046] Generate entity relationships through attribute mapping based on IFC format data;
[0047] Perform geometric data consistency verification to ensure that the converted model meets the BIM software parsing standards.
[0048] In a second aspect, the present application proposes an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the above-mentioned methods when executing the computer program.
[0049] In a third aspect, the present application proposes a computer-readable storage medium having a computer program stored thereon, which implements any one of the above-mentioned methods when executed by a processor.
[0050] This application proposes a method for converting CAD drawings to IFC files. Based on a large model combined with machine learning technology, it can quickly and reliably convert CAD drawings into IFC files. As a common open standard format in the construction industry, IFC can break through the barriers of different two-dimensional CAD software and BIM tools, realize lossless transmission of geometric models and attribute information, eliminate the problem of repeated export / import of multiple software due to format incompatibility in traditional workflows, establish a unified data channel, ensure the synchronization of design information throughout the entire life cycle, and reduce human operational errors; at the same time, IFC files can be directly processed by CAD software, and users can participate in collaboration without additional configuration of BIM software, which reduces costs and avoids the problems of high memory usage and slow response faced by professional BIM software, significantly improving processing efficiency;
[0051] Correspondingly, the electronic device and medium proposed in this application have the same technical effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings described herein are used to provide a further understanding of the embodiments of the present application, constitute a part of the present application, and do not constitute a limitation of the embodiments of the present application. In the drawings:
[0053] Figure 1 A schematic diagram of the method flow proposed in the embodiment of the present application;
[0054] Figure 2 A schematic diagram of the system hardware architecture proposed in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of an electronic device proposed in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of a computer-readable storage medium proposed in an embodiment of the present application;
[0057] Reference numerals and corresponding component names:
[0058] 200 - system, 201 - input device, 202 - output device, 203 - processor A, 204 - memory A, 300 - electronic device, 310 - memory B, 320 - processor B, 311 - computer program A, 400 - computer-readable storage medium, 411 - computer program B. DETAILED DESCRIPTION
[0059] Hereinafter, the terms "include" or "may include" as used in various embodiments of the present application indicate the presence of an invented function, operation, or element, and do not limit the addition of one or more functions, operations, or elements. In addition, as used in various embodiments of the present application, the terms "include," "have," and their cognates are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be understood as excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing or the possibility of adding one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing.
[0060] In various embodiments of the present application, the expression "or" or "at least one of A or / and B" includes any or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0061] The expressions (such as "first", "second", etc.) used in the various embodiments of the present application may modify the various constituent elements in the various embodiments, but may not limit the corresponding constituent elements. For example, the above expressions do not limit the order and / or importance of the elements. The above expressions are only used to distinguish one element from other elements. For example, a first user device and a second user device indicate different user devices, although both are user devices. For example, without departing from the scope of the various embodiments of the present application, a first element may be referred to as a second element, and similarly, a second element may also be referred to as a first element.
[0062] It should be noted that when a component is described as being “connected” to another component, the first component may be directly connected to the second component, and a third component may be “connected” between the first and second components. Conversely, when a component is described as being “directly connected” to another component, it can be understood that there is no third component between the first and second components.
[0063] The terms used in the various embodiments of the application are only used to describe the purpose of specific embodiments and are not intended to limit the various embodiments of the application. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise limited, all terms used here (including technical terms and scientific terms) have the same meaning as the meaning generally understood by those of ordinary skill in the art of the application. The terms (such as the terms defined in the dictionary generally used) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having idealized meaning or too formal meaning, unless clearly defined in the various embodiments of the application.
[0064] In order to make the objectives, technical solutions and advantages of this application more clear, the present application is further described in detail below in conjunction with examples and drawings. The schematic implementation methods of this application and their descriptions are only used to explain this application and are not intended to limit this application.
[0065] The present application embodiment proposes a method for converting CAD drawings into IFC files, such as Figure 1 As shown, the method proposed in the embodiment of the present application includes the following steps:
[0066] Step 110 , based on the large language model, combined with the construction engineering industry knowledge base, image recognition module and fine-tuning model, establish an initial large model suitable for engineering drawing.
[0067] Step 120: Use the initial large model to identify the CAD drawing and output a component identification list in Json format.
[0068] Step 130: Proofread the component identification list to check whether the recognition accuracy reaches the expected value. If not, mark the error sample control and feed it back to the fine-tuning model. Perform supervised learning on the fine-tuning model to optimize the initial large model, and return to the previous step for iterative optimization until the recognition accuracy reaches the expected value, thereby obtaining the optimized large model.
[0069] Step 140: Use the optimized large model to identify the CAD drawing to be identified, and generate a component identification list in Json format.
[0070] Step 150: Convert the component data in the build identification list in the Json format into a corresponding IFC format file.
[0071] Furthermore, in step 110 of the embodiment of the present application, the large language model used can be, but is not limited to: DeepSeek large language model, which is a deep neural network model based on the Transformer architecture (specifically, a Decoder-only Transformer based on a dynamic sparse attention mechanism can be used, which captures sequence dependencies through causal language modeling, combines fill-in modeling to improve long text processing capabilities, and uses MoE architecture to dynamically activate expert modules, such as 128-choose-8, to improve training efficiency by more than 20% while keeping the number of parameters unchanged). The image recognition module can be, but is not limited to: OCR (Optical Character Recognition) recognition model (which can use VisionTransformer architecture, process input images through 16×16 blocks, use CLIP contrast learning to achieve image-text alignment pre-training, cooperate with MAE's mask reconstruction task to enhance feature extraction capabilities, and finally output multi-scale features through a CNN-Transformer hybrid architecture to support pixel-level recognition and semantic understanding), which converts images into text data and inputs them into the large language model. The fine-tuning model can adopt, but is not limited to: LoRA (Low-Rank Adaptation) fine-tuning model, which incrementally updates the key weights of the large model embedding layer and attention mechanism, injecting knowledge of the construction engineering field while retaining the general semantic understanding ability. The construction engineering industry knowledge base mainly includes the following content-related data: (1) Engineering drawings and specification documents: CAD design drawings (DWG / DXF format) covering sub-sectors such as construction / mechanics / electricity, BIM model parametric data, construction acceptance specifications (GB / T series standards), material performance parameter tables and other technical information; (2) On-site practice data: Collect unstructured text such as supervision logs, quality inspection reports, equipment operation and maintenance records at the construction site to supplement the language expression features in actual engineering scenarios. The large language model determines the output component recognition list in Json format based on the image recognition text and the construction engineering industry knowledge base. The fine-tuning model is used to fine-tune the parameters of the large language model and optimize the large language model to improve the recognition accuracy of the large model.
[0072] In step 110, the large model building process includes:
[0073] First, create a knowledge base for the construction engineering industry and mount and integrate it:
[0074] Clean and structure engineering drawings and specification documents related to the construction industry, field practice data (such as PDF, TXT, web pages, etc.), extract key information and convert it into standard text format;
[0075] Use vectorization tools (such as Hugging Face and Ollama) to convert text into high-dimensional vectors and store them in vector databases (such as FAISS and Milvus).
[0076] After that, call the large language model and configure the embedding model to support vector retrieval;
[0077] Enable the knowledge base plug-in in the Big Semantic Model service and set a similarity threshold to ensure that the Big Language Model prioritizes using knowledge base content to answer professional questions.
[0078] Configure model parameters: set opening remarks, role description, and execution priority (force calling the knowledge base or online search);
[0079] Plugin integration: Set up automatic synchronization of the knowledge base (such as scheduled web crawling, document updates, etc.) to ensure the timeliness of model call information, and optimize intent recognition rules and retrieval algorithms through user feedback and log analysis.
[0080] Then, the LoRA model is inserted into the original convolutional layer of the large language model, and the original weights are frozen to reduce the number of training parameters. A low-rank incremental matrix is constructed by randomly initializing the matrix and zero-initializing the matrix. During forward propagation, the input is expanded into a matrix form, and the low-rank update amount is calculated and superimposed on the original convolution output to achieve efficient parameter fine-tuning while retaining the pre-trained knowledge of the original model. The specific process is as follows:
[0081] Select target convolutional layer: Because deep features are more task-specific, low-rank adaptation structures are usually injected into the deep layers of deep neural networks (the last few convolutional layers) or specific task-related layers.
[0082] Initialize the low-rank matrix: Randomly initialize the matrix, use random Gaussian initialization to ensure the diversity of the initial perturbation; zero-initialize the matrix, initialize it to an all-zero matrix to avoid interference with the original model in the early stages of training.
[0083] During subsequent iterative optimization, the LoRA increment is added to the original convolutional layer output in the forward propagation phase, resulting in output = W0*X + T*S*X (where X represents the input features). In the backward propagation phase, only the parameters T and S (T represents the correct component parameters, while S represents the component parameters actually recognized by the large model) are updated. The original parameters of the large language model remain frozen, and the gradient calculation is performed only on the low-rank matrix. After training is complete, the increment ΔW (i.e., TS) is merged with the original weights: W = W0 + TS.
[0084] Finally, the image recognition module is embedded in the model. That is, the image is converted into text data through the image recognition module and input into the large language model. The specific conversion process is as follows:
[0085] Extract vector data: Use Python's ezdxf library to parse DXF / DWG files of CAD drawings, extract basic geometric information such as lines, arcs, and text annotations, and retain attributes such as layers, colors, and line types;
[0086] Convert vector data into raster images through coordinate mapping technology and generate a coordinate comparison table;
[0087] Spatially match the coordinates of the text area recognized by OCR with the original CAD vector coordinates to establish the association between text annotations and graphic components;
[0088] Perform structured recognition of table areas in CAD drawings to accurately extract key information such as component numbers, specifications, and parameters (supports merging of tables across pages);
[0089] A dynamic threshold segmentation algorithm is used to eliminate watermark interference common in CAD drawings and improve the recognition rate of fuzzy text.
[0090] Thus, an initial large model suitable for engineering drawing is established.
[0091] Optionally, step 110 of the embodiment of the present application further includes: dynamically modifying the configuration of the intelligent agent (large language model + perception + execution through LoRA model parameters, perception is the process of understanding the drawings through the knowledge base and image recognition model, and correction is performed through the LoRA model, and execution is the standardized output of the knowledge understood by the large language model through the configured intelligent agent prompt words and LongChain project). The specific process is as follows:
[0092] First, the LoRA parameters are serialized and encoded using Protobuf structured serialization combined with the LZ4 compression algorithm to convert the LoRA parameter matrices A and B into compact data packets D.
[0093] Distinguish different modules of parameters in compact data packets (such as attention head parameters and word vector parameters of large language models) for data classification;
[0094] Through matrix decomposition technology, we can identify which parameters control "sentence fluency", which parameters affect "emotional judgment", and which parameters affect "central intention".
[0095] Generate description S and process the parameters in text form. For example, the data package contains optimization parameters for "weight name" to increase the weight "weight ratio", especially improving the handling of "solution selection" related issues;
[0096] The description S is used as the supplementary data of the intelligent agent, and the intelligent agent is integrated to form a dynamic intelligent agent model, thereby realizing the model fine-tuning method of multi-modal data correction.
[0097] Furthermore, in step 130 of the embodiment of the present application, the specific implementation process is as follows:
[0098] By comparing the component identification list in Json format output by the initial large model with the original CAD drawing, the component data (such as material parameters, geometric dimensions, etc.) in the component identification list are located to see whether they are consistent with the corresponding original data. If they are inconsistent, they are marked as errors, and the recognition accuracy is calculated based on the marking results.
[0099] If the recognition accuracy is less than the expected value (e.g., 85%, 90%, etc.), an error sample dataset is created. Each sample in the dataset consists of a pair of an error marker, an error output in JSON format from the component recognition list, and a correct JSON output obtained from the original CAD drawing. The error JSON output is directly extracted from the component recognition list, while the correct JSON output requires processing the original CAD drawing and converting it into JSON format.
[0100] The error sample data set is divided into a training set and a validation set according to a preset ratio (e.g. 8:2, 7:3).
[0101] The sample data in the error sample dataset is vectorized and encoded to generate a feature matrix for fine-tuning model training.
[0102] Optionally, in step 130, a cosine similarity weighted score matching method is used to verify the accuracy, and the specific process is as follows:
[0103] By querying the IFC dictionary library of the construction engineering industry, a parameter list of each component is obtained. In this embodiment of the application, a column element is used as an example for illustrative explanation. By consulting the IFC dictionary library of the construction engineering industry, various secondary parameters of the column element are obtained and summarized into a secondary parameter list. By consulting the IFC dictionary library, it can be known that the parameters of the column element include length, width, height, coordinates, material, process technology, connection object, etc.
[0104] The parameters of each component are matched one by one to obtain the weight of each parameter, and the cosine similarity weighted score matching method is used to calculate the weights of all parameters of each component to obtain the final score of the component. The process of determining the weight of each parameter includes: according to the standard compiled by IFC, the important parameters are placed at the front of the parameter list, usually the first 5 parameters are the main parameters, and the subsequent parameters are unimportant parameters. According to the above standard, the total weight sum of the main parameters is defined as 80%, and the total weight sum of the subsequent parameters is defined as 20%. The weight reduction rate of the main parameters (i.e., the first 5 parameters) is 20%, that is, the second weight T2 = T1 * 0.8 (according to the total weight sum, the weight of the first 5 parameters can be calculated). Similarly, excluding the first 5 parameters, the weight reduction rate of the subsequent parameters is 50% (according to the total weight sum, the weight of other parameters can be calculated); through the above calculation process, the corresponding weight of each parameter can be obtained.
[0105] The weighted cosine similarity calculation process is as follows: generate the original vector through the model, assign weights, multiply the vector and the weight element by element and accumulate them, and measure the directional consistency of the weighted vector. Its calculation formula is expressed as:
[0106]
[0107] Among them, A and B are the conversion vectors corresponding to the correct identification parameters and the actual identification parameters of the large model respectively (where the correct identification parameter is 1 and the incorrect one is -1); n is the dimension of the vector (i.e. the parameter quantity under the component); w i Indicates the weight corresponding to the i-th parameter; A i 、B i They are the vector values corresponding to the correctly identified i-th parameter and the i-th parameter actually identified by the large model (where correct is 1 and incorrect is -1).
[0108] Optionally, in step 120, the Json_repair library can be used to automatically generate some format error samples to simulate common problems such as missing quotation marks and mismatched brackets; and based on adversarial generation technology, common engineering feature errors such as material parameter out-of-bounds and component type conflicts can be created to further enhance the sample types in the error sample dataset and improve the reliability of training.
[0109] Furthermore, in step 150 of the embodiment of the present application, the process of converting the component data in the Json format into the IFC format file is as follows:
[0110] First, convert component data in Json format into ifcJson format data, and then convert ifcJson format data into IFC format data. You can use the open source tool chain to achieve structured conversion.
[0111] Then, through attribute mapping, entity relationships are generated;
[0112] Finally, geometric data consistency verification is performed to ensure that the converted model meets the BIM software parsing standards.
[0113] Specifically, you can use ifcjson-converter (based on Node.js) or the JSON module of IfcOpenShell to convert component data in Json format to ifcJson format data: verify whether the input Json format data complies with the component data specification (for example, the mapping of attribute names to IFC entities); use the tool to convert Json key-value pairs to the hierarchical structure of ifcJson; and supplement the necessary IFC metadata (such as the type field to mark the entity type). Specifically, you can use IfcOpenShell (a Python library) or web-ifc (a JavaScript library) to convert ifcJson format data to IFC format data: parse the ifcJson structure and generate an in-memory IFC model; call the tool's serialization interface (such as ifcopenshell.file.write()) to output the .ifc file; and verify the compliance of the output file (for example, using BIMServer verification).
[0114] The method proposed in the embodiment of the present application is based on a large model combined with machine learning technology, and can quickly and reliably realize the conversion of CAD drawings into IFC files. As an open standard format commonly used in the construction industry, IFC can break through the barriers of different two-dimensional CAD software and BIM tools, realize lossless transmission of geometric models and attribute information, eliminate the problem of repeated export / import of multiple software due to format incompatibility in traditional workflows, establish a unified data channel, ensure the synchronization of design information throughout the life cycle of the building, and reduce human operational errors; IFC files can be directly processed by CAD software, and users can participate in collaboration without additional configuration of BIM software, which reduces costs and avoids the problems of high memory usage and slow response faced by professional BIM software processing, significantly improving processing efficiency.
[0115] The present application also proposes a system for converting CAD drawings to IFC files. Figure 2 As shown, the system 200 proposed in the embodiment of the present application includes:
[0116] Input device 201, output device 202, processor A203 and memory A204; wherein the number of processor A203 and memory A204 can be one or more, Figure 2 The input device 201, the output device 202, the processor A203 and the memory A204 can be connected by a bus or other means. Figure 2 The bus connection is taken as an example.
[0117] Among them, by calling the operation instructions stored in the memory A204, the processor A203 is used to execute the steps shown in steps 110 to 150 in the above method.
[0118] Optionally, by calling the operation instructions stored in the memory A204, the processor A203 is also used to execute any implementation method in the corresponding embodiments of the above method.
[0119] The embodiment of the present application also provides an electronic device 300, such as Figure 3 As shown, the electronic device 300 includes: a memory B310, a processor B320, and a computer program A311 stored in the memory B310 and executable on the processor B320. When the processor B320 executes the computer program A311, the steps 110 to 150 in the above method are implemented.
[0120] Optionally, when the processor B320 executes the computer program A311, any implementation method corresponding to the embodiments of the above method can be implemented.
[0121] It should be noted that the electronic device proposed in the embodiment of the present application is a device used to implement the above method. Therefore, based on the above method proposed in the embodiment of the present application, technical personnel in this field can understand the specific implementation methods of the electronic device in the embodiment of the present application and its various variations. Therefore, how the electronic device specifically implements the above method will not be introduced in detail here. As long as the electronic device used by technical personnel in this field to implement the above method falls within the scope of protection to be protected by this application.
[0122] The present application also provides a computer-readable storage medium 400, such as Figure 4 As shown, the computer-readable storage medium 400 stores a computer program B411, which implements the steps 110 to 150 in the above method when executed by the processor.
[0123] Optionally, when the computer program B411 is executed by a processor, it can implement any implementation method in the embodiments corresponding to the above method.
[0124] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0125] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0126] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0129] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.
Claims
1. A method for converting CAD drawings to IFC files, characterized in that: include: Based on the large language model, combined with the construction engineering industry knowledge base, image recognition module and fine-tuning model, an initial large model suitable for engineering drawing is established; Using the initial large model to identify the CAD drawing, and outputting a component identification list in Json format; Proofread the component recognition list to check whether the recognition accuracy reaches the expected value. If not, mark the error sample control and feed it back to the fine-tuning model, perform supervised learning on the fine-tuning model, thereby optimizing the initial large model, and return to the previous step for iterative optimization until the recognition accuracy reaches the expected value, thereby obtaining the optimized large model; Use the optimized large model to identify the CAD drawings to be identified and generate a component identification list in Json format; The component data in the component identification list in the Json format is converted into a corresponding IFC format file.
2. The method for converting a CAD drawing to an IFC file according to claim 1, wherein: In the initial large model: The image recognition module converts the CAD drawings into text data and inputs the text data into the large language model; The large language model determines the component identification list output in Json format based on the text data and the construction engineering industry knowledge base; The fine-tuning model is used to fine-tune the parameters of the large language model to optimize the large language model and improve the recognition accuracy.
3. The method for converting a CAD drawing to an IFC file according to claim 2, wherein: The large language model adopts the Deepseek large language model; the image recognition module adopts the OCR recognition model; the fine-tuning model adopts a low-rank adaptation structure to replace the target layer in the large language model and incrementally update the weights; the construction engineering industry knowledge base includes engineering drawings and specification documents, as well as on-site practice data.
4. The method for converting a CAD drawing to an IFC file according to claim 2, wherein: The construction engineering industry knowledge base creation and mounting process includes: Clean and structure engineering drawings, specification documents, and field practice data related to the construction industry, extract key information, and convert it into a standard text format; Use vectorization tools to convert text into high-dimensional vectors and store them in a vector database; Calling the large language model and configuring an embedding model to support vector retrieval; And / or, the mounting process of the fine-tuning model includes: Injecting a low-rank adaptation structure into the target convolutional layer of the large language model; Initialize low-rank matrices, including random initialization and zero initialization; In the subsequent iterative optimization process: forward propagation, the low-rank adaptation increment term is superimposed on the original convolutional layer output; back propagation, only the parameters of the fine-tuning model are updated, the original parameters of the large language model remain frozen, and the gradient calculation only acts on the low-rank matrix; after training is completed, the increment is merged with the original weight; And / or, the working process of the image recognition module includes: Extract vector data: parse DXF / DWG files of CAD drawings, extract basic geometric information, and retain attribute information; Converting the vector data into a rasterized image by using a coordinate mapping technique, and generating a coordinate comparison table; Spatially match the recognized text area coordinates with the original vector coordinates of the CAD drawing to establish the association between the text annotation and the graphic component; Perform structured recognition on table areas in CAD drawings and accurately extract key information; Dynamic threshold segmentation algorithm is used to eliminate watermark interference in CAD drawings.
5. The method for converting a CAD drawing to an IFC file according to any one of claims 1 to 4, characterized in that: Also includes: The configuration of the intelligent agent is dynamically modified by fine-tuning the parameters of the model.
6. The method for converting a CAD drawing to an IFC file according to any one of claims 1 to 4, characterized in that: The proofreading of the component identification list to check whether the identification accuracy reaches the expected value, and if not, marking the error sample and feeding it back to the fine-tuning model, includes: By comparing the component identification list in the Json format output by the initial large model with the original CAD drawing, the component data in the component identification list is located to see if they are consistent with the corresponding original data. If they are inconsistent, they are marked as errors, and the recognition accuracy is calculated based on the marking results; If the recognition accuracy is lower than the expected value, an error sample data set is created. Each sample data in the data set consists of an error mark, a Json format error output of the component recognition list, and a Json format correct output obtained based on the original CAD drawing. The Json format correct output is obtained by processing and converting the original CAD drawing. The error sample data set is divided into a training set and a validation set according to a preset ratio; The sample data in the error sample data set is vectorized and encoded to generate a feature matrix for so-called fine-tuning model training.
7. The method for converting a CAD drawing to an IFC file according to claim 6, wherein: The calculation of the recognition accuracy rate based on the marking results includes: By querying the IFC dictionary library of the construction engineering industry, the parameter list of each component is obtained; The parameters of each component are matched one by one to obtain the weight of each parameter. The weights of all parameters of each component are statistically calculated using the cosine similarity weighted score matching method to obtain the final score of the component as the recognition accuracy. The calculation process of the pre-similarity weighted score matching method is as follows: the original vector of each parameter is multiplied by its corresponding weight element by element and then accumulated, and the directional consistency of the weighted vector is calculated.
8. The method for converting a CAD drawing to an IFC file according to any one of claims 1 to 4, characterized in that: The converting of the component data in the component identification list in the Json format into a corresponding IFC format file includes: Use open source tool chains to convert component data in Json format into ifcJson format data, and convert ifcJson format data into IFC format data; Generate entity relationships through attribute mapping based on IFC format data; Perform geometric data consistency verification to ensure that the converted model meets the BIM software parsing standards.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.