# YOLOv8n-CBAM-EfficientNetV2 Model for Aircraft Wake Recognition
## 4 Aircraft Wake Recognition
### Loss Function  
Regression loss is a metric that is used to quantify the discrepancy between the predicted outcomes of a regression model and the actual observations. To enhance the performance of the target detection model in terms of category imbalance and target localisation, as well as to improve the detection of the wake, a combination of the distribution focal loss (DFL) and complete intersection over union loss (CIoU Loss) was employed in the experiments. The DFL represents a loss function that addresses the issue of category imbalance in the context of target detection. The introduction of the focal loss into the DFL framework results in a greater focus on samples that are more challenging to classify, thereby reducing the influence of samples that are more readily categorizable on the loss function. The CIoU loss represents a loss function for target localisation. In comparison with the conventional IoU loss, the CIoU loss considers the complete intersection region between the predicted and actual frames, thereby providing a more precise assessment of the similarity between them. By minimising the CIoU loss, the target detection model can more effectively learn the location and shape of a target, thereby improving the accuracy of target localisation. The expressions of the DFL and CIoU loss functions are shown in Equations (1) and (2), respectively:  
\[L_{DF}=-\sum_{i\in\text{Pos}}(1-P_{i})^{\gamma}\log(P_{i}), \tag{1}\]  
where \(P_{i}\) denotes the similarity between the predicted and actual frames and \(\gamma\) is a moderating factor that is used to balance the weights of easily predictable and difficult-to-predict targets;  
\[L_{CIoU}=1-IoU+\frac{\rho^{2}\big{(}b,b_{gt}\big{)}}{c^{2}}+\alpha\cdot v, \tag{2}\]  
\[IoU=\frac{\text{Intersection}}{Union}, \tag{3}\]  
where _IoU_ stands for intersection over union. As illustrated in Equation (3), the term \"Intersection\" refers to the area of intersection between the predicted and actual frames, whereas \"Union\" denotes the area of concurrency between them. In addition, \(\rho(b,\,b_{gt})\) denotes the Euclidean distance between the centroids of the two bounding frames, whereas c denotes the Euclidean distance between the diagonals of the two bounding frames, \(\alpha\) is a balancing factor that serves to balance the centroid distance and the weight of the diagonal distance, and \(v\) is a penalty item that assesses the discrepancy in size, location, and shape  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Hyperparameter** & **Epoch** & **Batch Size** & **Optimiser** & **Initial Learning Rate** \\ \hline Value & 200 & 16 & AdamW optimisation algorithm & 0.001 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Hyperparameter Settings.  
between the predicted and actual frames. When the discrepancy is significant, the penalty item of the _CloU_ loss results in an increase in the value of the loss function, which prompts the model to devote greater attention to the target frames with notable differences. This encourages the model to develop a more precise prediction of the target frame, thereby enhancing its overall performance.  
Considering the aforementioned evidence, the overall regression loss of the model can be calculated as follows:  
\[L_{reg}=\lambda_{df}\cdot L_{DF}+\lambda_{CloU}\cdot L_{CloU}, \tag{4}\]  
where \(\lambda_{df}\) and \(\lambda_{CloU}\) are the weighting coefficients used to balance the _DFL_ and _CloU_ loss, respectively.