# Research on Improved Bridge Surface Disease Detection Algorithm Based on YOLOv7-Tiny-DBB
## 3 Algorithm Enhancement  
### Diverse Branch Block (DBB) Module Introduction  
The numerous ELAN-Tiny modules in YOLOv7-Tiny are primarily composed of multiple densely connected standard convolutional layers. This results in a complex network  
Figure 1: YOLOv7-Tiny network architecture. structure characterized by a high number of parameters and significant computational demands. However, the limited depth of the network poses challenges for effective feature extraction [28]. Diverse Branch Block (DBB) is a diversified branch module proposed by [PERSON] in 2021 [29]. It serves as an alternative to conventional convolutional modules, enhancing detection accuracy without incurring additional inference time costs. Compared to the convolutional replacements utilized in ACNet, the DBB module introduces a more intricate multi-branch structure reminiscent of Inception. It is based on the concept of structural reparameterization, which utilizes parameters derived from one structure to parameterize another. Specifically, during the training process, different receptive fields are introduced through a complex multi-branch architecture that incorporates branches with varying scales and complexities. Upon completion of training, this architecture can be equivalently transformed into a single convolutional layer for deployment during the inference phase. Consequently, replacing the EALN-Tiny module in the original algorithm with the DBB module contributes to a reduction in computational load and parameter count while enhancing detection speed. As illustrated in Figure 2, there are six distinct transformation methods for structural reparameterization within DBB. The two transformations that are particularly significant for the improvement of this algorithm are as follows: First, Transformation 2 involves convolutional branch fusion. Based on the additivity property of convolution, two convolutional layers with identical configurations can be summed and merged into a new convolutional layer, as illustrated in Equation (1). This merging process enhances the performance of the original model. \[F^{\prime}\gets F^{(1)}+F^{(2)},b^{\prime}\gets b^{(1)}+b^{(2)} \tag{1}\]  
In Formula (1), \(F^{(1)}\) represents the convolution after the fusion of \(1\times 1\) Conv and BN, \(F^{(2)}\) represents the convolution after the fusion of K \(\times\) K Conv and BN, and \(F^{\prime}\) is the convolution kernel after the merger. \(b^{(1)}\) represents the bias after the fusion of \(1\times 1\) Conv and BN, \(b^{(2)}\) represents the bias after the fusion of K \(\times\) K Conv and BN, and \(b^{\prime}\) is the bias after the merger. Another approach is the multi-scale convolution transformation 6, which utilizes multi-scale convolution kernels \(K_{h}\times K_{w}(K_{h}\leq K,K_{w}\leq K)\) and applies zero padding to convert them into a \(K\times K\) convolution. This process involves performing padding operations on the input to align the sliding window, as illustrated in Figure 3. Specifically, the \(1\times 1\) convolution undergoes zero padding to be transformed into a \(3\times 3\) convolution. Finally, after incorporating biases into the transformed \(3\times 3\) convolutions, these branches are summed according to Transformation 2, thereby integrating the DBB module into a new \(3\times 3\) convolution. Figure 2: Reparameterization transformation diagram of the DBB. The structure of the fused DBB is illustrated in Figure 4. During the training phase, the DBB module comprises four branches that enhance the original K \(\times\) K convolution through various combinations, including 1 \(\times\) 1, 1 \(\times\) 1-K \(\times\) K, and 1 \(\times\) 1-AVG. Notably, the intermediate output channels of the 1 \(\times\) 1 - K \(\times\) K branch are equal to those of the input channels, with the 1 \(\times\) 1 convolution initialized to 1; other branches utilize conventional initialization methods.