A method and device for detecting a pile in construction drawings

By using an improved YOLOv8 model and sliding window slicing technology, combined with geometric relationships and clustering processing, the problems of low efficiency and low accuracy in pile detection on construction drawings were solved, achieving efficient and accurate pile location and annotation identification.

CN120876485BActive Publication Date: 2025-12-12SHANGHAI BANGTU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511395399.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2025-12-12
Estimated Expiration
2045-09-28

AI Technical Summary

Technical Problem

Existing methods for detecting piles based on construction drawings are inefficient and inaccurate, and manual review can easily lead to missed or incorrect detections.

Method used

A semi-supervised training method based on an improved YOLOv8 model is adopted. By using sliding window slicing and nonmaximum suppression techniques, the location of piles in construction drawings is identified, and the in-situ annotations of piles are determined by combining geometric relationships and clustering.

Benefits of technology

It improves the efficiency and accuracy of pile inspection based on construction drawings, effectively identifies pile components and their annotation information, and reduces false positives and false negatives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876485B_ABST
    Figure CN120876485B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of pile detection method and device in construction drawing, more particularly to computer technology field, comprising: obtaining construction drawing including pile component;Using sliding window to overlap slice construction drawing, obtain multiple slice images;Each slice image in multiple slice images is respectively input into trained pile position detection model to carry out pile position identification, obtain the pile position detection result in each slice image;Wherein, trained pile position detection model is obtained based on semi-supervised training set to semi-supervised training improved YOLOv8 model;The pile position detection result of all slice images is merged and deduplicated to obtain the position of all pile components in construction drawing;Determine all pile original position annotation in construction drawing, and according to the position of all pile components in construction drawing, each pile original position annotation in all pile original position annotation is assigned to corresponding pile component, so that it can not only improve detection efficiency, but also improve detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for detecting piles in construction drawings. Background Technology

[0002] Construction drawing review is a core step in ensuring the quality, feasibility, and compliance of design drawings during engineering construction. Its purpose is to identify design defects in advance, avoid construction risks, and ensure that the project is safe, compliant, economical, and efficient.

[0003] Currently, the review of traditional construction pile drawings mainly relies on manual review, which has problems such as long review cycle and easy omission and misidentification. Summary of the Invention

[0004] (a) Technical problems to be solved

[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method and apparatus for detecting piles in construction drawings, which solves the technical problems of low detection efficiency and low detection accuracy in the prior art.

[0006] (II) Technical Solution

[0007] To achieve the above objectives, the main technical solutions adopted by the present invention include:

[0008] In a first aspect, embodiments of the present invention provide a method for detecting piles in construction drawings, comprising: acquiring construction drawings including pile components; using a sliding window to overlap and slice the construction drawings to obtain multiple slice images; inputting each slice image into a trained pile position detection model for pile position identification to obtain a pile position detection result in each slice image; wherein, the trained pile position detection model is obtained by semi-supervised training of an improved YOLOv8 model based on a semi-supervised training set; merging and deduplicating the pile position detection results of all slice images to obtain the positions of all pile components in the construction drawings; determining all in-situ annotations of piles in the construction drawings, and assigning each in-situ annotation of piles to the corresponding pile component according to the position of all pile components in the construction drawings.

[0009] In one possible embodiment, the backbone network in the improved YOLOv8 model includes a DP-SPPF module to replace the existing SPPF module. The DP-SPPF module includes a third conv2D module, a second Split module, a first MaxPool2D module, a second MaxPool2D module, a first AvgPool2D module, a second AvgPool2D module, a second concat module, and a fourth conv2D module. The second Split module is connected to the third conv2D module, the first MaxPool2D module, and the first AvgPool2D module, respectively. The first MaxPool2D module is also connected to the second MaxPool2D module, and the first AvgPool2D module is connected to the second AvgPool2D module. The second concat module is connected to the first MaxPool2D module, the second MaxPool2D module, the first AvgPool2D module, the second AvgPool2D module, and the fourth conv2D module, respectively.

[0010] In one possible embodiment, the pile location detection result includes the position coordinates of the minimum bounding box of the pile component in each slice image; merging and deduplicating the pile location detection results of all slice images to obtain the location of all pile components in the construction drawings includes: merging and deduplicating the pile location detection results of all slice images to obtain the position coordinates of the minimum bounding box of all targets in the construction drawings; determining the center coordinates of all target elements in the construction drawings, and selecting target elements whose center coordinates are within the target minimum bounding box as candidate elements; wherein, the target elements include at least one of line segment elements, multi-broken line elements, arc elements, and filled elements; traversing all candidate elements, finding rectangles, circles, and cross intersections based on geometric relationships, and determining a set of elements that approximately coincide with the center of the rectangle, the center of the circle, and the intersection of the cross as the basis for forming the pile component.

[0011] In one possible embodiment, the in-situ pile annotation includes at least one of the following: annotation information, annotation line, and annotation leader line. The process involves determining all in-situ pile annotations in the construction drawings and assigning each in-situ pile annotation to its corresponding pile component. This includes: using a pre-configured regular expression to search for candidate text elements containing the target keyword from all elements in the construction drawings; performing clustering processing on the candidate text elements to obtain multiple groups of clustered elements; wherein each group of clustered elements includes annotation information for the same in-situ pile annotation; determining the parameter information for each group of clustered elements, and based on the parameter information, determining the annotation line corresponding to each group of clustered elements; and, according to the annotation line corresponding to each group of clustered elements, using the line segment with the same layer and color and coinciding with one endpoint as the annotation leader line, and assigning the annotation information to the pile component pointed to by the annotation leader line.

[0012] In one possible embodiment, the parameter information includes the overall outer contour boundary of each group of clustered primitives, the text direction of the annotation information, and the target length of the edge in the text direction within the outer contour boundary.

[0013] In one possible embodiment, the annotation line corresponding to each group of clustered elements is determined based on the parameter information of each group of clustered elements, including: traversing all line segment elements in the construction drawing, and selecting line segment elements that meet specified conditions as candidate line segment elements for the current group of clustered elements; wherein, the current group of clustered elements is any group of clustered elements among multiple groups of clustered elements; the specified conditions include that the line segment direction is the same as the text direction of the current group of clustered elements, its line segment length is within a first length range, the distance from the text edge in the direction perpendicular to the text is less than a preset distance, and the projection of the outer contour boundary in the direction perpendicular to the text and its coincidence length are within a second length range; the first length range and the second length range are both determined by the target length; and selecting the candidate line segment element that is closest to the annotation information in the direction perpendicular to the text as the annotation line corresponding to the current group of clustered elements.

[0014] Secondly, embodiments of the present invention provide a detection device for piles in construction drawings, comprising:

[0015] The acquisition module is used to acquire construction drawings, including those for pile components.

[0016] The slicing module is used to overlap and slice construction drawings using a sliding window to obtain multiple slice images;

[0017] The input module is used to input each slice image from multiple slice images into the trained pile location detection model to identify the pile location and obtain the pile location detection result in each slice image; wherein, the trained pile location detection model is obtained by semi-supervised training of the improved YOLOv8 model based on a semi-supervised training set;

[0018] The merge and deduplication module is used to merge and deduplicate the pile position detection results of all slice images to obtain the position of all pile components in the construction drawings;

[0019] The assignment module is used to determine the in-situ annotations of all piles in the construction drawings, and to assign the value of each in-situ annotation of all piles to the corresponding pile component based on the position of all pile components in the construction drawings.

[0020] In one possible embodiment, the pile location detection result includes the position coordinates of the minimum bounding box of the pile component in each slice image; the merging and deduplication module is specifically used to: merge and deduplicate the pile location detection results of all slice images to obtain the position coordinates of the minimum bounding boxes of all targets in the construction drawings; determine the center coordinates of all target elements in the construction drawings, and select target elements whose center coordinates are within the target minimum bounding box as candidate elements; wherein, the target elements include at least one of line segment elements, multi-broken line elements, arc elements, and filled elements; traverse all candidate elements, find the rectangle, circle, and cross intersection lines according to geometric relationships, and determine the set of elements that approximately coincide with the center of the rectangle, the center of the circle, and the intersection of the cross line as the basis for forming the pile component.

[0021] Thirdly, embodiments of this application also provide an electronic device, which includes: a memory for storing a computer program; and a processor for executing the computer program stored in the memory. When the computer program is executed, the processor is used to execute a pile detection method in a construction drawing as described above.

[0022] Fourthly, embodiments of this application also provide a storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform a pile detection method as described above in a construction drawing.

[0023] (III) Beneficial Effects

[0024] The beneficial effects of this invention are:

[0025] This application provides a method and apparatus for detecting piles in construction drawings. The method involves acquiring construction drawings including pile components, overlaying and slicing the drawings using a sliding window to obtain multiple slice images, and inputting each slice image into a trained pile position detection model for pile position identification. The trained pile position detection model is obtained by semi-supervised training of an improved YOLOv8 model using a semi-supervised training set. The method also involves merging and deduplicating the pile position detection results from all slice images to obtain the positions of all pile components in the construction drawings, determining all in-situ annotations for all piles in the construction drawings, and assigning each in-situ annotation to the corresponding pile component based on its position. This approach not only improves detection efficiency but also enhances detection accuracy.

[0026] To make the above-mentioned objectives, features and advantages to be achieved by the embodiments of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 A flowchart illustrating a method for detecting piles in construction drawings according to an embodiment of this application is shown;

[0029] Figure 2 This paper shows a schematic diagram of the structure of a pile location detection model provided in an embodiment of this application;

[0030] Figure 3 This paper shows a schematic diagram of the structure of a CSPrayer module provided in an embodiment of this application;

[0031] Figure 4 This paper shows a schematic diagram of the structure of an SPPF module provided in an embodiment of this application;

[0032] Figure 5 A schematic diagram of an in-situ pile marking provided in an embodiment of this application is shown;

[0033] Figure 6 This paper shows a structural block diagram of a pile detection device in a construction drawing provided by an embodiment of this application. Detailed Implementation

[0034] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0035] Currently, some existing methods for detecting piles are rule-based, relying on the experience and rules proposed by drawing review experts to develop interpretation logic. However, different design institutes and designers create drawings with diverse styles, and a single set of rules typically only applies to one set of drawings. To adapt to multiple sets of drawings, nested rules are often required, leading to complex logic and even conflicts between rules, significantly increasing the difficulty of interpretation. Furthermore, these methods suffer from long interpretation processes, slow operation, low versatility, and difficulty in maintenance. Other pile detection methods have strict requirements on drawing methods, relying on user-defined information such as layer names, colors, and line types. Users need to draw using fixed templates or modify existing drawings according to templates to achieve compatibility. In other words, these methods not only change users' drawing habits but also have very limited application scenarios, failing to achieve truly intelligent drawing interpretation.

[0036] Based on this, this application provides a method and apparatus for detecting piles in construction drawings. The method involves acquiring construction drawings including pile components, and using a sliding window to overlap and slice the construction drawings to obtain multiple slice images. Each slice image is then input into a trained pile position detection model for pile position identification, resulting in a pile position detection result for each slice image. This trained pile position detection model is obtained through semi-supervised training of an improved YOLOv8 model using a semi-supervised training set. The method also merges and removes duplicates from all slice images to obtain the positions of all pile components in the construction drawings, determines all in-situ annotations for all piles in the construction drawings, and assigns values ​​to each in-situ annotation of all piles based on their positions. This approach not only improves detection efficiency but also enhances detection accuracy.

[0037] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although 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 to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.

[0038] It should be noted that this application mainly targets the inspection of pile components in construction drawings, primarily focusing on the positioning of pile components and the matching of pile labeling information. Pile positioning includes the coordinates of the pile's center point and the positioning scale line of the pile relative to the grid; pile information includes the pile shape, pile side length (for square piles) or diameter (for round piles), pile number, pile top elevation, and whether it is a test pile, etc.

[0039] Please see Figure 1 , Figure 1 A flowchart illustrating a method for detecting piles in construction drawings according to an embodiment of this application is shown. It should be understood that this detection method can be performed by a pile detection device in the construction drawings, and the specific components of the detection device can be configured according to actual needs; this embodiment is not limited thereto. For example, the detection device can be a computer or a server, etc. Specifically, the detection method includes:

[0040] Step S110: Obtain construction drawings including pile components.

[0041] It should be understood that the specific drawings of the construction drawings can be set according to actual needs, and the embodiments of this application are not limited thereto.

[0042] Optionally, if the construction drawings include at least one drawing frame, the drawing frame can be a pile location layout drawing that only includes pile components, or a foundation plan drawing that includes multiple components such as pile components.

[0043] Step S120: Use a sliding window to overlap and slice the construction drawings to obtain multiple slice images.

[0044] Specifically, when the construction drawings are CAD drawings, they can be converted into images. For example, for the original drawing elements, a scaling ratio of 32:1 (i.e., each 32mm length in the CAD drawing is exported as one pixel) can be used to export them as images. This scaling ratio ensures that the drawing content is clear enough after exporting, while also preventing the image resolution from being too high. A high image resolution is not conducive to model learning and also consumes more resources and slows down inference speed.

[0045] Furthermore, the pixel resolution of an image exported from a single map frame is typically above 4K, and basement maps may even reach over 10,000 pixels. However, image-based detection models cannot directly process such ultra-high-resolution images. Therefore, to support ultra-high-definition images without reducing map clarity, this invention proposes a block detection scheme based on a sliding window. This scheme uses a 20% overlap between slices for sliding window slicing, and each slice image is detected separately by the model. Since a single pile plan map frame typically contains hundreds of piles, each small and non-overlapping, it is feasible to slice the original image into multiple smaller images for detection and then merge the detection results. The 20% overlap ensures that a pile is complete in at least one slice image. However, this raises another problem: the same pile may be detected repeatedly in different slices. To address this issue, this invention uses the NMS (Non-Maximum Suppression) method to remove duplicate piles. The sliding window can be 640×640 pixels, which strikes a good balance between inference speed and accuracy.

[0046] It should be understood that the scaling ratio, the overlap value between slices, and the size of the sliding window can all be set according to actual needs, and the embodiments of this application are not limited thereto.

[0047] Step S130: Each slice image from the multiple slice images is input into the trained pile location detection model for pile location identification, obtaining the pile location detection result for each slice image. The trained pile location detection model is obtained by semi-supervised training of the improved YOLOv8 model using a semi-supervised training set.

[0048] It should be understood that the model structure of the pile location detection model can be set according to actual needs, and the embodiments of this application are not limited thereto.

[0049] Optionally, the pile location detection model employs a single-stage detector based on a convolutional neural network. This detector exhibits good performance in terms of speed and small target detection, meeting the real-time requirements and accuracy of online inference. And, as... Figure 2 As shown, the pile location detection model mainly consists of three parts: The first part is a lightweight backbone network used to extract image features. This network is optimized based on EfficientNet-B0 to enhance the receptive field and feature extraction capabilities. The second part is the neck network, which uses a PA-FPN network architecture to fully integrate multi-scale features extracted from the backbone network at different scales. The third part is the head network, which uses multi-level features for separation and prediction, predicting the class and bounding box at three feature scales. For this model, the CSPLAyer module in the backbone network and neck network has been improved, and the SPPF module in the backbone network can be replaced with the DP-SPPF (dual-channel spatial pyramid pooling) module.

[0050] In cases where both the backbone network and the neck network include CSPlayer modules, such as Figure 3 As shown, the CSPLAYE module includes a first conv2D module, a first Split module, N dynamic feature enhancement units connected in sequence, a first concat module and a second conv2D module, and the first conv2D module and the first Split module are connected, and the first Split module is also connected to each of the N dynamic feature enhancement units and the first concat module, and the first concat module is also connected to the second conv2D module.

[0051] In addition, the first dynamic feature enhancement unit among the N dynamic feature enhancement units includes a first RepBottleneck module, a first fusion module and a first ECA module connected in sequence, and the first RepBottleneck and the first fusion module are both connected to the first Split module;

[0052] Furthermore, each of the N dynamic feature enhancement units, except the first one, includes a second RepBottleneck module, a second fusion module, and a second ECA module connected in sequence. The second RepBottleneck module is connected to the ECA module of its adjacent previous dynamic feature enhancement unit, and the second fusion module is connected to the first Split module.

[0053] Therefore, the ECA module uses a non-dimensionality-reduction, local cross-channel interaction strategy to allow the model to dynamically and adaptively recalibrate channel feature responses. It emphasizes feature channels that are more important for identifying "piles" (such as edges and specific shapes) while suppressing unimportant or noisy channels (such as annotations and dimension lines on a drawing). Furthermore, the ECA module delivers significant performance improvements with minimal computational overhead, enabling the model to focus more on valuable features.

[0054] Furthermore, this application fuses the output of each RepBottleneck module with one branch output of the first Split module (e.g., element-wise addition or weighted fusion), allowing gradients to propagate back more directly, and enhancing the features of each stage with "directly connected" features. Additionally, this application concatenates the output of the other branch of the first Split module with the final outputs of N dynamic feature enhancement units, creating richer feature representations through this dense fusion strategy. This ensures that low-level details (such as the edges of the stakes) are effectively integrated into high-level semantic features, which is particularly effective in improving the recall rate of small target stakes.

[0055] Furthermore, the RepBottleneck module of this application uses a multi-branch structure (e.g., containing 3x3 convolutions, 1x1 convolutions, and an Identity branch) during training to enhance the model's learning ability. This multi-branch structure during training significantly enriches the feature space, allowing the model to learn more robust features. During inference, the branches are merged into a single branch without adding any additional computational overhead or latency.

[0056] Additionally, the backbone network includes DP-SPPF modules, such as... Figure 4 As shown, the DP-SPPF module includes a third conv2D module, a second Split module, a first MaxPool2D module, a second MaxPool2D module, a first AvgPool2D module, a second AvgPool2D module, a second concat module, and a fourth conv2D module. The second Split module is connected to the third conv2D module, the first MaxPool2D module, and the first AvgPool2D module, respectively. The first MaxPool2D module is connected to the second MaxPool2D module, and the first AvgPool2D module is connected to the second AvgPool2D module. The second concat module is connected to the first MaxPool2D module, the second MaxPool2D module, the first AvgPool2D module, the second AvgPool2D module, and the fourth conv2D module, respectively.

[0057] In this module, the kernel size of the first MaxPool2D module is the same as that of the first AvgPool2D module, and the kernel size of the second MaxPool2D module is the same as that of the second AvgPool2D module. However, the kernel size of the first MaxPool2D module is smaller than that of the second MaxPool2D module. For example, the kernel size of the first MaxPool2D module is 3, and the kernel size of the second MaxPool2D module is 5.

[0058] Therefore, compared to the original SPPF module, the DP-SPPF module uses max pooling to preserve local salient features in one channel and average pooling to fuse global contextual information in another channel. By fusing the two pooling features, it can significantly distinguish between foreground and background information, and improve the recognition ability of small targets and occluded targets.

[0059] Based on the above model structure, the training process of the model in this application can also be set according to actual needs, and the embodiments of this application are not limited thereto.

[0060] Optionally, this application uses a pile structure CAD drawing detection dataset, which contains multiple CAD drawings (e.g., 1000 drawings), and each drawing has at least one title block that is a pile location layout diagram or foundation plan diagram. Each title block may have dozens to thousands of pile components. Some of the drawings (e.g., 300 drawings) are labeled, and a specified number of drawings (e.g., 100 drawings) are randomly sampled from them as a validation set. The remaining unlabeled drawings are used for weakly supervised training.

[0061] Furthermore, this application also allows for the annotation of the dataset. Specifically, the annotation of this dataset is performed directly on the CAD drawings. The annotation uses an attribute block with a fixed coating name of CV_Label_Contours. This attribute block contains a closed polyline and several attributes. This dataset mainly uses the LABEL, DISC, and CLASS attributes. Among them, the LABEL attribute is used to represent the component category, and in this dataset, it is labeled 'pile'; the DISC attribute identifies the discipline to which the drawing belongs, and in this dataset, it is labeled 'structure'; the CLASS attribute identifies the algorithm domain to which the drawing belongs, and in this dataset, it is labeled 'CV' to represent an image algorithm.

[0062] Furthermore, since CAD drawings cannot be directly used for model training using image algorithms, this dataset requires exporting the CAD drawings as images in a specified format (e.g., JPG images). First, the drawing frame is located and all elements within it are obtained. The annotation block named CV_Label_Contours is distinguished from the original drawing elements of other layers based on the layer name. From the annotation block elements, the text attributes and polyline contours within the block are extracted. Annotations labeled "pile" are obtained based on the LABEL label of the text attributes, and the bounding box of the pile component is obtained based on the polyline contour coordinates. Here, the bounding box refers to the position coordinates of its smallest bounding rectangle. Next, the CAD coordinate system of the annotated pile outer contour can be converted to the image pixel coordinate system. Subsequently, a sliding window can be used to overlap and slice the image, obtaining multiple slice images for training.

[0063] In addition, since drawing annotation requires a high level of expertise from the annotators, and there are problems such as high cost and long production cycle for dataset annotation, this application proposes a semi-supervised training method for model training.

[0064] This application designs a semi-supervised training method that fully utilizes unlabeled data and trains with only a small number of labeled drawings. This method only requires labeling a specified number (e.g., 300) of a large number of collected drawings (e.g., 1000 sets) to train, while simultaneously making full use of a large number of unlabeled drawings. The invention first samples a portion (e.g., 200) of the labeled drawings for training, creating a basic stake detection model, referred to here as the first-generation model. Then, the first-generation model is used to perform inference detection on the remaining (e.g., 700) unlabeled drawings. Stakes with high confidence (e.g., greater than 0.9) in the detection results are added to the training set, and pseudo-labels are generated based on the model's detection results. This method greatly expands the training set. Subsequently, the first-generation model is fine-tuned on the newly expanded training set to train a second-generation model. After obtaining the second-generation model, the above steps are repeated to continue selecting high-confidence data from the unlabeled data and adding it to the training set, and training is repeated until the model stabilizes. This invention trained five generations of models. The fifth-generation model achieved accuracy and recall rates exceeding 95% on both the training and unlabeled datasets. Typically, different drawings from the same design institute share similar drawing styles. The semi-supervised training method designed in this invention can quickly adapt to new pairs of significantly different drawings with only a small number of labeled drawings and a certain amount of unlabeled drawings, demonstrating good robustness and generalization ability.

[0065] Furthermore, the loss functions used in the model training process may include the DFL (Distribution Focal Loss) loss function, the CIoU loss function, and the classification loss. Lcls The final optimization objective is a weighted sum of the three losses mentioned above. Specifically, the DFL loss function optimizes the bounding box coordinates of the target; the CIoU loss function, based on the standard IoU loss which only considers overlapping regions, adds the distance between the center points of the predicted box and the ground truth box, as well as the aspect ratio loss, allowing the model to better learn the component outline; and the classification loss... L cls It could be the binary crossover quotient loss BCELoss.

[0066] Step S140: Merge and deduplicate the pile location detection results of all slice images to obtain the location of all pile components in the construction drawings. The pile location detection result includes the position coordinates of the minimum bounding box of the pile component in each slice image, and the minimum bounding box refers to the smallest enclosing rectangle.

[0067] Specifically, the pile location detection results of all slice images are merged and deduplicated to obtain the position coordinates of the minimum bounding box of all targets in the construction drawings; the center coordinates of all target elements in the construction drawings are determined, and the target elements whose center coordinates are within the minimum bounding box are selected as candidate elements; among them, the target elements include at least one of line segment elements, multi-broken line elements, arc elements, and filled elements; all candidate elements are traversed, and the intersection of rectangles, circles, and crosses is found according to geometric relationships, and the points where the center of the rectangle, the center of the circle, and the intersection of the crosses approximately coincide are determined as a set of elements used to form the pile components.

[0068] In other words, the trained model is used to detect and identify pile components on the pile drawings, and coordinate transformation and rule-based pile identification are used to restore the pile components with pixel coordinates to the pile primitives on the drawings.

[0069] To facilitate understanding of step S140, a specific embodiment will be described below.

[0070] Specifically, the pile location detection results obtained from image-based target detection are in the coordinate system of the sliced ​​image. Before obtaining the coordinates of the pile components in the coordinate system of the CAD drawing, the results of all sliced ​​images need to be stitched together. Since adjacent slices have a preset overlap (e.g., 20%) during image slicing, some piles may be detected repeatedly. During the merging process, piles with similar coordinates are deduplicated. Deduplication is based on the confidence level of the model detection, retaining piles with high confidence and removing those with low confidence.

[0071] Furthermore, due to the scaling factor during image export, a one-pixel deviation in the detection result corresponds to a 32mm error in the CAD drawing. Directly converting the bounding box coordinates of the image detection from pixel coordinates to the CAD coordinate system makes it difficult to meet the required accuracy. Therefore, this application proposes a primitive restoration method that matches the original primitives of the CAD drawing based on the image detection results to improve detection accuracy, and further filters out falsely detected piles based on the primitives.

[0072] First, the minimum bounding box in the pixel coordinate system is converted to the CAD coordinate system. All line segment primitives (e.g., a single line segment), multi-line primitives (e.g., multiple consecutive line segments), arc primitives (e.g., circles), and filled primitives (i.e., primitives filling closed areas like circles) in the drawing are traversed. The center coordinates of each primitive are used as the basis to determine whether it is within the minimum bounding box. Primitives contained within the minimum bounding box are collected as candidate primitives. Candidate primitives are traversed, and rectangles, circles, and cross intersections are found based on geometric relationships. Since the centers of rectangles, circles, and positioning lines of the same pile are the same, primitives whose center, circle center, and cross intersection point approximately coincide are grouped together, and primitives in the same group form a pile. If a pile primitive group exists, the image detection result is correct, and the primitive location, outermost contour shape, and CAD bounding box are obtained. If no group of pile primitives exists, the image detection result is a false positive, usually caused by interference from other components in the drawing such as walls, columns, foundations, piers, and independent foundations. In this case, the detection result is removed.

[0073] Step S150: Determine all in-situ annotations of piles in the construction drawings, and assign values ​​to the corresponding pile components based on the positions of all pile components in the construction drawings.

[0074] Specifically, when the in-situ annotation of the pile includes at least one of the following: annotation information, annotation line, and annotation leader line, a pre-configured regular expression is used to search for candidate text elements containing the target keyword from all elements of the construction drawings; the candidate text elements are clustered to obtain multiple groups of clustered elements; each group of clustered elements includes the annotation information of the same in-situ annotation of the pile; the parameter information of each group of clustered elements is determined, and based on the parameter information of each group of clustered elements, the annotation line corresponding to each group of clustered elements is determined; according to the annotation line corresponding to each group of clustered elements, the line segment with the same layer and color and with one endpoint coinciding is taken as the annotation leader line, and the annotation information is assigned to the pile component pointed to by the annotation leader line.

[0075] Given that the parameter information includes the overall outer contour boundary of each group of clustered elements, the text direction (or writing direction) of the annotation information, and the target length of the edge in the text direction of the outer contour boundary, the annotation line corresponding to each group of clustered elements is determined based on the parameter information of each group of clustered elements. This includes: traversing all line segment elements in the construction drawing and selecting line segment elements that meet specified conditions as candidate line segment elements for the current group of clustered elements; wherein, the current group of clustered elements is any group of clustered elements among multiple groups of clustered elements; the specified conditions include that the line segment direction is the same as the text direction of the current group of clustered elements, its line segment length is within a first length range, the distance from the text edge in the direction perpendicular to the text is less than a preset distance, and the projection of the outer contour boundary in the direction perpendicular to the text and its coincident length are within a second length range; both the first length range and the second length range are determined by the target length; and selecting the candidate line segment element that is closest to the annotation information in the direction perpendicular to the text as the annotation line corresponding to the current group of clustered elements. The specific range of the first length range, the specific example of the preset distance, and the specific range of the second length range can all be set according to actual needs, and the embodiments of this application are not limited thereto.

[0076] To facilitate understanding of step S150, it will be described below through specific embodiments.

[0077] Specifically, such as Figure 5 As shown, the in-situ annotation of this pile typically includes the following three parts: annotation information, annotation lines, and annotation leader lines. The annotation information may include the pile number (e.g., RZH1), test pile identification (e.g., combined test pile), and pile top elevation (e.g., -7.900), or only one of these pieces of information; the annotation line is a line segment below the annotation information close to the text edge; the annotation leader line is a line segment extending from the annotation line, and there may be none or multiple lines (e.g., ...). Figure 5 There are four leader lines marked in the middle.

[0078] First, based on keywords such as pile number, pile top elevation, and test pile, a corresponding regular expression can be designed to traverse all text elements in the drawing and perform regular expression matching to find all candidate text elements containing the keywords.

[0079] Secondly, in annotation, multiple annotations often share a single annotation line. Therefore, text clustering is necessary to group annotations with the same annotation into a single group and match them against the annotation line. For the identified candidate text primitives, information such as text content, writing direction, outline coordinates, and character length and height can be directly obtained. Text clustering involves grouping text primitives with the same writing direction (e.g., horizontal or vertical) and horizontal or vertical spacing less than one character height together.

[0080] Subsequently, for the text primitives that were aggregated into a group in the previous step, this group of primitives is treated as a whole, and the outer contour boundary of the whole is obtained (e.g., Figure 5 The target length L of the edge in the text direction (e.g., the red rectangle boundary), the text direction (horizontal), and the outer contour boundary in the text direction (e.g., the red rectangle boundary). Figure 5 The length of the red rectangle boundary in the image). Simultaneously, traversing all line segment primitives under the entire frame, those satisfying the following conditions are considered: the line segment is in the same direction as the text group; its length is between 0.8L and 2.5L (the first length range is 0.8L to 2.5L); its distance from the text edge in the vertical text writing direction is less than one character height (i.e., the preset distance is one character height); and the projection of the outer contour boundary in the direction perpendicular to the text and its overlapping length are greater than 0.5L (for example, for...). Figure 5 The second length (greater than 0.5L) is considered as the second length when the projection of the red rectangle boundary in the text direction coincides with the length of the annotation line. Line segments meeting these conditions are selected as candidate line segments. If there are multiple candidate line segments, the line closest to the text in the vertical text writing direction is selected first.

[0081] Next, find the line segment with the same layer and color as the found annotation line and that coincides with one endpoint; this is the annotation leader line. If there is another line with the same layer and color and coincident endpoint at the other end of the annotation leader line, continue to extend it downwards until no more lines can be found to continue connecting it. Record the endpoint of the annotation leader line.

[0082] Finally, the annotation information is assigned to the pile component to which the endpoint of the annotation leader line points.

[0083] Therefore, by utilizing the above-mentioned technical solution, this application obtains construction drawings including pile components, and uses a sliding window to overlap and slice the construction drawings to obtain multiple slice images. Each slice image is then input into a trained pile position detection model for pile position identification, resulting in a pile position detection result for each slice image. This trained pile position detection model is obtained by semi-supervised training of an improved YOLOv8 model using a semi-supervised training set. Furthermore, the pile position detection results from all slice images are merged and deduplicated to obtain the positions of all pile components in the construction drawings. Additionally, all in-situ annotations for all piles in the construction drawings are determined, and each in-situ annotation is assigned to its corresponding pile component. This not only improves detection efficiency but also enhances detection accuracy.

[0084] Furthermore, this application improves the accuracy, precision, and efficiency of pile detection by integrating algorithms based on deep learning and rule-based fusion.

[0085] It should be understood that the pile testing method in the above construction drawings is merely exemplary. Those skilled in the art can make various modifications based on the above method, and the modified solutions also fall within the protection scope of this application.

[0086] Please see Figure 6 , Figure 6 This diagram illustrates a structural block diagram of a pile detection device 600 in a construction drawing according to an embodiment of this application. It should be understood that the detection device 600 is capable of performing the steps described in the above method embodiments. The specific functions of the detection device 600 can be found in the description above; detailed descriptions are omitted here to avoid repetition. The detection device 600 includes at least one software function module that can be stored in a memory or embedded in the operating system (OS) of the detection device 600 in the form of software or firmware. Specifically, the detection device 600 includes:

[0087] Module 610 is used to acquire construction drawings, including pile components;

[0088] The slicing module 620 is used to overlap and slice construction drawings using a sliding window to obtain multiple slice images;

[0089] The input module 630 is used to input each slice image from multiple slice images into the trained pile location detection model to identify the pile location and obtain the pile location detection result in each slice image; wherein, the trained pile location detection model is obtained by semi-supervised training of the improved YOLOv8 model based on a semi-supervised training set;

[0090] The deduplication module 640 is used to merge and deduplicate the pile position detection results of all slice images to obtain the position of all pile components in the construction drawings.

[0091] The assignment module 650 is used to determine all in-situ annotations of piles in the construction drawings, and assign values ​​to each in-situ annotation of piles to the corresponding pile component based on the position of all pile components in the construction drawings.

[0092] In one possible embodiment, the backbone network in the improved YOLOv8 model includes a DP-SPPF module to replace the existing SPPF module. The DP-SPPF module includes a third conv2D module, a second Split module, a first MaxPool2D module, a second MaxPool2D module, a first AvgPool2D module, a second AvgPool2D module, a second concat module, and a fourth conv2D module. The second Split module is connected to the third conv2D module, the first MaxPool2D module, and the first AvgPool2D module, respectively. The first MaxPool2D module is also connected to the second MaxPool2D module, and the first AvgPool2D module is connected to the second AvgPool2D module. The second concat module is connected to the first MaxPool2D module, the second MaxPool2D module, the first AvgPool2D module, the second AvgPool2D module, and the fourth conv2D module, respectively.

[0093] In one possible embodiment, the pile location detection result includes the position coordinates of the minimum bounding box of the pile component in each slice image; the merging and deduplication module 640 is specifically used to: merge and deduplicate the pile location detection results of all slice images to obtain the position coordinates of the minimum bounding boxes of all targets in the construction drawings; determine the center coordinates of all target elements in the construction drawings, and select target elements whose center coordinates are within the minimum bounding box of the target as candidate elements; wherein, the target elements include at least one of line segment elements, multi-broken line elements, arc elements, and filled elements; traverse all candidate elements, find the rectangle, circle, and cross intersection lines according to geometric relationships, and determine the set of elements that approximately coincide with the center of the rectangle, the center of the circle, and the intersection of the cross line as the basis for forming the pile component.

[0094] In one possible embodiment, the in-situ pile annotation includes at least one of the following: annotation information, annotation line, and annotation leader line. The assignment module 650 is specifically used to: use a pre-configured regular expression to search for candidate text elements containing the target keyword from all elements of the construction drawings; perform clustering processing on the candidate text elements to obtain multiple groups of clustered elements; wherein, each group of clustered elements includes the annotation information of the same in-situ pile annotation; determine the parameter information of each group of clustered elements, and determine the annotation line corresponding to each group of clustered elements based on the parameter information of each group of clustered elements; according to the annotation line corresponding to each group of clustered elements, take the line segment with the same layer and color and having one endpoint overlapping as the annotation leader line, and assign the annotation information to the pile component pointed to by the annotation leader line.

[0095] In one possible embodiment, the parameter information includes the overall outer contour boundary of each group of clustered primitives, the text direction of the annotation information, and the target length of the edge in the text direction within the outer contour boundary.

[0096] In one possible embodiment, the assignment module 650 is specifically used to: traverse all line segment elements in the construction drawing, and select line segment elements that meet specified conditions as candidate line segment elements for the current group of clustered elements; wherein, the current group of clustered elements is any group of clustered elements among multiple groups of clustered elements; the specified conditions include that the line segment direction is the same as the text direction of the current group of clustered elements, its line segment length is within a first length range, the distance from the text edge in the direction perpendicular to the text is less than a preset distance, and the projection of the outer contour boundary in the direction perpendicular to the text and its coincident length are within a second length range; the first length range and the second length range are both determined by the target length; and select the candidate line segment element that is closest to the annotation information in the direction perpendicular to the text as the annotation line corresponding to the current group of clustered elements.

[0097] Since the apparatus described in the above embodiments of the present invention is an apparatus used to implement the methods of the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the methods described in the above embodiments of the present invention, and therefore will not be described again here. All apparatuses used in the methods of the above embodiments of the present invention fall within the scope of protection of the present invention.

[0098] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0099] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.

[0100] It should be noted that the word "a" or "an" preceding a component does not preclude the existence of multiple such components. This invention can be implemented using hardware comprising several different components and using a suitably programmed computer. Among the listed devices, several of these devices may be embodied by the same hardware. The use of terms such as "first," "second," "third," etc., is merely for convenience and does not indicate any order. These terms can be understood as part of the component names.

[0101] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0102] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the technical solution should be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0103] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the invention's technical solutions and their equivalents, then the invention should also include these modifications and variations.

Claims

1. A method of detecting a pile in construction drawings, characterized by, The method comprises: obtaining construction drawings including pile members; overlapping slicing the construction drawings by using a sliding window to obtain a plurality of slice images; inputting each slice image of the plurality of slice images into a trained pile position detection model respectively for pile position recognition to obtain a pile position detection result of each slice image; wherein the trained pile position detection model is obtained by semi-supervised training an improved YOLOv8 model based on a semi-supervised training set; merging and deduplicating the pile position detection results of all slice images to obtain the positions of all pile members in the construction drawings; determining all pile in-place annotations in the construction drawings, and assigning each pile in-place annotation in the pile in-place annotations to a corresponding pile member according to the positions of all pile members in the construction drawings; the pile position detection result comprises position coordinates of a minimum bounding box of a pile member in each slice image; the merging and deduplicating of the pile position detection results of all slice images to obtain the positions of all pile members in the construction drawings comprises: merging and deduplicating the position coordinates of all target minimum bounding boxes in the construction drawings to obtain the positions of all target minimum bounding boxes in the construction drawings; determining the center coordinates of all target graph elements in the construction drawings, and taking a target graph element whose center coordinates are in the target minimum bounding box as a candidate graph element; wherein the target graph element comprises at least one of a line segment graph element, a multi-breakline graph element, a circular arc graph element and a fill graph element; traversing all the candidate graph elements, finding rectangles, circles and cross intersection lines according to geometric relationships, and determining that the centers of the rectangles, the centers of the circles and the intersection points of the cross intersection lines approximately coincide as a group of graph elements for composing a pile member.

2. The detection method according to claim 1, characterized in that, The improved YOLOv8 model comprises a DP-SPPF module for replacing an existing SPPF module, the DP-SPPF module comprising a third conv2D module, a second Split module, a first MaxPool2D module, a second MaxPool2D module, a first AvgPool2D module, a second AvgPool2D module, a second concat module and a fourth conv2D module; the second Split module is connected with the third conv2D module, the first MaxPool2D module and the first AvgPool2D module respectively, and the first MaxPool2D module is further connected with the second MaxPool2D module, and the first AvgPool2D module is connected with the second AvgPool2D module, and the second concat module is connected with the first MaxPool2D module, the second MaxPool2D module, the first AvgPool2D module, the second AvgPool2D module and the fourth conv2D module respectively.

3. The method of claim 1, wherein The pile in-situ annotation includes at least one of the following: annotation information, an annotation line, and an annotation lead line; the determination of all pile in-situ annotations in the construction drawing and the assignment of each pile in-situ annotation in the all pile in-situ annotations to the corresponding pile component comprises: Using a pre-configured regular expression, find candidate text elements containing target keywords from all elements in the construction drawing; Cluster processing the candidate text elements to obtain multiple groups of clustered elements; wherein each group of clustered elements in the multiple groups of clustered elements includes the annotation information of the same pile in-situ annotation; Determine the parameter information of each group of clustered elements, and determine the annotation line corresponding to each group of clustered elements based on the parameter information of each group of clustered elements; According to the annotation line corresponding to each group of clustered elements, a line segment with the same layer and color and having one endpoint coinciding as an annotation lead line, and the annotation information is assigned to the pile component pointed to by the annotation lead line.

4. The detection method according to claim 3, characterized in that, The parameter information includes the overall contour boundary of each group of clustered elements, the text direction of the annotation information, and the target length of the edge in the contour boundary in the text direction.

5. The detection method according to claim 4, characterized in that, The determination of the annotation line corresponding to each group of clustered elements based on the parameter information of each group of clustered elements comprises: Traverse all line element in the construction drawing, and the line element that meets the specified condition as the candidate line element of the current group of clustered elements; wherein the current group of clustered elements is any one of the multiple groups of clustered elements; the specified condition includes the same line direction as the text direction of the current group of clustered elements, the line length within the first length range, the distance from the text edge in the direction perpendicular to the text direction less than the preset distance, and the coinciding length of the projection of the contour boundary in the direction perpendicular to the text direction and the line element within the second length range; the first length range and the second length range are both determined by the target length; The candidate line element closest to the annotation information in the direction perpendicular to the text direction is taken as the annotation line corresponding to the current group of clustered elements.

6. A device for detecting a pile in construction drawings, characterized by Comprise: An acquisition module is configured to acquire a construction drawing including pile components; A slicing module is configured to perform overlapping slicing on the construction drawing using a sliding window to obtain multiple slice images; An input module is configured to input each slice image in the multiple slice images into a trained pile position detection model for pile position recognition, respectively, to obtain a pile position detection result for each slice image; wherein the trained pile position detection model is obtained by semi-supervised training an improved YOLOv8 model based on a semi-supervised training set; A merging and deduplication module is configured to merge and deduplicate the pile position detection results of all the slice images to obtain the positions of all the pile components in the construction drawing; A determination and assignment module is configured to determine all pile in-situ annotations in the construction drawing, and assign each pile in-situ annotation in the all pile in-situ annotations to the corresponding pile component according to the positions of all the pile components in the construction drawing.

7. The detection device of claim 6, wherein, The pile position detection result includes position coordinates of the minimum bounding box of the pile component in each slice image; the merging and deduplication module is specifically configured to: merge and deduplicate the pile position detection results of all the slice images to obtain position coordinates of all target minimum bounding boxes in the construction drawing; determine center coordinates of all target graph elements in the construction drawing, and take a target graph element whose center coordinates are in the target minimum bounding box as a candidate graph element; wherein the target graph element includes at least one of a line segment graph element, a multi-breakline graph element, a circular arc graph element and a fill graph element; traverse all the candidate graph elements, find a rectangular, a circular and a cross intersection line according to geometric relations, and determine that the center of the rectangular, the center of the circular and the intersection point of the cross intersection line approximately coincide as a group of graph elements for composing a pile component.

8. A storage medium having stored thereon a computer program, characterized in that The computer program is run by the processor to perform the pile detection method in the construction drawing as claimed in any one of claims 1-5.

9. An electronic device comprising a processor, a memory, and a computer program stored on the memory, wherein the computer program, when executed by the processor, is arranged to perform the method of any one of claims 1 to 8. The processor executes the computer program to implement the pile detection method in the construction drawing as claimed in any one of claims 1-5.

Citation Information

Patent Citations

  • Super-large building drawing sanitary appliance identification method based on deep learning

    CN115712942A

  • Fiber fabric defect detection method and device

    CN120451057A