CAD drawing engineering quantity automatic identification and calculation method based on large language model and image segmentation
By using a method based on a large language model and image segmentation, the engineering quantities in CAD drawings can be automatically identified and calculated, solving the problem of low efficiency of manual operation in existing technologies, achieving high-precision engineering quantity calculation and data structuring, and supporting the intelligent application of engineering projects.
Patent Information
- Application Number
- CN202510789047.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-12
Smart Images

Figure CN120634040A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image recognition of CAD drawings, and in particular relates to a method for automatic recognition and calculation of engineering quantities of CAD drawings based on a large language model and image segmentation. Background Art
[0002] In engineering fields such as architecture, municipal engineering, electromechanical engineering, and HVAC, CAD drawings, as a crucial vehicle for project design and construction, are widely used in key processes such as structural layout, equipment installation, and pipeline routing. They contain rich spatial information, component attributes, and engineering semantics. However, the extraction, understanding, and utilization of CAD drawing information currently relies heavily on manual labor, requiring professionals to rely on their experience to browse drawings, identify annotations, interpret graphics, and calculate project quantities. This approach is not only inefficient and labor-intensive, but also prone to human errors such as missed and incorrect items, hindering the further development of digital and intelligent engineering.
[0003] CAD drawings contain a variety of information, including not only textual content like project descriptions and component annotations, but also numerous symbolic graphical legends, such as pipeline routes, component numbers, and installation nodes. Much of this information exists in an unstructured format, making it challenging to identify and, consequently, automated extraction and understanding require a high technical threshold. Traditional image recognition and geometric extraction methods often fall short, especially when drawings are complex, frequently nested, and annotation positions are fluid.
[0004] Furthermore, engineering quantity calculations involve more than simple graphical measurements; they also involve semantic reasoning and contextual understanding, comprehensively considering component type, size, installation location, and their semantic relevance within the overall project. For example, the length of a pipeline is not only related to its geometric path, but also requires a comprehensive analysis of its starting and ending locations, floor distribution, and system affiliation. Traditional CAD drawing recognition tools and auxiliary software mostly remain at the geometric level, lacking in-depth understanding of the semantic layer and engineering logic, making it difficult to meet the demand for highly accurate, structured, and computable drawing information in complex engineering projects.
[0005] With the development of emerging technologies such as building industrialization, BIM modeling, digital twins, and smart construction sites, the industry has placed higher demands on the structured processing of CAD drawing data, the automatic extraction of engineering information, and the rapid construction of models. Therefore, there is an urgent need to develop an intelligent CAD drawing parsing technology that integrates OCR recognition, natural language processing, graphic semantic recognition, and engineering logic calculations, thereby bridging the critical links from drawings to models, from information to data, and from manual to automated processes. Summary of the Invention
[0006] In response to the shortcomings of the existing technology, the present invention provides a method for automatic recognition and calculation of engineering quantities in CAD drawings based on a large language model and image segmentation, so as to improve the efficiency of CAD drawing processing and the accuracy of engineering quantity calculation, and provide intelligent support for design, construction, drawing review, budgeting and other links.
[0007] In order to solve the above technical problems and achieve the above technical effects, the present invention is implemented through the following technical solutions: A method for automatically identifying and calculating engineering quantities of CAD drawings based on a large language model and image segmentation, comprising the following steps: Step S1: extract project annotation information from CAD drawings, use a large language model to understand and infer project descriptions, and express the project annotation information in a structured manner to obtain project-related information; Step S2: Preprocess the graphics in the CAD drawings using computer vision, and then use machine learning to analyze the pipeline drawings in the CAD drawings to identify the types and locations of components in the pipeline drawings, and achieve semantic segmentation and instance segmentation; Step S3: Fuse the structured project annotation information, semantic segmentation results, and instance segmentation results to count and calculate the engineering quantity of each pipeline component in the CAD drawing image, and output a report by classification to achieve quantitative conversion from drawings to data.
[0008] Furthermore, in step S1, the specific steps for obtaining project-related information are as follows: Step S1.1, using the AutoCAD API, perform layer analysis on the drawing image in DWG / PDF / PNG format and extract the TEXT layer; Step S1.2: using the CRAFT detection model to identify the text in the TEXT layer; Step S1.3: Output the text recognition result of the TEXT layer in JSON format; Step S1.4, performing regional classification on the text recognition results based on the "text position + text keyword" rule; Step S1.5: Remove interfering symbols, including extra line breaks and spaces, from the text recognition results, then exclude invalid or repeated text regions from the text recognition results. The text recognition results are then concatenated into a structured natural language text in a unified format, which serves as input to the large language model. The structured natural language text includes at least "Drawing Name," "Designer," "Component Name and Specifications," and "Installation Location," with each item on a separate line. Step S1.6: First, design prompt words whose prompt content at least includes "project name", "system type", "component name", "component specifications", "installation location", "output format" and "input content", and then use the LLM large language model combined with the prompt words to perform semantic understanding and structured extraction on the natural language text with structured tags, generate semantic data including project name, system type, component name, component specifications and installation location, and finally standardize the output semantic data in json format.
[0009] Furthermore, in step S1.4, the text region classification method based on the "text position + text keyword" rule is specifically as follows: 1) In the title bar area of the drawing, check the annotation information including "Drawing Name", "Design Unit" and "Professional Category"; 2) In the technical description area, detect multi-line natural language paragraphs; 3) In the component annotation area, extract annotation information including "component name + model + location".
[0010] Furthermore, in step S2, the specific methods of semantic segmentation and instance segmentation are as follows: Step S2.1, format adaptation and preprocessing of CAD drawings; Step S2.2: Use the DeepLabV3+ model to classify each pixel in the CAD drawing image into a corresponding semantic category, and construct a CAD drawing image semantic segmentation dataset; the names of the semantic categories include at least "background", "pipeline", "valve symbol", "text description", "equipment symbol block", and "pipeline number"; Step S2.3: After manual labeling based on the labels: instance mask, type label, bounding box coordinates, and connection relationship labels, Mask R-CNN is used to perform object detection and segmentation, and finally generate standard output data; Step S2.4, calculating geometric attributes including the straight line segment pipe length, the multi-segment broken line pipe path, and the pipe number according to corresponding formulas; Step S2.5: Establish a connection relationship using centroid distance + overlap ratio + primitive endpoint matching; construct an undirected graph G = (V, E), where each primitive is a node V and the connection relationship is an edge E.
[0011] Furthermore, in step 2.1, the pre-processing method includes: For the original CAD image, the ezdxf parsing library is first used to select the pipeline-related layers and primitive types to classify the original CAD image, and then the CAD coordinate system is converted into image coordinates or real scale; For raster images, we first perform preprocessing on them, including image enhancement, binarization, denoising, dilation, and erosion. Then, we use YOLO to divide the device area, pipeline area, and text area in the raster image, and use different blocks as input for subsequent semantic analysis.
[0012] Furthermore, in step 2.4, the formula for calculating geometric properties is as follows: 1) The calculation formula for the straight line pipe length (vector format) is: (2); In formula (2), x1 is the horizontal coordinate data of the starting position of the pipeline; x2 is the horizontal coordinate data of the ending position of the pipeline; y1 is the vertical coordinate data of the starting position of the pipeline; y2 is the vertical coordinate data of the ending position of the pipeline; 2) The calculation formula for a multi-segment polyline pipeline path is: (3); In formula (3), x i is the starting horizontal coordinate data of the i-th section of the pipeline; y i is the starting vertical coordinate data of the i-th section of the pipeline; x i+1 The ending horizontal coordinate data of the i-th pipeline or the starting horizontal coordinate data of the i+1-th pipeline; y i+1 The ending vertical coordinate data of the i-th pipeline or the starting vertical coordinate data of the i+1-th pipeline; 3) The calculation formula for extracting pipeline numbers is: (4); In formula (4), c gi For the element g i The geometric center coordinates of tj For text comment block t j The center coordinates of .
[0013] Furthermore, in step S3, the specific steps for converting the drawings into quantitative data are as follows: Step S3.1: Fusing the structured project annotation information data output from step S1 with the semantic segmentation results and instance segmentation results data output from step S2 according to fields to generate structural information including component category, floor location, system name, and pipeline specifications; Step S3.2: Based on the generated structural information, different strategies are selected, including classification by system type, classification by specification model, and classification by construction floor, for classification and statistics; Step S3.3, summarizing the total length of pipelines by category, calculating the total engineering quantities of single-layer and single-system components, and generating engineering quantity summary results; Step S3.4: Convert the format of the engineering quantity summary result from json data to excel format and output it.
[0014] Furthermore, in step S3.3, the formula for summarizing the engineering quantities is as follows: 1) Summarize the total length of pipelines by category: (5); In formula (5), L i The length of the i-th pipe belonging to category c; L class Indicates the total length of the pipeline of category c; 2) Calculate the total engineering quantity of single-layer and single-system components: (6); In formula (6), S represents the system name; f represents the floor; Q s,f Indicates the total pipe length of the system on this floor.
[0015] A computer device includes: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used to store at least one executable instruction, which enables the processor to perform operations corresponding to the above-mentioned automatic recognition and calculation method of engineering quantities in CAD drawings based on a large language model and image segmentation.
[0016] A computer storage medium, wherein the computer-readable storage medium stores at least one executable instruction, wherein the executable instruction causes a processor to perform operations corresponding to the above-mentioned automatic recognition and calculation method of engineering quantities of CAD drawings based on a large language model and image segmentation.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The intelligent CAD drawing parsing method of the present invention integrates technologies such as OCR recognition, natural language processing, graphic semantic recognition and engineering logic calculation, deeply explores the semantic layer and engineering logic, and opens up the key links from drawings to models, from information to data, and from manual to automatic. It can not only greatly improve the efficiency of CAD drawing processing and the accuracy of engineering quantity calculation, but also provide intelligent support for design, construction, drawing review, budgeting and other links, meeting the needs of complex engineering projects for high-precision, structured and computable drawing information. Therefore, it has important practical significance and broad application prospects.
[0018] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the invention and to implement it according to the contents of the description, the following preferred embodiments of the present invention are described in detail with reference to the accompanying drawings. The specific implementation methods of the present invention are given in detail by the following embodiments and the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 Schematic diagram of the process of the method for automatic identification and calculation of engineering quantities of CAD drawings based on a large language model and image segmentation of the present invention; Figure 2 This is a schematic diagram of the JSON format generated after the present invention recognizes the TEXT layer; Figure 3 This is a schematic diagram of the LLM data input format of the present invention; Figure 4 This is a schematic diagram of the prompt word format of the language model of the present invention; Figure 5 This is a schematic diagram of the JSON format of the large language model analysis results of the present invention; Figure 6 This is a label diagram of the CAD image semantic segmentation dataset of the present invention; Figure 7 This is a schematic diagram of the target detection + segmentation data output structure of the present invention; Figure 8 Output the schematic diagram in Excel format for the engineering quantity summary of the present invention. DETAILED DESCRIPTION
[0020] The following will be described in detail with reference to the accompanying drawings to better understand the purpose, features and advantages of the invention. It should be understood that the embodiments shown in the accompanying drawings are not intended to limit the scope of the invention, but are only intended to illustrate the essential spirit of the technical solution of the invention.
[0021] In the following description, for the purpose of illustrating the various disclosed embodiments, certain specific details are set forth in order to provide a thorough understanding of the various disclosed embodiments. However, those skilled in the relevant art will recognize that the embodiments may be practiced without one or more of these specific details. In other cases, well-known devices, structures, and techniques associated with this application may not be shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.
[0022] Unless the context requires otherwise, throughout the specification and claims, the word "comprise" and variations such as "include" and "have" should be construed in an open, inclusive sense, that is, should be interpreted to mean "including, but not limited to."
[0023] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any manner in one or more embodiments.
[0024] As used in this specification and the appended claims, the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise. It should be noted that the term "or" is generally employed in its sense including "and / or" unless the context clearly dictates otherwise.
[0025] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0026] See also Figure 1 As shown, the present invention provides a method for automatically identifying and calculating engineering quantities of CAD drawings based on a large language model and image segmentation, comprising the following steps: Step S1, project data extraction: extract project annotation information from CAD drawings, use a large language model to understand and infer project descriptions, and structure the project annotation information to obtain project-related information, providing basic semantic support for graphic recognition and engineering quantity calculation. Specifically, Step S1.1: Use the AutoCAD API to perform layer analysis on the drawing image in DWG / PDF / PNG format and extract the TEXT layer to locate the source of the text information.
[0027] Step S1.2: Using the CRAFT detection model to identify the text in the TEXT layer. This step uses the CRAFT detection model to ensure the accuracy of text recognition.
[0028] Step S1.3, in json format (such as Figure 2 This step unifies the output format of the text recognition results to facilitate subsequent processing and analysis.
[0029] Step S1.4: Classify the text recognition results into regions based on the "text position + text keyword" rule. This step classifies the text regions based on the "text position + text keyword" rule to improve the accuracy of semantic extraction.
[0030] The text region classification method based on the "text position + text keyword" rule is as follows: 1) In the drawing title bar area, check annotation information such as "Drawing Name", "Design Unit" and "Professional Category"; 2) In the technical description area, detect multi-line natural language paragraphs; 3) In the component annotation area, extract annotation information such as "component name + model + location".
[0031] Step S1.5: first remove the interference symbols (redundant line breaks, spaces) in the text recognition results, then exclude the invalid or repeated text areas in the text recognition results, and then use the following method to Figure 3 The unified format shown here combines the text recognition results into structured, tagged natural language text, which serves as input for the large language model. This structured, tagged natural language text includes multiple fields, such as "Drawing Title," "Designer," "Component Name and Specifications," and "Installation Location," each on a separate line. This step removes invalid characters from the text recognition results, optimizes the large language model input, and improves parsing quality.
[0032] Step S1.6, first design Figure 4 The prompt words shown in the figure include prompt contents such as "project name", "system type", "component name", "component specifications", "installation location", "output format" and "input content". Then, the LLM large language model is used to combine the prompt words to perform semantic understanding and structured extraction on the natural language text with structure tags, generate semantic data including project name, system type, component name, component specifications and installation location, and finally output it in json format (such as Figure 5 (as shown in the figure) to standardize the output semantic data. This step uses prompts to guide the large language model to complete structured extraction and generate standard semantic data.
[0033] Step S2, semantic segmentation and instance segmentation: First, use computer vision (CV) to pre-process the graphics in the CAD drawings, and then use machine learning to analyze the pipeline drawings in the CAD drawings to identify the type and location of the components in the pipeline drawings, achieve semantic segmentation and instance segmentation, and provide a graphical basis for geometric calculation and connection relationship construction. Specifically, Step S2.1: Format adaptation and preprocessing of CAD drawings to improve model input quality.
[0034] For CAD original images (DWG / DXF), first use the ezdxf parsing library to select pipeline-related layers (such as Piping, Hydronic, etc.) and classify the CAD original images by primitive type (such as LINE, POLYLINE, CIRCLE, ARC, BLOCK INSERT, TEXT), and then convert the CAD coordinate system into image coordinates or real-world scale. For raster images (PDF, PNG, and scanned images), we first perform preprocessing on the raster images, including image enhancement, binarization, denoising, dilation, and erosion. Then, we use YOLO to segment the raster images into device areas, pipeline areas, and text areas, and use these different blocks as input for subsequent semantic analysis.
[0035] Step S2.2: Use the DeepLabV3+ model to classify each pixel in the CAD drawing image into a corresponding semantic category, such as "background (non-component area)", "pipeline", "valve symbol", "text description", "equipment symbol block" and "pipeline number (marked line)", and construct a CAD drawing image semantic segmentation dataset (the dataset label design is as follows Figure 6 shown).
[0036] The cross entropy loss function of multi-class semantic segmentation used in this step is: (1); In formula (1), N is the total number of pixels in the image; C is the total number of categories; y i,c Indicates whether the i-th pixel belongs to the C-th category; p i,c Represents the probability that the model predicts that the pixel belongs to the Cth class.
[0037] Step S2.3: After manual annotation according to the labels: instance mask (mask), type label (class), bounding box coordinates (box), and connection relationship (such as optional graph structure or adjacency matrix), Mask R-CNN is used for target detection and segmentation, and the final result is as follows: Figure 7 The standard output data shown is shown in Figure 2. This step identifies each independent component through instance segmentation, achieving object-level tracking and labeling.
[0038] Step S2.4: Calculate geometric attributes, including straight-line pipe lengths, multi-segment broken-line pipe paths, and pipe numbers, using corresponding formulas. This step calculates geometric attributes, such as component lengths and paths, to support engineering quantity statistics.
[0039] 1) The calculation formula for the straight line pipe length (vector format) is: (2); In formula (2), x1 is the horizontal coordinate data of the starting position of the pipeline; x2 is the horizontal coordinate data of the ending position of the pipeline; y1 is the vertical coordinate data of the starting position of the pipeline; y2 is the vertical coordinate data of the ending position of the pipeline.
[0040] 2) The calculation formula for a multi-segment polyline pipeline path is: (3); In formula (3), x iis the starting horizontal coordinate data of the i-th section of the pipeline; y i is the starting vertical coordinate data of the i-th section of the pipeline; x i+1 The ending horizontal coordinate data of the i-th pipeline or the starting horizontal coordinate data of the i+1-th pipeline; y i+1 It is the ending vertical coordinate data of the i-th pipeline or the starting vertical coordinate data of the i+1-th pipeline.
[0041] 3) The calculation formula for extracting pipeline numbers is: (4); In formula (4), c gi For the element g i The geometric center coordinates of tj For text comment block t j The center coordinates of .
[0042] Step S2.5: Establish connections using centroid distance, overlap ratio, and primitive endpoint matching; construct an undirected graph G = (V, E), where each primitive is a node V and connections are edges E. This step establishes connections between primitives, constructs a component topology, and enhances understanding of the system structure.
[0043] Step S3, Calculation of Engineering Quantity: Fuse the structured project annotation information with the semantic segmentation results and instance segmentation results, count and calculate the engineering quantity of each pipeline component in the CAD drawing image, and output reports by classification to achieve quantitative conversion from drawings to data. Specifically, Step S3.1: The structured project annotation data output from step S1 and the semantic segmentation and instance segmentation results output from step S2 are fused according to fields, such as component category (e.g., "water supply riser"), floor location (e.g., "first floor," "basement"), system name (e.g., "domestic water supply system"), and pipe size (e.g., "DN50"), to generate unified structural information. This step fuses fields such as component category, floor, and system to unify the structural information.
[0044] Step S3.2: Based on the generated structural information, select different strategies for classification and statistics, including classification by system type (e.g., water supply system, drainage system), classification by specification and model (e.g., DN20, DN50), and classification by construction floor (e.g., first floor, second floor, basement). This step classifies and counts components by system, floor, and specification, facilitating multi-dimensional analysis.
[0045] Step S3.3: Summarize the total length of pipelines by category, calculate the total engineering quantity of single-layer and single-system components, and generate engineering quantity summary results.
[0046] 1) Summarize the total length of pipelines by category: (5); In formula (5), L i The length of the i-th pipe belonging to category c; L class Indicates the total length of the pipeline of category c; 2) Calculate the total engineering quantity of single-layer and single-system components: (6); In formula (6), S represents the system name; f represents the floor; Q s,f Indicates the total pipe length of the system on this floor.
[0047] Step S3.4, convert the format of the engineering quantity summary result from json data into Figure 8 This step calculates various quantities and generates a list to support budgeting and project management applications.
[0048] The present invention also provides a computer device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used to store at least one executable instruction, wherein the executable instruction enables the processor to perform operations corresponding to the above-mentioned automatic identification and calculation method of engineering quantities of CAD drawings based on a large language model and image segmentation.
[0049] The present invention also provides a computer storage medium, in which at least one executable instruction is stored, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned automatic identification and calculation method of engineering quantities of CAD drawings based on large language models and image segmentation.
[0050] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for automatic recognition and calculation of engineering quantities in CAD drawings based on a large language model and image segmentation, characterized in that: include: Step S1: extract project annotation information from CAD drawings, use a large language model to understand and infer project descriptions, and express the project annotation information in a structured manner to obtain project-related information; Step S2: Preprocess the graphics in the CAD drawings using computer vision, and then use machine learning to analyze the pipeline drawings in the CAD drawings to identify the types and locations of components in the pipeline drawings, and achieve semantic segmentation and instance segmentation; Step S3: Fuse the structured project annotation information, semantic segmentation results, and instance segmentation results to count and calculate the engineering quantity of each pipeline component in the CAD drawing image, and output a report by classification to achieve quantitative conversion from drawings to data.
2. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on large language model and image segmentation according to claim 1 is characterized in that: In step S1, the specific steps for obtaining project-related information are as follows: Step S1.1, using the AutoCAD API, perform layer analysis on the drawing image in DWG / PDF / PNG format and extract the TEXT layer; Step S1.2: using the CRAFT detection model to identify the text in the TEXT layer; Step S1.3: Output the text recognition result of the TEXT layer in JSON format; Step S1.4, performing regional classification on the text recognition results based on the "text position + text keyword" rule; Step S1.5: Remove interfering symbols, including extra line breaks and spaces, from the text recognition results, then exclude invalid or repeated text regions from the text recognition results. The text recognition results are then concatenated into a structurally tagged natural language text in a unified format, which serves as input to the large language model. The structurally tagged natural language text includes at least "Drawing Name," "Designer," "Component Name and Specifications," and "Installation Location," with each item on a separate line. Step S1.6: First, design prompt words whose prompt content at least includes "project name", "system type", "component name", "component specifications", "installation location", "output format" and "input content", and then use the LLM large language model combined with the prompt words to perform semantic understanding and structured extraction on the natural language text with structured tags, generate semantic data including project name, system type, component name, component specifications and installation location, and finally standardize the output semantic data in json format.
3. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on large language model and image segmentation according to claim 2 is characterized in that: In step S1.4, the text region classification method based on the "text position + text keyword" rule is specifically as follows: 1) In the title bar area of the drawing, check the annotation information including "Drawing Name", "Design Unit" and "Professional Category"; 2) In the technical description area, detect multi-line natural language paragraphs; 3) In the component annotation area, extract annotation information including "component name + model + location".
4. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on large language model and image segmentation according to claim 1 is characterized in that: In step S2, the specific methods of semantic segmentation and instance segmentation are as follows: Step S2.1, format adaptation and preprocessing of CAD drawings; Step S2.2: Use the DeepLabV3+ model to classify each pixel in the CAD drawing image into a corresponding semantic category, and construct a CAD drawing image semantic segmentation dataset; the names of the semantic categories include at least "background", "pipeline", "valve symbol", "text description", "equipment symbol block", and "pipeline number"; Step S2.3: After manual labeling based on the labels: instance mask, type label, bounding box coordinates, and connection relationship labels, Mask R-CNN is used to perform object detection and segmentation, and finally generate standard output data; Step S2.4, calculating geometric attributes including the straight line segment pipe length, the multi-segment broken line pipe path, and the pipe number according to corresponding formulas; Step S2.5: Establish a connection relationship using centroid distance + overlap ratio + primitive endpoint matching; construct an undirected graph G = (V, E), where each primitive is a node V and the connection relationship is an edge E.
5. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on a large language model and image segmentation according to claim 4 is characterized in that: In step 2.1, the pretreatment method includes: For the original CAD image, the ezdxf parsing library is first used to select the pipeline-related layers and primitive types to classify the original CAD image, and then the CAD coordinate system is converted into image coordinates or real scale; For raster images, we first perform preprocessing on them, including image enhancement, binarization, denoising, dilation, and erosion. Then, we use YOLO to divide the device area, pipeline area, and text area in the raster image, and use different blocks as input for subsequent semantic analysis.
6. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on large language model and image segmentation according to claim 4 is characterized in that: In step 2.4, the formula for calculating geometric properties is as follows: 1) The calculation formula for the straight line pipe length (vector format) is: (2); In formula (2), x1 is the horizontal coordinate data of the starting position of the pipeline; x2 is the horizontal coordinate data of the ending position of the pipeline; y1 is the vertical coordinate data of the starting position of the pipeline; y2 is the vertical coordinate data of the ending position of the pipeline; 2) The calculation formula for a multi-segment polyline pipeline path is: (3); In formula (3), x i is the starting horizontal coordinate data of the i-th section of the pipeline; y i is the starting vertical coordinate data of the i-th section of the pipeline; x i+1 The ending horizontal coordinate data of the i-th pipeline or the starting horizontal coordinate data of the i+1-th pipeline; y i+1 The ending vertical coordinate data of the i-th pipeline or the starting vertical coordinate data of the i+1-th pipeline; 3) The calculation formula for extracting pipeline numbers is: (4); In formula (4), c gi For the element g i The geometric center coordinates of tj For text comment block t j The center coordinates of .
7. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on large language model and image segmentation according to claim 1 is characterized in that: In step S3, the specific steps for converting drawings into quantitative data are as follows: Step S3.1: Fusing the structured project annotation information data output from step S1 with the semantic segmentation results and instance segmentation results data output from step S2 according to fields to generate structural information including component category, floor location, system name, and pipeline specifications; Step S3.2: Based on the generated structural information, different strategies are selected, including classification by system type, classification by specification model, and classification by construction floor, for classification and statistics; Step S3.3, summarizing the total length of pipelines by category, calculating the total engineering quantities of single-layer and single-system components, and generating engineering quantity summary results; Step S3.4: Convert the format of the engineering quantity summary result from json data to excel format and output it.
8. The method for automatic recognition and calculation of engineering quantities of CAD drawings based on large language model and image segmentation according to claim 7 is characterized in that: In step S3.3, the formula for the engineering quantity summary is as follows: 1) Summarize the total length of pipelines by category: (5); In formula (5), L i The length of the i-th pipe belonging to category c; L class Indicates the total length of the pipeline of category c; 2) Calculate the total engineering quantity of single-layer and single-system components: (6); In formula (6), S represents the system name; f represents the floor; Q s,f Indicates the total pipe length of the system on this floor.
9. A computer device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used to store at least one executable instruction, wherein the executable instruction enables the processor to perform operations corresponding to the method for automatic identification and calculation of engineering quantities in CAD drawings based on a large language model and image segmentation as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that The computer-readable storage medium stores at least one executable instruction, which enables the processor to perform operations corresponding to the method for automatic identification and calculation of engineering quantities in CAD drawings based on a large language model and image segmentation as described in any one of claims 1 to 8.
Citation Information
Cited By
Cloud-based project engineering measurement management method and system
CN121212755A
Marine equipment drawing identification method and system based on large model
CN121214476A
A large model-based marine equipment drawing identification method and system
CN121214476B
Engineering drawing online identification analysis method and system and storage medium
CN121459385A
PDF drawing data extraction method and system based on intelligent identification
CN121686504A