## 3 CCA-YOLO Network Model
### Improvement of Loss Function  
On the basis of multiple studies, in this experiment, the introduction of the EiU loss function led to the better identification and detection of tear defects taken at vertical and horizontal angles. The EiU loss function is defined as follows:  
\[ \begin{array}{ll}\text{L}_{\text{EiU}}&=\text{L}_{\text{IoU}}+\text{L}_{ \text{dis}}+\text{L}_{\text{asp}}\\ &=1-\text{IoU}+\frac{\rho^{2}(\text{b},\text{b}^{\text{gt}})}{c_{\text{C}}^{2} }+\frac{\rho^{2}(\text{w},\text{w}^{\text{gt}})}{c_{\text{w}}^{2}}+\frac{\rho^ {2}(\text{h},\text{h}^{\text{gt}})}{c_{\text{h}}^{2}}\end{array}  \tag{3}\]  
This function includes overlap loss \(\text{L}_{\text{IoU}}\), distance loss \(\text{L}_{\text{dis}}\), and width and height loss \(\text{L}_{\text{asp}}\). In the aforementioned equation, c represents the diagonal distance that can wrap the minimum rectangles of two frames; (b, bgt) represents the distance between the center points of two frames; c\({}_{\text{w}}\) and c\({}_{\text{h}}\) represent the width and height that can wrap the minimum rectangles of two frames, respectively; and (w, wgt) and (h, hgt) represent the difference between the width and height of the two boxes. EiU loss not only considers the distance factor of the two rectangular boxes but also minimizes the difference between the width and height of the two boxes. Therefore, the detection accuracy for smaller targets is improved to a certain extent and the convergence stability of the model is enhanced. From experimental research, it can be found that although the EiU loss function can effectively improve tear detection accuracy, it cannot accurately identify small defects such as scratches. Therefore, to address the characteristics of small scratch targets that are difficult to identify and the high level of noise interference in the plant environment, the experiment improved the loss function of the YOLOv5s model using \(\alpha\)-IoU. Unlike other variants, \(\alpha\)-IoU is a new IoU loss function proposed for the existing IoU loss based on the introduction of power transformation, with a power IoU term, an additional power regular term, and a single power parameter \(\alpha\), which can considerably exceed the existing IoU loss [32]. Common IoU losses are defined as follows:  
\[\text{L}_{\text{IoU}}=1-\text{IoU} \tag{4}\]  
The general form of the \(\alpha\)-IoU is as follows:  
\[\text{L}_{\alpha\text{-IoU}}=1-\text{IoU}_{\alpha} \tag{5}\]Ordinary IoU losses can be reduced to \(\alpha\)-IoU losses through Box-Cox transformation:  
\[\mathrm{L}_{\alpha-\mathrm{IOU}}=\frac{1}{\alpha}(1-\mathrm{IOU}^{\alpha}), \alpha>0 \tag{6}\]  
Compared with \(\mathrm{L}_{\mathrm{IoU}}\), \(\mathrm{L}_{\alpha-\mathrm{IoU}}\) increases the loss and gradient of high-IoU targets when \(\alpha>1\), thus improving the accuracy of bbox regression. The selection of \(\alpha\) is crucial to the loss of \(\alpha\)-IoU. In most cases, the best effect is attained at \(\alpha=3\). In this study, it was found that \(\alpha=2\) accelerated the learning of all positive IoU targets at \(\mathrm{AP}_{50}\). The calculation formula is as follows:  
\[\mathrm{L}_{2-\mathrm{IOU}}=\frac{1}{2}\Big{(}1-\mathrm{IOU}^{2}\Big{)}=\frac {1}{2}\mathrm{L}_{\mathrm{IOU}}^{2} \tag{7}\]  
Common IoU loss is defined as the effect of penalty conditions on the properties of vanilla \(\alpha\)-IoU. Therefore, based on the analysis of vanilla \(\alpha\)-IoU (4), it can be concluded that the power transformation of \(\mathrm{L}_{\alpha\text{-}\mathrm{IoU}}\) retains the key properties of \(\mathrm{L}_{\mathrm{IoU}}\), including non-negativity, indistinguishable identity, symmetry, and triangle inequality. Additionally, \(\mathrm{L}_{\alpha\text{-}\mathrm{IoU}}\) also includes the following five characteristics: Order preservation ensures that \(\mathrm{L}_{\mathrm{IoU}}\) and \(\mathrm{L}_{\alpha\text{-}\mathrm{IoU}}\) are both monotonic decreasing functions.