# Research on Rapid Recognition of Moving Small Targets by Robotic Arms Based on Attention Mechanisms
## 4 Experimental Results and Discussion
### Comparative Analysis of Experimental Indicators  
This study used precision-recall as one of the evaluation indicators. A high precision score suggests that most objects detected by the model are indeed objects, with only a few non-object entities being classified as objects. A high recall score, on the other hand, suggests that the model can locate more objects in the image. As can be seen, compared with the original network and YOLOv8-SE, both the precision and recall of the improved YOLOv8n were significantly higher than the other two network models. Intuitively speaking, measuring the quality of object detection using precision-recall seems sufficient. However, in object detection, each image may contain different targets of different categories, implying that the model's classifications and localizations need different indicators for evaluation. _mAP_ (mean average precision), commonly used in object detection to measure identification accuracy, was used as the reference indicator, representing the area underneath the precision-recall (P-R) curve. The formulas for _mAP_, \(P\), and \(R\) are as follows:  
\[mAP=\frac{\sum_{i=1}^{k}AP_{i}}{k} \tag{10}\]  
\[Precision=\frac{TP}{TP+FP} \tag{11}\]  
\[Recall=\frac{TP}{TP+FN} \tag{12}\]  
For variables in formulas, \(k\) represents the number of class objects. _TP_ (true positives), _TN_ (true negatives), _FP_ (false positives), and _FN_ (false negatives) are fundamental metrics for evaluating model performance and form the basis for calculating other important indicators such as accuracy and recall. \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Specifications** \\ \hline \hline \
\begin{tabular}{c} Scope of use/(m) \\ interface \\ Length, width, height/(mm \({}^{\star}\) mm \({}^{\star}\) mm) \\ \end{tabular} &
\begin{tabular}{c} 0.3–3.0 \\ USB Type-C 3.1 Gen 1 \\ 90’25’25’ \\ 69.4’42.5 \\ Resolution/Pixel \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Technical specifications of D435i. * _TP_ (true positives): the number of positive instances correctly predicted as positive. * _TN_ (true negatives): the number of negative instances correctly predicted as negative. * _FP_ (false positives): the number of negative instances incorrectly predicted as positive, also known as false alarms. * _FN_ (false negatives): the number of positive instances incorrectly predicted as negative, also known as missed detections. * _Precision_: measures the overall proportion of correct predictions (both positive and negative) made by the model. * _Recall_: measures the proportion of actual positives that are correctly identified by the model. While accuracy focuses on the overall correctness of the model's predictions, recall emphasizes the model's ability to capture positive instances. For this study, there were three types of fruits in the experiment, so k = 3 in Formula (10). Within this context, mAP50 denotes the mAP (mean average precision) value of each category when the IoU (intersection over union) is set to 0.5, and mAP50-95 denotes the mAP on different IoU thresholds (ranging from 0.5 to 0.95). According to these indicators, we compared the PR (precision-recall) curves of the experimental data, as shown in Figure 9.  
As can be seen, the improved model proposed in this study outperformed the original model. After training, TensorBoard was used to save the logs from both training and validation. The final performance metrics obtained by training with the original YOLOv8 are shown in Figure 10.  
Figure 10: Performance metrics of the Original YOLOv8. Figure 9: Comparison of P–R curves (left is the original YOLOv8 version, right is the improved version). Following modifications like refining the loss function and integrating an attention mechanism, the mAP of the enhanced YOLOv8 neural network model had markedly increased relative to the original model. Specifically, the mAP50, which denotes the mAP value at an IoU threshold of 0.5, approached 0.970.