Method and device for detecting steel bar binding quality
By using global dynamic convolutional layer, image repair layer and feature pyramid network in the reinforcement binding quality detection model, the problem of weak performance of the reinforcement binding detection algorithm in the prior art in small object detection is solved, and higher detection accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411577478.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The object detection algorithm used in steel bar binding in the prior art has weak performance in small object detection, which is prone to missed and missed detection, and has low reliability.
A steel bar binding quality detection method is adopted. By obtaining the initial steel bar binding image and inputting it into the steel bar binding quality detection model, the model uses multiple sets of training data for machine learning training, including global dynamic convolutional layer, image repair layer and feature pyramid network, to perform feature extraction and fusion, and finally use the head detection layer for detection.
The detection accuracy of small-sized steel bar binding points is improved, the missed and missed detection situations are reduced, the accuracy and robustness of the detection model are improved, and the requirements of the model lightweight and high real-time detection task are met.
Smart Images

Figure CN119648629A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and deep learning, and in particular to a method and device for detecting steel bar binding quality. Background Art
[0002] Rebar tying is an important construction process in construction and civil engineering. It mainly involves connecting pre-cut steel bars according to design drawings and engineering requirements through tying tools and tying wires so that the steel bars can be tightly fixed together. This process is designed to ensure the overall strength and stability of the concrete structure. The quality of steel bar tying is directly related to the safety and durability of the concrete structure. Testing the quality of steel bar tying can help construction personnel check and adjust the quality of steel bar tying, ensure that the tying is firm and the connection is good, improve the seismic resistance and bearing capacity of the overall structure, and ensure that it meets the design and construction standards.
[0003] However, the current target detection algorithm used in steel bar binding detection has relatively low positioning accuracy for targets in steel bar binding images. Due to the fuzzy details of the steel bar binding points, the existing detection model is directly used, and its single grid prediction box is difficult to accurately capture the position of the target, resulting in large positioning errors.
[0004] In addition, the steel bar binding images involve a variety of small-scale targets, such as thin steel bars, etc. However, the existing target detection algorithms have poor performance in small target detection and are prone to missed detection and false detection.
[0005] In addition, steel bars usually require multiple layers of tying, and the steel bar tying points may be blocked by other objects or structures, causing some of the steel bar tying points to be undetectable.
[0006] In view of the problem that the target detection algorithm used in steel bar binding in the above-mentioned related technologies has weak performance in small target detection, is prone to missed detection and false detection, and has low reliability, no effective solution has been proposed yet. Summary of the invention
[0007] The embodiments of the present invention provide a method and device for detecting the quality of steel bar binding, so as to at least solve the technical problems that the target detection algorithm used in steel bar binding in the related art has poor performance in small target detection, is prone to missed detection and false detection, and has low reliability.
[0008] According to one aspect of an embodiment of the present invention, a method for detecting steel bar binding quality is provided, comprising: obtaining an initial steel bar binding image of a target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; inputting the initial steel bar binding image into a steel bar binding quality inspection model, so as to process the initial steel bar binding image using a first convolutional layer in the steel bar binding quality inspection model, so as to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar 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 steel bar binding image and a sample inspection result corresponding to the sample steel bar binding image; in the steel bar binding quality inspection model, using The first channel feature map is processed by a global dynamic convolution 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, wherein the image restoration layer includes a partial convolution-coordinate attention model; in the steel bar binding quality detection model, the first channel feature map, the second channel feature map and the third channel feature map are fused by a feature pyramid network to obtain a fourth channel feature map, a fifth channel feature map and a sixth channel feature map; in the steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected by a head detection layer to obtain a detection result; and the binding quality data of the target steel bar is obtained according to the detection result output by the steel bar binding quality detection model.
[0009] Optionally, the sample steel bar binding images include: tied steel bar images corresponding to tied steel bars, untied steel bar images corresponding to untied steel bars, and steel bar images of incorrectly tied steel bars with unqualified binding quality; each of the sample steel bar binding images is marked with a steel bar binding point using a marking tool, and the marking information of the marking tool includes: the exact location of the steel bar binding point.
[0010] Optionally, before inputting the initial steel bar binding image into the steel bar binding quality detection model, the steel bar binding quality detection method further includes: performing a preprocessing operation on the initial steel bar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
[0011] Optionally, in the steel bar binding quality detection model, the first channel feature map is processed by a global dynamic convolution layer to obtain a second channel feature map, including: in the steel bar binding quality detection model, the seventh channel feature map is processed by a second convolution layer to obtain a first one-channel feature map, wherein the seventh channel feature map is used to generate the first channel feature map; the first one-channel feature map is input into the global dynamic convolution layer, so as to perform convolution processing on the first one-channel feature map by the global dynamic convolution layer to obtain a second one-channel feature map; the second one-channel feature map is divided along the channel dimension by the global dynamic convolution layer to obtain a plurality of second two-channel feature maps, and a portion of the plurality of second two-channel feature maps is processed to obtain a second three-channel feature map; the second three-channel feature map is spliced with the plurality of second two-channel feature maps to obtain a second four-channel feature map; the second four-channel feature map is processed to obtain a second five-channel feature map; the second five-channel feature map is convolved to obtain a second six-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.
[0012] Optionally, the second channel feature map is processed by an image restoration layer to obtain a third channel feature map, including: in the steel bar binding quality detection model, the second channel feature map is convolved by a third convolution layer to obtain a third one-channel feature map, and the global dynamic convolution layer is used to output a third two-channel feature map corresponding to the third one-channel feature map; the third two-channel feature map is convolved by the image restoration layer to obtain a third three-channel feature map; the third three-channel feature map is sequentially pooled by multiple pooling layers to obtain a pooling result; after each of the multiple pooling layers completes the pooling process, the third three-channel feature map is respectively concatenated with the pooling result to obtain a third four-channel feature map; the third four-channel feature map is input into the attention mechanism layer for processing to obtain a third five-channel feature map; the third five-channel feature map is convolved to obtain the third channel feature map.
[0013] Optionally, in the steel bar binding 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, including: 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; 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 steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected by using a head detection layer to obtain a detection result, including: inputting 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 perform bounding box prediction on the fourth channel feature map, the fifth channel feature map and the sixth channel feature map, and obtain 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; according to the relationship between the bounding box confidence and the confidence threshold in the bounding box information, selecting a target bounding box whose bounding box confidence is higher than the confidence threshold; determining the binding state corresponding to the binding point in the target bounding box, wherein the binding state includes: binding point position, binding point missed position, and binding quality of the bounded point; outputting the binding state in the binding result display diagram to obtain the detection result.
[0015] Optionally, the loss function of the steel bar binding quality detection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD , α represents the weight ratio of WIOU, and WIOU is obtained by the following formula: L WIOU The calculation formula of WIOU is shown in Figure 1. IOU represents the intersection-over-union loss between the predicted bounding box and the true bounding box, x, y represents the horizontal and vertical positions of the center point of the bounding box in the steel bar binding image, and x t ,y t represents the horizontal and vertical positions of the center point of the true bounding box in the steel bar binding image, w c ,h crepresents the width and height of the minimum circumscribed rectangle of the predicted bounding box and the true bounding box, exp represents the accuracy of the anchor box in the steel bar binding image; NWD is obtained by the following formula: C represents the number of data set categories, W2 2 (N a ,N b ) is the second-order distance definition, N a and N b Respectively represent the bounding box A=(cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ), c is the scaling factor used to adjust the scale of the center point coordinates, x a ,y a 、w a 、h a are the center x coordinate, center y coordinate, width and height of the bounding box A respectively, b ,y b 、w b 、h b are the center x coordinate, center y coordinate, width and height of the bounding box B, respectively, ||·|| F Represents a predetermined norm.
[0016] According to another aspect of an embodiment of the present invention, a device for detecting the quality of steel bar binding is also provided, comprising: a first acquisition module, used to acquire an initial steel bar binding image of a target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; a first processing module, used to input the initial steel bar binding image into a steel bar binding quality detection model, so as to process the initial steel bar binding image using a first convolutional layer in the steel bar binding quality detection model, so as to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar binding quality detection 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 steel bar binding image and a sample detection result corresponding to the sample steel bar binding image; a second processing module, used to process the initial steel bar binding image in the steel bar binding quality detection model; , using a global dynamic convolution layer to process the first channel feature map to obtain a second channel feature map, and using an image restoration layer to process the second channel feature map to obtain a third channel feature map, wherein the image restoration layer includes a partial convolution-coordinate attention model; a fusion module, used in the steel bar binding quality detection model, using a feature pyramid network 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; a detection module, used in the steel bar binding quality detection model, using a head detection layer to detect the fourth channel feature map, the fifth channel feature map and the sixth channel feature map to obtain a detection result; a second acquisition module, used to obtain the binding quality data of the target steel bar according to the detection result output by the steel bar binding quality detection model.
[0017] Optionally, the sample steel bar binding images include: tied steel bar images corresponding to tied steel bars, untied steel bar images corresponding to untied steel bars, and steel bar images of incorrectly tied steel bars with unqualified binding quality; each of the sample steel bar binding images in the data set is annotated with a marking tool to mark the steel bar binding points, and the marking information of the marking tool includes: the exact location of the steel bar binding point.
[0018] Optionally, before the first processing module, the device for detecting the steel bar binding quality further includes: a preprocessing unit for performing a preprocessing operation on the initial steel bar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
[0019] Optionally, the second processing module includes: a first processing unit, used in the steel bar binding quality detection model, to process the seventh channel feature map using the second convolution 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, used to input the first channel feature map into the global dynamic convolution layer, so as to perform convolution processing on the first channel feature map using the global dynamic convolution layer to obtain a second channel feature map; a third processing unit, used to segment the second channel feature map along the channel dimension using the global dynamic convolution layer to obtain to multiple second two-channel feature maps, processing parts of the multiple second two-channel feature maps to obtain a second three-channel feature map; a splicing unit, used to splice the second three-channel feature map with the multiple second two-channel feature maps to obtain a second four-channel feature map; a fourth processing unit, used to process the second four-channel feature map to obtain a second five-channel feature map; a fifth processing unit, used to perform convolution processing on the second five-channel feature map to obtain a second six-channel feature map; a sixth processing unit, used to input the second six-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, which is used to use the third convolution layer to convolve the second channel feature map in the steel bar binding quality detection model to obtain a third one-channel feature map, and use the global dynamic convolution layer to output a third two-channel feature map corresponding to the third one-channel feature map; an eighth processing unit, which is used to use the image restoration layer to convolve the third two-channel feature map to obtain a third three-channel feature map; a ninth processing unit, which is used to use multiple pooling layers to sequentially perform pooling processing on the third three-channel feature map to obtain a pooling processing result; a splicing unit, which is used to splice the third three-channel feature map with the pooling processing result after each of the multiple pooling layers completes the pooling processing to obtain a third four-channel feature map; a tenth processing unit, which is used to input the third four-channel feature map into the attention mechanism layer for processing to obtain a third five-channel feature map; and an eleventh processing unit, which is used to convolve the third five-channel feature map to obtain the third channel feature map.
[0021] Optionally, the fusion module includes: a twelfth processing unit, used 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, used 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; a fourteenth processing unit, used 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, which is 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 perform bounding box prediction on the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, and obtain 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, which is used to select a target bounding box whose bounding box confidence is higher than the confidence threshold according to a size relationship between the bounding box confidence and the confidence threshold in the bounding box information; a first determination unit, which is used to determine a binding state corresponding to a binding point in the target bounding box, wherein the binding state includes: a binding point position, a binding point missed position, and a binding quality of a bounded point; and an output unit, which is used to output the binding state in a binding result display diagram to obtain the detection result.
[0023] Optionally, the loss function of the steel bar binding quality detection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD , α represents the weight ratio of WIOU, and WIOU is obtained by the following formula: L WIOU The calculation formula of WIOU is shown in Figure 1. IOU represents the intersection-over-union loss between the predicted bounding box and the true bounding box, x, y represent the horizontal and vertical positions of the center point of the bounding box in the steel bar binding image, xt, yt represent the horizontal and vertical positions of the center point of the true bounding box in the steel bar binding image, wc, hc represent the width and height of the minimum circumscribed rectangle of the predicted bounding box and the true bounding box, and exp represents the accuracy of the anchor box in the steel bar binding image; NWD is obtained by the following formula: C represents the number of data set categories, W2 2 (N a ,N b ) is the second-order distance definition, N aand N b Respectively represent the bounding box A=(cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ), c is the scaling factor used to adjust the scale of the center point coordinates, x a ,y a 、w a 、h a are the center x coordinate, center y coordinate, width and height of the bounding box A respectively, b ,y b 、w b 、h b are the center x coordinate, center y coordinate, width and height of the bounding box B, respectively, ||·|| F Represents a predetermined norm.
[0024] According to another aspect of an embodiment of the present invention, there is further provided a computer-readable storage medium, the computer-readable storage medium comprising a stored program, wherein the program executes any one of the above-mentioned methods for detecting the quality of steel bar binding.
[0025] According to another aspect of an embodiment of the present invention, a processor is provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned methods for detecting the quality of steel bar binding is executed.
[0026] According to another aspect of an embodiment of the present invention, there is also provided a computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the above-mentioned methods for detecting the quality of steel bar binding is executed.
[0027] In an embodiment of the present invention, an initial steel bar binding image of a target steel bar is obtained, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; the initial steel bar binding image is input into a steel bar binding quality inspection model, so as to process the initial steel bar binding image using a first convolutional layer in the steel bar binding quality inspection model, so as to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar 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 includes a sample steel bar binding image and a sample detection result corresponding to the sample steel bar binding image; in the steel bar binding quality inspection model, a global dynamic convolutional layer is used to process the initial steel bar binding image. The first channel feature map is processed to obtain the second channel feature map, and the second channel feature map is processed by an image restoration layer to obtain a third channel feature map, wherein the image restoration layer includes a partial convolution-coordinate attention model; in the steel bar binding quality detection model, the first channel feature map, the second channel feature map and the third channel feature map are fused by a feature pyramid network to obtain a fourth channel feature map, a fifth channel feature map and a sixth channel feature map; in the steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected by a head detection layer to obtain a detection result; and the binding quality data of the target steel bar is obtained according to the detection result output by the steel bar binding quality detection model. Through the technical solution provided by the present invention, when detecting steel bar images, the network pays more attention to dense and homogeneous small-sized objects and pays more attention to areas that make important contributions to classification or positioning, improves the discrimination of features, and enables the model to efficiently identify and accurately locate steel bar binding points in complex environments, thereby achieving the technical effect of improving the accuracy and robustness of the steel bar binding quality detection model, reducing the number of model parameters and the amount of calculation, and meeting the requirements of the steel bar binding quality detection task for lightweight and high real-time performance of the model, thereby solving the technical problems in the related art that the target detection algorithm used in steel bar binding has weak performance in small target detection, is prone to missed detection and false detection, and has low reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0029] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for detecting steel bar binding quality according to an embodiment of the present invention;
[0030] Figure 2 is a flow chart of a method for detecting steel bar binding quality according to an embodiment of the present invention;
[0031] Figure 3 is a structural diagram of a PGCA algorithm according to an embodiment of the present invention;
[0032] Figure 4 is a structural diagram of a global dynamic convolution module according to an embodiment of the present invention;
[0033] Figure 5 is a structural diagram of a partial convolution-coordinate attention module according to an embodiment of the present invention;
[0034] Figure 6 is a flow chart of an optional method for detecting the quality of steel bar binding according to an embodiment of the present invention;
[0035] Figure 7 is a schematic diagram of a steel bar binding image detection result according to an embodiment of the present invention;
[0036] Figure 8 Schematic diagram of a device for detecting steel bar binding quality according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] As introduced in the background technology, the target detection algorithm used in the steel bar binding in the related art has poor performance in small target detection, is prone to missed detection and false detection, and has low reliability. In view of the above defects, a method and device for detecting the quality of steel bar binding, a computer-readable storage medium, a processor, and a computer program product are provided in the embodiments of the present invention.
[0040] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0041] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a method for detecting the quality of steel bar binding according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0042] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for detecting the quality of steel bar binding in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as 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 of a method for detecting the quality of steel bar binding is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] Figure 2 is a flow chart of a method for detecting the quality of steel bar binding according to an embodiment of the present invention, such as Figure 2 As shown, the method comprises the following steps:
[0045] Step S202, obtaining an initial steel bar binding image of a target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality.
[0046] Optionally, the target steel bars may include: tied steel bars, untied steel bars, and steel bars with insufficient tying quality, etc.
[0047] Optionally, the initial steel bar binding image may include: a bound steel bar image corresponding to the bound steel bar, an unbound steel bar image corresponding to the unbound steel bar, and a steel bar image of incorrectly bound steel bars with unqualified binding quality. In addition, it may also include: irrelevant steel bar binding points, incorrect steel bar binding methods, irrelevant building components, and partially cover the corresponding error images.
[0048] It should be noted that the above-mentioned erroneous images are a certain number of negative samples created through simulation to balance the number of positive and negative samples and increase the accuracy of the model in identifying the quality of steel bar binding.
[0049] In this embodiment, the initial steel bar binding image of the target steel bar can be obtained to ensure that the acquired image covers different steel bar binding states, thereby ensuring the diversity and representativeness of the data.
[0050] Step S204, inputting 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, so as to obtain the first channel feature map of the initial rebar binding image, wherein the rebar binding quality detection model is a model obtained by machine learning training using multiple sets of training data, and each set of the multiple sets of training data includes a sample rebar binding image and a 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 detection model. The initial rebar binding image is processed by utilizing the first convolutional layer in the rebar binding quality detection model to obtain the first channel feature map of the initial rebar binding image, thereby providing a more useful feature representation for subsequent rebar binding quality detection.
[0052] It should be noted that the first convolution layer includes Conv2D_BN_SiLU (i.e., a convolution layer with a convolution kernel size of 3×3 and a stride of 2, a BN layer, and a SiLU layer in series) module and PConv-GAMConv module (Partial convolution-Global attention mechanism convolution, global dynamic convolution module). Among them, Conv2D_BN_SiLU is a common neural network module, which is usually used in the field of image processing, especially in CNN (convolutional neural network); PConv-GAMConv is a module based on convolutional neural network, which is used to process global information in image data. The detailed features of the steel bar binding target feature map obtained by the PConv-GAMConv module are very rich, and it can enhance the global context information, thereby enhancing the spatial correlation of cross-dimensional channels, so that the model pays more attention to the characteristics of the target itself, reduces the dependence on redundant information generated in the model iteration process, and is more suitable for the detection task of steel bar binding targets.
[0053] Optionally, the convolution layer Conv2D_BN_SiLU may include: Conv2D (convolution layer), Batch Normalization (batch normalization layer, referred to as BN) and SiLU (ie Sigmoid Linear Unit, activation function).
[0054] Figure 3 : is a structural diagram of a PGCA algorithm according to an embodiment of the present invention, such as Figure 3 As shown in the figure, the initial input image of the model is the steel bar binding image X1 (i.e., the initial steel bar binding image). X1 is first passed through the convolutional layer Conv2D_BN_SiLU to obtain the channel feature map X2 of the steel bar binding image. X2 is then passed through the convolutional layer Conv2D_BN_SiLU module to continue the dimensionality reduction operation to obtain the channel feature map X3 (i.e., the seventh channel feature map below). After X3 passes through the PConv-GAMConv module, the feature map X4 (i.e., the first channel feature map) is output.
[0055] Step S206, in the steel bar binding quality detection model, the first channel feature map is processed by a global dynamic convolution 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, wherein the image restoration layer includes a partial convolution-coordinate attention model.
[0056] Optionally, the global dynamic convolution layer includes a Conv2d_BN_SiLU module and PConv-GAMConv (ie, a global dynamic convolution module) for performing a dimensionality reduction operation, and the image restoration layer includes a Conv2d_BN_SiLU module, PConv-GAMConv, and PConv-SPPF-CA (Partial convolution–SPPF-CoordAttention) for performing a dimensionality reduction operation.
[0057] It should be noted that PConv-SPPF-CA is a module that combines partial convolution, spatial pyramid pooling and coordinate attention, which can better handle occluded areas, capture multi-scale information and pay attention to spatial location information in image processing and computer vision tasks, thereby improving the performance and generalization ability of the model.
[0058] In this embodiment, the feature map can be processed by the global dynamic convolution layer and the image restoration layer to obtain the third channel feature map, which can extract richer and more accurate feature information and enhance the sensitivity of the model to local features, such as Figure 3 As shown, feature map X4 (i.e., the first channel feature map) is convolved through the Conv2D_BN_SiLU module to obtain feature map X5, X5 is passed through the PConv-GAMConv module to output feature map X6 (i.e., the second channel feature map), feature map X6 is convolved through the Conv2D_BN_SiLU module to obtain feature map X7, X7 is passed through the PConv-GAMConv module to output feature map X8, and X8 is passed through the PConv-SPPF-CA module to obtain feature map X9 (i.e., the third channel feature map).
[0059] Step S208, in the steel bar binding quality detection model, the 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.
[0060] It should be noted that FPN (Feature Pyramid Network) is a deep neural network structure used for target 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 feature fused through 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 detail information and semantic information in the image.
[0062] Step S210, in the steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected using the head detection layer to obtain a detection result.
[0063] It should be noted that Head (i.e., head detection layer) is a deep learning model layer used to detect whether there is a human head in an image or video. It is responsible for directly predicting the category, position (including the coordinates of the bounding box) and confidence of the object from the feature map.
[0064] Optionally, the above detection results may include: bounding box coordinates, category labels, and confidence scores.
[0065] Among them, the bounding box coordinates refer to the position and size information of the rectangular bounding box where the detected target is located, usually expressed by the coordinates of the upper left corner and the lower right corner, that is, the position of each binding point; the category label refers to the category to which the target belongs; the confidence score indicates the model's confidence in the detection result.
[0066] In this embodiment, the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map 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 3D tensor containing prediction information, with each row corresponding to one prediction.
[0067] Step S212, obtaining the binding quality data of the target steel bar according to the detection result output by the steel bar binding quality detection model.
[0068] In this embodiment, the binding quality data of the target steel bars can be obtained according to the detection results output by the steel bar binding quality detection model, so as to evaluate the quality and eligibility of the binding work.
[0069] As can be seen from the above, in an embodiment of the present invention, an initial steel bar binding image of a target steel bar can be obtained, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; the initial steel bar binding image is input into a steel bar binding quality inspection model, so as to process the initial steel bar binding image using a first convolutional layer in the steel bar binding quality inspection model to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar 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 includes a sample steel bar binding image and a sample detection result corresponding to the sample steel bar binding image; in the steel bar binding quality inspection model, the first channel feature map is processed using a global dynamic convolutional layer to obtain a second channel feature map, and the second channel feature map is processed using an image restoration layer to obtain a third channel feature map, wherein the image restoration layer includes a partial convolution-coordinate attention model; in the steel bar binding quality inspection model, In the reinforcement binding quality detection model, the 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; in the reinforcement binding quality detection model, the head detection layer is used to detect the fourth channel feature map, the fifth channel feature map and the sixth channel feature map to obtain the detection results; the binding quality data of the target reinforcement is obtained according to the detection results output by the reinforcement binding quality detection model, so that when detecting reinforcement images, the network pays more attention to dense and homogeneous small-sized objects and pays more attention to areas that make important contributions to classification or positioning, improves the discrimination of features, and enables the model to efficiently identify and accurately locate reinforcement binding points in complex environments, thereby achieving the technical effect of improving the accuracy and robustness of the reinforcement binding quality detection model, reducing the number of parameters and calculations of the model, and meeting the requirements of the reinforcement binding quality detection task for lightweight and high real-time performance of the model.
[0070] The technical solution provided by the embodiment of the present invention solves the technical problems that the target detection algorithm used in steel bar binding in the related art has poor performance in small target detection, is prone to missed detection and false detection, and has low reliability.
[0071] According to the above embodiment of the present invention, the sample steel bar binding images include: tied steel bar images corresponding to the tied steel bars, untied steel bar images corresponding to the untied steel bars, and steel bar images of incorrectly tied steel bars with unqualified binding quality; each of the sample steel bar binding images is marked with a steel bar binding point using a marking tool, and the marking information of the marking tool includes: the exact position of the steel bar binding point.
[0072] In this embodiment, a basic rebar tying data set can be collected (in actual engineering, the rebar tying scene is photographed using a camera), and based on the collected data set, a certain number of negative samples are created by simulating irrelevant rebar tying points or incorrect rebar tying methods, the number of positive and negative samples is balanced, the constructed data set is annotated, and then a label file is generated for each image.
[0073] Optionally, the above data set may include: sample steel bar binding images and label data corresponding to the images.
[0074] Optionally, the above-mentioned image data may include three categories: tied steel bars, untied steel bars and steel bars with insufficient tying quality.
[0075] Optionally, the above-mentioned label data may include three attributes: the exact location of the steel bar binding point, the location of the unbound point and the binding quality score of the bound point.
[0076] Optionally, the above-mentioned label file may include: location information of the reinforcement binding points and their status classification.
[0077] It should be noted that the dataset annotation is to use annotation tools to annotate the steel bar binding points for each captured image, that is, to annotate the extracted steel bar binding area with binding points, and to annotate the quality score for each binding point. The annotated information includes the exact location of the steel bar binding point, and a rectangular frame is used to distinguish the different states of the steel bars. For the bound steel bars, the label file contains the binding quality score, which is presented in the form of a score. The score can be based on visual inspection or other quality assessment criteria.
[0078] According to the above embodiment of the present invention, before the initial steel bar binding image is input into the steel bar binding quality detection model, the steel bar binding quality detection method further includes: performing a preprocessing operation on the initial steel bar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
[0079] In this embodiment, before the initial rebar binding image is input into the rebar binding quality detection model, a preprocessing operation can be performed on the collected initial rebar binding image to ensure that the image quality is suitable for model training, and then a data set saving operation is performed, that is, the processed image and the corresponding label file are stored in a unified data set. The data set can be divided into a training set, a validation set, and a test set in proportion for use in different stages of the model.
[0080] Optionally, the above data preprocessing operation may include: image size adjustment, image enhancement, etc.
[0081] It should be noted that the above data preprocessing operations may include but are not limited to the above contents, which will not be repeated here.
[0082] According to the above embodiment of the present invention, in the steel bar binding quality detection model, the first channel feature map is processed by the global dynamic convolution layer to obtain the second channel feature map, including: in the steel bar binding quality detection model, the seventh channel feature map is processed by the second convolution 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 convolution layer, and the first channel feature map is convolved by the global dynamic convolution layer to obtain the second channel feature map; the second channel feature map is divided along the channel dimension by the global dynamic convolution layer to obtain multiple second channel feature maps, and parts of the multiple second channel feature maps are processed to obtain a second third channel feature map; the second third channel feature map is spliced with the multiple second second channel feature maps to obtain a second fourth channel feature map; the second fourth channel feature map is processed to obtain a second fifth channel feature map; the second fifth channel feature map is convolved to obtain a second sixth channel feature map; the second sixth channel feature map is input into the attention mechanism layer for processing to obtain the second channel feature map.
[0083] Here combined Figure 4 This embodiment is described in detail. Figure 4 is a structural diagram of a 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, and the feature map X3 is recorded as F1 (i.e., the first one-channel feature map). PConv-GAMConv performs a PConv (Partial convolution) convolution on F1 to obtain a feature map F2 (i.e., the second one-channel feature map), and then F2 is divided into two parts along the channel dimension, one part is the unprocessed feature F4 (i.e., the second three-channel feature map), 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 through two layers of CBS (i.e., Conv2D_BN_SiLU) layers as the output of Bottleneck. In PConv-GAMConv, the output of each Bottleneck is used as the input of the next Bottleneck, which is repeated n times in sequence. The output of each Bottleneck is concatenated with the unprocessed feature maps F3 and F4 to obtain feature map F5 (i.e., the second four-channel feature map). After a layer of PConv convolution, feature map F6 (i.e., the second five-channel feature map) is obtained. Then, feature map F6 is convolved through a layer of CBS convolution to obtain feature map F7 (i.e., the second six-channel feature map). Finally, feature map F7 is input into GAM (Global Attention Module, attention mechanism layer) to obtain feature map F8 (i.e., the second channel feature map) as the final output feature map of PConv-GAMConv.
[0084] It should be noted that the above-mentioned GAM (Global Attention Module) is a global attention mechanism, which is used to enhance the perception of neural networks to global contextual information. GAM is usually embedded between different layers of neural networks to extract global features and guide the model to better focus on important information; the above-mentioned PConv (Partial convolution) is a convolution module. Partial convolution can extract spatial features more efficiently by reducing redundant calculations and memory accesses at the same time.
[0085] In this embodiment, a new feature extraction module is constructed by using partial convolution PConv and combining it with the global attention mechanism (GAM) to enhance the global context information and improve the ability of the model backbone network to extract features of fuzzy targets and small targets.
[0086] The specific design steps of the PConv-GAMConv module are as follows: Here, the size of F1 is C×H×W as an example for explanation, where C represents the number of channels, H represents the height, and W represents the width. Specifically, the above PConv-GAMConv design steps are: 1) Input F1 to the PConv layer, select 1 / 4 of the input channels in F1 for convolution operation, and obtain the intermediate feature map after convolution. The remaining channels keep the same size and are spliced with the intermediate feature map and output to obtain F2. The number of channels of F2 is the same as that of F1, and the size is C×H×W; 2) F2 is divided into feature map F3 and feature map F4 with a size of C / 2×H×W along the number of channels; 3) F3 is input to Bottleneck, and Bottleneck is F3 performs two consecutive CBS convolution operations with a convolution kernel of 3×3 and a stride of 1, and then outputs an intermediate feature map; 4) Each Bottleneck output intermediate feature map is concatenated with feature maps F3 and F4 to obtain a feature map F5 of size (n+2)·C / 2×H×W; 5) F5 is input into the PConv layer for partial convolution to obtain an output feature map F6 of size (n+2)·C / 2×H×W; 6) F6 is subjected to CBS convolution to obtain an output feature map F7 of size C×H×W, and the size of feature map F7 is consistent with that of feature map F1; 7) F7 is input into the GAM attention mechanism to obtain an output feature map F8 of size C×H×W, where F8 is the final output feature map of PConv-GAMConv.
[0087] Here, the steel bar binding target feature map with a size of 64×320×320 is taken as an example for explanation. For the steel bar binding target feature map F1 with an input size of 64×320×320, PConv-GAMConv first inputs it into the PConv layer. For the feature map F1, PConv selects 1 / 4 of the input channels in the feature map for convolution operation, and the remaining channels remain unchanged in size and are concatenated with the 1 / 4 channels after the convolution operation for output. The number of channels of 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 with a size of 32×320×320 along the number of channels. Then, the feature map F3 is input to Bottleneck. Bottleneck performs two consecutive CBS convolution operations on F3 with a convolution kernel of 3×3 and a step size of 1 to obtain an output intermediate feature map with a size of 32×320×320. In the PConv-GAMConv module, the output intermediate feature map of each Bottleneck is used as the input of the next Bottleneck, and this is repeated n times in sequence. The output intermediate feature maps of the above n Bottlenecks are then concatenated with feature maps F3 and F4 to obtain a feature map F5 of size (n+2)×32×320×320, where (n+2)×32 is the number of channels. The feature map F5 is then input into the PConv layer for partial convolution to obtain an output feature map F6 of size (n+2)×32×320×320. The feature map is then convolved with CBS to obtain a feature map F7 of size 64×320×320. At this time, the size of the feature map F7 is consistent with that of the input feature map F1. The feature map F7 of size 64×320×320 is input into the GAM attention mechanism to obtain an output feature map F8 of size 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 by each bottleneck is used as the input of the next bottleneck. It can be repeated n times according to the actual situation, and n is generally 1 by default.
[0089] According to the above embodiment of the present invention, the second channel feature map is processed by an image restoration layer to obtain a third channel feature map, including: in a steel bar binding quality detection model, the second channel feature map is convolved by a third convolution layer to obtain a third one-channel feature map, and a global dynamic convolution layer is used to output a third two-channel feature map corresponding to the third one-channel feature map; the third two-channel feature map is convolved by an image restoration layer to obtain a third three-channel feature map; the third three-channel feature map is pooled in sequence by multiple pooling layers to obtain a pooling result; after each of the multiple pooling layers completes the pooling process, the third three-channel feature map is respectively concatenated with the pooling result to obtain a third four-channel feature map; the third four-channel feature map is input into the attention mechanism layer for processing to obtain a third five-channel feature map; the third five-channel feature map is convolved to obtain a third channel feature map.
[0090] Here combined Figure 5 This embodiment is described in detail. Figure 5 is a structural diagram of a partial convolution-coordinate attention module according to an embodiment of the present invention, such as Figure 5 As shown in the figure, the output feature map X8 of the upper 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 for F 11 Perform a PConv convolution to get the feature map F 22 (i.e., the third two-channel feature map); then F 22 After passing through three maximum pooling layers MaxPool2d in sequence, at the same time, the output intermediate feature map of each maximum pooling layer MaxPool2d is compared with the unprocessed feature map F 22 Splice along the number of channels to get the feature map F 33 (i.e., the third three-channel feature map); the feature map F 33 Input to the CA (CoordAttention) attention mechanism to obtain the output feature map F 44 (i.e., the third four-channel feature map); the feature map F 44 After some convolutional layers, the output feature map F 55 (i.e., 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 That is the feature map X9 (ie, the third channel feature map).
[0091] In this embodiment, a partial convolution-coordinate attention module named PConv-SPPF-CA is designed to improve the model's ability to handle occluded targets in rebar binding images. By using partial convolution PConv combined with the coordinate attention mechanism (CA), the local and global relationships in the target feature space can be better captured, thereby improving the model's detection performance for occluded binding points in rebar binding images.
[0092] It should be noted that the above-mentioned CA (CoordAttention) is a publicly available coordinate attention mechanism. When calculating attention, CoordAttention not only considers the input feature information, but also the position information of each pixel, so as to better capture the local and global relationships in space.
[0093] The specific design steps of the PConv-SPPF-CA module are as follows: 11 The dimensions of C×H×W are taken as an example. Specifically, the PConv-SPPF-CA design steps are as follows: 1) Rebar binding characteristic diagram F 11 After PConv layer, select F 11 The convolution operation is performed on 1 / 4 of the input channels to obtain the intermediate feature map after convolution; the remaining channels keep the same size and are concatenated with the intermediate feature map before output to obtain F 22 , F 22 The number of channels and F 11 The number of channels is the same as that of the feature map F with a size of C×H×W. 22 After passing through three maximum pooling layers MaxPool2d in sequence, the size of the output intermediate feature map of each MaxPool2d is C×H×W; 3) The output intermediate feature maps of the three maximum pooling layers MaxPool2d are compared with the unprocessed feature map F 22 Concatenate along the number of channels to obtain an output feature map F of size 4·C×H×W 33 ; 4) The feature map F with size 4·C×H×W 33 Input CA attention mechanism and get the output feature map F 44 , feature map F 44 The size of the feature map F is 4·C×H×W; 5) The size of the feature map F is 4·C×H×W 44 After partial convolution in the PConv layer, we get an output feature map F with a size of 4·C×H×W. 55 ; 6) The feature map F of size 4·C×H×W 55 After CBS convolution, we get an output feature map F of size C×H×W 77 , then the output feature map F 66The size and characteristics of F 11 The size is consistent. 66 It is the final output feature map of PConv-SPPF-CA, which is feature map X9.
[0094] Here we take the steel bar binding target feature map with a size of 512×20×20 as an example. For the steel bar binding target feature map F with an input size of 512×20×20 11 , PConv-SPPF-CA first inputs it into the PConv layer, for the feature map F 11 PConv selects 1 / 4 of the input channels in the feature map for convolution operation, and the remaining channels remain unchanged in size and are concatenated with the 1 / 4 channels after the convolution operation before 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 F with a size of 512×20×20. 22 , the feature map F with size 512×20×20 22 After passing through three maximum pooling layers MaxPool2d in sequence, the size of the output intermediate feature map of each maximum pooling layer is 512×20×20. The output intermediate feature maps of the three maximum pooling layers MaxPool2d are compared with the unprocessed feature map F 22 Concatenate along the number of channels to obtain an output feature map F with a size of 4×512×20×20 33 The feature map F with size 4×512×20×20 33 Input CA attention mechanism and get the output feature map F 44 , feature map F 44 The size of the feature map F is 4×512×20×20. 44 After partial convolution of PConv, we get an output feature map F with a size of 4×512×20×20. 55 , the feature map F with size 4×512×20×20 55 After CBS convolution, we get an output feature map F of size 512×20×20 66 , then the output feature map F 66 The size and characteristics of F 11 The size is consistent. 66 It is the final output feature map of PConv-SPPF-CA, which is feature map X9.
[0095] According to the above embodiment of the present invention, in the steel bar binding quality detection model, the 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, including: fusing the first channel feature map with the second channel feature map and the third channel feature map and upsampling processing to obtain the fourth channel feature map; fusing the second channel feature map with the first channel feature map and the third channel feature map and upsampling processing to obtain the fifth channel feature map; fusing the third channel feature map with the first channel feature map and the second channel feature map and downsampling processing to obtain the sixth channel feature map.
[0096] In this embodiment, features of different scales are fused through the FPN (i.e., feature pyramid network) module to obtain a feature map with multi-scale information, which can better detect objects of different scales and improve the performance of target detection.
[0097] like Figure 3 As shown in FIG. 1 , 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, the feature map X4 is fused with the feature map after upsampling of X6 and X9, and the fused feature map is X 10 (i.e., the fourth channel feature map), feature map X6 fuses the feature map after downsampling X4 and upsampling X9, and the fused feature map is X 11 (i.e., the fifth channel feature map), feature map X9 fuses the feature maps after downsampling of X4 and X6, and the fused feature map is X 12 (i.e., the sixth channel feature map).
[0098] It should be noted that the above-mentioned upsampling process is the process of increasing the size of an image or feature map. In neural networks, upsampling is often used to restore the size of an image or feature map, especially after multiple downsamplings, when it is necessary to reconstruct a feature map of the original size or a larger size; the above-mentioned downsampling process is the process of reducing the size of an image or feature map. In deep learning, downsampling is usually used to reduce the amount of computation, memory requirements, and improve the level of abstraction of features.
[0099] According to the above embodiment of the present invention, in the steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected by using the head detection layer to obtain the detection result, including: inputting 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 perform bounding box prediction on the fourth channel feature map, the fifth channel feature map and the sixth channel feature map, and obtain 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; according to the relationship between the bounding box confidence and the confidence threshold in the bounding box information, selecting a target bounding box whose bounding box confidence is higher than the confidence threshold; determining the binding state corresponding to the binding point in the target bounding box, wherein the binding state includes: binding point position, binding point missed position, and binding quality of the bounded point; outputting the binding state in the binding result display diagram to obtain the detection result.
[0100] In this embodiment, the feature map with multi-scale information is input into the Head (i.e., head detection layer) detection head 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 in the figure, the output of the detection head is a three-dimensional tensor, in which each row contains the category probability of each predicted box at each spatial position (relative to the feature map), the coordinates of the bounding box, and the confidence of the object's existence. It should be noted that after the model outputs all predictions (the image containing the detection results has not been output at this time), there will be many overlapping bounding boxes. In order to solve this problem, NMS (Non-Maximum Supperssion) is used to select the best bounding box. NMS compares the confidence of all boxes, retains the box with the highest confidence, and removes other boxes with large overlap (IoU exceeds a certain threshold).
[0102] Optionally, the above-mentioned bounding box information may include: bounding box coordinates and bounding box confidence, etc.
[0103] Optionally, the above-mentioned binding status may include: the location of the binding point, the location of the binding point that is missed, and the binding quality of the binding point, etc.
[0104] It should be noted that the above bounding box prediction means that each cell is responsible for predicting the coordinates and confidence of several bounding boxes. These coordinates will pass through a sigmoid function to ensure that the output value is between 0 and 1, which can be trained more stably; the above category and confidence prediction means that each bounding box has a confidence prediction in addition to the coordinate prediction, which is used to indicate the probability of the existence of a specific category of objects in the box.
[0105] Optionally, the coordinates of the above bounding box may include: a center point (x, y) (relative to the position of the feature map cell), a width and a height (w, h) (scaled relative to the width and height of the entire image).
[0106] According to the above embodiment of the present invention, the loss function of the steel bar binding quality detection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD , α represents the weight ratio of WIOU, and WIOU is obtained by the following formula: L WIOU The calculation formula of WIOU is shown in Figure 1. IOU represents the intersection-over-union loss between the predicted bounding box and the true bounding box, x, y represent the horizontal and vertical positions of the center point of the bounding box in the steel bar binding image, xt, yt represent the horizontal and vertical positions of the center point of the true bounding box in the steel bar binding image, wc, hc represent the width and height of the minimum circumscribed rectangle of the predicted bounding box and the true bounding box, and exp represents the accuracy of the anchor box in the steel bar binding image; NWD is obtained by the following formula: C represents the number of data set categories, W2 2 (N a ,N b ) is the second-order distance definition, N a and N b Respectively represent the bounding box A=(cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ), ||·|| F represents the predetermined norm, c represents the scaling factor, which is used to adjust the scale of the center coordinates, and x a ,y a 、w a 、h a are the center x coordinate, center y coordinate, width and height of the bounding box A respectively, b ,y b 、w b 、hb are the center x coordinate, center y coordinate, width and height of the bounding box B respectively.
[0107] In addition, in an embodiment of the present invention, W2 2 (N a ,N b ) is a second-order Wasserstein distance definition, and the above predetermined norm is the Frobenius norm.
[0108] In this embodiment, WIOU and NWD can be combined as the positioning regression loss function NWD-WIOU. NWD-WIOU can maintain scale invariance to a certain extent, is fairer when measuring the similarity between the bounding boxes of tiny objects, and can improve the model's positioning accuracy for small targets in complex environments, making the model more robust when detecting steel bar binding targets.
[0109] It should be noted that the above NWD is a loss function used to estimate the difference between the predicted result and the actual result; WIOU is a commonly used evaluation index in the field of target detection, which is used to measure the prediction accuracy of the detection algorithm for the target position and size.
[0110] Figure 6 is a flow chart of an optional method for detecting the quality of steel bar binding according to an embodiment of the present invention, such as Figure 6As shown, in this embodiment, a steel bar dataset is first constructed and preprocessed; the Conv2d_BN_SiLU module is used to perform preliminary feature extraction on the input steel bar image; a global dynamic convolution module (PConv-GAMConv) is designed to extract deep features in the feature map; the deep features in the feature map are extracted through the global dynamic convolution module to provide a basis for subsequent feature fusion and attention mechanism; a partial convolution-coordinate attention module (PConv-SPPF-CA) is designed to further extract key information in the feature map and enhance the model's detection of steel bars. Ability; Use FPN (Feature Pyramid Network) module to fuse features at different levels to improve the model's detection performance for steel bars of different scales; Design a NWD-WIOU loss function to optimize the detection performance of the model so that it can more accurately locate the position of the steel bars; Use the Head detection head to detect the fused features and output the category and location information of the steel bars; Train and update the parameters of each layer based on the constructed steel bar binding quality detection model, first initialize all neural network parameters, set the hyperparameters related to the steel bar binding quality detection model, and divide the processed steel bar binding data set into training set, validation set and test set. The training set and validation set data are divided into multiple batches. Each time, a batch of training set data is input into the steel bar binding quality detection model for training to obtain the training loss value loss of the batch. After a round of training for all batch data of the entire training set is completed (in the actual training process, there may be multiple rounds), the validation set is input into the steel bar binding quality detection model in batches to obtain the corresponding batch loss value batch_loss. During training and verification, the steel bar binding quality detection model will automatically learn and adjust parameters according to each loss and batch_loss situation. When the training process has been carried out for one or more rounds until the batch_loss value converges, the training of the steel bar binding quality detection model is completed; the trained steel bar binding quality detection model is used to detect the steel bar binding image to realize automatic detection of the quality of steel bar binding.
[0111] Optionally, the above hyperparameters may include: training rounds, batch size, optimization method, learning rate, maximum value of gradient clipping strategy, etc.
[0112] It should be noted that the above hyperparameters may include but are not limited to the above contents, which will not be repeated here.
[0113] Here, we take the dataset containing 4000 steel bar binding images of different scenes, the feature map size is H×W×C, and the steel bar binding point map X1 size is 640×640×3 as an example. When dividing the dataset, the dataset is randomly divided into training set and validation set in a ratio of 8:2, that is, 3200 images are used as training set and 800 images are used as validation set. The data in the training set are input into the steel bar binding quality detection model for training. The whole training process is set to 300 epochs. The parameters in the model are adjusted according to the loss value in each iteration process. After adjusting the relevant parameters, the accuracy of the steel bar binding quality detection model tends to be stable, mainly fluctuating between 90-95%. Among them, the PGCA model has good accuracy for the input steel bar binding. The operation steps for the tied image are as follows: 1) X1 passes through the Conv2d_BN_SiLU module with a convolution kernel size of 3×3 and a step size of 2 (that is, the convolution layer BN layer and SiLU layer with a convolution kernel size of 3×3 and a step size of 2 are connected in series) to obtain a steel bar binding point feature map X2 with 64 channels and a size of 320×320×64; 2) X2 is further reduced in dimension by the Conv2d_BN_SiLU module to obtain a feature map X3 with a size of 160×160×128; 3) The feature map X3 passes through the PConv-GAMConv global dynamic convolution module to obtain a feature map X4 with a size of 160×160×128; 4) The feature map X4 passes through the Conv2d_BN_SiLU module Continue to perform dimensionality reduction operation to obtain a feature map X5 with a size of 80×80×256; 5) Feature map X5 is passed through the PConv-GAMConv global dynamic convolution module to obtain a feature map X6 with a size of 80×80×256; 6) Feature map X6 is passed through the Conv2d_BN_SiLU module to continue dimensionality reduction operation to obtain a feature map X7 with a size of 40×40×512; 7) Feature map X7 is passed through the PConv-GAMConv global dynamic convolution module to obtain a feature map X8 with a size of 40×40×512; 8) Feature map X8 is passed through the PConv-SPPF-CA partial convolution-coordinate attention module to obtain a feature map X9 with a size of 40×40×512; 9) The feature map X 4. X6 and X9 are input into the feature fusion module for feature fusion, that is, feature map X4 is fused with 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 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 feature maps after downsampling of X4 and X6, and the fused feature map is X12 with a size of 40×40×512; 10) X10, X11, and X12 are input into the Head detection head of the PGCA model for target detection, and a three-dimensional tensor containing prediction information is output, where each row corresponds to a prediction, including bounding box coordinates, category label, and confidence score.
[0114] Figure 7 is a schematic diagram of a steel bar binding image detection result according to an embodiment of the present invention, such as Figure 7 As shown, the collected steel bar binding image data is input into the steel bar binding quality detection model, and then the steel bar binding quality detection model detects the image to obtain the steel bar binding quality detection result, and outputs the detection result on the image, including the position of each binding point, the missed binding position of the binding point, and the binding quality of the bound point.
[0115] Through the technical solution provided by the above embodiment of the present invention, a data set suitable for steel bar detection is first constructed, Conv2D_BN_SiLU is used for image feature extraction, deep feature extraction is performed through the global dynamic convolution module and the partial convolution-coordinate attention module, and feature fusion at different levels is performed through the feature pyramid network (FPN) module. The model training process is optimized by the NWD-WIOU loss function, and the Head detection head is used for detection. Through the training and verification process, the parameters of the model are continuously optimized to improve the detection performance of the model. The trained model is applied to the actual steel bar detection task to realize automatic steel bar recognition and detection. The diversity of image features, the computational efficiency of the model and other factors are comprehensively considered, and the cumbersome steps of manually adjusting the anchor frame size in the traditional method as well as the problems of false detection and missed detection are avoided, so as to improve the detection accuracy and robustness of the model for steel bars.
[0116] That is, the above-mentioned technical solution provided by the embodiment of the present invention comprehensively considers various factors, adopts a suitable data set construction method, advanced loss function and feature extraction model, which improves the model's ability to extract detailed features of steel bar binding targets and the positioning accuracy of steel bar 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-mentioned embodiment of the present invention solves the following problems: 1) Low model detection accuracy: The existing target detection algorithm has relatively low positioning accuracy for targets in the rebar binding image. Since the details of the rebar binding points are fuzzy, it is difficult to accurately capture the position of the target by directly using the existing official model detection, and its single grid prediction frame leads to large positioning errors; 2) Difficulty in detecting small targets: The rebar binding image involves a variety of small-sized targets, such as thin rebars, etc., which poses a challenge to the detection accuracy of the existing target detection algorithm. The existing target detection algorithm has weak performance in detecting small targets, and is prone to missed detection and false detection; 3) Difficulty in detecting occluded targets: Rebars usually require multiple layers of binding, and the rebar binding points may be blocked by other objects or structures, resulting in some rebar binding points being unable to be detected. However, the existing technology can generally only detect completely visible targets. At the same time, it has the following beneficial effects: 1) A method for using a global dynamic convolution module (PConv-GAMConv) to improve the network's detection accuracy for blurred targets and small targets in steel bar binding images. In PConv-GAMConv, the GAM attention mechanism is combined with partial convolution PConv to improve the model's ability to extract detailed features of steel bar binding targets and reduce dependence on redundant information generated during model iteration; 2) A method for using a partial convolution-coordinate attention module (PConv-SPPF-CA) to improve the model's ability to handle occluded targets in steel bar binding images. By using the CA attention mechanism combined with partial convolution PConv, the model's detection performance of occluded binding points in steel bar binding images is improved; 3) A method for using the NWD-WIOU loss function to improve the model's positioning accuracy for small targets in complex environments. By using the normalized Gauss-Wasserstein distance (NWD) combined with WIOU, a new positioning regression loss function is constructed to improve the positioning accuracy of steel bar binding targets in complex environments.
[0118] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0120] According to an embodiment of the present invention, a device for detecting the quality of steel bar binding is provided for implementing the above-mentioned method for detecting the quality of steel bar binding. Figure 8 is a schematic diagram of a detection device for steel bar binding quality according to an embodiment of the present invention, such as 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 in the operation process of the power grid is described below.
[0121] The first acquisition module 801 is used to acquire an initial steel bar binding image of a target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality;
[0122] The first processing module 803 is used to input the initial steel bar binding image into the steel bar binding quality detection model, so as to use the first convolution layer in the steel bar binding quality detection model to process the initial steel bar binding image to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar binding quality detection model is a model obtained by machine learning training using multiple sets of training data, and each set of the multiple sets of training data includes a sample steel bar binding image and a sample detection result corresponding to the sample steel bar binding image;
[0123] The second processing module 805 is used to process the first channel feature map using a global dynamic convolution layer (PConv-GAMConv) to obtain a second channel feature map in the steel bar binding quality detection model, and 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 convolution-coordinate attention model;
[0124] A fusion module 807 is used to fuse the first channel feature map, the second channel feature map and the third channel feature map using a feature pyramid network (FPN) in the steel bar binding quality detection model to obtain a fourth channel feature map, a fifth channel feature map and a 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 using the head detection layer (Head) in the steel bar binding quality detection model to obtain a detection result;
[0126] The second acquisition module 811 is used to obtain the binding quality data of the target steel bar according to the detection result output by the steel bar binding quality detection model.
[0127] It should be noted here that the above-mentioned first acquisition module 801, first processing module 803, second processing module 805, fusion module 807, detection module 809 and second acquisition module 811 correspond to steps S202 to S212 in the above-mentioned embodiments, and the six modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0128] As can be seen from the above, in the scheme recorded in the above embodiment of the present invention, first, a first acquisition module can be used to acquire an initial steel bar binding image of the target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; then, a first processing module can be used to input the initial steel bar binding image into a steel bar binding quality detection model, so as to use the first convolution layer in the steel bar binding quality detection model to process the initial steel bar binding image to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar binding quality detection model is a model obtained by machine learning training using multiple sets of training data, each of the multiple sets of training data includes a sample steel bar binding image and a sample detection result corresponding to the sample steel bar binding image; then, a second processing module can be used to process the first channel feature map in the steel bar binding quality detection model using a global dynamic convolution layer to obtain a second channel feature map, and use an image restoration layer to process the second channel feature map to obtain a third channel feature map, wherein the image restoration layer includes a partial convolution-coordinate attention force model; secondly, a fusion module can be used to fuse the first channel feature map, the second channel feature map and the third channel feature map using a feature pyramid network in the steel bar binding quality detection model to obtain a fourth channel feature map, a fifth channel feature map and a sixth channel feature map; a detection module can also be used to detect the fourth channel feature map, the fifth channel feature map and the sixth channel feature map using a head detection layer in the steel bar binding quality detection model to obtain a detection result; finally, a second acquisition module can be used to obtain the binding quality data of the target steel bar according to the detection result output by the steel bar binding quality detection model, so that when detecting steel bar images, the network pays more attention to dense and homogeneous small-sized objects and pays more attention to areas that make important contributions to classification or positioning, improves the discrimination of features, and enables the model to efficiently identify and accurately locate steel bar binding points in complex environments, thereby achieving the technical effect of improving the accuracy and robustness of the steel bar binding quality detection model, reducing the number of parameters and calculations of the model, and meeting the requirements of the steel bar binding quality detection task for lightweight and high real-time performance of the model.
[0129] The technical solution provided by the embodiment of the present invention solves the technical problems that the target detection algorithm used in steel bar binding in the related art has poor performance in small target detection, is prone to missed detection and false detection, and has low reliability.
[0130] In an optional embodiment, a first acquisition module includes: sample steel bar binding images: tied steel bar images corresponding to tied steel bars, untied steel bar images corresponding to untied steel bars, and steel bar images of incorrectly tied steel bars with unqualified binding quality; each of the sample steel bar binding images in the data set is annotated with a marking tool to mark the steel bar binding points, and the marking information of the marking tool includes: the exact location of the steel bar binding point.
[0131] In an optional embodiment, the first acquisition module further includes: a preprocessing unit, configured to perform a preprocessing operation on the initial steel bar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
[0132] In an optional embodiment, the second processing module includes: a first processing unit, used to process the seventh channel feature map using the second convolution layer in the steel bar binding quality detection 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, used to input the first channel feature map into the global dynamic convolution layer, so as to perform convolution processing on the first channel feature map using the global dynamic convolution layer to obtain a second channel feature map; a third processing unit, used to segment the second channel feature map along the channel dimension using the global dynamic convolution layer, A plurality of second two-channel feature maps are obtained, and parts of the plurality of second two-channel feature maps are processed to obtain a second three-channel feature map; a concatenation unit is used to concatenate the second three-channel feature map with the plurality of second two-channel feature maps to obtain a second four-channel feature map; a fourth processing unit is used to process the second four-channel feature map to obtain a second five-channel feature map; a fifth processing unit is used to perform convolution processing on the second five-channel feature map to obtain a second six-channel feature map; a sixth processing unit is used to input the second six-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, which is used to use the third convolution layer to convolve the second channel feature map in the steel bar binding quality detection model to obtain a third one-channel feature map, and use the global dynamic convolution layer to output a third two-channel feature map corresponding to the third one-channel feature map; an eighth processing unit, which is used to use the image restoration layer to convolve the third two-channel feature map to obtain a third three-channel feature map; a ninth processing unit, which is used to use multiple pooling layers to sequentially pool the third three-channel feature map to obtain a pooling result; a splicing unit, which is used to splice the third three-channel feature map with the pooling result after each of the multiple pooling layers completes the pooling process to obtain a third four-channel feature map; a tenth processing unit, which is used to input the third four-channel feature map into the attention mechanism layer for processing to obtain a third five-channel feature map; and an eleventh processing unit, which is used to convolve the third five-channel feature map to obtain a third channel feature map.
[0134] In an optional embodiment, the fusion module includes: a twelfth processing unit, which is used to fuse and upsample the first channel feature map with the second channel feature map and the third channel feature map to obtain a fourth channel feature map; a thirteenth processing unit, which is used to fuse and upsample the second channel feature map with the first channel feature map and the third channel feature map to obtain a fifth channel feature map; and a fourteenth processing unit, which is used to fuse and upsample the third channel feature map with the first channel feature map and the second channel feature map to obtain a sixth channel feature map.
[0135] In an optional embodiment, the detection module includes: a prediction unit, which is 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 perform bounding box prediction on the fourth channel feature map, the fifth channel feature map and the sixth channel feature map, and obtain 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, which is used to select a target bounding box whose bounding box confidence is higher than the confidence threshold according to the size relationship between the bounding box confidence and the confidence threshold in the bounding box information; a first determination unit, which is used to determine the binding state corresponding to the binding point in the target bounding box, wherein the binding state includes: binding point position, binding point missed position, and binding quality of the bounded point; an output unit, which is used to output the binding state in a binding result display diagram to obtain a detection result.
[0136] According to another aspect of an embodiment of the present invention, a processor is provided, and the processor is used to run a program, wherein when the program is run, any one of the above-mentioned methods for detecting the quality of steel bar binding is executed.
[0137] According to another aspect of an embodiment of the present invention, there is also provided a computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the above-mentioned methods for detecting the quality of steel bar binding is executed.
[0138] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium comprising a stored program, wherein the program executes any one of the above-mentioned methods for detecting the quality of steel bar binding.
[0139] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the communication devices in a communication device group.
[0140] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0141] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made 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. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0144] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0145] If the integrated unit is implemented in the form of 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0146] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting the quality of steel bar binding, characterized in that: include: Acquire an initial steel bar binding image of a target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; Inputting the initial steel bar binding image into a steel bar binding quality detection model, and processing the initial steel bar binding image using the first convolutional layer in the steel bar binding quality detection model to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar binding quality detection model is a model obtained by machine learning training using multiple sets of training data, and each of the multiple sets of training data includes a sample steel bar binding image and a sample detection result corresponding to the sample steel bar binding image; In the steel bar binding quality detection model, the first channel feature map is processed by a global dynamic convolution 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, wherein the image restoration layer includes a partial convolution-coordinate attention model; In the steel bar binding 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 steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected by using the head detection layer to obtain a detection result; The binding quality data of the target steel bar is obtained according to the detection result output by the steel bar binding quality detection model.
2. The method for detecting the steel bar binding quality according to claim 1, characterized in that: The sample steel bar binding images include: tied steel bar images corresponding to tied steel bars, untied steel bar images corresponding to untied steel bars, and steel bar images of incorrectly tied steel bars with unqualified binding quality; each of the sample steel bar binding images is marked with a steel bar binding point using a marking tool, and the marking information of the marking tool includes: the exact position of the steel bar binding point.
3. The method for detecting the steel bar binding quality according to claim 1, characterized in that: Before inputting the initial steel bar binding image into the steel bar binding quality detection model, the method further includes: A preprocessing operation is performed on the initial steel bar binding image, wherein the preprocessing operation includes: image size adjustment and image pixel enhancement.
4. The method for detecting the quality of steel bar binding according to claim 1, characterized in that: In the steel bar binding quality detection model, the first channel feature map is processed by a global dynamic convolution layer to obtain a second channel feature map, including: In the steel bar binding quality detection model, the seventh channel feature map is processed by the second convolution layer to obtain the 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 to the global dynamic convolution layer, so as to perform convolution processing on the first-channel feature map using the global dynamic convolution layer to obtain a second-channel feature map; Using the global dynamic convolution layer to segment the second-first channel feature map along the channel dimension to obtain a plurality of second-second channel feature maps, and processing a portion of the plurality of second-second channel feature maps to obtain a second-third channel feature map; The second three-channel feature map is concatenated with a plurality of the second two-channel feature maps to obtain a second four-channel feature map; Processing the second four-channel feature map to obtain a second five-channel feature map; Performing convolution processing on the second five-channel feature map to obtain a second six-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 steel bar binding quality according to claim 1, characterized in that: The second channel feature map is processed by using an image restoration layer to obtain a third channel feature map, including: In the steel bar binding quality detection model, the second channel feature map is convolved by the third convolution layer to obtain a third one-channel feature map, and the third two-channel feature map corresponding to the third one-channel feature map is output by the global dynamic convolution layer; Using the image restoration layer to perform convolution processing on the third two-channel feature map to obtain a third three-channel feature map; Using multiple pooling layers to sequentially perform pooling processing on the third three-channel feature map to obtain a pooling processing result; After each of the multiple pooling layers completes the pooling process, the third three-channel feature map is respectively concatenated with the pooling process result to obtain a third four-channel feature map; Input the third four-channel feature map into the attention mechanism layer for processing to obtain a third five-channel feature map; The third five-channel feature map is convolved to obtain the third channel feature map.
6. The method for detecting the steel bar binding quality according to claim 1, characterized in that: In the steel bar binding 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, including: The first channel feature map is fused with the second channel feature map and the third channel feature map, and up-sampled 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 up-sampled 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 upsampled to obtain the sixth channel feature map.
7. The method for detecting the steel bar binding quality according to claim 1, characterized in that: In the steel bar binding quality detection model, the fourth channel feature map, the fifth channel feature map and the sixth channel feature map are detected by using the head detection layer to obtain the detection results, including: Inputting 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 perform bounding box prediction on the fourth channel feature map, the fifth channel feature map, and the sixth channel feature map, and obtain 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; According to the relationship between the bounding box confidence and the confidence threshold in the bounding box information, selecting a target bounding box whose bounding box confidence is higher than the confidence threshold; Determine the tying status corresponding to the tying point in the target boundary box, wherein the tying status includes: the tying point position, the tying point missing position, and the tying quality of the tying point; The binding state is output in a binding result display diagram to obtain the detection result.
8. The method for detecting the steel bar binding quality according to claim 1, characterized in that: The loss function of the steel bar binding quality detection model is: L NWD-WIOU =α·L WIOU +(1-α)·L NWD , α represents the weight ratio of WIOU, and WIOU is obtained by the following formula: L WIOU The calculation formula of WIOU is shown in Figure 1. IOU represents the intersection-over-union loss between the predicted bounding box and the true bounding box, x, y represent the horizontal and vertical positions of the center point of the bounding box in the steel bar binding image, xt, yt represent the horizontal and vertical positions of the center point of the true bounding box in the steel bar binding image, wc, hc represent the width and height of the minimum circumscribed rectangle of the predicted bounding box and the true bounding box, and exp represents the accuracy of the anchor box in the steel bar binding image; NWD is obtained by the following formula: C represents the number of data set categories, is the second-order distance definition, N a and N b Respectively represent the bounding box A=(cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ), c is the scaling factor used to adjust the scale of the center point coordinates, x a ,y a 、w a 、h a are the center x coordinate, center y coordinate, width and height of the bounding box A respectively, b ,y b 、w b 、h b are the center x coordinate, center y coordinate, width and height of the bounding box B, respectively, ||·|| F Represents a predetermined norm.
9. A device for detecting the quality of steel bar binding, characterized in that: include: A first acquisition module is used to acquire an initial steel bar binding image of a target steel bar, wherein the target steel bar is a steel bar that needs to be inspected for steel bar binding quality; A first processing module is used to input the initial steel bar binding image into a steel bar binding quality detection model, so as to use the first convolutional layer in the steel bar binding quality detection model to process the initial steel bar binding image to obtain a first channel feature map of the initial steel bar binding image, wherein the steel bar binding quality detection model is a model obtained by machine learning training using multiple sets of training data, each of the multiple sets of training data includes a sample steel bar binding image and a sample detection result corresponding to the sample steel bar binding image; A second processing module is used to process the first channel feature map using a global dynamic convolution layer to obtain a second channel feature map in the steel bar binding quality detection model, and 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 convolution-coordinate attention model; A fusion module, used for fusing the first channel feature map, the second channel feature map and the third channel feature map in the steel bar binding quality detection model using a feature pyramid network to obtain a fourth channel feature map, a fifth channel feature map and a sixth channel feature map; A detection module, used for detecting the fourth channel feature map, the fifth channel feature map and the sixth channel feature map by using a head detection layer in the steel bar binding quality detection model to obtain a detection result; The second acquisition module is used to obtain the binding quality data of the target steel bar according to the detection result output by the steel bar binding quality detection model.
10. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by the processor, the method for detecting the steel bar binding quality described in any one of claims 1 to 8 is performed.
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
Training method and apparatus for target detection model, device and storage medium
US20220147822A1