# YOLOv5 DA: An Improved YOLOv5 Model for Posture Detection of Grouped Pigs
## 3 Results
### Results and Analysis of Comparative Experiments  
To validate the efficacy of YOLOv5 DA, we conducted a comparative experiment with several mainstream object detection algorithms, including Faster-RCNN, YOLOv4, YOLOv5, FCOS [48], and CenterNet on the same pig posture dataset. As shown in Table 4, compared to other models, YOLOv5s achieves higher accuracy while utilizing fewer model  
Figure 8: mAP curve of the object detection model.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & & & \multicolumn{6}{c}{**AP**} \\ \cline{3-10}
**Class** & **Mosaic9** & **DC** & **ASFF** & **Standing** & **Prone Lying** & **Side Lying** & **mAP** & **GFLOPs** & **Params** \\ \hline YOLOv5s & — & — & — & 99.4 & 98.7 & 98.0 & 85.1 & 15.8 & 7.02 M \\ YOLOv5s & \(\surd\) & — & — & 99.5 & 99.0 & 98.8 & 85.8 & 15.8 & 7.02 M \\ YOLOv5s & \(\surd\) & \(\surd\) & — & 99.4 & 99.0 & 98.7 & 86.1 & 16.7 & 7.87 M \\ YOLOv5s & \(\surd\) & \(\surd\) & \(\surd\) & 99.4 & 99.1 & 99.1 & 86.8 & 25.2 & 13.3 M \\ \hline \hline \end{tabular}
\end{table}
Table 3: Ablation experiments of YOLOv5 DA on pig posture dataset.  
parameters and FLOPs. Consequently, we chose YOLOv5s as the benchmark model for further enhancement. The enhanced model, YOLOv5 DA, can accurately recognize the standing, prone-lying, and side-lying postures of pigs with an AP of 99.4%, 99.1%, and 99.1%, respectively. Compared with YOLOv5s, despite a slight increase in computational complexity, YOLOv5 DA exhibited a notable 1.7% improvement in mAP, resulting in superior detection performance. Furthermore, when compared with other mainstream object detection algorithms, YOLOv5 DA demonstrated the ability to attain the highest detection accuracy while utilizing the fewest model Params and FLOPs. This further supports the effectiveness of YOLOv5 DA for accurately identifying various postures of pigs.  
To further verify the detection effect of YOLOv5 DA, we selected two images to compare YOLOv5 DA and YOLOv5s. It can be observed that the mutual occlusion of live pigs poses a challenge for YOLOv5s, leading to missed detections (represented by red dashed boxes in Figure 9a,c); however, YOLOv5 DA can effectively identify the missed targets (Figure 9b,d). In addition, the pig with the side-lying posture at the top of Figure 9c was incorrectly identified as a prone-lying pig (indicated by the red arrow) by YOLOv5s; however, YOLOv5 DA can accurately identify the posture category (Figure 9d). Figure 9 revealed that YOLOv5 exhibited omissions in detecting two pigs and misclassification in identifying one pig. These results also demonstrated that YOLOv5 DA can effectively deal with missed or false detection and can be used to continuously monitor the growth of pigs and better protect animal welfare.  
Figure 9: Detection results of pig posture by YOLOv5s and YOLOv5 DA. (**a**,**c**) represent the detection results of YOLOv5s; (**b**,**d**) represent the detection results of YOLOv5 DA; the yellow bounding box represents the standing pig, the green bounding box represents the side-lying pig, and the light blue bounding box represents the prone-lying pig.