# Tailhook Recognition for Carrier-Based Aircraft Based on YOLO with Bi-Level Routing Attention
## 3 Methodology
### D_C3 Layer  
In the landing scene of carrier-based aircraft under varying sea conditions, the targets are diverse and complex. The taillbook exhibits characteristics such as significant texture variations, varying positions, and orientations. Furthermore, the quality of the acquired images may vary to different degrees, leading to a certain degree of deformation. Therefore, traditional convolution operations often struggle to accurately capture the precise position and shape of the target, which can lead to issues of missed or misidentified targets. To address the aforementioned issues, this paper employs the deformable convolutional networks (DCNs) introduced by [PERSON] et al. (2018), develops the D_C3 module, and integrates it into the backbone of the YOLOv5 framework, thereby enhancing the network's adaptability to geometric deformations. In traditional convolution operations, convolution kernels have predefined fixed geometries, which limit their ability to handle target deformations. The deformable convolutional network enhances the adaptability of the network to geometric deformations by increasing the offset of the spatial sampling positions. This mechanism allows the convolution operation to adapt to the content of the input image, dynamically adjusting its receptive fields to deal more efficiently with shape changes and object displacement. In standard convolution, sampling and weight multiplication are performed at fixed grid positions (such as within a \(3\times 3\) neighborhood). Deformable convolution introduces additional offsets, which are learned by the network to adjust each sampling position. Suppose \(x\) is the input feature map, \(p_{0}\) is the fixed sampling position in standard convolution, \(p_{n}\) is the \(n\)-th sampling position, and \(\Delta p_{n}\) is the learned offset. Thus, the sampling position for deformable convolution is \(p_{n}+\Delta p_{n}\). The deformable convolution output, \(y(p_{0})\), can be calculated with the following formula:  
\[y(p_{0})=\sum_{n=1}^{N}w(p_{n})\cdot x(p_{n}+\Delta p_{n}), \tag{9}\]Here, \(w(p_{n})\) is the weight of the convolution kernel at position \(p_{n}\), and \(N\) denotes the total number of sampling points. The offsets \(\Delta p_{n}\) are typically learned through an additional convolutional layer that runs parallel to the main convolutional layer. This auxiliary convolutional layer is specifically designed to predict the offsets for each position, adjusting the sampling locations of the convolution kernel on the input feature map. Given the standard sampling position \(p_{0}\) of a convolution kernel, the offsets \(\left(\Delta p_{x},\Delta p_{y}\right)\) are applied to \(p_{0}\) to obtain the adjusted sampling position \(p^{\prime}\). \[p^{\prime}=\left(p_{0x}+\Delta p_{x},p_{0y}+\Delta p_{y}\right). \tag{10}\]  
Since the offsets \(\Delta p_{n}\) can be fractional, the actual sampling position \(p_{n}+\Delta p_{n}\) may not lie on an integer grid. Therefore, methods such as bilinear interpolation are used to obtain the values at the sampling points from the input feature map. For a given input feature map, \(I\), the pixel value \(I^{\prime}_{(x,y)}\) is estimated based on the four nearest pixels (\((i,j)\), \((i+1,j)\), \((i,j+1)\), and \((i+1,j+1)\)) to the target pixel \((x,y)\). \[I^{\prime}_{(x,y)}=\sum_{i=1}^{2}\sum_{j=1}^{2}I_{i,j}\omega_{i,j}, \tag{11}\]  
\(I_{i,j}\) represents the pixel value of the input feature map; \(\omega_{i,j}\) is the weight coefficient, which is calculated based on the distances between the point \((x,y)\) and its nearest four integer co-ordinate points. The sum of these four coefficients equals 1. The weight coefficient \(\omega_{i,j}\) is specifically calculated as follows:  
\[\left\{ \begin{array}{c}\omega_{1,1}=(1-\Delta x)(1-\Delta y)\\ \omega_{1,2}=\Delta x(1-\Delta y)\\ \omega_{2,1}=(1-\Delta x)\Delta y\\ \omega_{2,2}=\Delta x\Delta y\end{array}