# RDD-YOLO: Road Damage Detection Algorithm Based on Improved You Only Look Once Version 8
## 3 The Proposed Method
### Bilinear Interpolation  
In YOLOv8, nearest interpolation is used for upsampling and enlarging images. As shown in Figure 7, this method first reduces the target image to the size of the original image. Then, at that scale, for each pixel to be interpolated, it calculates its corresponding position in the original image, finds the closest pixel coordinates in the original image to the target position, and sets the pixel value at the target position to the value of the nearest neighbor pixel. Nearest interpolation is the simplest and requires the least processing time of all the interpolation algorithms [26]. However, nearest interpolation simply selects the nearest pixel value without considering the information of surrounding pixels, and it does not generate new pixel values. This results in the inability to achieve smooth transitions between pixels when performing upsampling operations, leading to jagged edges or blurred details in the image. This influence is particularly noticeable when dealing with detail-rich images and may lead to image distortion.  
Therefore, this paper uses bilinear interpolation for the upsampling operation. Bilinear interpolation takes a weighted average of the four neighborhood pixels to calculate its final interpolated value [27], which better preserves details, resulting in smoother images and generating more realistic results. There are two alignment methods for bilinear inter  
Figure 6: Comparisons of Conv and GhostConv [3]. (**a**) The convolutional layer. (**b**) The Ghost module.  
Figure 7: Nearest interpolation diagram.  
polation, and the scaling ratios differ depending on the alignment method. As shown in Figure 8, bilinear interpolation scales the target image. In the corner alignment method, the center points of the pixels at the four corners of the target image align with the center points of the pixels at the four corners of the original image. In the edge alignment method, the sides of the target image align with the original image after scaling. The bilinear interpolation used in this paper employs the corner alignment method for computation. The calculation steps of bilinear interpolation are as follows.  
As shown in Figure 9, assuming that we require the pixel value of point \(P\) located at \((x,y)\) in the target image after scaling, and the pixel values of the four nearest original image points \(Q_{11}\), \(Q_{12}\), \(Q_{21}\), and \(Q_{22}\) to point \(P\) are \((x_{1},y_{1})\), \((x_{1},y_{2})\), \((x_{2},y_{1})\), and \((x_{2},y_{2})\), respectively, the bilinear interpolation diagram could be formed as follows.  
To begin with, linear interpolation is performed in the \(x\)-axis direction for \(Q_{11}\), \(Q_{21}\) and \(Q_{12}\), \(Q_{22}\), resulting in intermediate results \(R_{1}(x,y_{1})\) and \(R_{2}(x,y_{2})\):  
\[f(x,y_{1})=\frac{x_{2}-x}{x_{2}-x_{1}}f(Q_{11})+\frac{x-x_{1}}{x_{2}-x_{1}}f(Q_ {21}), \tag{10}\]  
\[f(x,y_{2})=\frac{x_{2}-x}{x_{2}-x_{1}}f(Q_{12})+\frac{x-x_{1}}{x_{2}-x_{1}}f(Q_ {22}). \tag{11}\]  
After that, linear interpolation is performed on \(R_{1}\), \(R_{2}\) in the \(y\)-axis direction to obtain the pixel value of point \(P\):  
Figure 8: Comparison diagram of corner alignment and edge alignment.  
Figure 9: Bilinear interpolation diagram.  
\[\begin{array}{l}f(x,y)=\frac{y_{2}-y}{y_{2}-y_{1}}f(x,y_{1})+\frac{y-y_{1}}{y_{2 }-y_{1}}f(x,y_{2})\\ =\frac{y_{2}-y}{y_{2}-y_{1}}\left(\frac{y_{2}-y}{x_{2}-y_{1}}f(Q_{11})+\frac{x- x_{1}}{x_{2}-x_{1}}f(Q_{21})\right)+\frac{y-y_{1}}{y_{2}-y_{1}}\left(\frac{x_{2}-x}{ x_{2}-x_{1}}f(Q_{21})+\frac{x-x_{1}}{x_{2}-x_{1}}f(Q_{22})\right)\\ =\frac{1}{(x_{2}-x_{1})(y_{2}-y_{1})}\left(f(Q_{11})(x_{2}-x)(y_{2}-y)+f(Q_{21} )(x-x_{1})(y_{2}-y)+f(Q_{12})(x_{2}-x)(y-y_{1})+f(Q_{22})(x-x_{1})(y-y_{1}) \right)\\ =\frac{1}{(x_{2}-x_{1})(y_{2}-y_{1})}\left[\begin{array}{cc}x_{2}-x&x-x_{1} \end{array}\right]\left[\begin{array}{cc}f(Q_{11})&f(Q_{12})\\ f(Q_{21})&f(Q_{22})\end{array}\right]\left[\begin{array}{cc}y_{2}-y\\ y-y_{1}\end{array}\right]\end{array}\end{array} \tag{12}\]