Automatic Detection Method for Reinforcing Steel Quality in Hidden Works Based on Computer Vision Technology
The automatic steel bar quality inspection method based on computer vision has solved the problems of low efficiency and poor accuracy in steel bar acceptance, and has achieved efficient and accurate automated inspection with a measurement error of less than ±5 mm and a relative error of less than 3%.
Patent Information
- Application Number
- CN202411989302.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing technologies suffer from low efficiency and poor accuracy in steel bar inspection, and computer vision technology lacks the ability to generalize models in steel bar inspection, making real-time detection impossible.
An automatic steel bar quality detection method based on computer vision is adopted, including dataset acquisition and enhancement, YOLOv8 object detection network training, image preprocessing, and steel bar position and size calculation. The model is optimized by adding a rib suppression loss function, and automatic detection is achieved by combining camera distortion correction and high-resolution camera.
It achieves efficient and accurate rebar detection, improving detection efficiency, increasing accuracy, and achieving a high degree of automation. The measurement error is controlled within ±1 mm to ±5 mm, and the relative error is within 1% to 3%.
Smart Images

Figure CN120070316B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of concealed works quality inspection technology, and in particular to an automatic inspection method for the quality of reinforcing steel bars in concealed works based on computer vision technology. Background Technology
[0002] The acceptance of concealed works is of great significance in engineering projects. As a crucial component of concealed works, the compliance of reinforcing steel bars with specifications can affect the quality of components and even the safety and stability of the engineering structure. Therefore, during construction, it is essential to ensure that the specifications, quantity, and location of the reinforcing steel bars meet design requirements to avoid potential structural risks.
[0003] The acceptance criteria for reinforcing bars mainly include the spacing, quantity, diameter, and anchorage length. Currently, traditional acceptance methods rely on manual assistance and simple measuring equipment (measuring tape, vernier calipers) to test various indicators of the reinforcing bars, which suffers from low efficiency and poor accuracy.
[0004] With the rapid development of deep learning technology, it has been widely used in the fields of computer vision and image recognition. However, in the current field of rebar inspection, the application and development of computer vision technology is still in its early stages. There are still problems such as insufficient model generalization ability and the inability to achieve real-time detection in actual operation. Summary of the Invention
[0005] In order to overcome the above-mentioned problems in the existing technology, the present invention proposes an automatic detection method for the quality of steel reinforcement in concealed engineering based on computer vision technology.
[0006] The technical solution adopted by this invention to solve its technical problem is: an automatic detection method for the quality of reinforcing steel bars in concealed engineering projects based on computer vision technology, comprising the following steps:
[0007] Step 1: Collect images of steel bars with different rib shapes and sizes, perform data augmentation on the collected images, and annotate the rib areas and the location and size of the steel bar center area on the processed images to obtain the tied steel bar dataset.
[0008] Step 2: Use the dataset obtained in Step 1 to train the YOLOv8 object detection network to obtain an object detection model;
[0009] Step 3: Input the preprocessed image to be detected into the target detection model obtained in Step 2 for target recognition, and obtain the quantity and location information of all steel bars in the image;
[0010] Step 4: Extract the outline based on the rebar location information obtained in Step 3, and perform size calculation using the size calculation algorithm;
[0011] Step 5: Compare the dimensions obtained in Step 4 and the quantity of steel bars obtained in Step 3 with the steel bar specifications specified in the design documents to determine whether the index error meets the acceptance standards.
[0012] In step 2, when training the YOLOv8 object detection network, a rib suppression loss function is added to adjust the YOLOv8 loss function and reduce the impact of the rib region on model training.
[0013] The above-mentioned automatic detection method for the quality of hidden engineering steel bars based on computer vision technology, the size calculation in step 4 is specifically as follows: perform distortion correction on the camera, select a segment of object with known size, calculate the conversion ratio between pixels and actual size, and the diameter of the steel bar is the product of the bounding box width and the conversion ratio between pixels and actual size.
[0014] The aforementioned automatic detection method for the quality of concealed engineering rebar based on computer vision technology includes the following camera distortion correction process: preparing a standard checkerboard pattern, wherein the size of each small square is known and used as a calibration benchmark; acquiring checkerboard images from different angles and positions, with the corner points of the checkerboard distributed in different positions and directions in each image; using the findChessboardCorners function in the OpenCV library to detect the corner points of the checkerboard in each image; and using the calibrateCamera function to calculate the camera's internal and external parameters.
[0015] The above-mentioned automatic detection method for the quality of hidden engineering steel bars based on computer vision technology includes, but is not limited to, rotation, scaling, flipping, cropping, translation, and color transformation in step 1.
[0016] In the above-mentioned automatic detection method for the quality of hidden engineering steel bars based on computer vision technology, step 1 uses the labelme tool to mark the minimum bounding rectangle of each steel bar on the image, and marks the corresponding position information and size information.
[0017] The aforementioned automatic detection method for the quality of reinforcing steel bars in concealed engineering projects based on computer vision technology uses the YOLOv8 target detection network loss function as follows:
[0018] ;
[0019] in, For the total loss, These are the values of the weighted graph; To determine the weights of the loss, The weights for the classification loss; To pinpoint the loss, Cross-entropy loss; It is the predicted bounding box. It's a real border; It is the predicted category. It is a real category.
[0020] The beneficial effects of the present invention are: (1) The present invention proposes a steel bar acceptance technology that utilizes computer vision. This technology is characterized by low cost, high precision, high efficiency and automation, and represents a new method in the field of steel bar acceptance.
[0021] (2) The detection efficiency of the present invention is significantly improved. Compared with traditional manual measurement, it usually takes 10 to 30 seconds to measure the size of a steel bar manually using tools such as calipers and measuring tapes, while the present invention can complete the size measurement of a steel bar in only 16 to 50 milliseconds. In addition, the traditional method requires measurement one steel bar at a time, while the present invention can achieve simultaneous measurement of multiple steel bars.
[0022] (3) The detection accuracy of the present invention is significantly improved. Traditional manual measurement is often subject to large deviations due to subjective factors and objective factors of the instrument. The patented technology uses a high-resolution camera, accurate sample data annotation, and camera distortion correction to control the measurement error within the range of ±1 mm to ±5 mm, with a relative error of 1% to 3%, which greatly improves the measurement accuracy.
[0023] (4) The present invention has a high degree of automation. Traditional manual inspection requires inspectors to manually record the position, size and quantity of each steel bar, which is time-consuming and prone to errors. The patented technology realizes the complete automation of steel bar index measurement. The computer automatically identifies the position of the steel bar, automatically assigns a boundary box to each steel bar, and accurately measures its diameter and length without manual intervention. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of the process of this invention;
[0025] Figure 2 This is a flowchart of the acceptance personnel's workflow in an embodiment of the present invention;
[0026] Figure 3 This is a flowchart of the model training process in an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of size calculation in an embodiment of the present invention;
[0028] Figure 5 This is a schematic diagram of the server system before and after the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] This invention discloses an automatic detection method for the quality of reinforcing steel bars in concealed engineering projects based on computer vision technology. The specific steps are as follows: Figure 1 As shown, it includes the following steps:
[0031] Step 1: Collect images of steel bars with different rib shapes and sizes, perform data augmentation on the collected images, and annotate the rib areas and the location and size of the steel bar center area on the processed images to obtain a dataset of tied steel bars.
[0032] Step 2: Use the dataset obtained in Step 1 to train the YOLOv8 object detection network to obtain an object detection model.
[0033] When training the YOLOv8 object detection network, a rib suppression loss function is added, and the YOLOv8 loss function is adjusted to reduce the impact of the rib region on model training.
[0034] Step 3: Input the preprocessed image to be detected into the target detection model obtained in Step 2 for target recognition, and obtain the quantity and location information of all steel bars in the image.
[0035] Step 4: Extract the outline based on the rebar location information obtained in Step 3, and perform size calculation using the size calculation algorithm.
[0036] Step 5: Compare the dimensions obtained in Step 4 and the quantity of steel bars obtained in Step 3 with the steel bar specifications specified in the design documents to determine whether the index error meets the acceptance standards.
[0037] Based on the above detection methods, the following preparatory work is required when conducting automatic detection of rebar quality:
[0038] I. Technical Preparations:
[0039] The specific process is as follows: Figure 2 As shown, the acceptance personnel first equipped themselves with a high-resolution industrial-grade network camera (IP camera) and established a real-time data transmission channel between the camera and the computer.
[0040] The specific steps for establishing a transmission channel between the camera and the computer are described below:
[0041] (1) Camera network access: First, connect the IP camera to the local area network or Wi-Fi network via physical connection or wireless means to ensure that the camera is successfully connected and obtains a valid IP address in order to achieve network communication.
[0042] (2) Configure the IP address to OpenCV: Then, configure the video IP address of the camera to the OpenCV program so that OpenCV can identify and receive the video stream data transmitted by the camera through the IP address.
[0043] The inspection personnel fixed cameras in the inspection area to capture images of the tied rebar, either handheld or fixed. Through an established transmission channel, the backend server was able to receive the captured image data in real time.
[0044] The backend server processes the collected data. After receiving the processed information from the backend, the frontend server marks the minimum bounding rectangle of each rebar on the original image of the tied rebars, and adds corresponding position and size information to the side. The processed result image is finally displayed on the frontend monitor.
[0045] The acceptance personnel will compare the measurement results of the steel reinforcement indicators displayed on the front-end monitor with the steel reinforcement specifications specified in the design documents in detail to determine whether the indicator error is within the allowable range of the acceptance standard.
[0046] II. Preparations for training the backend server model:
[0047] First, a dataset specifically designed for the target to be measured (i.e., the target rebar) is constructed, which includes three parts: a training set, a test set, and a validation set. Then, this dataset is used to train the target rebar on a single dataset to build a YOLOv8 target detection network with strong generalization capabilities.
[0048] The specific steps for training a high-intensity target detection network are as follows: Figure 3 As shown, the explanation is as follows:
[0049] (1) First, the collected images of reinforcing bars are subjected to systematic data augmentation processing, including but not limited to rotation, scaling, flipping, cropping, translation, and color transformation, to expand the dataset, aiming to improve the generalization ability of the model and simulate the performance of ribbed reinforcing bars at different positions and angles, so as to help the model better adapt to the morphological changes of reinforcing bars. This ensures that the model can maintain good detection performance in diverse environments and eliminates the influence of reinforcing bar ribs on measurement errors.
[0050] (2) Next, the labelme tool is used to accurately annotate the pre-prepared steel bar images to ensure that the position and size of each steel bar and the rib area are accurately recorded.
[0051] (3) Then, the annotation files corresponding to the images of the training set, test set and validation set are summarized and integrated into a standardized annotation file to facilitate subsequent processing and analysis.
[0052] (4) Finally, the program is executed in the PyCharm integrated development environment to convert all the JSON format annotation files into txt format so that the training process can proceed smoothly.
[0053] (5) Add a rib suppression loss function. By adjusting the YOLOv8 loss function, the influence of the rib region on model training is reduced. Finally, the improved YOLOv8 model is used for training.
[0054] The specific process of adding a rib suppression loss function and adjusting the YOLOv8 loss function is as follows:
[0055] 1) Data preparation and rib mask generation
[0056] Mask generation: The rib mask is generated using a manual annotation method;
[0057] Rib region labeling: Mark the center region and rib region of the rebar binary mask. This creates a weighted map, setting the weight of the center region to 1.0 and the weight of the rib region to 0.2.
[0058] Specifically, this is represented as: In the center region of the reinforcing bars: weight_map = 1.0;
[0059] Reinforcing rib region: weight_map = 0.2.
[0060] 2) Design the rib suppression loss function
[0061] `weight_map` is a weight map for each pixel or region, where the weight of the center region of the rebar is set to 1.0, and the weight of the rebar rib region is set to 0.2. In the YOLOv8 loss function, rib suppression is added through a weighted loss term, that is, this weight map is used to adjust the regular loss function (including localization loss and classification loss).
[0062] 3) Integrate into YOLOv8 model training (using the rib suppression loss function)
[0063] In the YOLOv8 training code, modify yolo_loss() to add the rib suppression loss function.
[0064] During the training loop, the weight map (weight_map) is passed in, and the weighted loss is calculated.
[0065] The adjusted loss function is:
[0066] ;
[0067] in, For the total loss, These are the values in the weighted graph. The rib area has a smaller weight (0.2), while the target area (the center area of the rebar) has a larger weight (1). To determine the weights of the loss, The weights are used for the classification loss. To pinpoint the loss, This represents the cross-entropy loss. It is the predicted bounding box. It's a real border. It is the predicted category. It is a real category.
[0068] The backend server receives the rebar images transmitted from the frontend and inputs them into a well-trained YOLOv8 detection network for target recognition. This process accurately identifies all rebar targets in the image and obtains information on their location and quantity.
[0069] The outline of the reinforcing bars is extracted based on their location information, and relevant dimensions are measured using a dimensional calculation algorithm. The detection results and dimensional calculation results are then transmitted back to the front-end server via the network for subsequent display and comparison.
[0070] To ensure high accuracy in dimensional measurements, the following dimensional calculation steps are implemented (e.g. Figure 4 (as shown)
[0071] First, distortion correction is performed on the camera to ensure measurement accuracy. The specific calibration procedure is as follows:
[0072] (1) Carefully prepare a standard checkerboard pattern, in which the size of each small square is known, as the benchmark for calibration.
[0073] (2) Take ten chessboard images from multiple angles and positions to ensure that the corner points of the chessboard in each image are distributed in different positions and directions, so as to facilitate subsequent calibration calculations.
[0074] (3) Use the findChessboardCorners function in the OpenCV library to accurately detect the corner points of the chessboard in each image.
[0075] (4) Use the calibrateCamera function to calculate the camera’s internal and external parameters.
[0076] (5) Correct the camera distortion based on the calibration results.
[0077] (6) After distortion correction is completed, select a segment of an object with known size, and then calculate the conversion ratio between pixels and actual size.
[0078] (7) After obtaining the conversion ratio, the diameter of the steel bar can be calculated according to the following formula: steel bar diameter (mm) = bounding box width (pixels) × pixel to millimeter ratio.
[0079] III. Verification of the feasibility of the method.
[0080] A batch of steel bars with a diameter of 20 mm were selected and prepared, and the binding operation was carried out in strict accordance with industry standards. At the same time, a high-definition camera was set up to capture and collect detailed images of the steel bars.
[0081] The backend server uses a high-efficiency YOLOv8 detection network to identify the target in the image. The results show an average accuracy of over 60% at map@0.5 and an average accuracy of over 40% at map@0.75, demonstrating that the model has high detection accuracy and reliability.
[0082] Operators read the detection data output by the back-end server on the front-end display device and compare it with the actual size of 20 mm. The error range is between 1% and 3%, thus confirming the practical feasibility of this patented technology.
[0083] Based on the above detection method, the detection system in this embodiment includes a front-end device and a back-end server, such as... Figure 5 As shown, the front-end device includes a camera and a computer. The computer includes a controller, a display screen, a keyboard, and a mouse. The back-end server is used to process the images captured by the front-end device and perform contour extraction and size calculation. The camera captures images and transmits them to the back-end server through a data transmission channel. The back-end server processes the captured images. The computer receives the processed information from the back-end server, marks the minimum bounding rectangle of each rebar on the original image, marks the corresponding position and size information on the side, and displays the processing results on the display screen.
[0084] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within its scope and spirit, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of the present invention.
Claims
1. An automatic inspection method for the quality of reinforcing steel bars in concealed engineering projects based on computer vision technology, characterized in that, Includes the following steps: Step 1: Collect images of steel bars with different rib shapes and sizes, perform data augmentation on the collected images, and annotate the rib areas and the position and size of the steel bar center area on the processed images to obtain the tied steel bar dataset. Step 2: Use the dataset obtained in Step 1 to train the YOLOv8 object detection network to obtain an object detection model; Step 3: Input the preprocessed image to be detected into the target detection model obtained in Step 2 for target recognition, and obtain the quantity and location information of all steel bars in the image; Step 4: Extract the outline based on the rebar location information obtained in Step 3, and perform size calculation using the size calculation algorithm; Step 5: Compare the dimensions obtained in Step 4 and the quantity of steel bars obtained in Step 3 with the steel bar specifications specified in the design documents to determine whether the index error meets the acceptance standards. In step 2, when training the YOLOv8 object detection network, a rib suppression loss function is added to adjust the YOLOv8 loss function and reduce the impact of the rib region on model training. The loss function of the YOLOv8 object detection network is: in, For the total loss, These are the values of the weighted graph; To determine the weights of the loss, The weights for the classification loss; To pinpoint the loss, Cross-entropy loss; It is the predicted bounding box. It's a real border; It is the predicted category. It is a real category.
2. The automatic inspection method for the quality of concealed engineering reinforcement based on computer vision technology according to claim 1, characterized in that, The size calculation in step 4 specifically involves: performing distortion correction on the camera, selecting an object with known size, calculating the conversion ratio between pixels and actual size, and the diameter of the reinforcing bar being the product of the bounding box width and the conversion ratio between pixels and actual size.
3. The automatic inspection method for the quality of concealed engineering reinforcement based on computer vision technology according to claim 2, characterized in that, The camera distortion correction process includes: preparing a standard checkerboard pattern, where the size of each small square is known and used as a calibration reference; acquiring checkerboard images from different angles and positions, with the corner points of the checkerboard distributed in different positions and directions in each image; using the findChessboardCorners function in the OpenCV library to detect the corner points of the checkerboard in each image; and using the calibrateCamera function to calculate the camera's internal and external parameters.
4. The automatic inspection method for the quality of concealed engineering reinforcement based on computer vision technology according to claim 1, characterized in that, The data augmentation process in step 1 includes, but is not limited to, rotation, scaling, flipping, cropping, translation, and color transformation.
5. The automatic inspection method for the quality of concealed engineering reinforcement based on computer vision technology according to claim 1, characterized in that, In step 1, the labelme tool is used to mark the minimum bounding rectangle of each steel bar on the image, and to mark the corresponding position and size information.
Citation Information
Patent Citations
Multi-target detection method and system adaptive to multi-band image
CN112070111A
Go map reliable identification method capable of overcoming light reflection phenomenon
CN113298767A