CN116994282B - Reinforcing steel bar quantity identification and collection method for bridge design drawing - Google Patents

Reinforcing steel bar quantity identification and collection method for bridge design drawing Download PDF

Info

Publication number
CN116994282B
CN116994282B CN202311234810.9A CN202311234810A CN116994282B CN 116994282 B CN116994282 B CN 116994282B CN 202311234810 A CN202311234810 A CN 202311234810A CN 116994282 B CN116994282 B CN 116994282B
Authority
CN
China
Prior art keywords
image
design drawing
bridge design
steel bar
reinforcing steel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311234810.9A
Other languages
Chinese (zh)
Other versions
CN116994282A (en
Inventor
殷亮
吴志刚
王倩
汪传建
谢玉萌
朱均安
聂文华
杨大海
胡梦男
魏庆庆
揭秋明
朱俊
杨凯
殷涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Transport Consulting and Design Institute Co Ltd
Original Assignee
Anhui Transport Consulting and Design Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Transport Consulting and Design Institute Co Ltd filed Critical Anhui Transport Consulting and Design Institute Co Ltd
Priority to CN202311234810.9A priority Critical patent/CN116994282B/en
Publication of CN116994282A publication Critical patent/CN116994282A/en
Application granted granted Critical
Publication of CN116994282B publication Critical patent/CN116994282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/42Document-oriented image-based pattern recognition based on the type of document
    • G06V30/422Technical drawings; Geographical maps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19173Classification techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention relates to a method for identifying and collecting the number of reinforcing steel bars in a bridge design drawing, which solves the defect that identification and collection are not carried out on the number of reinforcing steel bars in the bridge design drawing compared with the prior art. The invention comprises the following steps: obtaining and preprocessing a bridge design drawing; constructing a reinforcing steel bar quantity identification model; training a reinforcing steel bar quantity recognition model; obtaining a bridge design drawing to be identified; detecting a surface target in a bridge design drawing; form extraction and image processing; form recognition and generation of an editable document; and (5) collecting and verifying the number of the reinforcing steel bars. The method can accurately and rapidly detect and identify all the common steel bar quantity tables in the drawing, generate an editable Excel file and count the number of steel bars in the bridge design drawing.

Description

Reinforcing steel bar quantity identification and collection method for bridge design drawing
Technical Field
The invention relates to the technical field of bridge design drawing identification, in particular to a reinforcing steel bar quantity identification and collection method for bridge design drawing (paper).
Background
Along with the rapid development of traffic design construction in China, bridge design becomes the link with the highest technical difficulty and highest safety attention in the whole traffic engineering design. In the bridge construction drawing design stage, a designer typically refers to the design drawing of an existing bridge project. These design drawings contain not only graphic and structural components, but also a large amount of textual and tabular information, which becomes an important source for subsequent informative management. However, since drawings are typically stored in paper form, it is relatively difficult to scroll through and find, and the collection and management of such data using conventional manual methods can take a significant amount of time, money and labor. In bridge design, various tables are widely used, wherein a common steel bar quantity table is particularly important, and the steel bar distribution rate can be calculated through the table. The reinforcement ratio plays a vital role in the structural performance and safety of the bridge, and directly influences the bearing capacity, the crack resistance and the reinforcement utilization ratio of the bridge, and accords with structural limitations and constraints. For the task of calculating the reinforcement ratio, the calculation by referring to drawings one by one is a tedious and time-consuming task. Thus, new ways to quickly review and obtain the desired rebar information need to be explored.
However, the accurate identification of the required important tables in the complex engineering drawings is an important precondition for the subsequent processing, and currently, the commonly used target detection modes include YOLO (You Only Look Once), faster RCNN (Faster Regions with CNN features) and the like, and with the continuous improvement of the YOLO series algorithm, the YOLO v5 algorithm is widely applied to the target detection task with higher detection precision and speed. In addition, the pad OCR opens the source of a form extraction method PP-Structure V2, can effectively perform functions such as layout analysis and form recognition, and the application of the technologies provides possibility for bridge design.
Then, how to effectively realize the number identification and the collection of the number of the reinforcing steel bars in the bridge design drawing becomes a technical problem to be solved urgently.
Disclosure of Invention
The invention aims to solve the defect that identification and collection are not carried out on the number of the reinforcing steel bars in the bridge design drawing in the prior art, and provides a reinforcing steel bar number identification and collection method for the bridge design drawing to solve the problems.
In order to achieve the above object, the technical scheme of the present invention is as follows:
a method for identifying and collecting the number of reinforcing steel bars in a bridge design drawing comprises the following steps:
obtaining and preprocessing a bridge design drawing: acquiring a CAD drawing of a bridge design drawing, converting the CAD drawing into a jpg format, and preprocessing the CAD drawing;
building a reinforcing steel bar quantity identification model: constructing a reinforcing steel bar quantity identification model based on YOLOv 5;
training of a reinforcing steel bar quantity recognition model: inputting the preprocessed data set into a reinforcing steel bar quantity recognition model for training;
obtaining a bridge design drawing to be identified: acquiring a bridge design drawing to be identified and preprocessing;
detecting a surface target in a bridge design drawing: inputting the preprocessed bridge design drawing to be identified into a trained reinforcing steel bar quantity identification model for detection, and returning to the relative position of the bridge design drawing in the image if a form target and a title bar target exist; if no object exists in the graph, returning to the end;
table extraction and image processing: intercepting a table and a title bar image based on the relative positions in the identified image, and carrying out bordering treatment on the title bar image;
form recognition and generation of an editable document: analyzing the cut table and title bar pictures by adopting a table identification technology of PP-Structure V2 according to the table and title bar images, extracting information and respectively generating editable Excel documents;
and (3) collecting and verifying the number of the reinforcing steel bars: and reading all editable Excel documents generated in the last step by using a python script, merging the editable Excel documents into a new steel bar number Excel document, performing calculation and verification on the new steel bar number Excel document by using the python script, judging the accuracy of the identification result, and completing the identification and collection processing of the steel bar number.
The bridge design drawing acquisition and pretreatment method comprises the following steps:
converting the bridge design drawing in the archived pdf format into an image in jpg format by using an pdf2image open source library, wherein the resolution of the image is 3573 multiplied by 2526;
performing data enhancement processing, and adding Gaussian noise to all pictures by using a python script;
and marking the data set, and marking the table and the title frame in the experimental data set by using a Labelimg tool, wherein the marking format is the YOLO format.
The construction of the reinforcing steel bar quantity identification model comprises the following steps:
setting YOLOv5 includes four parts: the Input end is enhanced by using Mosaic data, self-adaptive initial anchor frame calculation and picture scaling, the Input end is preprocessed by using a Backbone network Backbone, neck layer and a Head layer, the Backbone network back is used for carrying out feature extraction on an Input image, the Neck layer is used for carrying out multi-scale feature fusion on a feature map, the multi-scale problem is solved, the Head layer calculates classification, positioning and confidence Loss by adopting binary cross entropy Loss BCE Loss and CIoU Loss, and a non-maximum suppression NMS algorithm is replaced by a Soft NMS algorithm;
introducing a multi-branch convolution RFB module between a Neck layer and a Head layer;
the multi-branch convolution RFB module is set: the RFB module uses three different sizes of convolution kernels 1*1, 3*3, 5*5 to construct a multi-branch structure,
firstly, the dimension is reduced through the convolution of 1*1, secondly, the convolution of 1*1, 3*3 and 5*5 is respectively carried out, convolution kernels with different sizes are correspondingly connected with the hole convolutions with the corresponding expansion rates of 1, 3 and 5, the convolution of 1*1 is used for adjusting the feature dimension, then the feature dimension is added with the shortcut, and the feature is output through the Relu activation function.
The training of the steel bar quantity recognition model comprises the following steps of:
setting training parameters, namely training parameters of a YOLOv5 network model, wherein the training parameters comprise iteration times, batch size and initial learning rate, the iteration times epoch are 50, the batch size batch-size is 8, the initial learning rate lr0 of the model is set to be 0.01, and a cosine annealing algorithm is adopted to reduce the learning rate;
setting data enhancement parameters of a YOLOv5 network model, wherein the data enhancement parameters comprise a tone hsv_h, a saturation hsv_s, a brightness hsv_v, a rotation angle degrees, an up-down turning probability flip and a left-right turning probability flip, wherein hsv_h is 0.015, hsv_s is 0.7, hsv_v is 0.4, degrees is 0, flip is 0, and flip is 0.5;
inputting the preprocessed bridge design drawing data set into a reinforcing steel bar number recognition model;
the Input module of the Input end adopts Mosaic data enhancement to carry out random scaling, random cutting and random arrangement on the image;
the training image output by the Input module at the Input end is sent to the Backbone network back-bone module, the Backbone network back-bone module extracts the characteristic information of the training image and outputs the characteristic information of the training image;
feature information of the training image enters a Neck layer to realize fusion of shallow graphic features and deep semantic features;
three feature images output by the Neck layer are sent to an RFB module;
the feature map output by the RFB module is sent to an output end Head module, binary cross entropy BCE Loss and cioU Loss are adopted to calculate classification, positioning and confidence Loss, a plurality of prediction frames are generated around a real target in the prediction process, a soft NMS algorithm carries out confidence attenuation on adjacent prediction frames based on the size of an overlapping part, and finally a prediction result of a network is output, namely, the identified bridge design drawing.
The table extraction and image processing includes the steps of:
acquiring the relative position in the image after target detection:
for the coordinate system of the identified bridge design drawing, the upper left corner of the image is taken as an original point, the relative position is the upper left vertex coordinate and the lower right vertex coordinate of the outline of the table, the table is set as a target 0, the title bar is set as a target 1, the relative position of the output target frame is a txt file, and the specific output result format is as follows:
[ object 0, [ upper left-hand abscissa, upper left-hand ordinate, lower right-hand abscissa, lower right-hand ordinate ]
[ object 1, [ upper left-hand abscissa, upper left-hand ordinate, lower right-hand abscissa, lower right-hand ordinate ] ];
for each target, according to the relative position information, using a python script, intercepting a form and a title bar image in the bridge design drawing from the identified bridge design drawing, naming the intercepted form and title bar image in the bridge design drawing by an original image name and category, and correspondingly storing the intercepted form and title bar image as an intercepted form and title bar image in two folders of a target 0 and a target 1 under a folder named by the original image name;
based on the requirement that PP-Structure V2 correctly recognizes the title bar, a frame with 320 pixels width is added to the upper side and the lower side of the truncated title bar image to adjust the size of the table image.
The aggregation and verification of the number of the reinforcing steel bars comprises the following steps:
all editable Excel documents generated in the previous step were read using the python script,
if the table and the title bar exist under the same bridge design drawing, inserting the characters of the first row and the third column of the identified title bar Excel document into the last column of the identified table Excel document, wherein the characters are used for distinguishing tables at different positions, storing the tables as new Excel documents, and taking the title of the table as the file name of the new Excel documents; if the table and the title bar do not exist in the design diagram at the same time, the table and the title bar are not processed;
reading all Excel documents named by the form title generated in the previous step by using a python script, and summarizing and storing all the steel bar quantity tables into a new Excel document by taking the file names of the Excel documents as indexes, namely, summarizing the summarized steel bar quantity Excel documents;
calculating and verifying the read steel bar quantity table, reading a total steel bar quantity Excel document by using a python script, multiplying the length and the quantity of a single steel bar to obtain a calculation result, and comparing the calculation result with the identified total length of the steel bar to judge whether the calculation result is the same as the identified total length of the steel bar;
if the number of the reinforcing steel bars is the same, outputting a reinforcing steel bar number identification and collection result;
if the two are different, writing an identification error in the corresponding later column so as to carry out manual verification and data modification later.
Advantageous effects
Compared with the prior art, the method for identifying and collecting the number of the steel bars for the bridge design drawing can accurately and rapidly detect and identify all the common steel bar number tables in the drawing, generate an editable Excel file and count the number of the steel bars of the bridge design drawing.
According to the invention, the table and the title bar in the bridge design drawing are identified through the YOLOv5 detection model, so that a large number of tables and title bars in the drawing can be extracted in batches under the condition of no supervision, and are archived and classified into different folders; analyzing the cut form picture by using a form identification technology of PP-Structure V2 and generating an Excel form; reading the Excel table, inserting important information in the title bar into a common steel bar table, and generating the Excel table containing information of all steel bar quantity tables, thereby realizing the aggregation and summarization of the steel bar information in the bridge design drawing. The invention combines computer vision and OCR technology, can improve the efficiency and accuracy of engineering drawing processing, and has wide application prospect and practical value.
Drawings
FIG. 1 is a process sequence diagram of the present invention;
fig. 2 is a schematic diagram of a model for identifying the number of reinforcing steel bars based on YOLOv5 according to the present invention;
FIG. 3 is a diagram of the recognition result of a bridge design drawing using the method of the present invention;
FIG. 4 is a table diagram of a bridge design drawing cut by the method of the present invention;
FIG. 5 is a diagram of a title bar in a bridge design drawing cut by the method of the present invention;
FIG. 6 is a diagram of a title bar image with additional frames using the method of the present invention;
fig. 7 is a schematic view of a number table of reinforcing bars identified by the method of the present invention;
fig. 8 is a schematic diagram of a number table of reinforcing bars after adding title bar information using the method of the present invention;
fig. 9 is a schematic view of a summary of all rebar counts tables identified using the method of the present invention;
fig. 10 is a schematic view showing the total (partial) table of all the number of reinforcing bars verified by the method of the present invention.
Detailed Description
For a further understanding and appreciation of the structural features and advantages achieved by the present invention, the following description is provided in connection with the accompanying drawings, which are presently preferred embodiments and are incorporated in the accompanying drawings, in which:
as shown in fig. 1, the method for identifying and collecting the number of reinforcing steel bars for a bridge design drawing (paper) according to the invention comprises the following steps:
firstly, acquiring and preprocessing a bridge design drawing: and acquiring a CAD drawing of the bridge design drawing, converting the CAD drawing into a jpg format, and preprocessing the CAD drawing.
(1) And converting the bridge design drawing in the archived pdf format into an image in the jpg format by using an open source library of pdf2 images, wherein the resolution size of the image is 3573 multiplied by 2526.
(2) Data enhancement processing is performed, and the python script is used to add gaussian noise to all pictures.
(3) And marking the data set, and marking the table and the title frame in the experimental data set by using a Labelimg tool, wherein the marking format is the YOLO format.
Secondly, constructing a reinforcing steel bar quantity identification model: and constructing a reinforcing steel bar quantity identification model based on the YOLOv 5. Because a plurality of table targets with different sizes exist in the engineering drawing, the YOLOv5 model is improved, as shown in fig. 2, so that the detection capability of the network model on the targets with different sizes is improved, and the detection omission risk is reduced.
The method comprises the following specific steps:
(1) Setting YOLOv5 includes four parts: the method comprises the steps of respectively inputting an Input end, a Backbone network Backbone, neck layer and a Head layer, wherein the Input end uses Mosaic data enhancement, self-adaptive initial anchor frame calculation and picture scaling to preprocess an image, the Backbone network back is used for extracting characteristics of the Input image, the Neck layer is used for carrying out multi-scale characteristic fusion on a characteristic image, the multi-scale problem is solved, the Head layer adopts binary cross entropy Loss BCE Loss and CIoU Loss to calculate classification, positioning and confidence Loss, and a non-maximum suppression NMS algorithm is replaced by a Soft NMS algorithm.
(2) A multi-branch convolution RFB module is introduced between the neg layer and the Head layer.
(3) The multi-branch convolution RFB module is set: the RFB module uses three different sizes of convolution kernels 1*1, 3*3, 5*5 to construct a multi-branch structure,
firstly, the dimension is reduced through the convolution of 1*1, secondly, the convolution of 1*1, 3*3 and 5*5 is respectively carried out, convolution kernels with different sizes are correspondingly connected with hole convolutions with corresponding expansion rates of 1, 3 and 5, the calculated amount is not increased while the receptive field is enlarged, the convolution of 1*1 is used for adjusting the feature dimension, then the feature dimension is added with shortcut, and the feature is output through a Relu activation function. The RFB module is introduced to improve the characteristic expression capability of the network model to targets with different sizes and improve the detection performance of the network.
Thirdly, training a reinforcing steel bar quantity recognition model: and inputting the preprocessed data set into a reinforcing steel bar quantity recognition model for training.
(1) Training parameters, namely training parameters of the YOLOv5 network model, are set, wherein the training parameters comprise iteration times, batch size and initial learning rate, the iteration times epoch are 50, the batch size batch-size is 8, the initial learning rate lr0 of the model is set to be 0.01, and the learning rate is reduced by adopting a cosine annealing algorithm.
(2) Setting data enhancement parameters of a YOLOv5 network model, wherein the data enhancement parameters comprise a tone hsv_h, a saturation hsv_s, a brightness hsv_v, a rotation angle degrees, an up-down flip probability flip and a left-right flip probability flip, wherein hsv_h is 0.015, hsv_s is 0.7, hsv_v is 0.4, degrees is 0, flip is 0, and flip is 0.5.
(3) And inputting the preprocessed bridge design drawing data set into a reinforcing steel bar number recognition model.
(4) The Input module of the Input end adopts Mosaic data enhancement to carry out random scaling, random clipping and random arrangement on the image.
(5) The training image output by the Input module at the Input end is sent to the Backbone network back-bone module, and the Backbone network back-bone module extracts the characteristic information of the training image and outputs the characteristic information of the training image.
(6) Feature information of the training image enters a Neck layer to realize fusion of shallow graphic features and deep semantic features.
(7) The three feature maps output by the Neck layer are sent to the RFB module.
(8) The feature map output by the RFB module is sent to an output end Head module, binary cross entropy BCE Loss and CIoU Loss are adopted to calculate classification, positioning and confidence coefficient Loss, a plurality of prediction frames are generated around a real target in the prediction process, the soft NMS algorithm carries out confidence coefficient attenuation on the adjacent prediction frames based on the size of an overlapping part instead of forcibly clearing the confidence coefficient of the adjacent prediction frames, so that the risk of target missing detection is reduced, and finally, the prediction result of a network, namely the identified bridge design drawing is output, as shown in fig. 2.
Fourth, obtaining a bridge design drawing to be identified: and obtaining a bridge design drawing to be identified and preprocessing.
Fifthly, detecting a surface target in a bridge design drawing: inputting the preprocessed bridge design drawing to be identified into a trained reinforcing steel bar quantity identification model for detection, wherein the detection result is shown in fig. 3, and if a form target and a title bar target exist, returning to the relative position of the form target and the title bar target in the image; if the target is not in the diagram, the method returns to the end.
Sixth, form extraction and image processing: and intercepting the table and the title bar image based on the relative positions in the identified image, and carrying out bordering processing on the title bar image. The identified target gives out relative position information in the image, so that the target area can be accurately intercepted, the complexity of manual cutting is avoided, an automatic flow is realized, and the header bar image is subjected to framing processing, so that the follow-up form identification can be more accurate.
(1) Acquiring the relative position in the image after target detection:
for the coordinate system of the identified bridge design drawing, the upper left corner of the image is taken as an original point, the relative position is the upper left vertex coordinate and the lower right vertex coordinate of the outline of the table, the table is set as a target 0, the title bar is set as a target 1, the relative position of the output target frame is a txt file, and the specific output result format is as follows:
[ object 0, [ upper left-hand abscissa, upper left-hand ordinate, lower right-hand abscissa, lower right-hand ordinate ]
[ object 1, [ upper left abscissa, upper left ordinate, lower right abscissa, lower right ordinate ] ].
(2) As shown in fig. 4 and 5, for each target, according to its relative position information, using a python script, intercepting the table and title bar images in the bridge design drawing from the identified bridge design drawing, naming the intercepted table and title bar images in the bridge design drawing by "original image name+category", and correspondingly saving the intercepted table and title bar images in two folders, namely, target 0 and target 1, under the folder named by the original image name.
(3) Based on the requirement that PP-Structure V2 correctly recognizes the title bar, a frame with 320 pixels width is added to the upper side and the lower side of the truncated title bar image to adjust the size of the table image.
In the case of performing form recognition on a title bar image, there is a case where the object is too slender, and thus OCR may fail to recognize the title bar correctly. The title bar image may be adjusted and the size of the form image may be adjusted by adding a 320 pixel wide border on the top and bottom sides of the image. The adjusted image is shown in fig. 6, which can be used in a subsequent form recognition process.
Seventh, form recognition and generation of an editable document are performed: and analyzing the cut table and title bar pictures by adopting a table identification technology of PP-Structure V2 according to the table and title bar images, extracting information and respectively generating editable Excel documents.
PP-Structure V2 is an intelligent document analysis system for self-lapping of a Paddle OCR team, and aims to help a developer to better complete document understanding related tasks such as layout analysis, form recognition and the like. PP-structure v2 supports independent use or flexible collocation of the individual modules, e.g., layout analysis alone, or form recognition alone. PP-Structure V2 currently provides a Chinese and English table recognition model, which is used here. The method can be mainly divided into six parts: text detection module: detecting a single-row text of the form picture to obtain coordinates; the text recognition module recognizes the model to obtain a text result; a table structure prediction module: four-point coordinates and table structure information of each Excel cell are obtained; acquiring 4-point coordinates of a single-line text box by combining text detection; cell coordinate aggregation module: bringing the coordinates together; cell text aggregation module: text belonging to the same cell is stitched together. Finally, combining the table structure information; excel export module: tabular data in Excel form was obtained.
The PP-structure v2 identified table is shown in fig. 7, and since a special symbol appears in the diameter and the special symbol is not in the dictionary, the special symbol is identified as the word "business" by error identification, but the subsequent data processing is not affected.
Eighth, the collection and verification of the number of the reinforcing steel bars: since there are several steel bar quantity tables in one project, each column has a corresponding steel bar quantity table for each span, and it is difficult to distinguish the steel bar quantity tables in an Excel summary table. All editable Excel documents generated in the previous step are read by using the python script, information in the title bar is read, and important information is inserted into the position of the rear column of the corresponding table, as shown in fig. 8. All the steel bar quantity tables are combined and integrated into a new steel bar quantity Excel document, and the integrated result is shown in fig. 9. And (3) performing calculation and verification on the new steel bar quantity Excel document by using a python script, judging the accuracy of the identification result, and completing the identification and collection processing of the steel bar quantity, as shown in fig. 10.
The aggregation and verification of the number of the reinforcing steel bars comprises the following steps:
(1) All editable Excel documents generated in the previous step were read using the python script,
if the table and the title bar exist under the same bridge design drawing, inserting the characters of the first row and the third column of the identified title bar Excel document into the last column of the identified table Excel document, wherein the characters are used for distinguishing tables at different positions, storing the tables as new Excel documents, and taking the title of the table as the file name of the new Excel documents; if the table and the title bar do not exist in the design diagram at the same time, the table and the title bar are not processed.
(2) And reading all Excel documents named by the form title generated in the previous step by using a python script, taking the file name of the Excel document as an index, and summarizing and storing all the steel bar quantity tables into a new Excel document, namely, the summarized steel bar quantity Excel document.
(3) Calculating and verifying the read steel bar quantity table, reading a total steel bar quantity Excel document by using a python script, multiplying the length and the quantity of a single steel bar to obtain a calculation result, and comparing the calculation result with the identified total length of the steel bar to judge whether the calculation result is the same as the identified total length of the steel bar;
if the number of the reinforcing steel bars is the same, outputting a reinforcing steel bar number identification and collection result;
if the two are different, writing an identification error in the corresponding later column so as to carry out manual verification and data modification later.
The foregoing has shown and described the basic principles, principal features and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, and that the above embodiments and descriptions are merely illustrative of the principles of the present invention, and various changes and modifications may be made therein without departing from the spirit and scope of the invention, which is defined by the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (2)

1. The method for identifying and collecting the number of the reinforcing steel bars in the bridge design is characterized by comprising the following steps of:
11 Obtaining and preprocessing a bridge design drawing: acquiring a CAD drawing of a bridge design drawing, converting the CAD drawing into a jpg format, and preprocessing the CAD drawing;
12 Construction of a reinforcing steel bar quantity identification model: constructing a reinforcing steel bar quantity identification model based on YOLOv 5;
the construction of the reinforcing steel bar quantity identification model comprises the following steps:
121 Set YOLOv5 includes four parts: the Input end is enhanced by using Mosaic data, self-adaptive initial anchor frame calculation and picture scaling, the Input end is preprocessed by using a Backbone network Backbone, neck layer and a Head layer, the Backbone network back is used for carrying out feature extraction on an Input image, the Neck layer is used for carrying out multi-scale feature fusion on a feature map, the multi-scale problem is solved, the Head layer calculates classification, positioning and confidence Loss by adopting binary cross entropy Loss BCE Loss and CIoU Loss, and a non-maximum suppression NMS algorithm is replaced by a Soft NMS algorithm;
122 Introducing a multi-branch convolution RFB module between the neg layer and the Head layer;
123 Setting the multi-branch convolution RFB module: the RFB module uses three different sizes of convolution kernels 1*1, 3*3, 5*5 to construct a multi-branch structure,
firstly, reducing the dimension through the convolution of 1*1, secondly, respectively carrying out 1*1, 3*3 and 5*5 convolutions, correspondingly connecting convolution kernels with different sizes with the hole convolutions with the corresponding expansion rates of 1, 3 and 5, adjusting the feature dimension through the convolution of 1*1, then carrying out addition with a shortcut, and outputting the feature through a Relu activation function;
13 Training of the reinforcing steel bar number recognition model: inputting the preprocessed data set into a reinforcing steel bar quantity recognition model for training;
the training of the steel bar quantity recognition model comprises the following steps of:
131 Training parameters, namely training parameters of the YOLOv5 network model, wherein the training parameters comprise iteration times, batch size and initial learning rate, the iteration times epoch are 50, the batch size batch-size is 8, the initial learning rate lr0 of the model is set to be 0.01, and the learning rate is reduced by adopting a cosine annealing algorithm;
132 Data enhancement parameters of the YOLOv5 network model are set, wherein the data enhancement parameters comprise hue hsv_h, saturation hsv_s, brightness hsv_v, rotation angle degrees, up-down flip probability flip and left-right flip probability flip, hsv_h is 0.015, hsv_s is 0.7, hsv_v is 0.4, degrees is 0, flip is 0, and flip is 0.5;
133 Inputting the preprocessed bridge design drawing data set into a reinforcing steel bar number recognition model;
134 The Input module at the Input end adopts Mosaic data enhancement to perform random scaling, random cutting and random arrangement on the image;
135 The training image output by the Input module at the Input end is sent to the Backbone network back-bone module, the Backbone network back-bone module extracts the characteristic information of the training image and outputs the characteristic information of the training image;
136 Feature information of the training image enters a Neck layer to realize fusion of shallow graphic features and deep semantic features;
137 Three feature images output by the Neck layer are sent to the RFB module;
138 The feature map output by the RFB module is sent to an output end Head module, binary cross entropy BCE Loss and cioU Loss are adopted to calculate classification, positioning and confidence Loss, a plurality of prediction frames are generated around a real target in the prediction process, the soft NMS algorithm carries out confidence attenuation on the adjacent prediction frames based on the size of an overlapping part, and finally a prediction result of a network is output, namely, the identified bridge design drawing;
14 Obtaining a bridge design drawing to be identified: acquiring a bridge design drawing to be identified and preprocessing;
15 Detection of a table target in a bridge design drawing: inputting the preprocessed bridge design drawing to be identified into a trained reinforcing steel bar quantity identification model for detection, and returning to the relative position of the bridge design drawing in the image if a form target and a title bar target exist; if no object exists in the graph, returning to the end;
16 Table extraction and image processing: intercepting a table and a title bar image based on the relative positions in the identified image, and carrying out bordering treatment on the title bar image;
17 Table identification and generation of editable documents): analyzing the cut table and title bar pictures by adopting a table identification technology of PP-Structure V2 according to the table and title bar images, extracting information and respectively generating editable Excel documents;
the table extraction and image processing includes the steps of:
171 Acquiring the relative position in the image after target detection:
for the coordinate system of the identified bridge design drawing, the upper left corner of the image is taken as an original point, the relative position is the upper left vertex coordinate and the lower right vertex coordinate of the outline of the table, the table is set as a target 0, the title bar is set as a target 1, the relative position of the output target frame is a txt file, and the specific output result format is as follows:
[ object 0, [ upper left-hand abscissa, upper left-hand ordinate, lower right-hand abscissa, lower right-hand ordinate ]
[ object 1, [ upper left-hand abscissa, upper left-hand ordinate, lower right-hand abscissa, lower right-hand ordinate ] ];
172 For each target, intercepting a table and a title bar image in the bridge design drawing from the identified bridge design drawing by using a python script according to the relative position information of the target, naming the intercepted table and title bar image in the bridge design drawing by using an original image name and a category, and correspondingly storing the intercepted table and title bar image as an intercepted table and title bar image in two folders of a target 0 and a target 1 under a folder named by the original image name;
173 Based on the requirement that PP-Structure V2 correctly recognizes the title bar, adding 320-pixel width frames on the upper side and the lower side of the intercepted title bar image to adjust the size of the table image;
18 Aggregation and verification of the number of the reinforcing steel bars: reading all editable Excel documents generated in the last step by using a python script, merging the editable Excel documents into new steel bar quantity Excel documents, performing calculation and verification on the new steel bar quantity Excel documents by using the python script, judging the accuracy of the identification result, and completing the identification and collection processing of the steel bar quantity;
the aggregation and verification of the number of the reinforcing steel bars comprises the following steps:
181 Reading all editable Excel documents generated in the previous step using the python script,
if the table and the title bar exist under the same bridge design drawing, inserting the characters in the first row and the third column of the identified title bar Excel document into the last column of the Excel document identified by the table, and storing the last column as a new Excel document by distinguishing the tables at different positions, wherein the title of the table is used as the file name of the new Excel document; if the table and the title bar do not exist in the design diagram at the same time, the table and the title bar are not processed;
182 Reading all Excel documents named by the form title generated in the previous step by using a python script, and summarizing and storing all the steel bar quantity tables into a new Excel document by taking the file names of the Excel documents as indexes, namely, summarizing the total steel bar quantity Excel documents;
183 Calculating and verifying the read steel bar quantity table, reading a total steel bar quantity Excel document by using a python script, multiplying the length and the quantity of a single steel bar to obtain a calculation result, and comparing the calculation result with the identified total length of the steel bar to judge whether the calculation result is the same as the identified total length of the steel bar;
if the number of the reinforcing steel bars is the same, outputting a reinforcing steel bar number identification and collection result;
if the two are different, writing an identification error in the corresponding later column so as to carry out manual verification and data modification later.
2. The method for identifying and collecting the number of the reinforcing steel bars for the bridge design drawing according to claim 1, wherein the obtaining and preprocessing of the bridge design drawing comprises the following steps:
21 Using an open source library of pdf2image to convert the bridge design drawing in the archived pdf format into an image in jpg format, wherein the resolution size of the image is 3573 multiplied by 2526;
22 Data enhancement processing, using python script to add gaussian noise to all pictures;
23 Labeling the data set, and labeling the table and the title frame in the experimental data set by using a Labelimg tool, wherein the labeling format is a YOLO format.
CN202311234810.9A 2023-09-25 2023-09-25 Reinforcing steel bar quantity identification and collection method for bridge design drawing Active CN116994282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311234810.9A CN116994282B (en) 2023-09-25 2023-09-25 Reinforcing steel bar quantity identification and collection method for bridge design drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311234810.9A CN116994282B (en) 2023-09-25 2023-09-25 Reinforcing steel bar quantity identification and collection method for bridge design drawing

Publications (2)

Publication Number Publication Date
CN116994282A CN116994282A (en) 2023-11-03
CN116994282B true CN116994282B (en) 2023-12-15

Family

ID=88526883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311234810.9A Active CN116994282B (en) 2023-09-25 2023-09-25 Reinforcing steel bar quantity identification and collection method for bridge design drawing

Country Status (1)

Country Link
CN (1) CN116994282B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111160157A (en) * 2019-12-17 2020-05-15 万翼科技有限公司 Text extraction method based on DWG drawing and related product
WO2020232872A1 (en) * 2019-05-22 2020-11-26 平安科技(深圳)有限公司 Table recognition method and apparatus, computer device, and storage medium
CN114677696A (en) * 2020-12-09 2022-06-28 中铁高新工业股份有限公司 Bridge steel structure quota data identification method
CN114694159A (en) * 2022-04-07 2022-07-01 武汉理工大学 Engineering drawing BOM identification method and device, electronic equipment and storage medium
TWI788206B (en) * 2022-01-25 2022-12-21 大鼎工程顧問股份有限公司 Method and system for interpreting the content of engineering drawing
CN115578741A (en) * 2022-09-14 2023-01-06 山东科技大学 Mask R-cnn algorithm and type segmentation based scanned file layout analysis method
CN115690823A (en) * 2022-11-01 2023-02-03 南京云阶电力科技有限公司 Method and device for extracting form information with burr features in electrical drawing
CN115761782A (en) * 2022-10-28 2023-03-07 浙江工业大学 Road engineering drawing title bar information extraction method
CN115953797A (en) * 2022-12-29 2023-04-11 四川云从天府人工智能科技有限公司 Form recognition method, document acquisition method, and storage medium
CN116451665A (en) * 2023-03-20 2023-07-18 杭州玖欣物联科技有限公司 Method for intelligently generating design BOM based on drawing
CN116486228A (en) * 2023-03-30 2023-07-25 浙江理工大学 Paper medicine box steel seal character recognition method based on improved YOLOV5 model
CN116703904A (en) * 2023-08-04 2023-09-05 中建八局第一数字科技有限公司 Image-based steel bar quantity detection method, device, equipment and medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020232872A1 (en) * 2019-05-22 2020-11-26 平安科技(深圳)有限公司 Table recognition method and apparatus, computer device, and storage medium
CN111160157A (en) * 2019-12-17 2020-05-15 万翼科技有限公司 Text extraction method based on DWG drawing and related product
CN114677696A (en) * 2020-12-09 2022-06-28 中铁高新工业股份有限公司 Bridge steel structure quota data identification method
TWI788206B (en) * 2022-01-25 2022-12-21 大鼎工程顧問股份有限公司 Method and system for interpreting the content of engineering drawing
CN114694159A (en) * 2022-04-07 2022-07-01 武汉理工大学 Engineering drawing BOM identification method and device, electronic equipment and storage medium
CN115578741A (en) * 2022-09-14 2023-01-06 山东科技大学 Mask R-cnn algorithm and type segmentation based scanned file layout analysis method
CN115761782A (en) * 2022-10-28 2023-03-07 浙江工业大学 Road engineering drawing title bar information extraction method
CN115690823A (en) * 2022-11-01 2023-02-03 南京云阶电力科技有限公司 Method and device for extracting form information with burr features in electrical drawing
CN115953797A (en) * 2022-12-29 2023-04-11 四川云从天府人工智能科技有限公司 Form recognition method, document acquisition method, and storage medium
CN116451665A (en) * 2023-03-20 2023-07-18 杭州玖欣物联科技有限公司 Method for intelligently generating design BOM based on drawing
CN116486228A (en) * 2023-03-30 2023-07-25 浙江理工大学 Paper medicine box steel seal character recognition method based on improved YOLOV5 model
CN116703904A (en) * 2023-08-04 2023-09-05 中建八局第一数字科技有限公司 Image-based steel bar quantity detection method, device, equipment and medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A YOLO-based Table Detection Method;Yilun Huang等;《2019 International Conference on Document Analysis and Recognition (ICDAR)》;第813-818页 *
基于改进YOLOv5s 的面向自动驾驶场景的道路目标检测算法;胡丹丹等;《智能系统学报》;第1-10页 *
多特征融合的文档图像版面分析;应自炉等;《中国图象图形学报》;第25卷(第2期);第311-320页 *

Also Published As

Publication number Publication date
CN116994282A (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN109902622B (en) Character detection and identification method for boarding check information verification
CN112528963A (en) Intelligent arithmetic question reading system based on MixNet-YOLOv3 and convolutional recurrent neural network CRNN
CN110569832A (en) text real-time positioning and identifying method based on deep learning attention mechanism
EP0546343B1 (en) Diagram recognizing system
CN109635805B (en) Image text positioning method and device and image text identification method and device
CN111027562A (en) Optical character recognition method based on multi-scale CNN and RNN combined with attention mechanism
CN114005123A (en) System and method for digitally reconstructing layout of print form text
CN111860525B (en) Bottom-up optical character recognition method suitable for terminal block
CN112818951A (en) Ticket identification method
CN113762269B (en) Chinese character OCR recognition method, system and medium based on neural network
CN112861865B (en) Auxiliary auditing method based on OCR technology
CN111626145B (en) Simple and effective incomplete form identification and page-crossing splicing method
CN112598004A (en) English composition test paper layout analysis method based on scanning
Cheng et al. M6doc: A large-scale multi-format, multi-type, multi-layout, multi-language, multi-annotation category dataset for modern document layout analysis
CN113537227B (en) Structured text recognition method and system
CN1320481C (en) Method for conducting title and text logic connection for newspaper pages
CN111832497B (en) Text detection post-processing method based on geometric features
CN116994282B (en) Reinforcing steel bar quantity identification and collection method for bridge design drawing
CN112464941A (en) Invoice identification method and system based on neural network
CN111507348A (en) Character segmentation and identification method based on CTC deep neural network
CN114694133B (en) Text recognition method based on combination of image processing and deep learning
CN116543391A (en) Text data acquisition system and method combined with image correction
CN115713775A (en) Method, system and computer equipment for extracting form from document
CN113901913A (en) Convolution network for ancient book document image binaryzation
CN114550189A (en) Bill recognition method, device, equipment, computer storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant