A bridge structure identification and parameter extraction method for bridge PDF design drawings
By combining the YOLOv8pose model and Harris corner detection algorithm, combined with PaddleOCR, the structure identification and parameter extraction of bridge design drawings are solved, which solves the problem of difficulty in accurately capturing detailed structures and extracting parameters in the existing technology, and achieves high-precision bridge structure identification and parameter extraction. Parameter extraction.
Patent Information
- Application Number
- CN202411070364.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-06
AI Technical Summary
Existing technology is difficult to accurately capture the detailed structure and extract parameter information in bridge design drawings. The traditional rectangular box annotation method cannot accurately describe the shape and spatial relationship of complex components, resulting in insufficient detail and accuracy in identification.
Combining the improved YOLOv8pose model and Harris corner detection algorithm, a bridge structure detection model is constructed. Through key point detection and corner point identification, text information extraction is performed with PaddleOCR to achieve structure identification and parameter extraction.
It achieves accurate detection of key structural points in bridge design drawings and effective extraction of parameters, improves identification accuracy and acquisition of detailed information, and meets the requirements for detecting structures and extracting parameters from bridge design drawings.
Smart Images

Figure CN118587733B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of PDF image recognition, in particular to a bridge structure recognition and parameter extraction method for bridge PDF design drawings. Background Art
[0002] During the bridge construction drawing design stage, designers usually refer to the design drawings of existing bridge projects, which greatly saves designers' time. This inevitably requires retrieving reference files similar to the current actual projects from many existing bridge drawings. As the requirements for bridge construction increase, the design becomes more complex. The application of Building Information Modeling (BIM) technology in road and bridge engineering can effectively improve the efficiency of bridge construction.
[0003] However, most of the reviewed bridge design drawings are usually archived in PDF format, and rebuilding BIM is a time-consuming and laborious task. It is increasingly urgent to digitize the design results and experience, meaningfully identify the structure and extract parameters from the bridge design files, and quickly, effectively and accurately call the previous mature results to improve work efficiency and design quality.
[0004] In recent years, researchers have also tried to identify the required multiple types of information from engineering drawings. Zhao proposed a method to reconstruct BIM from architectural structural drawings in 2021, using Faster RCNN to detect columns and beams from drawings, and extract annotation information from drawings to finally generate BIM structural models; Yang Moyi proposed an improved CascadeRCNN method in 2022 to identify duct equipment from two-dimensional drawings, extracting the category and location information of ducts; Zhou Quan proposed a method to use Faster RCNN to identify building component information from two-dimensional drawings in 2021, and extract text information using the py-tesseract tool; Pan Zaolin extracted component semantics and geometric information from heating, ventilation and air conditioning drawings through Cascade Mask RCNN in 2022; LU et al. proposed a method to identify structural components from two-dimensional drawings in 2017, first identifying special symbols in two-dimensional drawings, and then using optical character recognition (OCR) technology to extract the location of components from drawings. Zhao YF proposed a YOLO-based method to detect building components from scanned 2D drawings in 2020.
[0005] Patent document CN116978052B discloses a sub-graph layout recognition method for bridge design drawings based on improved YOLOv5, which uses target detection technology to detect and classify graphics, tables, annotations, and text boxes in bridge design drawings to obtain sub-graph layout recognition results.
[0006] Patent document CN116994282B discloses a method for identifying and collecting the number of steel bars in bridge design drawings. It uses an improved YOLOv5 to detect the tables and label columns of bridge design drawings, and uses the table recognition function of PP-StructureV2 to perform table recognition on the tables and label columns in the drawings. After summary and verification, the collection of steel bar quantity information in bridge design drawings is achieved.
[0007] The above existing studies have detected components of many types of drawings, but they almost all use rectangular boxes to mark the targets, which can realize the positioning and classification of their graphic blocks. However, bridge design drawings have the characteristics of a wide variety, complex information, and high professionalism. It is difficult for designers to truly understand the design content contained in the drawings by simply identifying the layout and simple text information of the drawings. The large amount of parameter information of the bridge structure contained in the drawings and the spatial constitutive relationship between these parameters are the information that designers really need to obtain, and it is also the most critical step to realize the digitization of drawings. Current research, including patent document CN116978052B, uses target detection technology, which is difficult to accurately capture its structure and obtain parameter information.
[0008] The steel bar quantity identification and collection method disclosed in patent document CN116994282B solves the problem of steel bar quantity table identification in bridge design drawings, but cannot solve the problem of structure identification and parameter extraction in bridge drawings. Because the steel bar quantity table is a relatively concentrated block, the information in the steel bar quantity table is text and numbers, which can be extracted through simple text recognition, while structure identification requires identification of the structural contours and structural lines of structural drawings of various shapes, and structural parameter extraction is not a simple text recognition, but requires the combination of structural graphics, dimensioning, text annotations, etc. to understand the physical meaning and spatial relationship of the parameters, so as to extract a set of design parameter information with physical meaning.
[0009] In addition, bridge design drawings are usually composed of a variety of components with different shapes and complex structures. Although the traditional rectangular box annotation method can work effectively in some simple scenarios, it is difficult to provide sufficient details and accuracy when facing the structures in bridge design drawings. This is mainly because the rectangular box cannot accurately describe the true shape and spatial relationship of complex components, and may also ignore many key geometric information.
[0010] Since the structure in the drawing is composed of points, lines, and surfaces, and the connection relationship between the components is intricate, the method of drawing the detection points into lines is more suitable for drawing the structure of the bridge. Compared with simple rectangular boxes, it can better capture the more complex structural information in the drawing. Traditional detection methods include Harris corner detection and Shi-Tomasi corner detection, but traditional corner detection does not have the characteristics of level and scale invariance and the number of output corners is uncertain. With the development of deep learning, key point detection methods based on convolutional neural networks have been widely used in many fields.
[0011] Although key point detection has achieved good results in many fields, in bridge design drawings, the key points of the structure are relatively small, and it is difficult for neural network prediction methods to accurately predict the location of the key points. At the same time, bridge design drawings contain many parameters, and direct OCR recognition only extracts text information and cannot obtain semantic information.
[0012] Then, how to design a structure recognition and parameter extraction method for bridge design drawings has become a technical problem that needs to be solved urgently. Summary of the invention
[0013] The purpose of the present invention is to solve the defects that target detection technology is difficult to capture the detailed structure of bridge structure drawings and difficult to extract parameters, and to provide a bridge structure recognition and parameter extraction method for bridge PDF design drawings to solve the above problems.
[0014] In order to achieve the above object, the technical solution of the present invention is as follows:
[0015] A bridge structure recognition method for bridge PDF design drawings comprises the following steps:
[0016] Acquisition and preprocessing of bridge PDF design drawings: Acquisition of bridge design drawings saved in PDF format and preprocessing of them;
[0017] Constructing a bridge structure detection model: Combining the improved YOLOv8pose model and Harris corner detection algorithm, a bridge structure detection model is constructed for detecting peripheral key points of bridge structures in bridge PDF design drawings;
[0018] Training of bridge structure detection model: Use pre-processed bridge design drawings to train the bridge structure detection model;
[0019] Obtaining the PDF design drawings of the bridge to be inspected: Obtain the PDF design drawings of the bridge to be inspected and perform preprocessing;
[0020] Identification of bridge structure: The preprocessed PDF design drawings of the bridge to be inspected are input into the trained bridge structure detection model to identify the bridge structure.
[0021] The construction of the bridge structure detection model comprises the following steps:
[0022] Set the YOLOv8pose model to include Backbone layer, Neck layer and Head layer;
[0023] The Backbone layer is set up with 5 Conv convolution blocks, 4 C2f modules and SPPF modules to extract features. Residual connections and bottleneck structures are also used to reduce the size of the network and improve performance.
[0024] The Neck layer is set up, and the multi-scale feature fusion technology is used to fuse the feature maps from different stages of the Backbone layer to enhance the feature representation capability;
[0025] Set the Head layer, which includes a detection head and a classification head. The detection head is used to generate results, and the classification head uses global average pooling to classify each feature map.
[0026] The CA attention mechanism is set up, which is divided into two parts: embedding coordinate information and generating coordinate information feature maps. First, the input feature map of size C×H×W is averagely pooled along the horizontal coordinate X direction and the vertical coordinate Y direction using pooling kernels of size (H, 1) and (1, W).
[0027] Among them, the output of the cth channel with height h It is expressed as:
[0028] ,
[0029] The output of the cth channel with width w It is expressed as:
[0030] ,
[0031] This generates a pair of direction-aware feature maps of size C×H×1 and C×1×W;
[0032] Then, the extracted feature information is concat-operated and sent to the 1×1 convolution transformation function F1 to obtain:
[0033] ,
[0034] in, represents the concatenation operation along the spatial dimension, δ is a nonlinear activation function, f is an intermediate feature map of size C / r×1×(W+H), and r represents the downsampling ratio;
[0035] The feature map is then split along the spatial dimension, decomposing it into two separate tensors and , respectively using 1×1 convolution transformation and Will and Convert to a tensor with the same number of channels as the input X, that is: , ,
[0036] Where σ is the sigmoid activation function, and are the features representing the height direction and width direction respectively;
[0037] Finally, the output result is expanded as the attention weight, and the output result Y of the CA attention mechanism is expressed as: ,
[0038] in, Represents the input feature map, represents the height direction weight, Represents the width direction weight;
[0039] Add the CA attention mechanism to the back layer of the SPPF module in the Backbone layer;
[0040] Set the Harris corner detection algorithm, use a window on the image, move it in any direction, and determine the corners based on the degree of grayscale change of the image pixels in the window before and after the movement. If the grayscale value of the window changes when it moves in any direction, then it is determined that a corner is detected in the window.
[0041] Set the local window to move in all directions (u, v) and calculate the sum of all grayscale differences. The expression is as follows:
[0042] E ( u , v ) = ∑ x , y ω ( x , y )[ I ( x + u , y + v ) − I ( x , y )] 2 ,
[0043] in, is the image grayscale of the local window, is the grayscale of the image after translation, is the window function, which is a rectangular window or a Gaussian window, and u and v are the pixel distances moved;
[0044] Will Taylor expansion
[0045]
[0046] Substituting into the formula we get
[0047] E ( u , v ) = ∑ x , y ω ( x , y ) [ I ( x , y ) + I x u + I y v − I ( x , y )] 2 = ∑ x , y ω ( x , y ) ( I x 2 u 2 + 2 I x I y uv + I y 2 v 2 ) = [ u , v ] ∑ x , y ω ( x , y ) [ I x 2 I x I y I x I y I y 2 v 2 ] [ u v ]
[0048] Then the autocorrelation matrix H of the image point to be detected is obtained:
[0049] H = ∑ x , y ω ( x , y ) [ I x 2 I x I y I x I y I y 2 v 2 ] ;
[0050] The corner points are determined by judging the eigenvalue size of the autocorrelation matrix H. Since the eigenvalue decomposition of the autocorrelation function H increases the complexity of the algorithm, the Harris corner point response function is selected as R = det(H) - αtrace(H) 2 , if the corner point response function R is greater than the set threshold and the point is a local maximum point, then the point is considered to be a corner point, where det(H) is the determinant of H, trace(H) represents the trace of the matrix H, and α is a constant used to adjust the weights of these two items;
[0051] Set the NMS algorithm to keep only the local maximum points and suppress those points that are not local maximum points by comparing the intensity values of the pixels; specifically, within a given window, if the value of the central pixel is not the maximum value, its value is set to 0;
[0052] The NMS algorithm is introduced into Harris corner detection, the response function values of Harris corner detection are sorted, and then the sorted corner point list is traversed one by one. For each corner point, check whether there is a corner point with a higher score in its surrounding neighborhood, and finally select the corner point with the highest score as the final result;
[0053] Using the location information of the key points detected by the YOLOv8pose model, the improved Harris corner detection algorithm is used to find the corner points closest to the key points in the bridge design drawings, and the final corner detection results are output.
[0054] The training of the bridge structure detection model includes the following steps:
[0055] Set the training parameters, i.e. the training parameters of the YOLOv8pose model, including the number of iterations, batch size, and initial learning rate. The number of iterations epoch is 50, the batch size batch-size is 16, and the initial learning rate lr0 of the model is set to 0.01;
[0056] Input the preprocessed bridge design drawing dataset into the YOLOv8pose model;
[0057] The training image is sent to the Backbone layer, which extracts the feature information of the training image and outputs the feature information of the training image;
[0058] The feature information enters the Neck layer, performs multi-scale feature fusion, enhances the feature representation capability, and outputs the feature information;
[0059] The feature information enters the Head layer, and the key points are predicted based on the target detection, and the target information and key point information are output;
[0060] The image output by the YOLOv8pose model is sent to the improved Harris corner detection algorithm, and the key point information is used to find the corner point closest to the key point. The corner point found is considered to be the key point of the final bridge structure contour.
[0061] The method also includes a parameter extraction method, which sends the bridge PDF design drawing detected by the bridge structure detection model to the PaddleOCR model, and uses the position information of the text detected by the PaddleOCR model to assign attributes to the parameters through logical constraints; the method includes the following steps:
[0062] Feed the bridge design drawings into the PaddleOCR model and output the detected text information and location information;
[0063] Set logical constraints: Use the text information detected by the PaddleOCR model to find the maximum or minimum value and assign attribute information;
[0064] Using the location information of the text detected by the PaddleOCR model, combined with the location information of the key points, traverse all parameters, find the parameters that meet the requirements, and output the type information and text information of the parameters;
[0065] For the cross section of cast-in-place box beam, the outer contour has 8 key points. The key points are connected in sequence to form line segments. The parameters are sequence number N, box beam upper flange width W1, box beam lower flange width W2, flange left cantilever width LB, flange right cantilever width RB, beam height H, cantilever end thickness HB1, cantilever root thickness HB2, left web thickness WL, left web thickness WR, upper flange thickness HF1, lower flange thickness HF2,
[0066] Determine whether the text is horizontal or vertical.
[0067] For the horizontal direction: set the parameter at the top of the image to N, the largest number to W1, the parameter at the bottom of the image to W2, the parameter at the same horizontal coordinate as the midpoint of line segment 2-3 to LB, the parameter to the right of LB to WL, the parameter at the same horizontal coordinate as the midpoint of line segment 6-7 to RB, and the parameter to the left of RB to WR;
[0068] For the vertical direction: set the leftmost parameter to H, the parameter at the same ordinate as the midpoint of line segment 1-2 to HF1, and the parameter at the same abscissa as HF1 to HF2;
[0069] Use Python code to generate an Excel table with the parameter type and text information to realize parameter extraction.
[0070] Beneficial Effects
[0071] The present invention provides a bridge structure recognition and parameter extraction method for bridge PDF design drawings. Compared with the prior art, the method realizes the detection of key points of the bridge structure in the drawings by combining the improved Harris corner point detection and the improved YOLOv8pose model, thereby drawing the outline of the bridge structure; uses PaddleOCR to perform text detection on the bridge design drawings to extract the parameters of the bridge structure; matches the structure with the parameters through a series of logical constraints, and finally realizes the structure recognition and parameter extraction of the bridge in the bridge design drawings.
[0072] The present invention introduces the NMS algorithm into Harris corner detection, adds CA attention into the YOLOv8pose model, and combines the two methods to solve the problems of inaccurate detection and uncertain quantity of key points in bridge design drawings. At the same time, in order to solve the problem that the text information detected by OCR lacks semantic information, semantic information is given to the text and parameters in the drawings.
[0073] Experimental results show that introducing the NMS algorithm in Harris corner detection can reduce redundant corners. After adding CA attention to the YOLOv8pose model, the recognition accuracy can reach 98.2%, which can meet the requirements of detecting structures and extracting parameters from bridge design drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 is a method sequence diagram of the present invention;
[0075] Figure 2 is a logic flow chart of the present invention;
[0076] Figure 3 This is a diagram of the YOLOv8pose network structure involved in the present invention;
[0077] Figure 4 This is a network diagram of the CA attention mechanism involved in the present invention;
[0078] Figure 5 This is a diagram of the PaddleOCR network structure involved in the present invention;
[0079] Figure 6 It is a schematic diagram of the contents to be identified in the cross section of the cast-in-situ box girder involved in the present invention;
[0080] Figure 7 This is a bridge structure identification result diagram involved in the present invention;
[0081] Figure 8 This is a diagram of parameter extraction results involved in the present invention. DETAILED DESCRIPTION
[0082] In order to have a further understanding and recognition of the structural features and the effects achieved by the present invention, a preferred embodiment and accompanying drawings are used for detailed description as follows:
[0083] like Figure 1 and Figure 2 As shown, the bridge structure recognition method for bridge PDF design drawings of the present invention comprises the following steps:
[0084] The first step is to obtain and preprocess the bridge PDF design drawings: obtain the bridge design drawings saved in PDF format and preprocess them.
[0085] The second step is to build a bridge structure detection model: combining the improved YOLOv8pose model and Harris corner detection algorithm to build a bridge structure detection model for detecting peripheral key points of bridge structures in PDF drawings.
[0086] In order to detect the key points of the structure from the bridge design drawings, the YOLOv8pose model is used to detect the peripheral key points of the bridge structure. YOLOv8 is a powerful and flexible target detection and segmentation model with higher performance and higher flexibility than previous YOLO versions. The YOLOv8Pose model is a deep convolutional network based on YOLOv8. While detecting targets, it also adds the estimation of the position of the key points of human posture, which can be used to detect key points. Its network structure is mainly composed of the following three parts: Backbone, which uses a series of convolution and deconvolution layers to extract features, and also uses residual connections and bottleneck structures to reduce the size of the network and improve performance; this part uses the C2 module as the basic building block, which has fewer parameters and excellent feature extraction capabilities; Neck, which uses multi-scale feature fusion technology to fuse feature maps from different stages of Backbone to enhance feature representation capabilities; Head, including a detection head and a classification head. The detection head contains a series of convolutional layers and deconvolution layers to generate detection results, and the classification head uses global average pooling to classify each feature map to achieve the final target detection and classification tasks.
[0087] (1) If Figure 3 As shown, the YOLOv8pose model is set to include Backbone layer, Neck layer and Head layer.
[0088] (2) The Backbone layer is set up, using 5 Conv convolution blocks, 4 C2f modules and SPPF modules to extract features. Residual connections and bottleneck structures are also used to reduce the size of the network and improve performance.
[0089] (3) The Neck layer is set up and the multi-scale feature fusion technology is adopted to fuse the feature maps from different stages of the Backbone layer to enhance the feature representation capability.
[0090] (4) Set the Head layer, which includes a detection head and a classification head. The detection head is used to generate results, and the classification head uses global average pooling to classify each feature map.
[0091] (5) If Figure 4 As shown in the figure, the CA attention mechanism is set, which is divided into two parts: embedding coordinate information and generating coordinate information feature map. First, the input feature map of size C×H×W is averagely pooled along the horizontal coordinate X direction and the vertical coordinate Y direction using pooling kernels of size (H, 1) and (1, W).
[0092] Among them, the output of the cth channel with height h It is expressed as:
[0093] ,
[0094] The output of the cth channel with width w It is expressed as:
[0095] ,
[0096] This generates a pair of direction-aware feature maps of size C×H×1 and C×1×W;
[0097] Then, the extracted feature information is concat-operated and sent to the 1×1 convolution transformation function F1 to obtain:
[0098] f = δ ( F 1 ([ z h , z w ])) ,
[0099] in, represents the concatenation operation along the spatial dimension, δ is a nonlinear activation function, f is an intermediate feature map of size C / r×1×(W+H), and r represents the downsampling ratio;
[0100] The feature map is then split along the spatial dimension, decomposing it into two separate tensors and , respectively using 1×1 convolution transformation and Will and Convert to a tensor with the same number of channels as the input X, that is: , ,
[0101] Where σ is the sigmoid activation function, and are the features representing the height direction and width direction respectively;
[0102] Finally, the output result is expanded as the attention weight, and the output result Y of the CA attention mechanism is expressed as: .
[0103] in, Represents the input feature map, represents the height direction weight, Represents the weight in the width direction.
[0104] The core idea of the attention mechanism is to focus on the information that is more critical to the current task among a large amount of input information, ignoring other irrelevant information, and then obtaining more details related to the target to improve the accuracy of task processing. CA coordinate attention integrates the connection between channel and position information, embedding position information into channel attention, which can not only capture cross-channel information, but also capture direction perception and position-sensitive information, which helps the model to more accurately locate and identify objects of interest. Adding the CA attention mechanism to the layer after SPPF in the Backbone of YOLOv8pose can improve the model's ability to detect key points.
[0105] (6) Add the CA attention mechanism to the layer after the SPPF module in the Backbone layer.
[0106] (7) Set the Harris corner detection algorithm, use a window on the image, move it in any direction, and determine the corners based on the degree of change in the grayscale of the image pixels in the window before and after the movement. If the grayscale value of the window changes when it moves in any direction, then it is determined that a corner is detected in the window;
[0107] Set the local window to move in all directions (u, v) and calculate the sum of all grayscale differences. The expression is as follows:
[0108] E ( u , v ) = ∑ x , y ω ( x , y )[ I ( x + u , y + v ) − I ( x , y )] 2 ,
[0109] in, is the image grayscale of the local window, is the grayscale of the image after translation, is the window function, which is a rectangular window or a Gaussian window, and u and v are the pixel distances moved;
[0110] Will Taylor expansion
[0111]
[0112] Substituting into the formula we get
[0113] E ( u , v ) = ∑ x , y ω ( x , y ) [ I ( x , y ) + I x u + I y v − I ( x , y )] 2 = ∑ x , y ω ( x , y ) ( I x 2 u 2 + 2 I x I y uv + I y 2 v 2 ) = [ u , v ] ∑ x , y ω ( x , y ) [ I x 2 I x I y I x I y I y 2 v 2 ] [ u v ]
[0114] Then the autocorrelation matrix H of the image point to be detected is obtained:
[0115] H = ∑ x , y ω ( x , y ) [ I x 2 I x I y I x I y I y 2 v 2 ] ;
[0116] The corner points are determined by judging the eigenvalue size of the autocorrelation matrix H. Since the eigenvalue decomposition of the autocorrelation function H increases the complexity of the algorithm, the Harris corner point response function is selected as R = det(H) - αtrace(H) 2 , if the corner point response function R is greater than the set threshold and the point is a local maximum point, then the point is considered to be a corner point. Where det(H) is the determinant of H, trace(H) represents the trace of matrix H, and α is a constant used to adjust the weights of these two items.
[0117] (8) Set the NMS algorithm to compare the intensity values of pixel points, retain only the local maximum points, and suppress those points that are not local maximum points; specifically, within a given window, if the value of the central pixel is not the maximum value, its value is set to 0.
[0118] (9) The NMS algorithm is introduced into Harris corner detection. The response function values of Harris corner detection are sorted, and then the sorted corner point list is traversed one by one. For each corner point, check whether there are corner points with higher scores in its surrounding neighborhood. Finally, the corner point with the highest score is selected as the final result.
[0119] (10) Using the location information of the key points detected by the YOLOv8pose model, the improved Harris corner detection algorithm is used to find the corner points closest to the key points in the bridge design drawings, and the final corner detection results are output.
[0120] The third step is the training of the bridge structure detection model: the bridge structure detection model is trained using the preprocessed bridge design drawings.
[0121] (1) Set the training parameters, i.e., the training parameters of the YOLOv8pose model. The training parameters include the number of iterations, batch size, and initial learning rate. The number of iterations epoch is 50, the batch size batch-size is 16, and the initial learning rate lr0 of the model is set to 0.01.
[0122] (2) Input the preprocessed bridge design drawing dataset into the YOLOv8pose model;
[0123] A1) The training image is sent to the Backbone layer, which extracts the feature information of the training image and outputs the feature information of the training image;
[0124] A2) Feature information enters the Neck layer, multi-scale feature fusion is performed, feature representation capability is enhanced, and feature information is output;
[0125] A3) Feature information enters the Head layer, and key point prediction is performed based on target detection, and target information and key point information are output.
[0126] (3) The image output by the YOLOv8pose model is sent to the improved Harris corner detection algorithm, and the key point information is used to find the corner points of the bridge structure. The corner points found are considered to be the key points of the final outer contour of the bridge structure.
[0127] The fourth step is to obtain the PDF design drawings of the bridge to be tested: obtain the PDF design drawings of the bridge to be tested and perform preprocessing.
[0128] Step 5: Identification of bridge structure: Input the preprocessed PDF design drawings of the bridge to be inspected into the trained bridge structure detection model to identify the bridge structure.
[0129] Here, a parameter extraction method for bridge structure identification is also provided. The PDF design drawings of the bridge detected by the bridge structure detection model are sent to the PaddleOCR model. The position information of the text detected by the PaddleOCR model is used to assign attributes to the parameters through logical constraints.
[0130] Considering the particularity and complexity of bridge design drawings, which contain rich text information, including parameter information, names, etc., this information is extremely meaningful for parameter reference, so it is necessary to explore effective methods for character recognition. PaddleOCR is a branch of Paddle, and its structure is as follows Figure 5 As shown in the figure, it can recognize text images in a variety of complex situations, with detection + classification + recognition functions, and has good recognition of Chinese, English, and numbers. The unfiltered bridge design drawings are fed into the PaddleOCR model, and the detected text information and relative position information are output.
[0131] It includes the following steps:
[0132] (1) Feed the bridge design drawings into the PaddleOCR model and output the detected text information and location information.
[0133] (2) Set logical constraints: Use the text information detected by the PaddleOCR model to find the maximum or minimum value and assign attribute information;
[0134] Using the location information of the text detected by the PaddleOCR model and the location information of the key points, we traverse all the parameters, find the parameters that meet the requirements, and output the type information and text information of the parameters.
[0135] The key points output by the key point detection model are connected in sequence into a closed loop to form the outer contour of the bridge for the next step of parameter matching. Taking the cast-in-place box girder as an example, the required parameters are serial number N, box girder upper flange width W1, box girder lower flange width W2, flange left cantilever width LB, flange right cantilever width RB, beam height H, cantilever end thickness HB1, cantilever root thickness HB2, left web thickness WL, left web thickness WR, upper flange thickness HF1, lower flange thickness HF2. The positions of each parameter in the bridge design drawing are as follows: Figure 6 As shown. Set multiple logical constraints to match the structure with the parameters. First, determine whether the text is horizontal or vertical, then traverse all the parameters, find the parameters that meet the requirements, and output the parameter type and text information.
[0136] B1) For cast-in-place box girders, the outer contour has 8 key points. The key points are connected in sequence to form line segments. The parameters are serial number N, box girder upper flange width W1, box girder lower flange width W2, flange left cantilever width LB, flange right cantilever width RB, beam height H, cantilever end thickness HB1, cantilever root thickness HB2, left web thickness WL, left web thickness WR, upper flange thickness HF1, and lower flange thickness HF2.
[0137] B2) Determine whether the text is horizontal or vertical.
[0138] For the horizontal direction: set the parameter at the top of the image to N, the largest number to W1, the parameter at the bottom of the image to W2, the parameter at the same horizontal coordinate as the midpoint of line segment 2-3 to LB, the parameter to the right of LB to WL, the parameter at the same horizontal coordinate as the midpoint of line segment 6-7 to RB, and the parameter to the left of RB to WR;
[0139] For the vertical direction: set the leftmost parameter to H, the parameter at the same vertical coordinate as the midpoint of line segment 1-2 to HF1, and the parameter at the same horizontal coordinate as HF1 to HF2.
[0140] (3) Use Python code to generate an Excel table with the parameter type and text information to realize parameter extraction.
[0141] like Figure 7 As shown, the bridge structure detection model can accurately extract the outline structure of the bridge from the bridge design drawings.
[0142] like Figure 8 As shown, the present invention can detect the type of bridge structure in the bridge design drawings, obtain necessary parameter information, and classify all structural dimensions into a library.
[0143] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A bridge structure recognition method for bridge PDF design drawings, characterized in that: The following steps are involved: 11) Obtaining and preprocessing bridge PDF design drawings: Obtain bridge design drawings saved in PDF format and preprocess them; 12) Building a bridge structure detection model: Combining the improved YOLOv8pose model and the Harris corner detection algorithm, a bridge structure detection model was constructed for detecting peripheral key points of bridge structures in PDF design drawings. The construction of the bridge structure detection model comprises the following steps: 121) Set the YOLOv8pose model to include Backbone layer, Neck layer and Head layer; 122) Set the Backbone layer, using 5 Conv convolution blocks, 4 C2f modules and SPPF modules to extract features. It also uses residual connections and bottleneck structures to reduce the size of the network and improve performance. 123) The Neck layer is set up and multi-scale feature fusion technology is used to fuse feature maps from different stages of the Backbone layer to enhance feature representation capabilities; 124) Set the Head layer, which includes a detection head and a classification head. The detection head is used to generate results, and the classification head uses global average pooling to classify each feature map. 125) Set the CA attention mechanism, which is divided into two parts: embedding coordinate information and generating coordinate information feature map. First, use the pooling kernels of size (H, 1) and (1, W) to perform average pooling on the input feature map of size C×H×W along the horizontal coordinate X direction and the vertical coordinate Y direction respectively. Among them, the output of the cth channel with height h Expressed as: , The output of the cth channel with width w Expressed as: , This generates a pair of direction-aware feature maps of size C×H×1 and C×1×W; Then the extracted feature information is concat-operated and sent to the 1×1 convolution transformation function F1 to obtain: , in, represents the concatenation operation along the spatial dimension, δ is the nonlinear activation function, f is the intermediate feature map of size C / r×1×(W+H), and r represents the downsampling ratio; The feature map is then split along the spatial dimension, decomposing it into two separate tensors. and , respectively using 1×1 convolution transformation and Will and Convert to a tensor with the same number of channels as the input X, that is: , , Among them, σ is the sigmoid activation function, and are features representing the height and width directions respectively; Finally, the output result is expanded as the attention weight, and the output result Y of the CA attention mechanism is expressed as: , in, Represents the input feature map, represents the height direction weight, Represents the width direction weight; 126) Add the CA attention mechanism to the back layer of the SPPF module in the Backbone layer; 127) Set the Harris corner detection algorithm, use a window on the image, move it in any direction, and determine the corners based on the degree of grayscale change of the image pixels in the window before and after the movement. If the grayscale value of the window changes when it moves in any direction, then it is determined that a corner is detected in the window; Set the local window to move in all directions (u, v) and calculate the sum of all grayscale differences. The expression is as follows: , in, is the image grayscale of the local window, is the grayscale of the image after translation, It is a window function, which is a rectangular window or a Gaussian window, and u and v are the pixel distances moved; Will Taylor expansion ; Substituting into the formula we get ; Then the autocorrelation matrix H of the image point to be detected is obtained: ; The corner points are determined by judging the eigenvalue size of the autocorrelation matrix H. Since the eigenvalue decomposition of the autocorrelation function H increases the complexity of the algorithm, the Harris corner point response function is selected as R = det(H) - αtrace(H) 2 , if the corner point response function R is greater than the set threshold and the point is a local maximum point, then the point is considered to be a corner point, where det(H) is the determinant of H, trace(H) represents the trace of the matrix H, and α is a constant used to adjust the weights of these two terms; 128) Set the NMS algorithm to compare the intensity values of pixels, retain only the local maximum points, and suppress those that are not local maximum points; specifically, within a given window, if the value of the central pixel is not the maximum value, its value is set to 0; 129) The NMS algorithm is introduced into Harris corner detection. The response function values of Harris corner detection are sorted, and then the sorted corner list is traversed one by one. For each corner point, whether there is a corner point with a higher score in its surrounding neighborhood is checked, and finally the corner point with the highest score is selected as the final result. 1210) Using the location information of key points detected by the YOLOv8pose model, use the improved Harris corner detection algorithm to find the corner points closest to the key points in the bridge design drawings and output the final corner detection results; 13) Training of bridge structure detection model: Use pre-processed bridge design drawings to train the bridge structure detection model; 14) Obtaining PDF design drawings of the bridge to be inspected: Obtain PDF design drawings of the bridge to be inspected and perform pre-processing; 15) Bridge structure identification: The pre-processed PDF design drawings of the bridge to be inspected are input into the trained bridge structure detection model to identify the bridge structure.
2. The bridge structure recognition method for bridge PDF design drawings according to claim 1 is characterized in that: The training of the bridge structure detection model includes the following steps: 21) Set the training parameters of the YOLOv8pose model, including the number of iterations, batch size, and initial learning rate. The number of iterations is 50, the batch size is 16, and the initial learning rate lr0 of the model is set to 0.
01. 22) Input the preprocessed bridge design drawing dataset into the YOLOv8pose model; 221) The training image is sent to the Backbone layer, which extracts the feature information of the training image and outputs the feature information of the training image; 222) Feature information enters the Neck layer, multi-scale feature fusion is performed, feature representation capability is enhanced, and feature information is output; 223) Feature information enters the Head layer, which predicts key points based on target detection and outputs target information and key point information; 23) The image output by the YOLOv8pose model is fed into the improved Harris corner detection algorithm, which uses the key point information to find the corner point closest to the key point. The corner point found is considered to be the key point of the final bridge structure outline.
3. The bridge structure recognition method for bridge PDF design drawings according to claim 1 is characterized in that: It also includes a parameter extraction method for bridge structure identification. The bridge PDF design drawings detected by the bridge structure detection model are fed into the PaddleOCR model. The position information of the text detected by the PaddleOCR model is used to assign attributes to the parameters through logical constraints. It includes the following steps: 31) Feed the bridge design drawings into the PaddleOCR model and output the detected text information and location information; 32) Set logical constraints: Use the text information detected by the PaddleOCR model to find the maximum or minimum value and assign attribute information; Using the position information of the text detected by the PaddleOCR model, combined with the position information of the key points, traverse all parameters, find the parameters that meet the requirements, and output the type information and text information of the parameters; 321) For the cross section of cast-in-place box girder, the outer contour has 8 key points. The key points are connected in sequence to form line segments. Its parameters include sequence number N, box girder upper flange width W1, box girder lower flange width W2, flange left cantilever width LB, flange right cantilever width RB, beam height H, cantilever end thickness HB1, cantilever root thickness HB2, left web thickness WL, left web thickness WR, upper flange thickness HF1, lower flange thickness HF2; 322) Determine whether the text is horizontal or vertical. For the horizontal direction: set the parameter at the top of the image to N, the largest number to W1, the parameter at the bottom of the image to W2, the parameter at the same horizontal coordinate as the midpoint of line segment 2-3 to LB, the parameter to the right of LB to WL, the parameter at the same horizontal coordinate as the midpoint of line segment 6-7 to RB, and the parameter to the left of RB to WR; For the vertical direction: set the leftmost parameter to H, the parameter at the same vertical coordinate as the midpoint of line segment 1-2 to HF1, and the parameter at the same horizontal coordinate as HF1 to HF2; 33) Use Python code to generate an Excel table with the parameter type and text information to implement parameter extraction.
