## 3 Results
### Evaluation Index  
Precision, recall, and mean average precision (_AP_) metrics are utilized to evaluate the detection performance of COTTON-YOLO. Precision is the probability that a predicted positive sample is actually positive. It measures the accuracy of the predictions for positive samples. Recall is the probability that an actual positive sample is predicted to be positive, representing the model's sensitivity.  
\[precision=\frac{TP}{TP+FP} \tag{28}\]  
\[recall=\frac{TP}{TP+FN} \tag{29}\]  
True positive (_TP_) refers to the correct prediction of a cotton ball target. False positive (_FP_) indicates a background or other feature incorrectly predicted as a cotton ball. False negative (_FN_) refers to a cotton ball target incorrectly classified as another feature. Setting precision and recall as the vertical and horizontal axes, respectively, produces the precision-recall curve, also known as the _P-R_ curve. The area under the _P-R_ curve is referred to as average precision (_AP_). The formulas are as shown in (30) to (31):  
\[AP=\int_{0}^{1}P(R)dR \tag{30}\]  
\[AP_{50:95}=\frac{1}{10}(AP_{50}+AP_{55}+\dots+AP_{90}+AP_{95}) \tag{31}\]  
To describe mean average precision (_mAP_), we represent the _AP_ for a single category as the sum of the _AP_ values for each category, given that our model focuses exclusively on cotton bolls. _AP\({}_{50}\)_ represents the average precision at different recall levels with _loU_ = 0.5. _loU_ measures the extent of overlap between the predicted target and the actual target. _AP\({}_{50:95}\)_ represents the average of the ten _AP_ values at _loU_ thresholds ranging from 0.50 to 0.95 in increments of 0.05 (_AP\({}_{50}\)_, _AP\({}_{55}\)_, \(\dots\), _AP\({}_{95}\)_). GFLOPs indicate the number of floating-point operations per second (in billions) performed by the model on a GPU.  
To evaluate the model's performance in counting cotton bolls, we utilize the following metrics: mean absolute error (_MAE_), mean absolute percentage error (_MAPE_), coefficient of determination (_R\({}^{2}\)_), and root mean squared error (_RMSE_). _MAE_ reflects the average difference between the actual number of cotton bolls and the counted number of cotton bolls; the smaller the _MAPE_ is, the closer the model's performance is to perfection. _RMSE_, based on mean squared error (_MSE_), measures the square root of the deviation between observed and actual values and is often used as a performance metric in machine learning models. The formulas are as shown in (32) to (35):  
\[MAE=\frac{1}{n}\underset{1}{\overset{n}{\sum}}|m_{i}-c_{i}| \tag{32}\]  
\[MAPE=\frac{1}{n}\underset{1}{\overset{n}{\sum}}|\frac{m_{i}-c_{i}}{m_{i}}| \times 100\% \tag{33}\]  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Configuration** & **Parameter** \\ \hline CPU & 14 vCPU Intel(R) Xeon(R) Gold 6330 CPU @ \\ GPU & 2.00 GHz \\ GPU & RTX 3090(24 GB) \\ Operating system & Windows 11 \\ Accelerated environment & CUDA 11.8 \\ Development environment & Pycharm 2018 \\ Libraries & PyTorch 2.0.0 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Experimental environment configuration.  
\[R^{2}=1-\frac{\frac{\sum\limits_{i}^{n}{(m_{i}-c_{i})}^{2}}{\frac{n}{1}(m_{i}- \bar{m}_{i})}^{2}}{RMSE}=\sqrt{\frac{\frac{\sum\limits_{i}^{n}{(m_{i}-c_{i})}^{2 }}{n}}} \tag{34}\]  
where \(m_{I}\), \(\bar{m}_{i}\), and \(c_{i}\) represent the actual count in the annotation file for the \(i\)th image, the average actual count for the \(i\)th image, and the predicted count for the \(i\)th image, respectively. Here, \(n\) denotes the number of test images.