# A New Road Damage Detection Baseline with Attention Learning
## 4 Our Proposed Baseline with Attention Learning
### Attention Fusion Based on Edge Detection  
Many existing algorithms have achieved success in pedestrian detection, remote sensing detection and other tasks. However, when they are directly applied to road damage detection, they all lose their excellent performance. The main reason lies in the sparse distribution of damage in foreground pixels. To solve this problem, along with adjusting the anchor generation strategy, we also need to correctly guide damage positions. Therefore, we rethought early road damage detection algorithms in this paper. We found that edge detection is the most common idea to detect road damage; it obtains the possible location  
Figure 5: Outline of the proposed method.  
of damage by analyzing the pixel gradient. It is often disturbed by the noise of pavement diversity and thus has a large rate of false detection. However, if it is only used to provide position cues, it can still help the observer quickly locate the salient damage area. Therefore, we designed an attention fusion module based on edge detection.  
As shown in Figure 5, our method consists of an edge branch and an RGB branch. The inputs of the edge branch come from the classical Canny edge detector, which has the advantages of efficiency and coverage [32]. Considering that wide-view images contain a large number of trees and buildings, which will introduce many edges independent of the damage location, we decided to perform edge detection only on the lower half of each image. An example illustration is shown in Figure 6.  
From Figure 6b,c, it can be seen that extracted edge information is more related to the damage location without the interference of other objects around the road. However, we also observe that edge detection of half images is a single-channel gray image with sparse effective pixels. In order to make it play a better role in attention guidance for feature learning, it is necessary to expand the range of the receptive field. Therefore, we used dilated convolution to design the DC block in Figure 5, which can learn the attention map of damage location according to edge detection.  
This DC block takes three same edge detections as inputs. For any input, edge feature \(F_{eg}\) will be extracted after two groups of dilated convolutions with a dilation rate of 2. After a softmax calculation, \(F_{eg}\) will become the attention maps that can provide damage location. The corresponding RGB branch consists of standard convolution and encoder blocks. This takes the split RGB channel graph as inputs and can achieve a feature map \(F_{ri}\) as large as \(F_{eg}\). In order to enable \(F_{eg}\) to generate spatial attention guidance to \(F_{ri}\), they are fused through the calculation defined in Equation (4).  
\[F_{fu}=Softmax\big{(}F_{eg}\big{)}\odot F_{ri} \tag{4}\]  
where \(F_{eg}\) indicates the feature map of edge detection, and \(F_{ri}\) represents the feature map of the RGB image. _Softmax()_ refers to the calculation that can activate the attention of the feature map. After the fusion operation defined in Equation (4), the potential location information of damage in edge detection will enter the next module with fusion feature \(F_{fu}\) and will play a role in salient feature learning.  
Figure 6: Comparative illustration of edge detection on full graph and half graph: (**a**) raw image; (**b**) edge detection on the whole graph; and (**c**) edge detection on the half graph.