Methods and apparatus for testing the quality of rebar tying
By combining global dynamic convolutional layers, image inpainting layers, and feature pyramid networks, the accuracy and robustness of the rebar tying quality detection model are improved, solving the problems of missed detection and false detection in small target detection, and achieving efficient and accurate rebar tying quality detection.
Patent Information
- Application Number
- CN202411577478.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-11-06
AI Technical Summary
Existing target detection algorithms are weak in detecting small targets in rebar tying images, and are prone to missed detections and false detections, resulting in low reliability of rebar tying quality detection.
A method for detecting the quality of rebar tying is proposed. The model is trained using multiple sets of training data. The initial rebar tying image is processed through a global dynamic convolutional layer, an image restoration layer, and a feature pyramid network. The head detection layer is then used for detection to improve the ability to identify small targets.
It improves the accuracy and robustness of rebar tying quality inspection, reduces the number of model parameters and computational load, and meets the requirements of lightweight design and high real-time performance.
Smart Images

Figure CN119648629B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and deep learning, and more specifically, to a method and apparatus for detecting the quality of rebar tying. Background Technology
[0002] Reinforcing bar tying is a crucial construction technique in building and civil engineering. It involves connecting pre-cut reinforcing bars according to design drawings and project requirements using tying tools and tying lines to ensure a tight bond. This process aims to guarantee the overall strength and stability of the concrete structure. The quality of reinforcing bar tying directly affects the safety and durability of the concrete structure. Inspecting the quality of reinforcing bar tying helps construction workers check and adjust the tying process, ensuring secure binding, good connections, improved seismic resistance and load-bearing capacity of the overall structure, and compliance with design and construction standards.
[0003] However, the target detection algorithms currently used in rebar tying inspection have relatively low accuracy in locating targets in rebar tying images. Due to the blurred details at the rebar tying points, directly using existing detection models results in a single grid prediction box that cannot accurately capture the target's position, leading to significant positioning errors.
[0004] Furthermore, images of rebar tying involve various small-scale targets, such as thin rebars. Existing target detection algorithms are relatively weak in detecting small targets, and are prone to missed detections and false detections.
[0005] In addition, reinforcing bars usually need to be tied in multiple layers, and the binding points may be obscured by other objects or structures, causing some binding points to go undetected.
[0006] The target detection algorithms used in rebar tying in the aforementioned related technologies have weak performance in detecting small targets, are prone to missed detections and false detections, and have low reliability. No effective solution has been proposed yet. Summary of the Invention
[0007] This invention provides a method and apparatus for detecting the quality of rebar tying, which at least solves the technical problem in related technologies that the target detection algorithm used in rebar tying has weak performance in detecting small targets, is prone to missed detection and false detection, and has low reliability.
[0008] According to one aspect of the present invention, a method for detecting the quality of rebar tying is provided, comprising: acquiring an initial rebar tying image of a target rebar, wherein the target rebar is a rebar for which rebar tying quality detection is required; inputting the initial rebar tying image into a rebar tying quality detection model, and processing the initial rebar tying image using a first convolutional layer in the rebar tying quality detection model to obtain a first channel feature map of the initial rebar tying image, wherein the rebar tying quality detection model is a model obtained by machine learning training using multiple sets of training data, each set of training data including a sample rebar tying image and a sample detection result corresponding to the sample rebar tying image; and processing the initial rebar tying image using a first convolutional layer in the rebar tying quality detection model. The first channel feature map is processed by a global dynamic convolutional layer to obtain a second channel feature map, and the second channel feature map is processed by an image restoration layer to obtain a third channel feature map. The image restoration layer includes a partial convolutional-coordinate attention model. In the rebar tying quality detection model, the first channel feature map, the second channel feature map, and the third channel feature map are fused using a feature pyramid network to obtain a fourth channel feature map, a fifth channel feature map, and a sixth channel feature map. In the rebar tying quality detection model, the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map are detected using a head detection layer to obtain a detection result. The tying quality data of the target rebar is obtained based on the detection result output by the rebar tying quality detection model.
[0009] Optionally, the sample rebar binding images include: images of bound rebars, images of unbound rebars, and images of incorrectly bound rebars with substandard binding quality; each of the sample rebar binding images is annotated with a rebar binding point using an annotation tool, and the annotation information of the annotation tool includes: the accurate location of the rebar binding point.
[0010] Optionally, before inputting the initial rebar binding image into the rebar binding quality detection model, the rebar binding quality detection method further includes: performing a preprocessing operation on the initial rebar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
[0011] Optionally, in the rebar binding quality inspection model, the first channel feature map is processed using a global dynamic convolutional layer to obtain a second channel feature map, including: processing the seventh channel feature map using a second convolutional layer to obtain a first channel feature map, wherein the seventh channel feature map is used to generate the first channel feature map; inputting the first channel feature map into the global dynamic convolutional layer to perform convolution processing on the first channel feature map using the global dynamic convolutional layer to obtain a second channel feature map; segmenting the second channel feature map along the channel dimension using the global dynamic convolutional layer to obtain multiple second channel feature maps; processing a portion of the multiple second channel feature maps to obtain a second third channel feature map; concatenating the second third channel feature map with the multiple second channel feature maps to obtain a second fourth channel feature map; processing the second fourth channel feature map to obtain a second fifth channel feature map; performing convolution processing on the second fifth channel feature map to obtain a second sixth channel feature map; and inputting the second sixth channel feature map into an attention mechanism layer for processing to obtain the second channel feature map.
[0012] Optionally, the second channel feature map is processed using an image restoration layer to obtain a third channel feature map, including: in the rebar binding quality inspection model, the second channel feature map is convolved using a third convolutional layer to obtain a third first channel feature map, and the third second channel feature map corresponding to the third first channel feature map is output using the global dynamic convolutional layer; the third second channel feature map is convolved using the image restoration layer to obtain a third third channel feature map; the third third channel feature map is pooled sequentially using multiple pooling layers to obtain pooling results; after each pooling process in the multiple pooling layers, the third third channel feature map is concatenated with the pooling results to obtain a third fourth channel feature map; the third fourth channel feature map is input into an attention mechanism layer for processing to obtain a third fifth channel feature map; and the third fifth channel feature map is convolved to obtain the third channel feature map.
[0013] Optionally, in the rebar binding quality inspection model, a feature pyramid network is used to fuse the first channel feature map, the second channel feature map, and the third channel feature map to obtain a fourth channel feature map, a fifth channel feature map, and a sixth channel feature map. This includes: fusing and upsampling the first channel feature map with the second channel feature map and the third channel feature map to obtain the fourth channel feature map; fusing and upsampling the second channel feature map with the first channel feature map and the third channel feature map to obtain the fifth channel feature map; and fusing and upsampling the third channel feature map with the first channel feature map and the second channel feature map to obtain the sixth channel feature map.
[0014] Optionally, in the rebar tying quality inspection model, the head detection layer is used to inspect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the inspection result. This includes: inputting the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map into the head detection layer to perform bounding box prediction on the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map using the head detection layer, obtaining the bounding box information of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, wherein the bounding box information includes: bounding box coordinates and bounding box confidence; selecting target bounding boxes whose bounding box confidence is higher than the confidence threshold based on the relationship between the bounding box confidence and the confidence threshold in the bounding box information; determining the tying status corresponding to the tying points in the target bounding box, wherein the tying status includes: tying point position, tying point missing position, and tying quality of the tying points; and outputting the tying status in the tying result display image to obtain the inspection result.
[0015] Optionally, the loss function of the rebar tying quality inspection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD α represents the weighting ratio of WIOU, which is obtained using the following formula: L WIOU The formula for calculating WIOU, L IOU The intersection-over-union (IoU) loss represents the ratio of the predicted bounding box to the ground truth bounding box, where x and y represent the horizontal and vertical positions of the bounding box's center point in the rebar binding image. t ,y t The horizontal and vertical positions of the center point of the true bounding box in the rebar binding image are represented by w. c ,h cLet represent the width and height of the minimum bounding rectangle between the predicted bounding box and the true bounding box, and exp represent the accuracy of the anchor frame in the rebar tying image; NWD is obtained by the following formula: C represents the number of categories in the dataset, W2 2 (N a N b ) is the definition of second-order distance, N a and N b These represent bounding box A = (cx) a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b The distribution is modeled as a Gaussian distribution, where c is a scaling factor used to adjust the scale of the center point coordinates, and x... a y a w a h a The x-coordinate of the center, the y-coordinate of the center, the width, and the height of the bounding box A are respectively given. b y b w b h b These are the center x-coordinate, center y-coordinate, width, and height of the bounding box B, respectively. F This indicates the predefined norm.
[0016] According to another aspect of the present invention, a device for detecting the quality of rebar tying is also provided, comprising: a first acquisition module, configured to acquire an initial rebar tying image of a target rebar, wherein the target rebar is a rebar for which rebar tying quality detection is required; a first processing module, configured to input the initial rebar tying image into a rebar tying quality detection model, and to process the initial rebar tying image using a first convolutional layer in the rebar tying quality detection model to obtain a first channel feature map of the initial rebar tying image, wherein the rebar tying quality detection model is a model obtained by machine learning training using multiple sets of training data, each set of the multiple sets of training data including a sample rebar tying image and a sample detection result corresponding to the sample rebar tying image; and a second processing module, configured to... The rebar tying quality detection model employs a global dynamic convolutional layer to process the first channel feature map to obtain a second channel feature map, and an image restoration layer to process the second channel feature map to obtain a third channel feature map. The image restoration layer includes a partial convolutional-coordinate attention model. A fusion module is used to fuse the first, second, and third channel feature maps using a feature pyramid network to obtain fourth, fifth, and sixth channel feature maps. A detection module is used to detect the fourth, fifth, and sixth channel feature maps using a head detection layer to obtain detection results. A second acquisition module is used to obtain the tying quality data of the target rebar based on the detection results output by the rebar tying quality detection model.
[0017] Optionally, the sample rebar binding images include: images of bound rebars, images of unbound rebars, and images of incorrectly bound rebars with substandard binding quality; the dataset annotation uses an annotation tool to annotate the rebar binding points in each of the sample rebar binding images, and the annotation information of the annotation tool includes: the accurate location of the rebar binding points.
[0018] Optionally, before the first processing module, the rebar binding quality detection device further includes: a preprocessing unit for performing preprocessing operations on the initial rebar binding image, wherein the preprocessing operations include: image size adjustment and image pixel enhancement.
[0019] Optionally, the second processing module includes: a first processing unit, configured to process the seventh channel feature map using a second convolutional layer in the rebar binding quality inspection model to obtain a first channel feature map, wherein the seventh channel feature map is used to generate the first channel feature map; a second processing unit, configured to input the first channel feature map into the global dynamic convolutional layer to perform convolution processing on the first channel feature map using the global dynamic convolutional layer to obtain a second channel feature map; and a third processing unit, configured to segment the second channel feature map along the channel dimension using the global dynamic convolutional layer to obtain... The system obtains multiple second-channel feature maps, processes portions of these second-channel feature maps to obtain second-third-channel feature maps; a concatenation unit concatenates the second-third-channel feature maps with the multiple second-channel feature maps to obtain a second-fourth-channel feature map; a fourth processing unit processes the second-fourth-channel feature map to obtain a second-fifth-channel feature map; a fifth processing unit performs convolution processing on the second-fifth-channel feature map to obtain a second-sixth-channel feature map; and a sixth processing unit inputs the second-sixth-channel feature map into the attention mechanism layer for processing to obtain the second-channel feature map.
[0020] Optionally, the second processing module includes: a seventh processing unit, configured to perform convolution processing on the second channel feature map using a third convolution layer in the rebar binding quality inspection model to obtain a third first channel feature map, and to output the third second channel feature map corresponding to the third first channel feature map using the global dynamic convolution layer; an eighth processing unit, configured to perform convolution processing on the third second channel feature map using the image restoration layer to obtain a third third channel feature map; a ninth processing unit, configured to perform pooling processing on the third third channel feature map sequentially using multiple pooling layers to obtain pooling processing results; a stitching unit, configured to stitch the third third channel feature map with the pooling processing results after each of the multiple pooling layers has completed pooling processing to obtain a third fourth channel feature map; a tenth processing unit, configured to input the third fourth channel feature map into the attention mechanism layer for processing to obtain a third fifth channel feature map; and an eleventh processing unit, configured to perform convolution processing on the third fifth channel feature map to obtain the third channel feature map.
[0021] Optionally, the fusion module includes: a twelfth processing unit, configured to fuse and upsample the first channel feature map with the second channel feature map and the third channel feature map to obtain the fourth channel feature map; a thirteenth processing unit, configured to fuse and upsample the second channel feature map with the first channel feature map and the third channel feature map to obtain the fifth channel feature map; and a fourteenth processing unit, configured to fuse and upsample the third channel feature map with the first channel feature map and the second channel feature map to obtain the sixth channel feature map.
[0022] Optionally, the detection module includes: a prediction unit, configured to input the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map into the head detection layer, so as to use the head detection layer to predict the bounding boxes of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the bounding box information of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, wherein the bounding box information includes: bounding box coordinates and bounding box confidence; a selection unit, configured to select target bounding boxes whose bounding box confidence is higher than the confidence threshold according to the relationship between the bounding box confidence and the confidence threshold in the bounding box information; a first determination unit, configured to determine the binding state corresponding to the binding points in the target bounding box, wherein the binding state includes: binding point position, binding point missing position, and binding quality of the bounding points; and an output unit, configured to output the binding state in the binding result display image to obtain the detection result.
[0023] Optionally, the loss function of the rebar tying quality inspection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD α represents the weighting ratio of WIOU, which is obtained using the following formula: L WIOU The formula for calculating WIOU, L IOU The intersection-union loss (NWD) represents the cross-union ratio (CUD) between the predicted bounding box and the ground truth bounding box. x and y represent the horizontal and vertical positions of the center point of the bounding box in the rebar binding image, xt and yt represent the horizontal and vertical positions of the center point of the ground truth bounding box in the rebar binding image, wc and hc represent the width and height of the minimum bounding rectangle of the predicted and ground truth bounding boxes, and exp represents the accuracy of the anchor frame in the rebar binding image. The NWD is obtained using the following formula: C represents the number of categories in the dataset, W2 2 (N a N b ) is the definition of second-order distance, N aand N b These represent bounding box A = (cx) a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b The distribution is modeled as a Gaussian distribution, where c is a scaling factor used to adjust the scale of the center point coordinates, and x... a y a w a h a The x-coordinate of the center, the y-coordinate of the center, the width, and the height of the bounding box A are respectively given. b y b w b h b These are the center x-coordinate, center y-coordinate, width, and height of the bounding box B, respectively. F This indicates the predefined norm.
[0024] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program executes the method for detecting the quality of rebar tying as described in any one of the above embodiments.
[0025] According to another aspect of the present invention, a processor is also provided, the processor being configured to run a program, wherein the program, when running, executes the method for detecting the quality of rebar tying as described in any of the above embodiments.
[0026] According to another aspect of the present invention, a computer program product is also provided, including computer instructions, which, when executed by a processor, perform the method for detecting the quality of rebar tying as described above.
[0027] In this embodiment of the invention, an initial rebar binding image of the target rebar is obtained, wherein the target rebar is the rebar for which rebar binding quality inspection is required; the initial rebar binding image is input into a rebar binding quality inspection model, and the initial rebar binding image is processed using the first convolutional layer of the rebar binding quality inspection model to obtain a first channel feature map of the initial rebar binding image; wherein the rebar binding quality inspection model is a model obtained by machine learning training using multiple sets of training data, each set of training data including sample rebar binding images and sample detection results corresponding to the sample rebar binding images; in the rebar binding quality inspection model, a global dynamic convolutional layer is used to process the initial rebar binding image. The first channel feature map is processed to obtain the second channel feature map, and the second channel feature map is then processed using an image restoration layer to obtain the third channel feature map. The image restoration layer includes a partial convolutional-coordinate attention model. In the rebar tying quality detection model, a feature pyramid network is used to fuse the first, second, and third channel feature maps to obtain the fourth, fifth, and sixth channel feature maps. The head detection layer in the rebar tying quality detection model then performs detection on the fourth, fifth, and sixth channel feature maps to obtain the detection results. Based on the detection results output by the rebar tying quality detection model, the tying quality data of the target rebar is obtained. The technical solution provided by this invention achieves the goal of improving the discriminative power of the network in detecting rebar images. This is because the network focuses more on dense and homogeneous small-sized objects and regions that contribute significantly to classification or localization, thus enabling the model to efficiently identify and accurately locate rebar binding points in complex environments. This improves the accuracy and robustness of the rebar binding quality detection model, reduces the number of model parameters and computational load, and meets the requirements of lightweight and high real-time performance for rebar binding quality detection tasks. Furthermore, it solves the technical problems of weak performance, frequent false negatives and missed detections, and low reliability of target detection algorithms used in rebar binding in related technologies. Attached Figure Description
[0028] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0029] Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of detecting the quality of rebar tying according to an embodiment of the present invention.
[0030] Figure 2 This is a flowchart of a method for detecting the quality of rebar tying according to an embodiment of the present invention;
[0031] Figure 3 This is a structural diagram of the PGCA algorithm according to an embodiment of the present invention;
[0032] Figure 4 This is a structural diagram of the global dynamic convolution module according to an embodiment of the present invention;
[0033] Figure 5 This is a structural diagram of a partial convolutional-coordinate attention module according to an embodiment of the present invention;
[0034] Figure 6 This is a flowchart of an optional method for detecting the quality of rebar tying according to an embodiment of the present invention;
[0035] Figure 7 This is a schematic diagram of the image detection results of rebar tying according to an embodiment of the present invention;
[0036] Figure 8 This is a schematic diagram of a device for detecting the quality of rebar tying according to an embodiment of the present invention. Detailed Implementation
[0037] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0038] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0039] As described in the background section, the target detection algorithms used in rebar tying in related technologies have weak performance in detecting small targets, are prone to missed detections and false detections, and have low reliability. To address these shortcomings, embodiments of the present invention provide a method and apparatus for detecting the quality of rebar tying, a computer-readable storage medium, a processor, and a computer program product.
[0040] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0041] The methods and embodiments provided in this invention can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of detecting the quality of rebar tying according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0042] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method for detecting the quality of rebar tying in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] According to an embodiment of the present invention, a method embodiment for detecting the quality of rebar tying is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0044] Figure 2 This is a flowchart of a method for detecting the quality of rebar tying according to an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes the following steps:
[0045] Step S202: Obtain the initial rebar binding image of the target rebar, wherein the target rebar is the rebar that needs to be inspected for rebar binding quality.
[0046] Optionally, the target reinforcing bars may include: tied reinforcing bars, untied reinforcing bars, and reinforcing bars with insufficient tying quality.
[0047] Optionally, the initial rebar binding image may include: images of bound rebars, images of unbound rebars, and images of incorrectly bound rebars with substandard binding quality. Additionally, it may include: images of irrelevant rebar binding points, incorrect rebar binding methods, and partially obscured images of irrelevant building components.
[0048] It should be noted that the above-mentioned erroneous images are created by simulating a certain number of negative samples to balance the number of positive and negative samples and increase the accuracy of the model in identifying the quality of rebar tying.
[0049] In this embodiment, initial rebar binding images of the target rebar can be obtained, ensuring that the collected images cover different rebar binding states, thus ensuring the diversity and representativeness of the data.
[0050] Step S204: Input the initial rebar binding image into the rebar binding quality detection model, so as to process the initial rebar binding image using the first convolutional layer in the rebar binding quality detection model to obtain the first channel feature map of the initial rebar binding image. The rebar binding quality detection model is a model trained by machine learning using multiple sets of training data. Each set of training data includes a sample rebar binding image and the sample detection result corresponding to the sample rebar binding image.
[0051] In this embodiment, the initial rebar binding image can be input into the rebar binding quality inspection model. The initial rebar binding image is then processed using the first convolutional layer in the rebar binding quality inspection model to obtain the first channel feature map of the initial rebar binding image, providing a more useful feature representation for subsequent rebar binding quality inspection.
[0052] It should be noted that the first convolutional layer includes a Conv2D_BN_SiLU module (i.e., a concatenated convolutional layer with a kernel size of 3×3 and a stride of 2, a BN layer, and a SiLU layer) and a PConv-GAMConv module (Partial convolution-Global attention mechanism convolution). Conv2D_BN_SiLU is a common neural network module, typically used in image processing, especially in CNNs (Convolutional Neural Networks). PConv-GAMConv is a convolutional neural network-based module used to process global information in image data. The PConv-GAMConv module acquires highly detailed features in the rebar binding target feature map and enhances global contextual information, thereby strengthening cross-dimensional channel spatial correlation. This allows the model to focus more on the target's own features, reducing reliance on redundant information generated during model iteration, making it more suitable for rebar binding target detection tasks.
[0053] Optionally, the aforementioned convolutional layer Conv2D_BN_SiLU may include: Conv2D (convolutional layer), Batch Normalization (BN for short), and SiLU (i.e., Sigmoid Linear Unit, activation function).
[0054] Figure 3 This is a structural diagram of the PGCA algorithm according to an embodiment of the present invention, as shown below. Figure 3 As shown, the initial input image of the model is the rebar binding image X1 (i.e., the initial rebar binding image). X1 is first passed through the Conv2D_BN_SiLU convolutional layer to obtain the channel feature map X2 of the rebar binding image. X2 is then passed through the Conv2D_BN_SiLU convolutional layer module to continue the dimensionality reduction operation to obtain the channel feature map X3 (i.e., the seventh channel feature map in the following text). X3 is then passed through the PConv-GAMConv module to output the feature map X4 (i.e., the first channel feature map).
[0055] Step S206: In the rebar binding quality inspection model, the first channel feature map is processed by a global dynamic convolutional layer to obtain the second channel feature map, and the second channel feature map is processed by an image restoration layer to obtain the third channel feature map. The image restoration layer includes a partial convolutional-coordinate attention model.
[0056] Optionally, the global dynamic convolutional layer includes the Conv2d_BN_SiLU module and PConv-GAMConv (i.e., the global dynamic convolution module) for dimensionality reduction operations, and the image inpainting layer includes the Conv2d_BN_SiLU module, PConv-GAMConv, and PConv-SPPF-CA (Partial convolution–SPPF-CoordAttention) module for dimensionality reduction operations.
[0057] It should be noted that PConv-SPPF-CA is a module that combines partial convolution, spatial pyramid pooling, and coordinate attention. It can better handle occluded regions, capture multi-scale information, and focus on spatial location information in image processing and computer vision tasks, thereby improving the performance and generalization ability of the model.
[0058] In this embodiment, a global dynamic convolutional layer and an image inpainting layer can be used to process the feature map to obtain a third-channel feature map. This allows for the extraction of richer and more accurate feature information, enhancing the model's sensitivity to local features, such as... Figure 3 As shown, feature map X4 (i.e., the first channel feature map) is convolved by the Conv2D_BN_SiLU module to obtain feature map X5. X5 is then convolved by the PConv-GAMConv module to output feature map X6 (i.e., the second channel feature map). Feature map X6 is then convolved by the Conv2D_BN_SiLU module to obtain feature map X7. X7 is then convolved by the PConv-GAMConv module to output feature map X8. X8 is then convolved by the PConv-SPPF-CA module to obtain feature map X9 (i.e., the third channel feature map).
[0059] Step S208: In the rebar binding quality inspection model, the first channel feature map, the second channel feature map, and the third channel feature map are fused using a feature pyramid network to obtain the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map.
[0060] It should be noted that FPN (Feature Pyramid Network) is a deep neural network structure used for object detection and semantic segmentation tasks, which is used to fuse feature maps of different scales.
[0061] In this embodiment, the first channel feature map, the second channel feature map, and the third channel feature map can be fused by FPN to obtain the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map. That is, by fusing the feature maps of different channels, the network can better capture the detailed information and semantic information in the image.
[0062] Step S210: In the rebar binding quality inspection model, the head inspection layer is used to inspect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the inspection results.
[0063] It should be noted that the Head (i.e., the head detection layer) is a deep learning model layer used to detect the presence of a human head in an image or video. It is responsible for directly predicting the object's category, location (including the coordinates of the bounding box), and confidence level of its presence from the feature map.
[0064] Optionally, the above detection results may include: bounding box coordinates, category labels, and confidence scores.
[0065] Among them, bounding box coordinates refer to the position and size information of the rectangular bounding box where the detected target is located, usually represented by the coordinates of the top left and bottom right corners, that is, the position of each binding point; the category label refers to the category to which the target belongs; and the confidence score represents the degree of confidence of the model in the detection result.
[0066] In this embodiment, the fourth, fifth, and sixth channel feature maps can be input into the head detection head of the PGCA model for target detection, such as... Figure 3 As shown, the output is a three-dimensional tensor containing prediction information, with each row corresponding to a prediction.
[0067] Step S212: Obtain the binding quality data of the target rebar based on the detection results output by the rebar binding quality detection model.
[0068] In this embodiment, the binding quality data of the target rebar can be obtained based on the detection results output by the rebar binding quality detection model, thereby evaluating the quality and qualification of the binding work.
[0069] As described above, in this embodiment of the invention, an initial rebar binding image of the target rebar can be obtained, wherein the target rebar is the rebar that needs to be inspected for rebar binding quality; the initial rebar binding image is input into the rebar binding quality inspection model, and the first convolutional layer in the rebar binding quality inspection model is used to process the initial rebar binding image to obtain a first channel feature map of the initial rebar binding image, wherein the rebar binding quality inspection model is a model obtained by machine learning training using multiple sets of training data, each set of training data including sample rebar binding images and sample detection results corresponding to the sample rebar binding images; in the rebar binding quality inspection model, a global dynamic convolutional layer is used to process the first channel feature map to obtain a second channel feature map, and an image restoration layer is used to process the second channel feature map to obtain a third channel feature map, wherein the image restoration layer includes a partial convolutional-coordinate attention model; in the steel In the rebar tying quality inspection model, a feature pyramid network is used to fuse the first, second, and third channel feature maps to obtain the fourth, fifth, and sixth channel feature maps. The head detection layer then uses these feature maps to perform inspections, yielding the inspection results. Based on the inspection results output by the rebar tying quality inspection model, the tying quality data of the target rebar is obtained. This achieves the goal of improving the network's focus on dense and homogeneous small-sized objects and regions that significantly contribute to classification or localization when inspecting rebar images, thus enhancing the discriminative power of features. This enables the model to efficiently identify and accurately locate rebar tying points in complex environments, thereby improving the accuracy and robustness of the rebar tying quality inspection model, reducing the number of model parameters and computational load, and meeting the requirements of lightweight and high real-time performance for rebar tying quality inspection tasks.
[0070] The technical solutions provided by the embodiments of the present invention solve the technical problems in the related art where the target detection algorithm used in rebar tying has weak performance in small target detection, is prone to missed detection and false detection, and has low reliability.
[0071] According to the above embodiments of the present invention, the sample rebar binding images include: images of bound rebars corresponding to bound rebars, images of unbound rebars corresponding to unbound rebars, and images of rebars with substandard binding quality that are incorrectly bound; each of the sample rebar binding images is annotated with a rebar binding point using an annotation tool, and the annotation information of the annotation tool includes: the accurate location of the rebar binding point.
[0072] In this embodiment, a basic rebar binding dataset can be collected (in actual engineering, the rebar binding scene is captured using camera equipment). Based on the collected dataset, a certain number of negative samples are created by simulating irrelevant rebar binding points or incorrect rebar binding methods to balance the number of positive and negative samples. The constructed dataset is then labeled, and a label file is generated for each image.
[0073] Optionally, the dataset may include: sample rebar binding images and corresponding label data for the images.
[0074] Optionally, the above image data may include three categories: tied rebar, untied rebar, and rebar with insufficient tying quality.
[0075] Optionally, the above label data may include three attributes: the exact location of the rebar tying point, the location of the untied point, and the tying quality score of the tied point.
[0076] Optionally, the aforementioned tag file may include: location information of the rebar tying points and their status classification.
[0077] It should be noted that the dataset annotation involves using annotation tools to label the rebar tying points for each acquired image. That is, the tying points are labeled in the extracted rebar tying area, and a quality score is assigned to each tying point. The annotation information includes the exact location of the rebar tying point, using a rectangular box to distinguish different states of the rebar. For the tied rebars, the label file contains a tying quality score, presented in the form of a score, which can be based on visual inspection or other quality assessment standards.
[0078] According to the above embodiments of the present invention, before inputting the initial rebar binding image into the rebar binding quality detection model, the rebar binding quality detection method further includes: performing a preprocessing operation on the initial rebar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
[0079] In this embodiment, before inputting the initial rebar binding image into the rebar binding quality detection model, the initial rebar binding image can be preprocessed to ensure that the image quality is suitable for model training. Then, the dataset is saved, that is, the processed image and the corresponding label file are stored in a unified dataset. The dataset can be divided into training set, validation set and test set according to the proportion for use in different stages of the model.
[0080] Optionally, the above data preprocessing operations may include: image resizing, image enhancement, etc.
[0081] It should be noted that the above data preprocessing operations may include, but are not limited to, the above-mentioned contents, which will not be elaborated here.
[0082] According to the above embodiments of the present invention, in the rebar tying quality inspection model, the second channel feature map is obtained by processing the first channel feature map using a global dynamic convolutional layer, including: processing the seventh channel feature map using a second convolutional layer to obtain a first channel feature map, wherein the seventh channel feature map is used to generate the first channel feature map; inputting the first channel feature map into the global dynamic convolutional layer to perform convolution processing on the first channel feature map using the global dynamic convolutional layer to obtain a second channel feature map; segmenting the second channel feature map along the channel dimension using the global dynamic convolutional layer to obtain multiple second channel feature maps; processing a portion of the multiple second channel feature maps to obtain a second third channel feature map; concatenating the second third channel feature map with the multiple second channel feature maps to obtain a second fourth channel feature map; processing the second fourth channel feature map to obtain a second fifth channel feature map; performing convolution processing on the second fifth channel feature map to obtain a second sixth channel feature map; and inputting the second sixth channel feature map into an attention mechanism layer for processing to obtain the second channel feature map.
[0083] Here we combine Figure 4 This embodiment will be described in detail. Figure 4 This is a structural diagram of the global dynamic convolution module according to an embodiment of the present invention, such as... Figure 4As shown, the output feature map X3 of the upper module Conv2D_BN_SiLU is used as the input feature map of PConv-GAMConv. Feature map X3 is denoted as F1 (i.e., the first one-channel feature map). PConv-GAMConv performs a PConv (Partial convolution) convolution on F1 to obtain feature map F2 (i.e., the second one-channel feature map). Then, F2 is divided into two parts along the channel dimension. One part is the feature map F4 (i.e., the second three-channel feature map) without processing, and the other part F3 (i.e., the second two-channel feature map) is used as the input feature map of Bottleneck. In Bottleneck, the feature map is concatenated with the original Bottleneck input after passing through two CBS (i.e., Conv2D_BN_SiLU) layers to obtain the output of Bottleneck. In PConv-GAMConv, the output of each Bottleneck is used as the input of the next Bottleneck, and this process is repeated n times. The output of each Bottleneck is concatenated with the unprocessed feature maps F3 and F4 to obtain feature map F5 (i.e., the second fourth-channel feature map). After passing through a PConv convolution layer, feature map F6 (i.e., the second fifth-channel feature map) is obtained. Then, feature map F6 is passed through a CBS convolution layer to obtain feature map F7 (i.e., the second sixth-channel feature map). Finally, feature map F7 is input into GAM (Global Attention Module) to obtain feature map F8 (i.e., the second-channel feature map), which is the final output feature map of PConv-GAMConv.
[0084] It should be noted that the aforementioned GAM (Global Attention Module) is a global attention mechanism used to enhance the neural network's ability to perceive global contextual information. GAM is usually embedded between different layers of the neural network to extract global features and guide the model to better focus on important information. The aforementioned PConv (Partial convolution) is a convolution module. Partial convolution can extract spatial features more effectively by reducing redundant computation and memory access at the same time.
[0085] In this embodiment, a novel feature extraction module is constructed by using partial convolutional PConv combined with a global attention mechanism (GAM) to enhance global contextual information and improve the ability of the model's backbone network to extract features of fuzzy targets and small targets.
[0086] The specific design steps of the PConv-GAMConv module are as follows: Taking F1 with dimensions C×H×W as an example, where C represents the number of channels, H represents the height, and W represents the width, the PConv-GAMConv design steps are: 1) Input F1 into the PConv layer, select 1 / 4 of the input channels of F1 for convolution to obtain the intermediate feature map after convolution. Keep the remaining channels unchanged in size and concatenate them with the intermediate feature map to obtain F2. The number of channels in F2 is the same as that in F1, and the size is C×H×W; 2) Divide F2 along the number of channels into feature map F3 and feature map F4, both with dimensions C / 2×H×W; 3) Input F3 into Bottleneck, Bottleneck... F3 performs two consecutive CBS convolution operations with a kernel size of 3×3 and a stride of 1 to output an intermediate feature map; 4) Concatenate the output intermediate feature map of each Bottleneck with feature maps F3 and F4 to obtain a feature map F5 with a size of (n+2)·C / 2×H×W; 5) Input F5 into the PConv layer for partial convolution to obtain an output feature map F6 with a size of (n+2)·C / 2×H×W; 6) Perform CBS convolution on F6 to obtain an output feature map F7 with a size of C×H×W, the size of which is the same as that of feature map F1; 7) Input F7 into the GAM attention mechanism to obtain an output feature map F8 with a size of C×H×W, where F8 is the final output feature map of PConv-GAMConv.
[0087] Here, we take a rebar binding target feature map with a size of 64×320×320 as an example. For the input rebar binding target feature map F1 with a size of 64×320×320, PConv-GAMConv first inputs it into the PConv layer. For feature map F1, PConv selects 1 / 4 of the input channels in the feature map for convolution operation, while keeping the size of the remaining channels unchanged. It is then concatenated with the 1 / 4 channels after the convolution operation and output. The number of channels in the output feature map is the same as the number of input channels. Finally, PConv outputs an output feature map F2 with a size of 64×320×320. For F2, PConv-GAMConv divides it into feature maps F3 and F4, both with a size of 32×320×320, along the number of channels. Then, feature map F3 is input into Bottleneck. Bottleneck performs two consecutive CBS convolution operations on F3 with a kernel size of 3×3 and a stride of 1 to obtain an output intermediate feature map with a size of 32×320×320. In the PConv-GAMConv module, the intermediate feature map output of each Bottleneck is used as the input of the next Bottleneck, and this process is repeated n times. The intermediate feature maps output from the above n Bottlenecks are then concatenated with feature maps F3 and F4 to obtain feature map F5 with a size of (n+2)×32×320×320, where (n+2)×32 is the number of channels. Feature map F5 is then input into the PConv layer for partial convolution to obtain output feature map F6 with a size of (n+2)×32×320×320. The feature map is then subjected to CBS convolution to obtain feature map F7 with a size of 64×320×320. At this point, the size of feature map F7 is the same as the size of the input feature map F1. Feature map F7 with a size of 64×320×320 is then input into the GAM attention mechanism to obtain output feature map F8 with a size of 64×320×320. F8 is the output feature map of PConv-GAMConv.
[0088] It should be noted that in the PConv-GAMConv module, the intermediate feature map output of each Bottleneck is used as the input for the next Bottleneck. This can be repeated n times depending on the actual situation; generally, n defaults to 1.
[0089] According to the above embodiments of the present invention, the method of processing the second channel feature map using an image restoration layer to obtain the third channel feature map includes: in the rebar binding quality inspection model, using a third convolutional layer to perform convolution processing on the second channel feature map to obtain a third first channel feature map, and using a global dynamic convolutional layer to output the third second channel feature map corresponding to the third first channel feature map; using an image restoration layer to perform convolution processing on the third second channel feature map to obtain a third third channel feature map; using multiple pooling layers to sequentially perform pooling processing on the third third channel feature map to obtain pooling processing results; after each of the multiple pooling layers has completed pooling processing, concatenating the third third channel feature map with the pooling processing results to obtain a third fourth channel feature map; inputting the third fourth channel feature map into an attention mechanism layer for processing to obtain a third fifth channel feature map; and performing convolution processing on the third fifth channel feature map to obtain the third channel feature map.
[0090] Here we combine Figure 5 This embodiment will be described in detail. Figure 5 This is a structural diagram of a partial convolutional-coordinate attention module according to an embodiment of the present invention, such as... Figure 5 As shown, the output feature map X8 of the upper-layer module PConv-GAMConv is used as the input feature map of PConv-SPPF-CA, and the feature map X8 is denoted as F. 11 (i.e., the third channel feature map), PConv-SPPF-CA against F 11 Perform a PConv convolution to obtain the feature map F 22 (i.e., the third two-channel feature map); then F 22 The feature map is sequentially passed through three max-pooling layers (MaxPool2d). Simultaneously, the intermediate feature map output from each MaxPool2d layer is compared with the unprocessed feature map F. 22 By concatenating along the channel number, we obtain the feature map F. 33 (i.e., the third three-channel feature map); the feature map F 33 The input is fed into the CoordAttention (CA) attention mechanism to obtain the output feature map F. 44 (i.e., the third and fourth channel feature maps); The feature map F 44 After passing through some convolutional layers, the output feature map F is obtained. 55 (That is, the third and fifth channel feature maps), and finally the feature map F 55 After CBS convolution, the final output feature map F of PConv-SPPF-CA is obtained. 66 F 66 This is feature map X9 (i.e., the third channel feature map).
[0091] In this embodiment, a partially convolutional-coordinate attention module called PConv-SPPF-CA is designed to improve the model's ability to handle occluded targets in rebar tying images. By using partially convolutional PConv combined with the coordinate attention mechanism (CA), the model can better capture local and global relationships in the target feature space, thereby improving the model's detection performance of occluded tying points in rebar tying images.
[0092] It should be noted that the aforementioned CA (CoordAttention) is a publicly available coordinate attention mechanism. When calculating attention, CoordAttention considers not only the input feature information but also the position information of each pixel, thereby better capturing local and global spatial relationships.
[0093] The specific design steps of the PConv-SPPF-CA module are as follows: Here, we take F as an example. 11 Taking the dimensions C×H×W as an example, the design steps of PConv-SPPF-CA are as follows: 1) Create the reinforcement binding feature diagram F 11 After passing through the PConv layer, F is selected. 11 One-quarter of the input channels are convolved to obtain an intermediate feature map; the remaining channels retain their original size and are concatenated with the intermediate feature map before outputting F. 22 F 22 The number of channels and F 11 The number of channels is the same, and the size is C×H×W; 2) The feature map F with size C×H×W is... 22 The feature maps are sequentially processed through three max-pooling layers, each with an output intermediate feature map of size C×H×W; 3) The output intermediate feature maps of the three max-pooling layers are compared with the unprocessed feature map F. 22 By concatenating along the number of channels, an output feature map F with dimensions of 4·C×H×W is obtained. 33 ;4) The feature map F with size 4·C×H×W 33 The input CA attention mechanism yields the output feature map F. 44 Feature map F 44 The dimensions are 4·C×H×W; 5) The feature map F with dimensions 4·C×H×W 44 After partial convolution of the input PConv layer, an output feature map F with dimensions 4·C×H×W is obtained. 55 ;6) The feature map F with dimensions of 4·C×H×W 55 After CBS convolution, an output feature map F of size C×H×W is obtained. 77 At this point, the output feature map F 66Size and feature map F 11 The dimensions are consistent. F 66 The final output feature map of PConv-SPPF-CA is feature map X9.
[0094] This section uses a rebar tying target feature map with a size of 512×20×20 as an example for explanation. For an input rebar tying target feature map F with a size of 512×20×20... 11 PConv-SPPF-CA first inputs it into the PConv layer, for feature map F 11 PConv selects 1 / 4 of the input channels in the feature map for convolution, while keeping the remaining channels unchanged. This concatenated feature map is then output with the convolutionally processed 1 / 4 channels. The number of channels in the output feature map is the same as the number of input channels. Finally, PConv outputs a feature map F with dimensions of 512×20×20. 22 The feature map F with a size of 512×20×20 22 The data is sequentially processed through three max-pooling layers (MaxPool2d), each with an output intermediate feature map size of 512×20×20. The output intermediate feature maps of the three MaxPool2d layers are then compared with the unprocessed feature map F. 22 By splicing along the channel number, an output feature map F with dimensions of 4×512×20×20 is obtained. 33 The feature map F with dimensions of 4×512×20×20 33 The input CA attention mechanism yields the output feature map F. 44 Feature map F 44 The dimensions are 4×512×20×20. The feature map F with dimensions 4×512×20×20 is... 44 After partial convolution of the input PConv, an output feature map F with dimensions of 4×512×20×20 is obtained. 55 The feature map F with dimensions of 4×512×20×20 55 After CBS convolution, an output feature map F with a size of 512×20×20 is obtained. 66 At this point, the output feature map F 66 Size and feature map F 11 The dimensions are consistent. F 66 The final output feature map of PConv-SPPF-CA is feature map X9.
[0095] According to the above embodiments of the present invention, in the rebar binding quality inspection model, a feature pyramid network is used to fuse the first channel feature map, the second channel feature map, and the third channel feature map to obtain the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map. This includes: fusing the first channel feature map with the second and third channel feature maps and performing upsampling processing to obtain the fourth channel feature map; fusing the second channel feature map with the first and third channel feature maps and performing upsampling processing to obtain the fifth channel feature map; and fusing the third channel feature map with the first and second channel feature maps and performing downsampling processing to obtain the sixth channel feature map.
[0096] In this embodiment, features at different scales are fused through the FPN (Feature Pyramid Network) module to obtain a feature map with multi-scale information, which can better detect objects at different scales and improve the performance of target detection.
[0097] like Figure 3 As shown, feature maps X4 (i.e., the first channel feature map), X6 (i.e., the second channel feature map), and X9 (i.e., the third channel feature map) are the input feature maps of FPN. The FPN module fuses the features of X4, X6, and X9, that is, feature map X4 is fused with the feature maps after upsampling of X6 and X9. The fused feature map is X. 10 (That is, the fourth channel feature map), feature map X6 is the feature map after fusing downsampling of X4 and upsampling of X9, and the fused feature map is X. 11 (That is, the fifth channel feature map), feature map X9 is the feature map after fusing X4 and X6 downsampled, and the fused feature map is X. 12 (That is, the sixth channel feature map).
[0098] It should be noted that the above upsampling process is the process of increasing the size of the image or feature map. In neural networks, upsampling is often used to restore the size of the image or feature map, especially when it is necessary to reconstruct the original size or a larger size of the feature map after multiple downsampling operations. The above downsampling process is the process of reducing the size of the image or feature map. In deep learning, downsampling is usually used to reduce the amount of computation and memory required, and to improve the abstraction of features.
[0099] According to the above embodiments of the present invention, in the rebar tying quality inspection model, the head detection layer is used to inspect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the inspection results. This includes: inputting the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map into the head detection layer to perform bounding box prediction on the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, obtaining the bounding box information of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map. The bounding box information includes: bounding box coordinates and bounding box confidence. Based on the relationship between the bounding box confidence and the confidence threshold in the bounding box information, a target bounding box with a confidence higher than the confidence threshold is selected. The tying status corresponding to the tying points in the target bounding box is determined. The tying status includes: tying point position, tying point omission position, and tying quality of the tying points. The tying status is output in the tying result display image to obtain the inspection results.
[0100] In this embodiment, feature maps with multi-scale information are input into the head (i.e., head detection layer) of the PGCA model for target detection, and a three-dimensional tensor containing prediction information is output. Each row corresponds to a prediction, which can classify the detected targets, evaluate and adjust the detection results, and improve the detection performance and effect.
[0101] like Figure 3 As shown, the output of the detection head is a three-dimensional tensor, where each row contains the class probability of each predicted box at each spatial location (relative to the feature map), the coordinates of the bounding box, and the confidence score of the object's presence. It should be noted that after the model outputs all predictions (before the image containing the detection results is output), there will be many overlapping bounding boxes. To address this issue, Non-Maximum Suppression (NMS) is used to select the optimal bounding box. NMS compares the confidence scores of all boxes, retains the box with the highest confidence score, and removes other boxes that overlap significantly (IoU exceeds a certain threshold).
[0102] Optionally, the bounding box information mentioned above may include: bounding box coordinates and bounding box confidence, etc.
[0103] Optionally, the above binding status may include: binding point location, missing binding points, and binding quality of already bound points.
[0104] It should be noted that the bounding box prediction mentioned above means that each cell is responsible for predicting the coordinates and confidence scores of several bounding boxes. These coordinates are passed through a sigmoid function to ensure that the output values are between 0 and 1, which can make training more stable. The category and confidence prediction mentioned above means that in addition to coordinate prediction, each bounding box also has a confidence prediction, which is used to represent the probability that there is an object of a specific category within the box.
[0105] Optionally, the coordinates of the bounding box may include: center point (x, y) (position relative to the feature map cell), width, and height (w, h) (scaled relative to the width and height of the entire image).
[0106] According to the above embodiments of the present invention, the loss function of the rebar tying quality inspection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD α represents the weighting ratio of WIOU, which is obtained using the following formula: L WIOU The formula for calculating WIOU, L IOU The cross-union loss (NWD) represents the intersection-with-union (IoU) ratio between the predicted and ground truth bounding boxes. x and y represent the horizontal and vertical positions of the center point of the predicted bounding box in the rebar binding image, xt and yt represent the horizontal and vertical positions of the center point of the ground truth bounding box in the rebar binding image, wc and hc represent the width and height of the minimum bounding rectangle between the predicted and ground truth bounding boxes, and exp represents the accuracy of the anchor box in the rebar binding image. The NWD is obtained using the following formula: C represents the number of categories in the dataset, W2 2 (N a N b ) is the definition of second-order distance, N a and N b These represent bounding box A = (cx) a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b Gaussian modeling distribution, ||·|| F The x-axis represents the predefined norm, c represents the scaling factor used to adjust the scale of the center coordinates, and x represents the scaling factor. a y a w a h a These are the center x-coordinate, center y-coordinate, width, and height of bounding box A, respectively. b y b w b hb These are the center x-coordinate, center y-coordinate, width, and height of bounding box B, respectively.
[0107] Furthermore, in embodiments of the present invention, W2 2 (N a N b ) is a second-order Wasserstein distance definition, and the predefined norm is the Frobenius norm.
[0108] In this embodiment, WIOU and NWD can be combined as the localization regression loss function NWD-WIOU. NWD-WIOU can maintain scale invariance to a certain extent, and is more fair when measuring the similarity between the bounding boxes of small objects. It is a method that can improve the localization accuracy of the model for small targets in complex environments, and make the model more robust when detecting targets tied with steel bars.
[0109] It should be noted that NWD is a loss function used to estimate the difference between the predicted result and the actual result; WIOU is a commonly used evaluation metric in the field of object detection, used to measure the accuracy of the detection algorithm in predicting the position and size of the target.
[0110] Figure 6 This is a flowchart of an optional method for detecting the quality of rebar tying according to an embodiment of the present invention, such as... Figure 6As shown, in this embodiment, a rebar dataset is first constructed and preprocessed. The Conv2d_BN_SiLU module is used to perform preliminary feature extraction on the input rebar images. A global dynamic convolution module (PConv-GAMConv) is designed to extract deep features from the feature maps. This global dynamic convolution module extracts deep features from the feature maps, providing a foundation for subsequent feature fusion and attention mechanisms. A partially convolutional-coordinate attention module (PConv-SPPF-CA) is designed to further extract key information from the feature maps and enhance the model's detection of rebar. Capabilities: The model utilizes the FPN (Feature Pyramid Network) module to fuse features at different levels, improving its detection performance for rebar of varying scales. An NWD-WIOU loss function is designed to optimize the model's detection performance, enabling more accurate rebar location. A Head detection head is used to detect the fused features, outputting the rebar category and location information. Based on the constructed rebar tying quality detection model, the parameters of each layer are trained and updated. All neural network parameters are initialized first, and hyperparameters related to the rebar tying quality detection model are set. The processed rebar tying dataset is then divided into training, validation, and test sets. The training and validation sets are divided into multiple batches. Each batch of training data is input into the rebar tying quality detection model for training, resulting in a training loss value (loss) for that batch. After completing one round of training on all batches of data in the entire training set (in actual training, there may be multiple rounds), the validation set is input into the rebar tying quality detection model in batches, resulting in a corresponding batch loss value (batch_loss). During training and validation, the rebar tying quality detection model automatically learns and adjusts its parameters based on each loss and batch_loss. The training process continues for one or more rounds until the batch_loss value converges, at which point the rebar tying quality detection model training is complete. The trained rebar tying quality detection model is then used to detect rebar tying images, achieving automatic detection of rebar tying quality.
[0111] Optionally, the hyperparameters mentioned above may include: training epochs, batch size, optimizer selection, learning rate, maximum value of gradient pruning strategy, etc.
[0112] It should be noted that the hyperparameters mentioned above may include, but are not limited to, the contents described above, which will not be elaborated upon here.
[0113] This example uses a dataset containing 4000 images of rebar tying in different scenarios, with feature map sizes of H×W×C and rebar tying point maps of size X1 of 640×640×3. The dataset is randomly divided into a training set and a validation set in an 8:2 ratio, with 3200 images used as the training set and 800 images as the validation set. The data from the training set is input into the rebar tying quality detection model for training. The entire training process is set to 300 epochs. The parameters in the model are adjusted based on the loss value in each iteration. After adjusting the relevant parameters, the accuracy of the rebar tying quality detection model tends to stabilize, mainly fluctuating between 90-95%. The PGCA model, in particular, is effective for detecting the input rebar tying... The steps for processing the rebar binding image are as follows: 1) X1 is processed by a Conv2d_BN_SiLU module with a kernel size of 3×3 and a stride of 2 (i.e., a concatenated BN layer and SiLU layer with a kernel size of 3×3 and a stride of 2) to obtain a rebar binding point feature map X2 with 64 channels and a size of 320×320×64; 2) X2 is then processed by the Conv2d_BN_SiLU module for further dimensionality reduction to obtain a feature map X3 with a size of 160×160×128; 3) Feature map X3 is processed by the PConv-GAMConv global dynamic convolution module to obtain a feature map X4 with a size of 160×160×128; 4) Feature map X4 is processed by the Conv2d_BN_SiLU module. 5) Dimensionality reduction is performed again to obtain feature map X5 with a size of 80×80×256; 6) Feature map X5 is processed by the PConv-GAMConv global dynamic convolution module to obtain feature map X6 with a size of 80×80×256; 7) Feature map X6 is processed by the Conv2d_BN_SiLU module to obtain feature map X7 with a size of 40×40×512; 8) Feature map X7 is processed by the PConv-GAMConv global dynamic convolution module to obtain feature map X8 with a size of 40×40×512; 9) Feature map X9 is processed by the PConv-SPPF-CA partial convolution-coordinate attention module to obtain feature map X9 with a size of 40×40×512; 10) Feature map X9 is processed by the PConv-SPPF-CA partial convolution-coordinate attention module to obtain feature map X9 with a size of 40×40×512; 4. Input X6 and X9 into the feature fusion module for feature fusion. That is, feature map X4 is fused with the feature maps after upsampling of X6 and X9, and the fused feature map is X10 with a size of 160×160×128. Feature map X6 is fused with the feature maps after downsampling of X4 and upsampling of X9, and the fused feature map is X11 with a size of 80×80×256. Feature map X9 is fused with the feature maps after downsampling of X4 and X6, and the fused feature map is X12 with a size of 40×40×512. 10) Input X10, X11 and X12 into the Head detection head of the PGCA model for target detection, and output a three-dimensional tensor containing prediction information. Each row corresponds to a prediction, including bounding box coordinates, class label and confidence score.
[0114] Figure 7 This is a schematic diagram of the image detection results of rebar tying according to an embodiment of the present invention, as shown below. Figure 7 As shown, the collected rebar binding image data is input into the rebar binding quality inspection model. The rebar binding quality inspection model then inspects the image to obtain the inspection results of the rebar binding quality and outputs the results on the image, including the position of each binding point, the location of missing binding points, and the binding quality of the bound points.
[0115] The technical solution provided by the above embodiments of the present invention first constructs a dataset suitable for rebar detection, uses Conv2D_BN_SiLU for image feature extraction, performs deep feature extraction through a global dynamic convolution module and a partial convolution-coordinate attention module, performs feature fusion at different levels through a feature pyramid network (FPN) module, optimizes the model training process through the NWD-WIOU loss function, and uses a Head detection head for detection. Through the training and validation process, the model parameters are continuously optimized to improve the model's detection performance. The trained model is then applied to actual rebar detection tasks to achieve automated rebar recognition and detection. This approach comprehensively considers factors such as the diversity of image features and the computational efficiency of the model, avoiding the tedious steps of manually adjusting the anchor frame size and the problems of false detection and missed detection in traditional methods, thus improving the model's detection accuracy and robustness for rebar.
[0116] In other words, the technical solution provided by the embodiments of the present invention comprehensively considers multiple factors, adopts a suitable dataset construction method, advanced loss function and feature extraction model, improves the model's ability to extract detailed features of rebar binding targets and the positioning accuracy of rebar binding targets in complex environments, and better captures local and global relationships in the target feature space.
[0117] Therefore, the technical solution provided by the above embodiments of the present invention solves the following problems: 1) Low model detection accuracy: Existing target detection algorithms have relatively low positioning accuracy for targets in rebar tying images. Due to the blurred details of the rebar tying points, directly using existing official models for detection results in the single grid prediction box failing to accurately capture the target's position, leading to a large positioning error; 2) Difficulty in detecting small targets: Rebar tying images involve various small-sized targets, such as thin rebars, which poses a challenge to the detection accuracy of existing target detection algorithms. Existing target detection algorithms are weak in detecting small targets and are prone to missed detections and false detections; 3) Difficulty in detecting occluded targets: Rebar usually requires multiple layers of tying, and the rebar tying points may be occluded by other objects or structures, causing some rebar tying points to be undetectable. Existing technologies can generally only detect fully visible targets. It also has the following beneficial effects: 1) Using a global dynamic convolution module (PConv-GAMConv) to improve the network's accuracy in detecting blurred targets and small targets in rebar tying images. In PConv-GAMConv, the GAM attention mechanism combined with partial convolution PConv is used to improve the model's ability to extract detailed features of rebar tying targets and reduce the dependence on redundant information generated during model iteration; 2) Using a partial convolution-coordinate attention module (PConv-SPPF-CA) to improve the model's ability to handle occluded targets in rebar tying images. By using the CA attention mechanism combined with partial convolution PConv, the model's detection performance of occluded tying points in rebar tying images is improved; 3) Using the NWD-WIOU loss function to improve the model's localization accuracy for small targets in complex environments. By combining normalized Gaussian Vassasstein distance (NWD) with WIOU, a novel localization regression loss function is constructed, which improves the localization accuracy of rebar tying targets in complex environments.
[0118] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0120] According to an embodiment of the present invention, a device for detecting the quality of rebar tying is also provided for implementing the above-described method for detecting the quality of rebar tying. Figure 8 This is a schematic diagram of a rebar tying quality detection device according to an embodiment of the present invention, as shown below. Figure 8 As shown, the device includes: a first acquisition module 801, a first processing module 803, a second processing module 805, a fusion module 807, a detection module 809, and a second acquisition module 811. The risk analysis device for the power grid operation process will be described below.
[0121] The first acquisition module 801 is used to acquire the initial rebar binding image of the target rebar, wherein the target rebar is the rebar that needs to be inspected for rebar binding quality.
[0122] The first processing module 803 is used to input the initial rebar binding image into the rebar binding quality detection model, so as to process the initial rebar binding image using the first convolutional layer of the rebar binding quality detection model to obtain the first channel feature map of the initial rebar binding image. The rebar binding quality detection model is a model obtained by machine learning training using multiple sets of training data. Each set of training data includes a sample rebar binding image and a sample detection result corresponding to the sample rebar binding image.
[0123] The second processing module 805 is used to process the first channel feature map in the rebar binding quality inspection model using a global dynamic convolutional layer (PConv-GAMConv) to obtain the second channel feature map, and to process the second channel feature map using an image restoration layer to obtain the third channel feature map. The image restoration layer includes a partial convolutional-coordinate attention model.
[0124] The fusion module 807 is used to fuse the first channel feature map, the second channel feature map, and the third channel feature map in the rebar binding quality inspection model using the Feature Pyramid Network (FPN) to obtain the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map.
[0125] The detection module 809 is used to detect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map in the rebar binding quality detection model using the head detection layer to obtain the detection results;
[0126] The second acquisition module 811 is used to obtain the binding quality data of the target rebar based on the detection results output by the rebar binding quality detection model.
[0127] It should be noted that the first acquisition module 801, the first processing module 803, the second processing module 805, the fusion module 807, the detection module 809, and the second acquisition module 811 mentioned above correspond to steps S202 to S212 in the above embodiments. The six modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments.
[0128] As can be seen from the above, in the scheme described in the above embodiments of the present invention, firstly, a first acquisition module can be used to acquire an initial rebar binding image of the target rebar, wherein the target rebar is the rebar that needs to be inspected for rebar binding quality; then, a first processing module can be used to input the initial rebar binding image into a rebar binding quality inspection model, so that the initial rebar binding image is processed by the first convolutional layer of the rebar binding quality inspection model to obtain a first channel feature map of the initial rebar binding image, wherein the rebar binding quality inspection model is a model obtained by machine learning training using multiple sets of training data, each of the multiple sets of training data including a sample rebar binding image and a sample detection result corresponding to the sample rebar binding image; then, a second processing module can be used to process the first channel feature map in the rebar binding quality inspection model using a global dynamic convolutional layer to obtain a second channel feature map, and to process the second channel feature map using an image restoration layer to obtain a third channel feature map, wherein the image restoration layer includes a partial convolutional-coordinate attention layer. The rebar tying quality inspection model employs a force model; secondly, a fusion module can be used to fuse the first, second, and third channel feature maps using a feature pyramid network to obtain fourth, fifth, and sixth channel feature maps; a detection module can also be used to detect the fourth, fifth, and sixth channel feature maps using a head detection layer to obtain detection results; finally, a second acquisition module can be used to obtain the tying quality data of the target rebar based on the detection results output by the rebar tying quality inspection model. This achieves the goal of improving the accuracy and robustness of the rebar tying quality inspection model, reducing the number of model parameters and computational load, and meeting the requirements of lightweight and high real-time performance for the rebar tying quality inspection task.
[0129] The technical solutions provided by the embodiments of the present invention solve the technical problems in the related art where the target detection algorithm used in rebar tying has weak performance in small target detection, is prone to missed detection and false detection, and has low reliability.
[0130] In one optional embodiment, the first acquisition module includes: sample rebar binding images: images of bound rebars, images of unbound rebars, and images of incorrectly bound rebars with substandard binding quality; each of the sample rebar binding images in the dataset is annotated with a rebar binding point using an annotation tool, and the annotation information of the annotation tool includes: the accurate location of the rebar binding point.
[0131] In an optional embodiment, the first acquisition module further includes a preprocessing unit for performing preprocessing operations on the initial rebar binding image, wherein the preprocessing operations include image size adjustment and image pixel enhancement.
[0132] In an optional embodiment, the second processing module includes: a first processing unit, configured to process the seventh-channel feature map in the rebar tying quality inspection model using a second convolutional layer to obtain a first-channel feature map, wherein the seventh-channel feature map is used to generate the first-channel feature map; a second processing unit, configured to input the first-channel feature map into a global dynamic convolutional layer to perform convolution processing on the first-channel feature map using the global dynamic convolutional layer to obtain a second-channel feature map; and a third processing unit, configured to segment the second-channel feature map along the channel dimension using the global dynamic convolutional layer. Multiple second-channel feature maps are obtained. Parts of these second-channel feature maps are processed to obtain second- and third-channel feature maps. A concatenation unit concatenates the second- and third-channel feature maps with the multiple second-channel feature maps to obtain a second- and fourth-channel feature map. A fourth processing unit processes the second- and fourth-channel feature map to obtain a second- and fifth-channel feature map. A fifth processing unit performs convolution processing on the second- and fifth-channel feature map to obtain a second- and sixth-channel feature map. A sixth processing unit inputs the second- and sixth-channel feature map into the attention mechanism layer for processing to obtain a second-channel feature map.
[0133] In an optional embodiment, the second processing module includes: a seventh processing unit, used to perform convolution processing on the second channel feature map using a third convolution layer to obtain a third first channel feature map in the rebar binding quality inspection model, and to output the third second channel feature map corresponding to the third first channel feature map using a global dynamic convolution layer; an eighth processing unit, used to perform convolution processing on the third second channel feature map using an image restoration layer to obtain a third third channel feature map; a ninth processing unit, used to perform pooling processing on the third third channel feature map sequentially using multiple pooling layers to obtain pooling processing results; a stitching unit, used to stitch the third third channel feature map with the pooling processing results after each of the multiple pooling layers has completed pooling processing to obtain a third fourth channel feature map; a tenth processing unit, used to input the third fourth channel feature map into an attention mechanism layer for processing to obtain a third fifth channel feature map; and an eleventh processing unit, used to perform convolution processing on the third fifth channel feature map to obtain a third channel feature map.
[0134] In one optional embodiment, the fusion module includes: a twelfth processing unit, configured to fuse and upsample the first channel feature map with the second and third channel feature maps to obtain a fourth channel feature map; a thirteenth processing unit, configured to fuse and upsample the second channel feature map with the first and third channel feature maps to obtain a fifth channel feature map; and a fourteenth processing unit, configured to fuse and upsample the third channel feature map with the first and second channel feature maps to obtain a sixth channel feature map.
[0135] In one optional embodiment, the detection module includes: a prediction unit, used to input the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map into the head detection layer, so as to use the head detection layer to predict the bounding boxes of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the bounding box information of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, wherein the bounding box information includes: bounding box coordinates and bounding box confidence; a selection unit, used to select target bounding boxes whose bounding box confidence is higher than the confidence threshold according to the relationship between the bounding box confidence and the confidence threshold in the bounding box information; a first determination unit, used to determine the binding state corresponding to the binding points in the target bounding box, wherein the binding state includes: binding point position, binding point missing position, and binding quality of the bounding points; and an output unit, used to output the binding state in the binding result display image to obtain the detection result.
[0136] According to another aspect of the present invention, a processor is also provided, the processor being configured to run a program, wherein the program, when running, executes the method for detecting the quality of rebar tying as described in any of the above embodiments.
[0137] According to another aspect of the present invention, a computer program product is also provided, including computer instructions, which, when executed by a processor, perform the method for detecting the quality of rebar tying as described above.
[0138] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program executes the method for detecting the quality of rebar tying as described above.
[0139] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any communication device in a group of communication devices.
[0140] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0141] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0145] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0146] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for detecting the quality of rebar tying, characterized in that, include: Obtain an initial image of the target rebar binding, wherein the target rebar is the rebar that needs to be inspected for binding quality. The initial rebar binding image is input into the rebar binding quality detection model, and the first convolutional layer in the rebar binding quality detection model is used to process the initial rebar binding image to obtain the first channel feature map of the initial rebar binding image. The rebar binding quality detection model is a model trained by machine learning using multiple sets of training data. Each set of training data includes a sample rebar binding image and a sample detection result corresponding to the sample rebar binding image. In the rebar binding quality inspection model, the first channel feature map is processed by a global dynamic convolutional layer to obtain the second channel feature map, and the second channel feature map is processed by an image restoration layer to obtain the third channel feature map. The image restoration layer includes a partial convolutional-coordinate attention model. In the rebar binding quality inspection model, the first channel feature map, the second channel feature map, and the third channel feature map are fused using a feature pyramid network to obtain the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map. In the rebar binding quality inspection model, the head inspection layer is used to inspect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the inspection results; The binding quality data of the target rebar is obtained based on the detection results output by the rebar binding quality detection model.
2. The method for detecting the quality of reinforcing bar binding according to claim 1, characterized in that, The sample rebar binding images include: images of bound rebars, images of unbound rebars, and images of incorrectly bound rebars with substandard binding quality. Each of the sample rebar binding images is annotated with rebar binding points using an annotation tool. The annotation information of the annotation tool includes the accurate location of the rebar binding points.
3. The method for detecting the quality of reinforcing bar binding according to claim 1, characterized in that, Before inputting the initial rebar binding image into the rebar binding quality inspection model, the following steps are also included: The initial rebar binding image is subjected to preprocessing operations, which include image size adjustment and image pixel enhancement.
4. The method for detecting the quality of reinforcing bar binding according to claim 1, characterized in that, In the rebar tying quality inspection model, a global dynamic convolutional layer is used to process the first channel feature map to obtain the second channel feature map, including: In the rebar binding quality inspection model, the seventh channel feature map is processed by the second convolutional layer to obtain the first channel feature map, wherein the seventh channel feature map is used to generate the first channel feature map; The first channel feature map is input into the global dynamic convolutional layer to perform convolution processing on the first channel feature map to obtain the second channel feature map. The global dynamic convolutional layer is used to segment the second first channel feature map along the channel dimension to obtain multiple second second channel feature maps. Parts of the multiple second second channel feature maps are processed to obtain the second third channel feature map. The second and third channel feature maps are concatenated with multiple second and second channel feature maps to obtain the second and fourth channel feature map; The second fourth channel feature map is processed to obtain the second fifth channel feature map; The second fifth channel feature map is convolved to obtain the second sixth channel feature map; The second six-channel feature map is input into the attention mechanism layer for processing to obtain the second channel feature map.
5. The method for detecting the quality of rebar tying according to claim 1, characterized in that, The second channel feature map is processed using an image inpainting layer to obtain the third channel feature map, including: In the rebar binding quality inspection model, the third convolutional layer is used to convolve the second channel feature map to obtain the third first channel feature map, and the global dynamic convolutional layer is used to output the third second channel feature map corresponding to the third first channel feature map. The image restoration layer is used to perform convolution processing on the third two-channel feature map to obtain the third three-channel feature map; The third three-channel feature map is sequentially pooled using multiple pooling layers to obtain the pooling result; After each of the multiple pooling layers has completed the pooling process, the third three-channel feature map is concatenated with the pooling result to obtain the third four-channel feature map. The third and fourth channel feature maps are input into the attention mechanism layer for processing to obtain the third and fifth channel feature maps. The third five-channel feature map is obtained by performing convolution processing on the third feature map.
6. The method for detecting the quality of reinforcing bar binding according to claim 1, characterized in that, In the rebar tying quality inspection model, a feature pyramid network is used to fuse the first channel feature map, the second channel feature map, and the third channel feature map to obtain a fourth channel feature map, a fifth channel feature map, and a sixth channel feature map, including: The first channel feature map is fused with the second channel feature map and the third channel feature map and then upsampled to obtain the fourth channel feature map. The second channel feature map is fused with the first channel feature map and the third channel feature map and then upsampled to obtain the fifth channel feature map. The third channel feature map is fused with the first channel feature map and the second channel feature map and then upsampled to obtain the sixth channel feature map.
7. The method for detecting the quality of reinforcing bar tying according to claim 1, characterized in that, In the rebar tying quality inspection model, the head inspection layer is used to inspect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map to obtain the inspection results, including: The fourth channel feature map, the fifth channel feature map, and the sixth channel feature map are input into the head detection layer to perform bounding box prediction on the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, thereby obtaining the bounding box information of the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map. The bounding box information includes: bounding box coordinates and bounding box confidence. Based on the relationship between the bounding box confidence score and the confidence score threshold in the bounding box information, target bounding boxes with a bounding box confidence score higher than the confidence score threshold are selected. Determine the binding status corresponding to the binding points in the target bounding box, wherein the binding status includes: binding point position, missing binding point position, and binding quality of the bound points; The binding status is output in the binding result display diagram to obtain the detection result.
8. The method for detecting the quality of reinforcing bar binding according to claim 1, characterized in that, The loss function of the rebar tying quality inspection model is: α represents the weighting ratio of WIOU, which is obtained using the following formula: , This represents the formula for calculating WIOU. This represents the intersection-union loss between the predicted bounding box and the ground truth bounding box. This indicates the horizontal and vertical positions of the center point of the bounding box in the rebar tying image. This indicates the horizontal and vertical positions of the center point of the actual bounding box in the rebar binding image. This represents the width and height of the minimum bounding rectangle between the predicted bounding box and the true bounding box. This indicates the accuracy of the anchor frame in the rebar tying image; NWD is obtained using the following formula: C represents the number of categories in the dataset. It is a second-order distance definition. and Representing bounding boxes and bounding box Gaussian modeling distribution, This is a scaling factor used to adjust the scale of the center point coordinates. , , , The bounding boxes are respectively The center x-coordinate, center y-coordinate, width, and height. , , , The bounding boxes are respectively The center x-coordinate, center y-coordinate, width, and height. This indicates the predefined norm.
9. A device for detecting the quality of rebar tying, characterized in that, include: The first acquisition module is used to acquire the initial rebar binding image of the target rebar, wherein the target rebar is the rebar that needs to be inspected for rebar binding quality. The first processing module is used to input the initial rebar binding image into the rebar binding quality detection model, so as to process the initial rebar binding image using the first convolutional layer in the rebar binding quality detection model to obtain the first channel feature map of the initial rebar binding image. The rebar binding quality detection model is a model obtained by machine learning training using multiple sets of training data. Each set of training data includes a sample rebar binding image and a sample detection result corresponding to the sample rebar binding image. The second processing module is used in the rebar binding quality inspection model to process the first channel feature map using a global dynamic convolutional layer to obtain a second channel feature map, and to process the second channel feature map using an image restoration layer to obtain a third channel feature map, wherein the image restoration layer includes a partial convolutional-coordinate attention model. The fusion module is used to fuse the first channel feature map, the second channel feature map, and the third channel feature map in the rebar binding quality inspection model using a feature pyramid network to obtain the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map. The detection module is used to detect the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map in the rebar binding quality detection model using the head detection layer to obtain the detection results; The second acquisition module is used to obtain the binding quality data of the target rebar based on the detection results output by the rebar binding quality detection model.
10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they perform the method for detecting the quality of rebar tying as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Steel bar binding equipment control method for intelligent construction
CN117253028A
Lightweight peony flowering phase detection method based on improved YOLOv8n
CN118644776A