Steel bar detection model, method and system

By improving the YOLOv11 network, introducing multi-directional state space scanning and multi-scale adaptive feature pyramid network, and optimizing the rebar detection model, the problems of low rebar counting efficiency and large error in traditional methods are solved, and efficient and accurate automated rebar detection is achieved.

CN122073010APending Publication Date: 2026-05-22THE FOURTH ENG CO LTD OF CTCE GRP +1
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
THE FOURTH ENG CO LTD OF CTCE GRP
Filing Date
2026-04-22
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Traditional manual counting methods are inefficient and error-prone, especially in large-scale and complex construction projects where counting steel bars is difficult. Existing target detection algorithms struggle to eliminate interference from complex backgrounds, making it difficult to identify the number of steel bars.

Method used

Based on the YOLOv11 network, this paper improves upon it by introducing a multi-directional state space scanning module (MD-SSM) and a multi-scale adaptive feature pyramid network (MS-AFPN), combined with a multi-level deep feature extraction module (MDR-SS) and an adaptive spatial feature fusion module (ASFF) to optimize feature extraction and fusion, thereby enhancing the detection capability of steel bars.

Benefits of technology

It significantly improves the accuracy and robustness of rebar counting, effectively solves the problems of missed and false detections under dense rebar arrangement and reflective interference, and improves detection accuracy and speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122073010A_ABST
    Figure CN122073010A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition and target detection, in particular to a steel bar detection model, method and system. A backbone network of YOLOv11 is modified into a down-sampling module, an MD-SSM module, a first feature extraction module, a second feature extraction module, a third feature extraction module, a fourth feature extraction module, an SPPF module and a C2PSA module which are connected in sequence. According to the method, the MDR-SS module is introduced in the feature extraction stage of the backbone network for extracting the multi-level depth 2D feature map, so that the aggregation capability of the multi-scale features is remarkably enhanced while the advantages of visual state space modeling are reserved. Residual design is introduced into the MDR-SS module to minimize information loss in the depth stacking process, effective flowing of gradients is promoted, and it is ensured that multi-scale space details captured by SDRes are completely reserved before global scanning is carried out. The problems that reinforcing steel bar recognition is easily interfered by complex backgrounds, and the counting difficulty is large are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition and target detection technology, and in particular to a rebar detection model, method and system. Background Technology

[0002] In building construction, rebar counting is a fundamental task, involving the quantity and location of rebar during construction. The quantity and location of rebar play a crucial role in the stability and safety of the building structure. However, traditional manual counting methods suffer from inefficiency and are prone to errors, especially in large-scale and complex construction projects where the counting difficulty is even greater. Therefore, researching an efficient, accurate, and automated rebar counting method is of great significance for improving work efficiency, reducing human error, and enhancing project quality.

[0003] Deep learning, especially object detection algorithms, has provided a better option for rebar counting. Among object detection algorithms, such as... Figure 2 The YOLOv11 network shown is an improvement and enhancement based on the classic object detection network YOLOv8, possessing high performance and powerful feature extraction capabilities. However, the basic YOLOv11 network struggles to eliminate interference from the longitudinal surface of the reinforcing bars and the cross-section of the reinforcing bars from complex backgrounds, resulting in high difficulty in identifying the number of reinforcing bars. Summary of the Invention

[0004] To overcome the problems of existing rebar identification methods being easily affected by complex backgrounds and having high counting difficulty, this invention proposes a training method for a rebar detection model, which has higher work efficiency and lower counting error, and can bring convenience to rebar counting work.

[0005] This invention proposes a training method for a rebar detection model, which is an improvement on the YOLOv11 network and is then trained on a dataset {image; rebar annotation results}. The improvement to the YOLOv11 network is as follows: the backbone network is modified to consist of a downsampling module, an MD-SSM module, a first feature extraction module, a second feature extraction module, a third feature extraction module, a fourth feature extraction module, an SPPF module, and a C2PSA module connected in sequence. The image to be detected is sampled by the downsampling module and then input into the MD-SSM module for multi-directional state space scanning. The scan outputs of each direction are obtained and fused to obtain multi-directional state features. The MD-SSM module extracts and fuses attention features of X through multiple attention mechanisms to obtain hybrid attention features A(X); then it fuses them again. The final output of the MD-SSM module is obtained by combining A(X); The second, third, and fourth feature extraction modules have the same structure, including convolutional units and dynamic residual units connected in front and behind. The first feature extraction module and the dynamic residual unit both adopt the MDR-SS module. The MDR-SS module includes a sequentially connected convolutional network, an SDRes network, a layer normalization layer, an SS2D network, and an iRes network. The output of the SS2D network is superimposed with the output dimension of the convolutional network and then input into the iRes network. The input and output of the MDR-SS module are the input of the convolutional network and the output of the iRes network, respectively. After the input features are convolved, SDRes splits into three branches to perform convolution operations with different dilation rates d. The outputs of the three branches are dynamically fused, then batch normalized and convolved sequentially, and finally superimposed with the input feature dimensions of SDRes to obtain the output features of the SDRes network.

[0006] Preferably, the MD-SSM module scans in the specified scanning direction by flattening the feature map X into a one-dimensional feature sequence along the scanning direction. L is the sequence length; for The hidden state is recursively updated using the discretized form of a continuous-time system. , 1≤t≤L; fuse feature maps at each time step. With latent state , to obtain output features Then, the output features of all time steps t are... Rearrange the feature maps as the scan output in this scanning direction. .

[0007] Preferably, in the MD-SSM module, multi-directional state features are fused through dimensional overlay. The mixed attention feature A(X) is then processed by layer normalization and multilayer perceptron to obtain the final output of the MD-SSM module. .

[0008] Preferably, the second feature extraction module, the third feature extraction module and the fourth feature extraction module have the same structure, all of which are composed of convolutional units and dynamic residual units connected one after the other, and the first feature extraction module and the dynamic residual unit both adopt the MDR-SS module; The MDR-SS module consists of a convolutional network, an SDRes network, a layer normalization layer, an SS2D network, and an iRes network connected in sequence. The input of the iRes network is also connected to the output of the convolutional network. The input of the iRes network is the superposition of the dimensions of the outputs of the SS2D network and the convolutional network. The input of the convolutional network is used as the input of the MDR-SS module, and the output of the iRes network is used as the output of the MDR-SS module. SDRes process the input features through convolution and then split them into three parallel branches. Each branch performs convolution operations with a different dilation rate (d). The outputs of the three branches... , and After dynamic fusion of WSDI units, batch normalization and convolution are performed sequentially, followed by... The input feature dimensions are superimposed to obtain the output features of the SDRes network.

[0009] Preferably, all three branches use depthwise convolution, with the dilation rates set to 1, 3, and 5, respectively.

[0010] Preferably, the iRes network comprises the following sequentially connected layers: a linear normalization layer, a first pointwise convolutional layer, a depthwise convolutional layer, an activation layer, a second pointwise convolutional layer, and a dimension stacking layer; the input of the activation layer is also connected to the output of the first pointwise convolutional layer, and the input of the dimension stacking layer is also connected to the input of the iRes network.

[0011] Preferably, the improvement of the YOLOv11 network also includes replacing the neck network with an MS-AFPN structure, which includes: a first convolutional layer, a second convolutional layer, a third convolutional layer, a first fusion module, a second fusion module, a third fusion module, a fourth fusion module, a fifth fusion module, and an MSDA unit; The first and second fusion modules have the same structure, consisting of an ASFF_2 network and a C3k2 module connected in front and behind; the third, fourth, and fifth fusion modules have the same structure, consisting of an ASFF_3 network and a C3k2 module connected in front and behind. The inputs of the first, second, and third convolutional layers are respectively connected to the outputs of the first feature extraction unit, the second feature extraction unit, and the C2PSA module in the backbone network; The inputs of the first fusion module and the second fusion module are simultaneously connected to the outputs of the first convolutional layer and the second convolutional layer; the outputs of the first fusion module, the second fusion module and the third convolutional layer are processed by the MSDA unit and then simultaneously input to the third fusion module, the fourth fusion module and the fifth fusion module.

[0012] The present invention proposes a method for detecting reinforcing bars. First, a reinforcing bar detection model is trained using the aforementioned training method. Then, the reinforcing bar detection model is used to process the image to be detected, marking the reinforcing bars with annotation boxes, and finally counting and outputting the number of reinforcing bars.

[0013] The present invention proposes a rebar detection system, including a memory and a processor. The memory stores a rebar detection model and a computer program, and the processor is connected to the memory and is used to execute the computer program to implement the rebar detection method.

[0014] The present invention proposes a storage medium storing a computer program, which, when executed, is used to implement the rebar detection method.

[0015] The advantages of this invention are: (1) The rebar detection model proposed in this invention introduces the MDR-SS module in the feature extraction stage of the backbone network to extract multi-level depth 2D feature maps. While retaining the advantages of visual state space (VSS) modeling, it significantly enhances the ability to aggregate multi-scale features. The MDR-SS module introduces residual design, which can minimize information loss during the depth stacking process, promote the effective flow of gradients, and ensure that the multi-scale spatial details captured by SDRes are completely preserved before global scanning.

[0016] (2) SDRes employs a multi-branch dilated convolution strategy to construct a hierarchical receptive field structure; the low-dilution-rate branch focuses on minute local textures, while the high-dilution-rate branch captures a broader semantic context; after multi-scale aggregation by SDRes, the feature map enters the SS2D module. By implementing complementary four-way one-dimensional traversal paths, SS2D establishes a global receptive field in two-dimensional space, effectively integrating contextual information from all pixels, and enhancing the multidimensional characteristics of the features through directional decoupling, so as to maintain the structural continuity of the slender steel bars.

[0017] (3) The MS-AFPN structure processes information through multi-scale expanded attention (MSDA) to capture multi-scale semantic information and better understand different abstraction levels of the image; it adopts an adaptive spatial feature fusion (ASFF) module to adaptively allocate spatial weights, which enhances the importance of key feature layers; ASFF utilizes the sparsity of the self-attention mechanism at different scales to reduce computational redundancy while maintaining performance.

[0018] (4) The introduction of MSDA enables the fusion of multiple receptive fields, allowing the model to capture image features at different scales, thereby allowing the model to understand images at different scales and improve the overall understanding of image content.

[0019] (5) The rebar detection method proposed in this invention adopts an improved model. An MD-SSM module (Multi-directional State Space Model) is introduced in the first layer of the backbone network to prioritize the processing of input features to suppress background noise and enhance global perception capabilities. An MS-AFPN (Multi-scale Adaptive Feature Pyramid Network) module is designed in the neck network to achieve adaptive weighted fusion of deep semantic information and shallow detail information, thereby improving the ability to capture small targets. Through the above improvements, this invention effectively solves the problems of missed and false detections under dense rebar arrangement and reflective interference, significantly improving the accuracy and robustness of rebar counting. Attached Figure Description

[0020] Figure 1(a) shows the original image captured; Figure 1(b) shows the darkened version of the original image; Figure 1(c) shows the original image after exposure processing; Figure 1(d) shows a reduced-resolution image of the original image; Figure 2 Here is a diagram of the baseline network YOLOv11; Figure 3 This is a structural diagram of the improved model of the present invention; Figure 4 This is a structural diagram of the MDR-SS module proposed in this invention; Figure 5 This is a structural diagram of the MS-AFPN proposed in this invention; Figure 6 The comparison is between the instance segmentation of the baseline model and the model of this invention; where a0, b0 and c0 are the original images, a1, b1 and c1 are the YOLOv11 instance segmentation results of a0, b0 and c0 respectively, and a2, b2 and c2 are the model C instance segmentation results of a0, b0 and c0 respectively. Figure 7 This is a flowchart of a training method for a rebar detection model proposed in this invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0022] Reference Figure 7This embodiment proposes a training method for a rebar detection model. First, the YOLOv11 model is improved. Then, a dataset {image; rebar annotation results} is used for model training. The improved model is then used to detect and segment rebar images. During rebar detection, the image is input into the trained rebar detection model, and the number of bounding boxes (i.e., instance segmentation results) output by the model is counted as the number of rebars, and this count is then output.

[0023] This embodiment is based on several improved models, denoted as models A, B, and C.

[0024] The first type of rebar detection model is referred to as Model A.

[0025] Reference Figure 3 , Figure 4 Compared to the traditional YOLOv11 model, Model A improves the backbone network. The improved backbone network is denoted as the MD-DAF structure, which includes the sequentially connected downsampling module Stem, the multi-directional state space scanning module MD-SSM, the first feature extraction module, the second feature extraction module, the third feature extraction module, the fourth feature extraction module, the SPPF module, and the C2PSA module.

[0026] The downsampling module Stem performs downsampling to generate a 2D feature map with a resolution of 160×160, and then performs multi-stage feature extraction on the feature map output by the downsampling module Stem.

[0027] The second, third, and fourth feature extraction modules have the same structure, consisting of convolutional units (e.g., Conv) and dynamic residual units linked together. The first feature extraction module and the dynamic residual unit both use the MDR-SS module (Multi-scale Dynamic Residual State Space Block).

[0028] The MDR-SS module aims to extract multi-level deep 2D feature maps and significantly enhances the ability to aggregate multi-scale features while retaining the advantages of Visual State Space (VSS) modeling. The MDR-SS module includes a sequentially connected convolutional network Conv, a Spatial Dilated Residual (SDRes) network, a Layer Normalization layer, a SS2D (2D Selective Scan) network, and an iRes (Inverted Residual) network. The input of the iRes network is also connected to the output of the convolutional network.

[0029] Reference Figure 4The input of the MDR-SS module is processed sequentially through the Conv convolutional network, the SDRes network, the layer normalization layer, and the SS2D network. Then, it is superimposed with the output dimension of the Conv convolutional network and input into the iRes network for processing to obtain the output of the MDR-SS module.

[0030] The MDR-SS module processes the input data as follows: (1) (2) (3) (4) in, and These represent the input and output feature maps of the MDR-SS module, respectively. Indicates that the convolutional network uses Convolution kernel on input feature map Perform convolution operations; and These represent the outputs of the convolutional network and the SDRes network, respectively. This represents the input to the iRes network, which is the superposition of the outputs of the SS2D network and the convolutional network.

[0031] Representation layer normalization.

[0032] A key residual connection design is introduced in Equation (2): the output of the SDRes network It is not only used as input to the SS2D network, but also directly added to the output of the SS2D network; in this way, information loss during the depth stacking process can be minimized, the effective flow of gradients can be promoted, and the multi-scale spatial details captured by the SDRes network can be fully preserved before the global scan is performed.

[0033] SDRes for input features After initial convolution, the stream is split into three parallel branches. These branches employ depthwise separable convolution (DConv) with a fixed kernel size of K=3, but each is assigned a different dilation rate d; the dilation rates d for the three branches are set to 1, 3, and 5, respectively. This design constructs a hierarchical receptive field structure: the low-dilation-rate branches focus on subtle local textures, while the high-dilation-rate branches capture broader semantic context.

[0034] Output of three branches , and After dynamic fusion of WSDI units, batch normalization and convolution are performed sequentially, followed by... Dimensional stacking is used to obtain the output features of the SDRes network. .

[0035] The operation of the WSDI unit is expressed by the following formula: ; in, These are learnable adaptive weights that are dynamically adjusted based on the input content. for , and Features after dynamic fusion by WSDI units.

[0036] This implementation proposes an improved WSDI unit, introducing a dynamic weighting strategy to achieve adaptive feature fusion. This mechanism endows the network with the ability of "attention selection": when processing dense, fine reinforcing bars, the network automatically increases the weight of branches with low void ratios; while when processing large overlapping areas, it focuses on branches with high void ratios. The fused features... After batch normalization and convolutional projection, and then... The output of SDRes is obtained after superposition. .

[0037] The MDR-SS module aggregates multi-scale features through SDRes and then establishes the characteristics of a global receptive field in two-dimensional space through SS2D, effectively integrating contextual information from all pixels. It also enhances the multidimensional characteristics of features through directional decoupling to maintain the structural continuity of the slender steel bars. An iRes (InvertedResidual) network is introduced at the end of the module.

[0038] The iRes network employs an inverted bottleneck structure, comprising the following sequentially connected layers: a linear normalization layer, a first pointwise convolutional layer, a depthwise convolutional layer, an activation layer, a second pointwise convolutional layer, and a dimension stacking layer. The input of the activation layer is also connected to the output of the first pointwise convolutional layer, and the input of the dimension stacking layer is also connected to the input of the iRes network. That is: ; This is the output of the iRes network, i.e., the output of the MDR-SS module. ; This indicates an activation operation. and These represent depthwise convolution and pointwise convolution, respectively.

[0039] Thus, the iRes network first expands the channel dimension using point-wise convolution, then extracts features through depth-wise convolution, and finally projects them back to the original dimension. This "expand first, compress later" structure, combined with residual connections, acts as a "detail refiner," which can re-sharpen the local edge information of the feature map, thereby significantly improving the model's robustness to complex scenarios such as reflections and occlusions at the ends of steel bars.

[0040] The MDR-SS module effectively enhances feature representation capabilities through dynamic fusion and multi-scale residual design. However, its feature interaction still mainly relies on local convolution and unidirectional state propagation, making it difficult to fully capture the global spatial dependencies of the reinforcing bars in different directions (horizontal, vertical, and oblique). The Multi-Directional StateSpace Module (MD-SSM) is used to compensate for the shortcomings of the original feature modeling in terms of directional continuity and structural integrity. During the input stage, it performs multi-directional (left-right, up-down, and tilted) state modeling on image features to achieve cross-directional global dependency fusion.

[0041] When performing a scan in a single direction, the MD-SSM module first flattens the input feature map X into a one-dimensional feature sequence along the scan direction. ,in H is the sequence length. W is the size of the feature map X, 1 ≤ t ≤ L; the MDR-SS module processes one-dimensional feature sequences. The hidden state is updated recursively using the discretized form of the continuous-time system. Thus capturing long-distance dependencies ; Fuse feature maps at each time step With latent state , to obtain output features Finally, the output features at all time steps The elements are rearranged back to their original 2D spatial structure, forming the scan output in that direction. .

[0042] Specifically: ; ; ; ; Where B and C are the initial state-space parameters; GAP represents global average pooling, MLP represents a multilayer perceptron, and σ is the sigmoid activation function. These are the discretized state transition parameters. and The generated adaptive discretization parameters are used to control the information forgetting and updating in each scanning step. Initialize as a vector of zero.

[0043] Scan output in all directions Weighted fusion yields multi-directional state features .

[0044] To balance local texture details with global channel correlation, the MDR-SS module also combines Window Self Attention (WSA) and Global Channel Attention (GCA) to process the input feature map X, obtaining a hybrid attention feature A(X) of X. Finally, the MDR-SS module combines the aggregated multi-directional state features through dimension stacking. The MD-SSM module's final output is obtained by fusing the hybrid attention feature A(X) with layer normalization (LayerNorm) and multilayer perceptron (MLP) processing. .

[0045] The processing procedure of the MDR-SS module for the input feature map X is expressed by the following formula: ; ; ; in, The adaptive directional fusion weights are obtained through Softmax normalization, where D is the set of directions, D = {horizontal, vertical, diagonal}, WSA is the window self-attention mechanism, and GCA is the global channel attention mechanism.

[0046] The second type of rebar detection model is referred to as Model B.

[0047] Reference Figure 3 , Figure 5 Compared to the traditional YOLOv11 model, Model B improves the neck network. The improved backbone network is denoted as MS-AFPN structure, which includes: first convolutional layer, second convolutional layer, third convolutional layer, first fusion module, second fusion module, third fusion module, fourth fusion module, fifth fusion module and multi-scale extended attention unit (MSDA unit).

[0048] The first and second fusion modules have the same structure, consisting of an ASFF_2 network and a C3k2 module connected in front and behind; the third, fourth, and fifth fusion modules have the same structure, consisting of an ASFF_3 network and a C3k2 module connected in front and behind.

[0049] The inputs of the first, second, and third convolutional layers are connected to the outputs of the first feature extraction unit, the second feature extraction unit, and the C2PSA module in the backbone network, respectively.

[0050] The inputs of the first fusion module and the second fusion module are both connected to the outputs of the first convolutional layer and the second convolutional layer. The outputs of the first fusion module, the second fusion module and the third convolutional layer are processed by multi-scale expanded attention (MSDA) and then simultaneously input into the third fusion module, the fourth fusion module and the fifth fusion module.

[0051] The MS-AFPN structure introduces the AFPN structure to fully fuse features from non-adjacent layers using a progressive fusion approach. This achieves comprehensive fusion of multi-scale features (large, medium, and small target features) to address the issue of small target features being small and lacking clear texture. The MS-AFPN structure employs an adaptive spatial feature fusion (ASFF) module to adaptively assign spatial weights, enhancing the importance of key feature layers. Information is processed through multi-scale dilated attention (MSDA) to capture multi-scale semantic information, better understanding different levels of image abstraction. The self-attention mechanism leverages the sparsity at different scales to reduce computational redundancy while maintaining performance. In MSDA, the feature map channels are first segmented into different heads, and then each head uses different dilation rates to perform self-attention operations. MSDA employs three different dilation rates (r=1, 2, 3), corresponding to different receptive field sizes (3x3, 5x5, 7x7). The self-attention operation for each head targets its corresponding dilation rate and receptive field, enabling the model to capture image features at different scales. These features are then concatenated and fed into a linear layer for feature aggregation. This design allows the model to understand images at different scales, thereby improving the overall understanding of image content.

[0052] The third type of rebar detection model is referred to as Model C.

[0053] Reference Figure 3 , Figure 4 , Figure 5 Compared to model A, model C replaces the neck network with an MS-AFPN structure.

[0054] The following specific embodiments are used to verify the models A, B, and C proposed in this invention.

[0055] This embodiment uses a self-built dataset for model training and testing. The dataset contains 250 original images, which are expanded through data augmentation to improve the generalization ability of the rebar detection model. Data augmentation includes adjusting exposure and sharpness, as shown in Figures 1(a), 1(b), 1(c), and 1(d). In this embodiment, Labelimg-1.8.6 is used on a Windows 11 system to annotate the images in the dataset with rebars, and the annotation results are used as the ground truth labels. The annotated dataset is divided into a training set, a test set, and a validation set, with a ratio of 7:2:1, as shown in Table 1.

[0056] Table 1 Number of Dataset Splits

[0057] In this embodiment, the model training method is as follows: S1. Extract training samples from the training set and input them into the model, so that the model learns from the training samples to update the parameters; S2. Extract test samples from the test set and label the steel bars of the test samples using the model; calculate the loss function based on the model labeling and the real labels of the test samples.

[0058] S3, repeat steps S1 and S2 until the model converges.

[0059] In this embodiment, models A, B, C and other comparison models are all trained using the above steps S1-S3, and then the model performance is verified on the validation set.

[0060] This experiment was conducted on a Linux operating system, using an NVIDIA Ampere A100 processor with 100GB of memory for training and testing. The software environment used PyTorch 1.11.0 as the deep learning library and Python 3.8.0 as the programming language. During model training, the batch size and training epochs were set to 16 and 300, respectively. Furthermore, stochastic gradient descent (SGD) was selected as the optimizer, with a momentum parameter of 0.937 and weight decay of 0.0005. To ensure a balance between computational speed and accuracy, a learning rate of 0.001 was used.

[0061] In this embodiment, Figure 2 The performance of YOLOv11 and models A, B, and C on the validation set is shown in the figure below. Figure 6 And as shown in Table 2 below. Figure 6 In the diagram, a0, b0, and c0 are the original images, a1, b1, and c1 are the YOLOv11 instance segmentation results of a0, b0, and c0, respectively, and a2, b2, and c2 are the model C instance segmentation results of a0, b0, and c0, respectively.

[0062] Figure 6 The original image and the detection results of YOLOv11 and the model C of this invention are shown in different scenarios. As can be observed from the figures, YOLOv11 can detect the main steel reinforcement targets in most cases. However, in scenarios with dense stacking, partial occlusion, and uneven lighting, there are still significant issues with detection omissions and bounding box overlap. For example, in the first row of samples, YOLOv11 does not completely identify steel reinforcement targets in the edge areas, with some target edge boxes showing adhesion or missed detection. In the second row of samples, due to the strong reflection on the steel reinforcement surface, the false detection rate of YOLOv11 increases significantly, and the detection box positioning is offset.

[0063] In comparison, the improved Model C of this invention exhibits higher detection accuracy and robustness in the same scene. Its detection bounding boxes are more evenly distributed, almost all rebar targets are accurately identified, and the bounding boxes fit the target edges better. Especially in situations with densely stacked or elongated rebars causing occlusion, the model can still accurately distinguish adjacent targets, avoiding missed detections and duplicate detections. Furthermore, Model C maintains stable detection performance in low-light and complex background scenes, indicating that the model has stronger generalization ability in feature representation.

[0064] In summary, Model C of this invention not only significantly improves the detection accuracy in the automatic identification of rebar quantity, but also maintains good visual consistency and engineering practicality.

[0065] Table 2 Ablation Test Indicators

[0066] As shown in Table 2, although the YOLOv11 basic model can complete target recognition in the rebar detection task, it still has false detection and missed detection in the detection of densely occluded and slender targets, and the overall accuracy and mAP (mean accuracy) value are low.

[0067] When only the MD-DAF (Multi-Directional Dynamic Adaptive Fusion Network) structure proposed in this invention is used as the backbone network (Model A), the model accuracy improves from 91.6% to 94.1%, and the mAP improves by 2.3%. This result fully verifies the significant advantages of the MD-DAF structure in modeling the directionality of steel reinforcement arrangement and capturing spatial dependencies. This improvement is attributed to the six-directional state scanning mechanism (→, ←, ↓, ↑) of the MD-SSM (Multi-Directional State Space Module). , The network can establish global dependencies across pixels in multiple directions, effectively enhancing its ability to continuously model densely arranged, directionally intersecting, and partially occluded steel reinforcement targets. Simultaneously, the content-adaptive gating mechanism introduced in the module dynamically adjusts the state-space parameters, enabling the model to adaptively regulate the feature response intensity according to the input scene, exhibiting better robustness, especially in areas with metallic reflections or texture interference. Furthermore, experimental results show that the detection time of Model A has decreased to 28.4 ms, indicating that the MD-DAF structure maintains efficient inference performance with linear complexity while improving feature representation capabilities. This is attributed to the backbone network employing a state-space linear modeling and lightweight residual fusion strategy, significantly reducing the computational burden compared to traditional attention networks.

[0068] With only the MS-AFPN structural module (Model B) introduced, the mAP reached 96.4%, a 3.56% improvement compared to the basic YOLO-Mamba model. This indicates that the introduction of multi-scale progressive fusion and multi-scale expanded attention (MSDA) effectively strengthens the semantic association between features at different scales, enabling the model to better identify steel reinforcement targets with varying distances and sizes. Simultaneously, the detection time decreased from 68.7 ms to 40.6 ms, demonstrating that this module achieves good accuracy while maintaining a lightweight design.

[0069] The proposed model C integrates both the MD-DAF and MS-AFPN structures, achieving optimal results across all metrics. The model excels in precision, recall, and mAP. 50 The accuracy rates reached 96.3%, 95.4%, and 98.9% respectively, representing a significant improvement in overall performance compared to the basic model, with an inference speed increase of approximately 45%. These results demonstrate that the MD-DAF and MS-AFPN structures complement each other in terms of spatial orientation modeling and multi-scale fusion at the feature modeling level: the former enhances feature perception of linear structures and directional consistency targets; the latter strengthens the global semantic consistency and scale adaptability of cross-level features. This complementary characteristic enables Model C of this invention to maintain high detection accuracy and stability even in scenarios with complex rebar distribution, overlap, and weak texture.

[0070] From the perspective of overall performance changes, the MD-DAF structure mainly contributes to improved feature representation and orientation modeling capabilities, while the MS-AFPN structure module optimizes multi-scale information fusion and global semantic consistency. The combination of the two enables the model to achieve a balance between high accuracy and high speed while maintaining lightweight computation. This improved scheme provides effective model support for subsequent automatic rebar detection and quantity recognition tasks.

[0071] The model C of this invention was compared with classic object detection networks such as YOLOv5, YOLOv7, YOLOv8, YOLOv9, YOLOv10, and the Mamba-YOLO network. The operating environment and network parameters were kept consistent, and all methods were ensured to be trained and converged to achieve optimal performance. Table 3 shows the detection results.

[0072] Compared to Model C of this invention, the Mamba-YOLO network replaces the MDR-SS module in the backbone network (MD-DAF structure) with the existing ODSS module.

[0073] Table 3 Comparison Results of YOLO Series Networks

[0074] As can be seen from Table 3, the present invention model C has a certain mAP 50 The model significantly outperforms other YOLO series models in terms of metrics, with an accuracy improvement of approximately 7.0% compared to YOLOv8 and approximately 6.7% compared to YOLOv9. This indicates that the model C of this invention has significant advantages in feature representation and multi-scale feature aggregation.

[0075] Regarding detection speed, although the average inference time of Model C in this invention is slightly higher than that of YOLOv8 and YOLOv10, it still remains within 40ms, which can meet the requirements of real-time detection. The increase in computational cost of Model C in this invention mainly comes from the introduction of multi-directional state space scanning and multi-scale attention mechanism, but this design results in significant accuracy gains and robustness improvements.

[0076] Specifically, early versions such as YOLOv5–YOLOv8 excelled in lightweight design and speed, but their recognition rate significantly decreased when faced with dense, occluded, and slender rebar detection tasks. While YOLOv9 and YOLOv10 introduced new distributed training and feature aggregation strategies, their generalization ability on rebar datasets remained limited. In contrast, the model C of this invention introduces multi-directional state space modeling in the backbone network, effectively improving its ability to model the spatial distribution and directional features of the target; the neck network strengthens multi-scale information fusion, enabling the model to maintain stable performance in both near and far rebar detection.

[0077] Furthermore, comparing the model C of this invention with Mamba-YOLO, which adopts some of the improved ideas of this invention, it can be found that the existing YOLO series models of Mamba-YOLO have improved detection accuracy, but their detection time is much longer than that of the existing YOLO series models. However, the model C of this invention has a significant improvement in speed.

[0078] In summary, Model C of this invention achieves high-precision detection of rebar identification while maintaining a high detection speed, fully verifying the effectiveness and adaptability of the improved method proposed in this paper. This model achieves an optimal balance between lightweight design, robustness, and detection accuracy, making it suitable for automated rebar identification and counting tasks in engineering sites.

[0079] Of course, those skilled in the art will recognize that the present invention is not limited to the details of the exemplary embodiments described above, but also includes the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0080] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0081] The technologies, shapes, and structures not described in detail in this invention are all known technologies.

Claims

1. A training method for a rebar detection model, characterized in that, The rebar detection model is an improvement on the YOLOv11 network and is then trained on the dataset {images; rebar annotation results}. The improvement to the YOLOv11 network is as follows: the backbone network is modified to consist of a downsampling module, an MD-SSM module, a first feature extraction module, a second feature extraction module, a third feature extraction module, a fourth feature extraction module, an SPPF module, and a C2PSA module connected in sequence. The image to be detected is sampled by the downsampling module and then input into the MD-SSM module for multi-directional state space scanning. The scan outputs of each direction are obtained and fused to obtain multi-directional state features. The MD-SSM module extracts and fuses attention features of X through multiple attention mechanisms to obtain hybrid attention features A(X); then it fuses them again. The final output of the MD-SSM module is obtained by combining A(X); The second, third, and fourth feature extraction modules have the same structure, including convolutional units and dynamic residual units connected in front and behind. The first feature extraction module and the dynamic residual unit both adopt the MDR-SS module. The MDR-SS module includes a sequentially connected convolutional network, an SDRes network, a layer normalization layer, an SS2D network, and an iRes network. The output of the SS2D network is superimposed with the output dimension of the convolutional network and then input into the iRes network. The input and output of the MDR-SS module are the input of the convolutional network and the output of the iRes network, respectively. After the input features are convolved, SDRes splits into three branches to perform convolution operations with different dilation rates d. The outputs of the three branches are dynamically fused, then batch normalized and convolved sequentially, and finally superimposed with the input feature dimensions of SDRes to obtain the output features of the SDRes network.

2. The training method for the rebar detection model as described in claim 1, characterized in that, The MD-SSM module scans in the specified scanning direction by flattening the feature map X into a one-dimensional feature sequence along the scanning direction. L is the sequence length; for The hidden state is recursively updated using the discretized form of a continuous-time system. , 1≤t≤L; fuse feature maps at each time step. With latent state , to obtain output features Then, the output features of all time steps t are... Rearrange the feature maps as the scan output in this scanning direction. .

3. The training method for the rebar detection model as described in claim 1 or 2, characterized in that, In the MD-SSM module, multi-directional state features are fused through dimensional overlay. The mixed attention feature A(X) is then processed by layer normalization and multilayer perceptron to obtain the final output of the MD-SSM module. .

4. The training method for the rebar detection model as described in claim 1, characterized in that, All three branches use depthwise convolution, with dilation rates set to 1, 3, and 5, respectively.

5. The training method for the rebar detection model as described in claim 1, characterized in that, The iRes network consists of the following sequentially connected layers: a linear normalization layer, a first pointwise convolutional layer, a depthwise convolutional layer, an activation layer, a second pointwise convolutional layer, and a dimension stacking layer. The input of the activation layer is also connected to the output of the first pointwise convolutional layer, and the input of the dimension stacking layer is also connected to the input of the iRes network.

6. The training method for the rebar detection model as described in claim 1, characterized in that, Improvements to the YOLOv11 network also include replacing the neck network with an MS-AFPN structure, which includes: a first convolutional layer, a second convolutional layer, a third convolutional layer, a first fusion module, a second fusion module, a third fusion module, a fourth fusion module, a fifth fusion module, and an MSDA unit; The first and second fusion modules have the same structure, consisting of an ASFF_2 network and a C3k2 module connected in front and behind; the third, fourth, and fifth fusion modules have the same structure, consisting of an ASFF_3 network and a C3k2 module connected in front and behind. The inputs of the first, second, and third convolutional layers are respectively connected to the outputs of the first feature extraction unit, the second feature extraction unit, and the C2PSA module in the backbone network; The inputs of the first fusion module and the second fusion module are simultaneously connected to the outputs of the first convolutional layer and the second convolutional layer; the outputs of the first fusion module, the second fusion module and the third convolutional layer are processed by the MSDA unit and then simultaneously input to the third fusion module, the fourth fusion module and the fifth fusion module.

7. A rebar detection method employing the training method of the rebar detection model as described in any one of claims 1-6, characterized in that, First, the rebar detection model is trained using the training method of the rebar detection model as described in any one of claims 1-6. Then, the rebar detection model is used to process the image to be detected, the rebars are marked with annotation boxes, and the number of rebars is counted and output.

8. A rebar detection system, characterized in that, It includes a memory and a processor. The memory stores a rebar detection model and a computer program. The processor is connected to the memory and is used to execute the computer program to implement the rebar detection method as described in claim 7.

9. A storage medium, characterized in that, The device contains a computer program that, when executed, implements the rebar detection method as described in claim 7.