Constructional engineering CAD drawing intelligent identification method and system, terminal and medium
By training the YOLOv8 model to automatically identify the scope and type of drawing frames in architectural engineering CAD drawings, the problem of low efficiency in traditional manual application is solved, and efficient automated identification and accurate drawing frame application are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN CAPOL INT & ASSOC CO LTD
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-24
Smart Images

Figure CN121921808A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of architectural engineering drawing processing technology, and in particular to an intelligent recognition method, system, terminal and medium for architectural engineering CAD drawings. Background Technology
[0002] In the design process of architectural engineering drawings, the application of drawing frames is a crucial step in the standardized management of drawings. Traditionally, designers rely on manually matching the corresponding drawing frames based on project, discipline, and drawing type information. This process is cumbersome, labor-intensive, inefficient, and prone to errors due to human negligence, affecting the quality of the output drawings. Although CAD software provides drawing frame insertion functions, its automation level is limited, making it difficult to achieve semantic understanding and intelligent recognition of drawing content, thus failing to meet the needs of batch processing and efficient drawing output.
[0003] Therefore, existing technologies still have shortcomings. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a method, system, terminal, and medium for intelligent recognition of architectural engineering CAD drawings, addressing the aforementioned deficiencies of the prior art. The technical solution adopted by this invention is as follows: In a first aspect, the present invention provides a method for intelligent recognition of architectural engineering CAD drawings, wherein the method includes: The frame recognition range is determined, an original dataset is established, and the original dataset is processed to obtain a training dataset, which contains several images labeled with frame range and frame type; The YOLOv8 model is trained based on the training dataset to obtain a bounding box range and type recognition model. Based on the aforementioned drawing frame range and type recognition model, reasoning is performed on the CAD drawing to obtain the drawing frame range and type reasoning results. The drawing frame range and type reasoning results are then processed by coordinate mapping and recorded in the drawing recognition JSON file.
[0005] In one implementation, the frame recognition range is determined, and an original dataset is established, including: The scope of the drawing frame identification is determined, which includes: drawing catalog, drawing description and drawing type. The drawing type includes: plan view, elevation view, section view, detail view, detailed drawing, system diagram, location diagram, lightning protection diagram, reinforcement diagram, fabrication diagram, control diagram, equipment diagram and schematic diagram. Several drawing samples were collected according to different drawing frame recognition ranges to form the original dataset.
[0006] In one implementation, the original dataset is processed to obtain a training dataset, including: The bounding boxes of the design content in the original dataset are deleted, and the bounding box range and bounding box type of the deleted bounding boxes are marked to obtain the processed dataset. The drawings in the processed dataset are printed and exported to form an image dataset, and a training dataset is obtained based on the image dataset.
[0007] In one implementation, the YOLOv8 model is trained based on the training dataset to obtain a bounding box extent and type recognition model, including: Set up the Python runtime environment and install the yolov8-seg model and its related dependency libraries; Write a data configuration file, which includes: training dataset directory, training dataset path, validation dataset path, and frame recognition range; The YOLOv8 model is trained based on the training dataset, and the trained YOLOv8 model is converted into ONNX format to obtain a bounding box range and type recognition model.
[0008] In one implementation, the YOLOv8 model is trained based on the training dataset to obtain a bounding box extent and type recognition model, including: The training performance of the YOLOv8 model is confirmed based on changes in loss, evaluation metrics, or human observations.
[0009] In one implementation, the CAD drawing is inferred based on the drawing frame range and type recognition model to obtain the drawing frame range and type inference results, including: The image export range is determined based on the CAD drawings, the target image is exported based on the image export range, and the resolution of the target image is processed. Based on the frame range and type recognition model, reasoning is performed on the target image to obtain the frame range and type reasoning results.
[0010] In one implementation, the inference results of the drawing frame range and type are processed by coordinate mapping and recorded in a drawing recognition JSON file, including: Based on the size of the target image and the world coordinates of the CAD drawing printing area, determine the coordinate transformation matrix between the image pixel coordinates and the CAD drawing world coordinate system; Based on the coordinate transformation matrix, the inference results of the drawing frame range and type are mapped to the world coordinate system of the CAD drawing, and the inference results of the drawing frame range and type are written into the drawing recognition JSON file; The drawing recognition JSON file is indexed and associated with the CAD drawing.
[0011] Secondly, embodiments of the present invention also provide an intelligent recognition system for architectural engineering CAD drawings, wherein the system is used to implement the steps of the intelligent recognition method for architectural engineering CAD drawings as described in any of the above solutions, and the system includes: The training dataset creation module is used to determine the frame recognition range, create the original dataset, and process the original dataset to obtain the training dataset, which contains several images labeled with the frame range and frame type. The model training module is used to train the YOLOv8 model based on the training dataset to obtain a bounding box range and type recognition model. The model application module is used to infer the CAD drawing based on the drawing frame range and type recognition model, obtain the drawing frame range and type inference results, perform coordinate mapping processing on the drawing frame range and type inference results, and record them in the drawing recognition JSON file.
[0012] Thirdly, embodiments of the present invention also provide a terminal, wherein the terminal includes a memory, a processor, and an intelligent recognition program for architectural engineering CAD drawings stored in the memory and executable on the processor. When the processor executes the intelligent recognition program for architectural engineering CAD drawings, it implements the steps of the intelligent recognition method for architectural engineering CAD drawings of any of the above-mentioned solutions.
[0013] Fourthly, embodiments of the present invention also provide a computer-readable storage medium, wherein the computer-readable storage medium stores an intelligent recognition program for architectural engineering CAD drawings, and the intelligent recognition program for architectural engineering CAD drawings implements the steps of the intelligent recognition method for architectural engineering CAD drawings described in any of the above-described schemes on the computer-readable storage medium.
[0014] Beneficial Effects: Compared with existing technologies, this invention provides an intelligent recognition method for architectural engineering CAD drawings. First, the recognition range of the drawing frame is determined, an original dataset is established, and the original dataset is processed to obtain a training dataset. The training dataset contains several images labeled with the drawing frame range and type. Then, a YOLOv8 model is trained based on the training dataset to obtain a drawing frame range and type recognition model. Finally, the CAD drawings are inferred based on the drawing frame range and type recognition model to obtain the drawing frame range and type inference results. These results are then processed using coordinate mapping and recorded in a drawing recognition JSON file. This invention can identify the reasonable boundary range and drawing frame type of valid design content from CAD drawings, facilitating the development of automated drawing frame overlay algorithms based on boundary ranges in subsequent application layers. This transforms the drawing frame overlay process during design drawing production from traditional manual operation and review to machine-based manual review, demonstrating strong engineering practicality. Attached Figure Description
[0015] Figure 1 A flowchart of a preferred embodiment of the intelligent recognition method for architectural engineering CAD drawings provided in this invention.
[0016] Figure 2 The flowchart illustrates the intelligent recognition method for architectural engineering CAD drawings provided in this embodiment of the invention.
[0017] Figure 3 This is a schematic diagram of the intelligent recognition system for architectural engineering CAD drawings provided in an embodiment of the present invention.
[0018] Figure 4 A schematic diagram of the terminal provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0020] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content, operations, or steps, nor does it require execution in the described order. For example, some operations or steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0021] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. For example, the first control information and the second control information are only used to distinguish different control information and do not limit their order. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or the order of execution, and that the words "first" and "second" do not necessarily imply that they are different. It should also be understood that the terms "and / or" as used in this specification and the appended claims refer to any combination of one or more of the associated listed items and all possible combinations, and include such combinations.
[0022] To address the problems in existing technologies, this embodiment provides an intelligent recognition method for architectural engineering CAD drawings. Based on this method, the reasonable boundary range and drawing frame type of valid design content can be identified from CAD drawings. This facilitates the development of automated drawing frame overlay algorithms based on the boundary range in subsequent application layers, transforming the drawing frame overlay process from traditional manual work and review to machine-based manual review, demonstrating strong engineering practicality. Specifically, this embodiment first determines the drawing frame recognition range, establishes an original dataset, and processes the original dataset to obtain a training dataset. The training dataset contains several images labeled with drawing frame ranges and types. Then, a YOLOv8 model is trained based on the training dataset to obtain a drawing frame range and type recognition model. Finally, the CAD drawings are inferred based on the drawing frame range and type recognition model to obtain the drawing frame range and type inference results. These results are then subjected to coordinate mapping and recorded in a drawing recognition JSON file.
[0023] The intelligent recognition method for architectural engineering CAD drawings in this embodiment can be applied to terminals, including intelligent product terminals such as computers. Specifically, as shown in the example... Figure 1 As shown in the figure, the intelligent recognition method for architectural engineering CAD drawings in this embodiment includes the following steps: Step S100: Determine the frame recognition range, establish an original dataset, and process the original dataset to obtain a training dataset. The training dataset contains several images labeled with frame range and frame type.
[0024] In practical applications, combined with Figure 2 As shown, this embodiment first requires constructing a training dataset, which can be used in subsequent steps to train a bounding box range and type recognition model. To ensure that the subsequent model has good adaptability and generalization ability in complex and diverse actual engineering drawings, this embodiment has carefully designed the data collection stage. First, it considers the classification of recognition scenes, minimizing overlap and contradictions in the recognition scenes to avoid overfitting or failure to recognize during subsequent training. Second, data collection should be considered from multiple dimensions to increase the scene coverage and representativeness of the dataset.
[0025] This embodiment first determines the scope of drawing frame recognition, which includes: drawing catalog, drawing description, and drawing type. The drawing type includes: floor plan, elevation, section, detailed drawing, detailed drawing, system diagram, location diagram, lightning protection diagram, reinforcement diagram, fabrication drawing, control diagram, equipment diagram, and schematic diagram. Then, several drawing samples are collected according to different drawing frame recognition scopes to form the original dataset. Specifically, the drawing catalog covers the most frequently used standard drawing catalog, power and weak current drawing catalog, basement drawing catalog, and intelligent drawing catalog, basically covering more than 80% of the scenarios. At least 50 drawings are collected for each category, totaling 200 drawings, which meets the model learning data requirements for catalog-type drawings. The drawing specifications cover general specifications for electrical design, automatic fire alarm systems, structural design, water supply and drainage, energy conservation, HVAC, civil defense water supply and drainage, landscaping, and intelligent building design, essentially covering 90% of scenarios. While the different general specifications share similar visual characteristics, they are generally based on continuous, page-changing tables filled with single-line or multi-line text, inserted tables, and graphical representations. In practical applications, this invention primarily predicts the drawing frame range; therefore, it's unnecessary to differentiate between the design specification drawings. Observing the characteristics of the following design specifications and considering similarities, collecting at least 50 drawings from each category, totaling 300 drawings, is sufficient.
[0026] Floor plans are the most common type of drawing, most clearly categorized by profession. Based on the content of the professional design, the graphic characteristics also differ, resulting in architectural design construction drawings, structural design construction drawings, water supply and drainage design construction drawings, electrical design and construction drawings, HVAC design and construction drawings, and fire protection and electrical construction drawings, abbreviated as architectural drawings, structural drawings, water supply and drainage drawings, electrical drawings, HVAC drawings, and fire protection and electrical drawings. These categories basically cover over 90% of floor plans. Since the design objectives of each category differ, at least 50 drawings of each category are required, totaling 300 drawings. In this embodiment, the above-mentioned drawing catalog, drawing descriptions, and floor plans constitute the most important part of architectural design drawings and should account for at least 50% of all data in the training sample, which is generally sufficient for training. However, considering the universality of the application of drawing frame range prediction, the following drawing types need to be added. The following describes the key classification methods and minimum quantity requirements for data sample collection: Elevation drawings: Elevation drawings primarily showcase the form, elevation, door and window layout, and decorative details of the building's exterior facade. Their visual characteristics typically include vertically arranged outlines and component labels. Considering the diversity of architectural styles and the different design practices of various design institutes, it is recommended to collect elevation drawings categorized as follows: residential, office, and commercial complex elevations, etc. Each building type should have at least 10 drawings, totaling at least 30 drawings, to ensure sufficient coverage of the diversity of elevation drawings.
[0027] Sectional drawings: Sectional drawings are used to reveal the internal structural layers, floor height variations, and vertical component relationships of a building, and are often accompanied by annotations and textual descriptions. Based on their purpose, they are mainly divided into architectural sections, structural sections, and mechanical and electrical sections. Figure 3 Each category of drawings has a different focus, but the overall image structure has a certain similarity. Therefore, no fewer than 10 drawings can be collected from each category, for a total of no fewer than 30 drawings.
[0028] Detail drawings: Detail drawings are mainly used to refine structural nodes and are usually high-precision representations of specific areas of a building. They are often used in conjunction with index drawings. Based on building function, they can be further subdivided into: entrance details, staircase details, partial details of bathrooms, and details of auxiliary components such as balconies and canopies. It is recommended to have at least 5 categories, with at least 10 drawings in each category, totaling at least 50 drawings, to ensure the model can fully recognize the features of the detail drawings.
[0029] Detailed drawings: Detailed drawings are the most comprehensive type of drawing in architectural design, expressing structural details and covering wall joints, joint construction, door and window opening methods, etc. They are mainly categorized by profession, including architectural details, structural details, and MEP details. Due to the wide variety of detailed drawings and the significant differences in content between each drawing, it is recommended to collect detailed drawings covering at least six professional areas, with at least 10 drawings for each area, totaling at least 60 drawings, to improve the model's fine-grained recognition capabilities.
[0030] System diagrams: System diagrams are mainly used in mechanical and electrical engineering, such as electrical power system diagrams, low-voltage system diagrams, water supply and drainage system diagrams, and HVAC system diagrams. System diagrams have strong logical structure, are usually composed of modular graphic elements, and have a relatively standardized image structure. It is recommended to classify them according to professional categories, with no fewer than 10 drawings in each category, for a total of no fewer than 50 drawings.
[0031] Location Map: Location maps are used to identify the distribution of equipment, terminals, or signal acquisition points, and are commonly used in intelligent system design. Common types include location layout maps, alarm location maps, monitoring location maps, and broadcast and access control location maps. The image characteristics of a location map are points + legend + layer label. It is recommended to classify it into no fewer than 5 types, collect no fewer than 5 drawings of each type, and a total of no fewer than 25 drawings.
[0032] Lightning protection diagrams: Lightning protection diagrams are part of building electrical design and mainly involve the classification of building lightning protection levels, surge arrester layout, down conductor paths, and grounding system design. The visual representation of lightning protection diagrams is primarily line graphs, supplemented by legends. Considering the highly specialized nature of these diagrams and their relatively low frequency of appearance, it is recommended to collect at least 20 diagrams, covering different building types and lightning protection levels.
[0033] Reinforcement drawings: Reinforcement drawings are the core part of structural construction drawings, showing the arrangement, spacing, and anchorage length of the reinforcing bars. While the image structure of these drawings is relatively uniform, they need to be categorized separately due to differences in reinforcement methods (beam reinforcement, slab reinforcement, column reinforcement, etc.). It is recommended to collect at least four main categories of reinforcement drawings, with at least 10 drawings in each category, for a total of at least 40 drawings.
[0034] Fabrication drawings: Fabrication drawings are typically used for the fabrication of components such as steel structures, curtain walls, aluminum panels, and glass, and fall under the category of secondary detailed design. Due to the highly specialized content and complex image composition of these drawings, which need to cover various component types (such as curtain wall framing, steel component nodes, etc.), it is recommended to collect no less than 4 component categories, with no less than 10 drawings for each category, for a total of no less than 40 drawings.
[0035] Control charts: Control charts primarily appear in intelligent and control systems, used to express logical control flows, controller configurations, and control strategies. These include building automation diagrams and fire control logic diagrams. Control charts share some similarities with system diagrams, but place greater emphasis on representing logical relationships. It is recommended to collect at least 10 charts of each type, for a total of at least 30. In addition, equipment lists, schematic diagrams, equipment diagrams, and general diagrams constitute a relatively smaller portion; collecting a total of 50 of these is sufficient.
[0036] This embodiment collects data from multiple dimensions based on different projects and design subjects, according to the aforementioned frame recognition range, to ensure dataset diversity. The data sample size is at least 1000 drawings to ensure good results. During training, the dataset can be adjusted appropriately based on the training results, adding drawing types with poor predictions and deleting overfitted data types to form the original dataset. To ensure scenario coverage for model training and good subsequent generalization, the features of the actual content of the drawings are covered as much as possible according to various dimensions: for example, according to the source of DWG drawing content, it is divided into model and layout drawings; according to the number of frames, it is divided into single-frame and multi-frame drawings; according to the drawing content modality, it is divided into text, table, and graphic types; according to the design discipline, it is divided into architecture, structure, plumbing and electrical, and mixed types, etc.
[0037] Next, in this embodiment, the drawing frames of the design content (i.e., DWG drawings) in the original dataset are deleted. These frames will become distractors in the subsequent labeling process. Then, the scope and type of the deleted drawing frames are labeled to obtain the processed dataset. Then, a script plugin is developed to print and export the drawing content from the processed dataset, forming an image dataset. At this point, the drawing frame scope and type are labeled in the image dataset, thus a training dataset that can be used for training the YOLOv8 model can be obtained based on this image dataset.
[0038] Step S200: Train the YOLOv8 model based on the training dataset to obtain a frame range and type recognition model.
[0039] Specifically, in combination Figure 2 As shown, this embodiment sets up a Python runtime environment and installs the YOLOv8-seg model and its related dependent libraries, including core frameworks such as OpenCV, PyTorch, and ONNX. This runtime environment provides complete technical support for subsequent model training, inference, and deployment. Next, a YAML format data configuration file is written, which includes: the training dataset directory, the training dataset path, the validation dataset path, and the bounding box recognition range. Then, the official YOLOv8 model training script is called to train the YOLOv8 model based on the training dataset. During the training process, to improve efficiency, a device with a GPU can be used to enable GPU acceleration, thereby significantly improving the training speed. The training epochs are performed at 300, 400, and 500 times to observe the learning effect and avoid insufficient learning rate or overfitting. The training image resolution is uniformly set to 1024 (limited by GPU memory size). If more memory and GPU memory are available, a higher resolution can be adjusted to observe the effect of learning from higher-precision images.
[0040] In one implementation, this embodiment can also verify the training effect of the YOLOv8 model based on loss changes, evaluation metrics, or manual observation results. Specifically, this embodiment can call the ONNX Runtime library to load ONNX model inference test cases to verify the training effect of the YOLOv8 model, and then observe the accuracy of the bounding box range and bounding box type both inside and outside the dataset. When verifying loss changes, the main focus is on determining box_loss, cls_loss, and df1_loss to reflect the loss changes. Box_loss is the bounding box regression loss; the smaller the bounding box regression loss, the more accurate the box localization. cls_loss is the classification loss; the smaller the classification loss, the more accurate the class prediction. df1_loss is generally related to target confidence, etc. The evaluation metrics in this embodiment include precision and recall. Precision reflects the proportion of truly positive samples among those predicted as positive; a precision closer to 1 is better. Recall reflects the proportion of truly positive samples correctly predicted as positive by the model; a recall closer to 1 is better. Furthermore, this embodiment can also calculate the mean accuracy based on IoU=0.5. IoU is a standard for the accuracy of a vehicle in detecting responding objects in a specific dataset. The mean accuracy reflects the detection capability of the YOLOv8 model in different categories; the higher the better, and it is one of the core indicators of object detection. In addition, the mean accuracy can be calculated based on IoU intervals from 0.5 to 0.95 to more rigorously evaluate the YOLOv8 model's requirements for bounding box accuracy; a higher mean accuracy indicates stronger robustness of the YOLOv8 model. The mean accuracy gradually increases and stabilizes with training iterations, representing a continuous improvement in the model's detection performance, eventually converging to a better state, which conforms to the ideal trend. Next, the trained YOLOv8 model is converted to ONNX format to obtain a bounding box range and type recognition model, supporting cross-platform deployment and efficient inference.
[0041] Step S300: Based on the drawing frame range and type recognition model, reason about the CAD drawing to obtain the drawing frame range and type reasoning results, and perform coordinate mapping processing on the drawing frame range and type reasoning results and record them in the drawing recognition JSON file.
[0042] Specifically, in combination Figure 2 As shown in the diagram, this embodiment first acquires the CAD drawing to be inferred, then determines the image export range based on the CAD drawing, and uses a CAD secondary development interface or ODA technology to export the target image based on the image export range. The world coordinate range of the exported DWG drawing is recorded for subsequent image pixel coordinate mapping processing. Furthermore, this embodiment also performs resolution processing on the target image to improve its quality. Next, inference is performed on the target image based on the frame range and type recognition model to obtain the frame range and type inference results.
[0043] Next, this embodiment performs coordinate mapping processing on the inference results of the image frame range and type. Specifically, based on the size of the target image and the world coordinates of the CAD drawing printing area, a coordinate transformation matrix is determined between the image pixel coordinates and the CAD drawing world coordinate system. In practical applications, in the CAD software coordinate system, the coordinate origin is located at the lower left corner of the view, with the X-axis extending to the right and the Y-axis extending upwards. However, in the pixel coordinate system of the target image, the coordinate origin is usually located at the upper left corner of the image, with the X-axis extending to the right and the Y-axis extending downwards. To achieve the conversion between the two coordinate systems, it is first necessary to determine the minimum bounding rectangle of the CAD drawing export range and obtain the world coordinates (minX, maxY) of its upper left corner point, which serves as the reference origin for subsequent coordinate transformations. Next, a scaling factor, `scale`, is set. Its value is equal to the ratio of the width of the exported target image (`imgWidth`) to the actual width of the exported area of the CAD drawing (`width`), i.e., `scale = width / imgWidth`. During coordinate transformation, the Y coordinate of the target image is first inverted (i.e., multiplied by -1) to align its direction with the Y-axis in the CAD drawing. Then, the X and Y components are scaled by multiplying by `scale`. Finally, the origin of the coordinate system is moved to (`minX`, `maxY`) through a translation operation, completing the mapping from pixel coordinates to the world coordinates of the CAD drawing and obtaining the coordinate transformation matrix. Therefore, this embodiment maps the drawing frame range and type inference results to the world coordinate system of the CAD drawing based on the coordinate transformation matrix. Finally, an index association is established between the drawing recognition JSON file and the CAD drawing, and structured data for the drawing frame range and type inference results is designed. The `drawing_frame_recognition.json` file is designed to record the drawing frame range and type inference results, which includes information such as the unique index of the drawing frame, the drawing frame type, and the coordinates of the drawing frame spatial range, for subsequent use by the business layer.
[0044] In practical applications, after obtaining a drawing frame range and type recognition model through the above step S200 training, the drawing frame range and type recognition model inference program can be integrated into the architectural engineering software AutoCAD. Through AutoCAD secondary development, the inference program can be called to perform inference on local drawings. Combined with coordinate matrix calculation, the practical function of "one-click drawing frame application" can be realized. Combined with intelligent agent technology, the functional interface is deployed as a server. Natural language driven tools help designers to batch apply drawing frames to drawings that have not been applied during the process. The large model understands the user's intent, and the intelligent agent solves the task execution process, such as batch drawing frame application. This invention is responsible for predicting the drawing frame range of specific drawings.
[0045] Furthermore, in another application scenario, this embodiment can also segment drawings based on the prediction results of the drawing frame type. Different types of drawings, combined with the prediction of the drawing frame range, can be accurately segmented, and the drawings can be organized into folders according to their categories. Alternatively, by integrating with the drawing management system of a business platform, the segmentation of drawings can be standardized, facilitating subsequent management, printing, browsing, and standardized delivery of drawings.
[0046] Furthermore, this embodiment can also segment drawings based on the prediction results of the drawing frame type. Different types of drawings are routed to different secondary algorithm modules for further recognition and reading. After segmentation, the drawings are then combined with graphic algorithms, OCR (Optical Character Recognition), and multimodal large models for recognition, which can significantly reduce the difficulty of recognizing the entire drawing and thus improve the level of engineering drawing recognition.
[0047] In summary, this invention standardizes the drawing output process based on the scope and type of the drawing frame, improving drawing output efficiency. Furthermore, the structured reasoning results of the scope and type of the drawing frame support more automated drawing frame application scenarios, such as automatic layout, drawing frame application, drawing archiving, drawing frame retrieval, and drawing approval, further improving design efficiency and accuracy. In addition, the model training phase of this invention fully considers the diversity and complexity of designs, utilizes a wide range of data sources, achieves good model training results, has strong generalization ability, and is compatible with drawings from various sources, possessing significant value for engineering application.
[0048] Based on the above embodiments, the present invention also provides an intelligent recognition system for architectural engineering CAD drawings. This system is used to implement the steps in the above method embodiments, specifically, as follows: Figure 3 As shown, the system in this embodiment includes: a training dataset establishment module 10, a model training module 20, and a model application module 30. Specifically, the training dataset establishment module 10 is used to determine the frame recognition range, establish an original dataset, and process the original dataset to obtain a training dataset, which contains several images labeled with frame range and frame type. The model training module 20 is used to train the YOLOv8 model based on the training dataset to obtain a frame range and type recognition model. The model application module 30 is used to perform inference on CAD drawings based on the frame range and type recognition model to obtain frame range and type inference results, and performs coordinate mapping processing on the frame range and type inference results, recording them in a drawing recognition JSON file.
[0049] The working principle of each functional module in the system embodiment of this example is the same as that of each step in the above-mentioned intelligent recognition method for architectural engineering CAD drawings, and will not be repeated here.
[0050] Each module in the aforementioned intelligent recognition system for architectural engineering CAD drawings can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the terminal in hardware form or independent of it, or stored in the terminal's memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0051] Based on the above embodiments, the present invention also provides a terminal, the principle block diagram of which can be as follows: Figure 4 As shown. The terminal may include one or more processors 100 ( Figure 4 (Only one is shown in the image), memory 101, and computer program 102 stored in memory 101 and executable on one or more processors 100. For example, a smart recognition program for architectural CAD drawings. When one or more processors 100 execute computer program 102, they can implement the various steps in the embodiment of the smart recognition method for architectural CAD drawings. Alternatively, when one or more processors 100 execute computer program 102, they can implement the functions of various modules / units in the embodiment of the smart recognition system for architectural CAD drawings, which is not limited here.
[0052] In one embodiment, the processor 100 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0053] In one embodiment, memory 101 may be an internal storage unit of an electronic device, such as a hard drive or RAM. Memory 101 may also be an external storage device of the electronic device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, memory 101 may include both internal and external storage units. Memory 101 is used to store computer programs and other programs and data required by the terminal. Memory 101 can also be used to temporarily store data that has been output or will be output.
[0054] Those skilled in the art will understand that Figure 4 The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal to which the present invention is applied. A specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0055] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, operational databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operating data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0056] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligent recognition of CAD drawings for architectural engineering, characterized in that, The method includes: The frame recognition range is determined, an original dataset is established, and the original dataset is processed to obtain a training dataset, which contains several images labeled with frame range and frame type; The YOLOv8 model is trained based on the training dataset to obtain a bounding box range and type recognition model. Based on the aforementioned drawing frame range and type recognition model, reasoning is performed on the CAD drawing to obtain the drawing frame range and type reasoning results. The drawing frame range and type reasoning results are then processed by coordinate mapping and recorded in the drawing recognition JSON file.
2. The intelligent recognition method for architectural engineering CAD drawings according to claim 1, characterized in that, Determine the frame recognition range and establish the original dataset, including: The scope of the drawing frame identification is determined, which includes: drawing catalog, drawing description and drawing type. The drawing type includes: plan view, elevation view, section view, detail view, detailed drawing, system diagram, location diagram, lightning protection diagram, reinforcement diagram, fabrication diagram, control diagram, equipment diagram and schematic diagram. Several drawing samples were collected according to different drawing frame recognition ranges to form the original dataset.
3. The intelligent recognition method for architectural engineering CAD drawings according to claim 2, characterized in that, The original dataset is processed to obtain the training dataset, which includes: The bounding boxes of the design content in the original dataset are deleted, and the bounding box range and bounding box type of the deleted bounding boxes are marked to obtain the processed dataset. The drawings in the processed dataset are printed and exported to form an image dataset, and a training dataset is obtained based on the image dataset.
4. The intelligent recognition method for architectural engineering CAD drawings according to claim 1, characterized in that, The YOLOv8 model is trained based on the aforementioned training dataset to obtain a bounding box range and type recognition model, including: Set up the Python runtime environment and install the yolov8-seg model and its related dependency libraries; Write a data configuration file, which includes: training dataset directory, training dataset path, validation dataset path, and frame recognition range; The YOLOv8 model is trained based on the training dataset. The trained YOLOv8 model is then converted to ONNX format to obtain a bounding box range and type recognition model.
5. The intelligent recognition method for architectural engineering CAD drawings according to claim 4, characterized in that, The YOLOv8 model is trained based on the aforementioned training dataset to obtain a bounding box range and type recognition model, including: The training performance of the YOLOv8 model is confirmed based on changes in loss, evaluation metrics, or human observations.
6. The intelligent recognition method for architectural engineering CAD drawings according to claim 1, characterized in that, Based on the aforementioned drawing frame range and type recognition model, reasoning is performed on the CAD drawing to obtain the drawing frame range and type reasoning results, including: The image export range is determined based on the CAD drawings, the target image is exported based on the image export range, and the resolution of the target image is processed. Based on the frame range and type recognition model, reasoning is performed on the target image to obtain the frame range and type reasoning results.
7. The intelligent recognition method for architectural engineering CAD drawings according to claim 6, characterized in that, The coordinate mapping process is performed on the inference results of the drawing frame range and type, and the data is recorded in the drawing recognition JSON file, including: Based on the size of the target image and the world coordinates of the CAD drawing printing area, determine the coordinate transformation matrix between the image pixel coordinates and the CAD drawing world coordinate system; Based on the coordinate transformation matrix, the inference results of the drawing frame range and type are mapped to the world coordinate system of the CAD drawing, and the inference results of the drawing frame range and type are written into the drawing recognition JSON file; The drawing recognition JSON file is indexed and associated with the CAD drawing.
8. A smart recognition system for architectural engineering CAD drawings, characterized in that, The system is used to implement the steps of the intelligent recognition method for architectural engineering CAD drawings according to any one of claims 1-7, the system comprising: The training dataset creation module is used to determine the frame recognition range, create the original dataset, and process the original dataset to obtain the training dataset, which contains several images labeled with the frame range and frame type. The model training module is used to train the YOLOv8 model based on the training dataset to obtain a bounding box range and type recognition model. The model application module is used to perform reasoning on CAD drawings based on the drawing frame range and type recognition model, obtain the drawing frame range and type reasoning results, perform coordinate mapping processing on the drawing frame range and type reasoning results, and record them in the drawing recognition JSON file.
9. A terminal, characterized in that, The terminal includes a memory, a processor, and an intelligent recognition program for architectural engineering CAD drawings stored in the memory and executable on the processor. When the processor executes the intelligent recognition program for architectural engineering CAD drawings, it implements the steps of the intelligent recognition method for architectural engineering CAD drawings as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an intelligent recognition program for architectural engineering CAD drawings, and the intelligent recognition program for architectural engineering CAD drawings implements the steps of the intelligent recognition method for architectural engineering CAD drawings as described in any one of claims 1-7 on the computer-readable storage medium.