A method for detecting a sub-drawing frame in an architectural drawing and an electronic device
Through the diagram block detection model and dual encoder technology, the problem of sub-frame detection in architectural drawings is solved, efficient drawing structure analysis and accurate drawing name recognition are achieved, and the accuracy and efficiency of the intelligent drawing review system are improved.
Patent Information
- Application Number
- CN202311096933.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-08-29
AI Technical Summary
The existing intelligent drawing review system cannot effectively detect and identify sub-diagram frames in architectural drawings, resulting in large workload, low efficiency, and lack of unified analysis capabilities for drawing structure.
The graph frame sign detection model and dual encoder technology are used to detect the graph frame area and graph sign area, key information is extracted, frame classification and area segmentation are performed, sub-frames are identified and map name information is matched, and a tree-like structural model is constructed.
It improves the accuracy and efficiency of intelligent drawing review of architectural drawings, realizes the hierarchical analysis and traceability of the drawing structure, and reduces the possibility of errors and omissions.
Smart Images

Figure CN117133012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of architectural drawing review, and particularly to a method for detecting sub-frame in architectural drawings and an electronic device. Background Art
[0002] Currently, in the architectural design industry, most construction drawings are drawn using software (e.g., CAD drawings). Each manually drawn drawing needs to be judged by a drawing review program or software to determine whether it violates national standards and specifications. At present, most rely on experienced drawing review engineers for review, but there are problems of large workload and low efficiency. Therefore, it is extremely urgent to use computer vision image recognition to calculate the drawing content quantitatively to achieve intelligent drawing review. And the first step of intelligent drawing review is to realize the detection of the drawing frame. In intelligent drawing review of engineering drawings, the positioning of the drawing frame is very important. The drawing frame can provide a reference boundary. The drawing frame defines the boundary of the drawing, which determines the size and shape of the drawing. This provides a reference boundary for the computer, enabling it to accurately position and arrange image elements on the drawing.
[0003] In addition, the drawing frame can standardize the layout and position. The title block in the drawing frame usually includes a title, project information, date, and other necessary identifiers. And the layout and position of this information are standardized, enabling the computer to quickly and accurately identify and interpret the drawing. Also, the existence of the drawing frame ensures a consistent layout and position, thereby improving the readability and comprehensibility of the drawing. Moreover, the boundary and reference lines of the drawing frame can be used to assist in measurement and dimensioning. The computer can use the boundary of the drawing frame to determine the relative position and distance between elements. In addition, the reference lines of the drawing frame can be used as the reference lines for dimensioning, ensuring the accuracy and consistency of dimensioning. Also, the drawing frame, as a fixed component of each engineering drawing, ensures the integrity and continuity of the drawing. They provide a unified appearance and structure for each engineering drawing, enabling the computer to easily identify and distinguish different drawings.
[0004] Therefore, the positioning of the drawing frame in engineering drawings is very important. It provides a reference boundary, standardizes the layout and position, assists in measurement and dimensioning, and provides the integrity and continuity of the drawing. Without a drawing frame, the positioning of engineering drawings will become difficult and may lead to chaotic and inconsistent drawing layouts and positions.
[0005] At the same time, there are different blocks inside the drawing frame, which usually represent different components or functional modules in the drawing. In this application, this area is called a sub-frame (that is, because there may be several small drawings inside the drawing frame, it can be called a sub-frame). Reasonably dividing the sub-frame can better understand and organize the structure of the drawing, thus facilitating review and analysis. This is crucial for an intelligent drawing review system because it can help the system better understand and interpret the content of the drawing.
[0006] Moreover, dividing the sub - drawing frames can better capture and understand the correlation between different parts of the drawing, thus accurately reviewing and evaluating the consistency of the drawing. And this helps to ensure that the design and specifications of the drawing meet the requirements and reduce the possibility of errors and omissions. Also, the sub - drawing frames can provide the positioning function for different parts of the drawing and are convenient for computer call, improving the efficiency of review and analysis. Therefore, this is particularly important for dealing with large and complex drawings as it can save time and improve efficiency.
[0007] Therefore, there is an urgent need for a detection scheme for sub - drawing frames in architectural drawings. Summary of the Invention
[0008] (1) Technical Problems to be Solved
[0009] In view of the above - mentioned disadvantages and deficiencies of the prior art, the present invention provides a detection method and an electronic device for sub - drawing frames in architectural drawings, which can lay a good foundation for subsequent intelligent drawing review.
[0010] (2) Technical Solutions
[0011] To achieve the above object, the main technical solutions adopted by the present invention include:
[0012] In the first aspect, an embodiment of the present invention provides a detection method for sub - drawing frames in architectural drawings. The detection method is executed by an electronic device and includes: obtaining an architectural drawing; wherein, the architectural drawing includes a drawing frame area and a title block area; detecting the positions of the drawing frame area and the title block area from the architectural drawing, and extracting key information in the title block area based on the position of the title block area to obtain an extraction result of the key information, and classifying the drawing frame based on the extraction result of the key information and the position of the drawing frame area to obtain a drawing frame classification result; performing region segmentation on the drawing frame area based on the drawing frame classification result to obtain sub - drawing frame information of each sub - drawing frame area in a plurality of segmented sub - drawing frame areas, and determining the position of the non - sub - drawing frame area in the drawing frame area except for all sub - drawing frame areas based on the position information included in each sub - drawing frame information, and determining all drawing title information in the non - sub - drawing frame area based on the position of the non - sub - drawing frame area; performing matching processing on all sub - drawing frame information and all drawing title information through a pre - trained dual encoder to obtain the position information of each sub - drawing frame area and its corresponding drawing title information.
[0013] In a possible embodiment, detecting the positions of the drawing frame area and the title block area from the architectural drawing includes: inputting the architectural drawing into a pre - trained drawing frame and title block detection model for detection processing to obtain a plurality of detection results; performing NMS processing on the plurality of detection results to obtain the positions of the drawing frame area and the title block area.
[0014] In a possible embodiment, the model architecture of the drawing title bar detection model includes a backbone module, a neck module, and a head detection head module connected in sequence, and the model architecture of the drawing title bar detection model further includes a backbone branch module that serves as an input channel for the template drawing and is connected to the backbone module.
[0015] In a possible embodiment, the backbone branch module includes a SEM self-attention module, a first CBL module, a CSP1_1 module, a second CBL module, a CSP1_3 module, a concat module, and a conv module connected in sequence.
[0016] In a possible embodiment, key information in the drawing title bar area is extracted based on the position of the drawing title bar area to obtain an extraction result of the key information, including: performing an OCR text recognition operation on the drawing title bar area based on the position of the drawing title bar area to obtain the text of the drawing title bar area; obtaining an extraction result of the key information from the text of the drawing title bar area through an NLP model.
[0017] In a possible embodiment, the key information includes at least one of drawing name information, drawing number information, sub-item information, project name, scale information, and specialty information.
[0018] In a possible embodiment, the drawing frame area is segmented based on the drawing frame classification result to obtain sub-drawing frame information for each sub-drawing frame area in multiple segmented sub-drawing frame areas, including: after obtaining the drawing frame classification result, inputting the drawing of the drawing frame area into a pre-trained segmentation model to obtain sub-drawing frame information for each sub-drawing frame area; wherein, the sub-drawing frame information includes position information for indicating the position of the corresponding sub-drawing frame area and sub-drawing frame label information for indicating the type of the corresponding sub-drawing frame area.
[0019] In a possible embodiment, all drawing name information in the non-sub-drawing frame area is determined based on the position of the non-sub-drawing frame area, including: performing an OCR text recognition operation on the non-sub-drawing frame area based on the position of the non-sub-drawing frame area to obtain the text within the non-sub-drawing frame area; detecting all drawing name information from the text within the non-sub-drawing frame area through an NLP model.
[0020] In a possible embodiment, the detection method further includes: using the position information of each sub-drawing frame area and its corresponding drawing name information to construct a tree structure for auditing architectural drawings.
[0021] In a second aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored. When the computer program is run by a processor, the method described in the first aspect or any optional implementation manner of the first aspect is executed.
[0022] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, communication between the processor and the memory is carried out through the bus. When the machine-readable instructions are executed by the processor, the method described in the first aspect or any optional implementation manner of the first aspect is executed.
[0023] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0024] (III) Beneficial effects
[0025] The beneficial effects of the present invention are as follows:
[0026] The present application provides a method and an electronic device for detecting sub-drawing frames in architectural drawings. By obtaining the architectural drawings, detecting the positions of the drawing frame area and the title block area from the architectural drawings, extracting key information in the title block area based on the position of the title block area to obtain the extraction result of the key information, classifying the drawing frame based on the extraction result of the key information and the position of the drawing frame area to obtain the drawing frame classification result, performing regional segmentation on the drawing frame area based on the drawing frame classification result to obtain the sub-drawing frame information of each sub-drawing frame area in the multiple segmented sub-drawing frame areas, determining the position of the non-sub-drawing frame area in the drawing frame area except for all the sub-drawing frame areas based on the position information included in each sub-drawing frame information, determining all the drawing name information in the non-sub-drawing frame area based on the position of the non-sub-drawing frame area, and performing matching processing on all the sub-drawing frame information and all the drawing name information through a pre-trained dual encoder to obtain the position information of each sub-drawing frame area and its corresponding drawing name information, thus laying a good foundation for subsequent intelligent drawing review.
[0027] To make the above objects, features, and advantages to be achieved by the embodiments of the present application more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. Description of the drawings
[0028] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0029] Figure 1 Shows a flowchart of a method for detecting a sub-frame in an architectural drawing provided by an embodiment of the present application;
[0030] Figure 2 Shows a schematic diagram of a drawing title bar detection model provided by an embodiment of the present application;
[0031] Figure 3A Shows a schematic diagram of a CBL module provided by an embodiment of the present application;
[0032] Figure 3B Shows a schematic diagram of a CSP1_X module provided by an embodiment of the present application;
[0033] Figure 3C Shows a schematic diagram of a CSP2_X module provided by an embodiment of the present application;
[0034] Figure 3D Shows a schematic diagram of a SEM module provided by an embodiment of the present application;
[0035] Figure 3E Shows a schematic diagram of a Focus module provided by an embodiment of the present application;
[0036] Figure 3F Shows a schematic diagram of a SPP module provided by an embodiment of the present application. Detailed implementation manners
[0037] To better explain the present invention for easy understanding, the following will describe the present invention in detail with reference to the accompanying drawings through specific implementation manners.
[0038] Since architectural drawings come from various design institutes, there is no standard and uniformity in the drawing process. Different design institutes and designers will draw drawings in different formats according to their own habits, resulting in a wide variety of drawing frames. Moreover, currently, the detection of drawing frames in intelligent drawing review products is basically through specific layers or manual selection, which means that if the layer structure of the drawing does not meet the expectations or the correct selection is not made, the drawing frame cannot be accurately detected, thus increasing the complexity of the operation and the possibility of errors. In addition, currently, intelligent drawing review products are basically human-computer interaction, allowing users to select the drawing frame or detect the drawing frame through fixed layer or block attributes, etc. There is no relevant definition for sub-drawing frames, nor are they detected, and there is no relevant drawing architecture analysis solution.
[0039] That is to say, existing intelligent drawing review products usually identify drawing frames through specific layers or manual selection, and currently, there is no clear concept of sub-drawing frames in intelligent drawing review products. Therefore, once the layer is incorrect, it will lead to missed detection. And if manual selection is carried out, it will lead to a large amount of human-computer interaction, seriously affecting work efficiency and user experience.
[0040] Based on this, the embodiments of the present application provide a method and an electronic device for detecting sub-drawing frames in architectural drawings. First, the drawing frame area and the title block area of the drawing frame are detected through a drawing frame and title block detection model, and the text in the title block area is detected through OCR, and the text is sequenced. The key information is detected through an NLP model. In addition, the drawing frame is classified according to the title block information. The graphic element information in the drawing frame is segmented into multiple sub-drawing frame areas through a segmentation model. At the same time, the text in the non-sub-drawing frame area included in the drawing frame area is detected through OCR, and the text is sequenced. The drawing name information is detected through an NLP model, and the drawing name is classified. These drawing names, drawing name position information, detected drawing frame labels and position information are input into a pre-trained dual encoder for matching to obtain the position of the sub-drawing frame and the corresponding drawing name information, so that "drawing frame detection and sub-drawing frame splitting" can be used as the entry point of the computer vision algorithm for structural professional engineering drawing hierarchical architecture analysis, aiming to improve the accuracy of drawing review and realize the traceability of the drawing review process.
[0041] To better understand the above technical solutions, the exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and the scope of the present invention can be fully conveyed to those skilled in the art.
[0042] Please refer to Figure 1 , Figure 1The flowchart of a method for detecting a sub-frame in an architectural drawing provided by an embodiment of the present application is shown. As Figure 1 The described detection method can be executed by an electronic device, and the specific device of the electronic device can be set according to actual needs. The embodiments of the present application are not limited thereto. Specifically, the detection method includes:
[0043] Step S110, obtain an architectural drawing. Among them, the architectural drawing includes a frame area and a title block area.
[0044] It should be understood that the architectural drawing in the present application refers to an electronic drawing. For example, the architectural drawing can be a CAD drawing.
[0045] It should also be understood that the title block area is generally located in the lower right corner of the architectural drawing, and the title block area is generally in the form of a table. And, the frame area generally refers to the plan view in the middle of the architectural drawing.
[0046] Step S120, detect the positions of the frame area and the title block area from the architectural drawing, extract the key information in the title block area based on the position of the title block area to obtain the extraction result of the key information, and classify the frame based on the extraction result of the key information and the position of the frame area to obtain the frame classification result.
[0047] It should be understood that the specific process of detecting the positions of the frame area and the title block area from the architectural drawing can be set according to actual needs. The embodiments of the present application are not limited thereto.
[0048] Optionally, input the architectural drawing into a pre-trained frame and title block detection model for detection processing to obtain multiple detection results; perform non-maximum suppression (NMS) processing on the multiple detection results to obtain the positions of the frame area and the title block area.
[0049] Among them, the frame and title block detection model can also be called a deep learning object detection model, or a network double-branch self-attention detection model, etc. The embodiments of the present application are not limited thereto.
[0050] To facilitate understanding of the frame and title block detection model, the following will be described through specific embodiments.
[0051] Specifically, detecting the drawing frame is the first step in intelligent drawing review. Engineering CAD drawings usually contain a large number of complex geometric elements such as lines, texts, and symbols, and the shapes and structures of these elements are diverse, resulting in significant variations in the shape and size of the drawing frame. Different from simple objects in traditional object detection tasks, traditional deep learning models (such as R-CNN series models, YOLO series models, SSD models, and RetinaNet models, etc.) may not be able to accurately capture these complex geometric features, leading to a decrease in the accuracy of drawing frame detection.
[0052] Secondly, the drawing frames in engineering CAD drawings usually have high requirements for details and precision, and traditional deep learning models usually scale or downsample the images when processing them, which may result in the loss or blurring of the details of the drawing frame, thereby affecting the detection accuracy.
[0053] In addition, the drawing frames in engineering CAD drawings usually have features such as different line thicknesses, colors, and textures, which may be difficult for traditional deep learning models to distinguish and learn. Traditional deep learning models may have difficulties in processing these complex features, resulting in low accuracy of drawing frame detection.
[0054] To address these problems, as Figure 2 shown, the embodiment of the present application discloses a drawing frame and title block detection model applicable to various design drawings, and the model architecture of the drawing frame and title block detection model consists of a backbone module (i.e., the backbone network) responsible for feature extraction, a backbone branch module serving as the input channel of the template drawing, a neck module (i.e., the neck structure module) responsible for feature fusion, and a head detection head module (i.e., the head head module) containing three detection heads and responsible for outputting detection information. Among them, the backbone module, the neck module, and the head detection head module are connected in series, and the backbone branch module is also connected to the backbone module.
[0055] It should be noted here that during the training process of the model, template drawings of architectural drawings from multiple design institutes can be collected and used for model training in sequence. And after the model training is completed, only the architectural drawings need to be input into the trained drawing frame and title block detection model, and there is no need to input the template drawings into the trained drawing frame and title block detection model anymore.
[0056] It should be understood that the specific structures of the backbone module, the backbone branch module, the neck module, and the head detection head module can all be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0057] For example, the specific structure of the backbone module can be as Figure 2 shown in the figure.
[0058] For another example, the backbone branch module includes an SEM self-attention module, a first CBL module, a CSP1_1 module, a second CBL module, a CSP1_3 module, a concat module, and a conv module connected in sequence.
[0059] Here, it should be noted that in order to enhance the attention of the neural network to the drawing frame and the drawing title bar, an input channel of a template drawing (i.e., the backbone branch module) is added, and this channel is fused with the data output from the above channels after passing through a series of SEM self-attention modules, convolutional modules, and residual modules, and after dimensionality reduction through one layer of convolution, the data after dimensionality reduction is input into the neck module. This can help the model focus on the drawing frame and the drawing title bar, while ignoring other irrelevant objects, thereby improving the detection accuracy of the model and reducing the computational complexity. Among them, the content of the drawing frame of the template drawing is empty, and the drawing title area of the template drawing has a title, but the subsequent content of the title is not filled in.
[0060] For another example, the specific structure of the neck module can be as Figure 2 shown in the figure.
[0061] For another example, the specific structure of the head detection head module can be as Figure 2 shown in the figure.
[0062] Based on the above Figure 2 shown model architecture, the image data can be input through the branches corresponding to the two modules of the backbone module and the backbone branch module. The branch input of the backbone module is the drawing data with information, and the branch input of the backbone branch module is the template data without information but only with the basic information of the drawing frame.
[0063] For the branch of the backbone module, the core of this backbone module is to perform slicing operations on the picture. Taking a simple input picture (for example, this picture can be a 640x640x3 picture) as an example, for the red area, regardless of the width or height, start from 0 and take values every two steps; for the yellow area, regardless of the width or height, start from 1 and take values every two steps; and so on, perform such slicing operations on all three channels. Finally, all the slices are concatenated together according to the channels to obtain a feature map (for example, this feature map can be a 32x304x304 feature map).
[0064] Also, for the branches of the backbone branch module, the SEM self-attention module adopts an attention mechanism for enhancing convolutional neural networks. First, the spatial dimension of the input feature map is compressed into a feature vector through global average pooling operation. This feature vector represents the global statistical information of the input feature map in the channel dimension. Next, through a series of fully connected layers and activation functions, the compressed feature vector is mapped to a new feature vector. This new feature vector represents the importance weights of each channel and is used to adjust the activation values of each channel in the input feature map.
[0065] Also, the outputs of the two branches are respectively passed through the same convolutional block (CBL represents conv convolution, BN normalization, leakyrelu activation, and CSP1 represents the combination of residual units and conv convolution) to extract features, and then contact fusion is performed, and 1×1 conv convolution is used for dimensionality reduction. Then, the CSP2 structure (a combination of convolutional blocks) is adopted to strengthen the model's detection of objects at different scaling scales and improve the feature fusion ability. Finally, three output results are output through the detection head module (including some convolutional layers, pooling layers, and fully connected layers), and after performing NMS processing on the three outputs (it should be noted here that the process of this NMS processing is a process outside the model), a 5*n result is output. Among them, 5 represents lx for the x coordinate of the upper left corner of the box, ly for the y coordinate of the upper left corner of the box, rx for the x coordinate of the lower right corner of the box, ry for the y coordinate of the lower right corner of the box, and f for the confidence; n represents the detection position. Thus, after determining the position of the frame area through the 5*n result, the position of the title bar area can be further determined.
[0066] It should be noted here that the specific structures of the modules included in each module in the frame and title bar detection model (such as the SEM self-attention module and the first CBL module, etc.) can be as Figures 3A to 3F shown in the structure, which will not be elaborated here.
[0067] It should also be understood that the specific process of extracting key information from the title bar area based on the position of the title bar area to obtain the extraction result of the key information can also be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0068] Optionally, perform OCR text recognition operation on the title bar area based on the position of the title bar area to obtain the text in the title bar area. Also, obtain the extraction result of the key information from the text in the title bar area through the NLP model. Among them, the NLP model can be an existing model.
[0069] For example, perform OCR character recognition on the title block area to detect characters, sequence the characters, detect key information through an NLP model, and classify the drawing frames based on the key information in the title block. For example, in structural engineering drawings, the drawings in the title block can be divided into building drawings and basement drawings according to the sub-items, and can also be divided into drawings of walls, columns, beams, slabs, stairs, etc. according to the drawing names in the title block. Subsequently, the subsequent recognition and analysis of walls, columns, beams, slabs, stairs, etc. can be automatically input into the corresponding analysis modules for analysis based on this classification result.
[0070] It should be noted here that this application can facilitate the subsequent review of architectural drawings. For example, the drawing frame classification result obtained by this application is also for subsequent drawing recognition services, so the acquisition of this drawing frame classification result is also necessary.
[0071] It should also be understood that the information included in the key information can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0072] Optionally, the key information includes at least one of drawing name information, drawing number information, sub-item information, project name, scale information, and specialty information.
[0073] Step S130, based on the drawing frame classification result, perform regional segmentation on the drawing frame area to obtain the sub-drawing frame information of each sub-drawing frame area in the multiple segmented sub-drawing frame areas, determine the position of the non-sub-drawing frame area in the drawing frame area except for all sub-drawing frame areas based on the position information included in each sub-drawing frame information, and determine all the drawing name information in the non-sub-drawing frame area based on the position of the non-sub-drawing frame area.
[0074] It should be understood that the specific process of performing regional segmentation on the drawing frame area based on the drawing frame classification result to obtain the sub-drawing frame information of each sub-drawing frame area in the multiple segmented sub-drawing frame areas can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0075] Optionally, after obtaining the drawing frame classification result, input the drawing of the drawing frame area into a pre-trained segmentation model to obtain the sub-drawing frame information of each sub-drawing frame area. Among them, the sub-drawing frame information includes position information for indicating the position of the corresponding sub-drawing frame area and sub-drawing frame label information for indicating the type of the corresponding sub-drawing frame area.
[0076] It should be noted here that the segmentation models corresponding to different drawing frame classification results are the same. This drawing frame classification result is mainly used for the analysis of the entire hierarchical architecture. It is a part of this architecture, and at the same time, this classification result is also for subsequent drawing recognition services.
[0077] For example, the drawing in the frame area is segmented by a segmentation model to obtain the position information of each sub-frame area in the multiple segmented sub-frame areas, and corresponding sub-frame label information such as grid axis numbers, reinforcement tables, ordinary tables, and details is added to each sub-frame.
[0078] It should be noted here that in addition to the above four types of information, the sub-frame label information may also include other label information, and the embodiments of the present application are not limited thereto.
[0079] It should also be understood that the specific model and its model structure of the segmentation model can be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0080] For example, the segmentation model can be a semantic segmentation model such as U-net or deeplab, or an instance segmentation model such as YOLACT or SOLO.
[0081] It should also be understood that the specific process of determining all the drawing name information in the non-sub-frame area based on the position of the non-sub-frame area can also be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0082] Optionally, an OCR text recognition operation is performed on the non-sub-frame area based on its position to obtain the text in the non-sub-frame area; all the drawing name information is detected from the text in the non-sub-frame area through an NLP model. Here, the non-sub-frame area refers to the area in the frame area other than the sub-frame area.
[0083] For example, by performing an OCR text recognition operation on the non-sub-frame area to detect the text in the non-sub-frame area, and sequencing the text, the drawing name information is detected through an NLP model, and the drawing names are classified. For example, "Three to Six Floor Beam Plan Drawing" is the drawing name of the beam plan; "19# Building Three to Sixteen Floor Slab Plan Drawing" is the drawing name of the slab plan; "8.92m to 50.92m Shear Wall Plan Drawing" is the drawing name of the wall plan; "Structural Floor Elevation, Storey Height, Concrete Strength Grade" is the drawing name of the storey height table.
[0084] Step S140, the pre-trained dual encoder is used to match all the sub-frame information and all the drawing name information to obtain the position information of each sub-frame area and its corresponding drawing name information. Among them, the dual encoding model can perform the matching task of images and drawing names by maximizing the similarity between images and texts.
[0085] It should be understood that the specific model of the dual encoder can be set according to actual needs, and the embodiments of the present application are not limited thereto.
[0086] For example, the dual encoder can be an existing encoder model, and the dual encoder can be the ALIGN model.
[0087] It should also be understood that the specific process of matching all sub - figure frame information and all figure name information through a pre - trained dual encoder to obtain the position information of each sub - figure frame area and its corresponding figure name information can also be set according to actual needs, and the embodiments of this application are not limited thereto.
[0088] Optionally, all sub - figure frame information and all figure name information are input into the dual encoder for matching processing to obtain the position of the sub - figure frame and the corresponding figure name information, and the hierarchical structure can be determined from the information obtained from the figure frame, the title block, and the sub - figure frame. For example, the project name, the sub - item name (such as Building No. 1, etc.), the figure name (such as the beam plan, etc.), and the figure name information within the sub - figure frame (such as the beam reinforcement drawing, etc.). Then, an architecture model can be constructed based on the above - mentioned information, and this architecture model is a tree - like structure.
[0089] Among them, the root node of the tree - like structure represents the entire scene (such as a project), and with this model, the child nodes of the root node represent an object (such as a sub - item). Thus, during the drawing review process, the corresponding hierarchical information can be extracted by traversing this tree - like structure.
[0090] It should be noted here that the input of one of the encoders of the dual encoder is the sub - figure frame information, and the input of the other encoder is a sequence of figure name information (for example, it can be figure name information or classified figure name information), and this data can be processed by the encoder and an output sequence can be generated by the decoder. Also, both the encoder and the decoder are composed of multiple layers of self - attention mechanisms and feed - forward neural networks. After the sub - figure frame information and the figure name information are encoded by the encoder, through the self - attention mechanism, different positions (or elements) in the input sequence are weighted, enabling the model to learn the context relationship and dependence between the sub - figure frame information and the figure name information. Then, the similarity between them can be calculated to obtain the attention weights. Finally, the figure name information can be weighted and summed according to the attention weights to finally obtain the best match between the sub - figure frame information and the figure name information.
[0091] Therefore, by means of the above - mentioned technical solution, the embodiments of this application divide the figure frame to obtain sub - figure frames and obtain the sub - figure frame information of the sub - figure frames, and also perform OCR character recognition on the non - sub - figure frame area to obtain the text within the non - sub - figure frame area, and also use the encoder model to complete the matching task between the sub - figure frame information and the figure name information within the non - sub - figure frame area. Finally, a tree - like structure model can be constructed based on the data obtained previously, which can not only improve the efficiency of drawing review but also realize the hierarchical structure analysis of structural professional engineering drawings, thus laying a good foundation for subsequent intelligent drawing review.
[0092] It should be understood that the method for detecting the sub-drawing frame in the above building drawings is merely exemplary, and those skilled in the art can make various deformations according to the above method, and the solutions after such deformations also fall within the protection scope of this application.
[0093] This application provides a storage medium, on which a computer program is stored, and when the computer program is run by a processor, it executes the method described in the embodiment.
[0094] This application also provides a computer program product, which, when running on a computer, causes the computer to execute the method described in the method embodiment.
[0095] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described system can refer to the corresponding process in the foregoing method, and will not be elaborated herein too much.
[0096] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0097] It should be understood that in various embodiments of this application, the magnitudes of the sequence numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0098] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0099] In addition, the functional modules in each embodiment of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0100] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes. It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of another identical element in the process, method, article or device comprising the said element.
[0101] The above are only the preferred embodiments of this application and are not used to limit this application. For those skilled in the art, this application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application. It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0102] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or replacements, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A method for detecting a sub-drawing frame in an architectural drawing, characterized in that, The detection method is executed by an electronic device, and the detection method includes: Obtain the architectural drawing; wherein, the architectural drawing includes a title block area and a drawing list area; Detect the positions of the title block area and the drawing list area from the architectural drawing, and extract key information in the drawing list area based on the position of the drawing list area to obtain an extraction result of the key information, and perform title block classification based on the extraction result of the key information and the position of the title block area to obtain a title block classification result; Perform region segmentation on the title block area based on the title block classification result to obtain sub-title block information of each of the multiple segmented sub-title block areas, and determine the position of the non-sub-title block area in the title block area except for all the sub-title block areas based on the position information included in each piece of sub-title block information, and determine all the drawing title information in the non-sub-title block area based on the position of the non-sub-title block area; Perform matching processing on all the sub-title block information and all the drawing title information through a pre-trained dual encoder to obtain the position information of each sub-title block area and its corresponding drawing title information.
2. The detection method according to claim 1, characterized in that The detecting the positions of the title block area and the drawing list area from the architectural drawing includes: Input the architectural drawing into a pre-trained title block and drawing list detection model for detection processing to obtain multiple detection results; Perform NMS processing on the multiple detection results to obtain the positions of the title block area and the drawing list area.
3. The detection method according to claim 2, wherein The model architecture of the title block and drawing list detection model includes a backbone module, a neck module, and a head detection head module connected in sequence, and the model architecture of the title block and drawing list detection model further includes a backbone branch module used as an input channel for the template drawing and connected to the backbone module.
4. The detection method according to claim 3, characterized in that The backbone branch module includes a SEM self-attention module, a first CBL module, a CSP1_1 module, a second CBL module, a CSP1_3 module, a concat module, and a conv module connected in sequence.
5. The detection method according to claim 1, wherein, The extracting the key information in the drawing list area based on the position of the drawing list area to obtain the extraction result of the key information includes: Perform OCR text recognition operation on the drawing list area based on the position of the drawing list area to obtain the text of the drawing list area; Obtain the extraction result of the key information from the text of the drawing list area through an NLP model.
6. The detection method according to claim 5, wherein The key information includes at least one of drawing title information, drawing number information, sub-item information, project name, scale information, and specialty information.
7. The detection method according to claim 1, wherein The performing region segmentation on the title block area based on the title block classification result to obtain sub-title block information of each of the multiple segmented sub-title block areas includes: After obtaining the frame classification result, input the drawing of the frame area into a pre-trained segmentation model to obtain the sub-frame information of each sub-frame area; wherein, the sub-frame information includes position information for representing the position of the corresponding sub-frame area and sub-frame label information for representing the type of the corresponding sub-frame area.
8. The detection method according to claim 1, wherein Based on the position of the non-sub-frame area, determining all the drawing name information in the non-sub-frame area, including: Performing OCR text recognition operation on the non-sub-frame area based on the position of the non-sub-frame area to obtain the text in the non-sub-frame area; Detecting all the drawing name information from the text in the non-sub-frame area through an NLP model.
9. The detection method according to claim 1, wherein The detection method further includes: Utilizing the position information of each sub-frame area and its corresponding drawing name information to construct a tree structure for auditing the architectural drawing.
10. An electronic device, comprising a processor, a memory, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the detection method of the sub-frame in the architectural drawing as described in any one of claims 1-9.
Citation Information
Patent Citations
Region division method and device in architectural plan, equipment and medium
CN113469086A
Electronic drawing identification method and device, electronic equipment and storage medium
CN115100673A
Cited By
Beam member identification method and electronic equipment
CN117275031A
Beam member identification method and electronic device
CN117275031B