Abstract:
Egg-laying chickens can inevitably perish daily in large-scale farms. However, manual inspection of deceased chickens cannot fully meet the large-scale production under harsh conditions. Consequently, inspection robots can be utilized as a highly efficient trend in modern agriculture. In this study, the inspection robot was performed on the egg-laying chickens house to swiftly and precisely detect the deceased chickens under complex environments. The detection of dead chickens were also introduced for the caged egg-laying chickens using an improved YOLOv8n model. The research objects were four-tier caged laying chickens on a large-scale laying chickens farm in Zhejiang Province, China. In order to improve the recognition effect and avoid misjudging the lying chickens as dead chickens. Thus, a "lie" label was added during annotation. The dataset was defined with a total of three labels: normal, lying, and dead, where the label was named "normal", "lie", and "dead", respectively. The dataset of
4000 images was constructed after labeling. The dead chickens were presented in
2000 images, while the lying chickens were presented in
1000 images. The dataset was randomly divided into a training set, a validation set, and a test set at a ratio of 6:2:2. Initially, cross stage partial hetconv (CSPHet) was employed to replace the C2f structure within the network using YOLOv8n. The gradient changes of feature maps were then focused across various levels. Additionally, the smaller 1×1 convolution kernels were utilized to substitute some 3×3 convolution kernels, effectively minimizing the model's parameters and computational burden while maintaining detection precision. Secondly, due to the acute occlusion issue in high-density caged chickens farming, occlusion among egg-laying chickens resulted in data loss. Therefore, the spatially improved attention module (SEAM) was integrated into the neck layer to compensate for the response loss in occluded regions and enhance the detection precision of occluded targets. Lastly, dynamics upsampling (DySample) was introduced to bolster the resolution of upsampled feature maps, and then emphasize the effective features of layer regions. A series of experiments were carried out to compare the effects of different input image sizes on the training.The results showed that when the input image size is 800 × 800 pixels, the precision, recall and mAP were the highest, which were 96.5%, 98.0% and 94.4% respectively. Furthermore, the highest recall was 98%, when the size of the input image was 640 × 640 pixels. The precision and mAP were 1.3 and 0.1 percentage points lower than the size of 800 × 800 pixels, respectively, but the required GPU was reduced by 24.4%. The more appropriate size of input image was selected as the 640 × 640 pixels, considering that the edge computing device of the robot was required to process the data of four cameras at the same time. After introducing SEAM mechanism, the box precision (box (P)) was improved by 0.6 percentage point increase, which confirmed the ameliorative effect of the SEAM mechanism on occlusion. The mAP of the improved YOLOv8n algorithm was 95.8% to detectthe dead chickens, with a precision of 96.6%, 2.46 MB of parameters, and an inference time of 25.8 ms. In addition, the improved YOLOv8n model was compared with the YOLO series models, such as YOLOv5n, YOLOv6n, and the original YOLOv8n. The results showed that the improved mAP increased by 2.5, 2.8, and 1.5 percentage points; the precision increased 1.7, 1.6 and 1.4 percentage points; the parameters are reduced by1.6%, 41.8% and 18.3%; the inference time decreased by 11.9%, 36.8% and 15.7% respectively, which showed that the improved YOLOv8n model has strong advantages in thecomprehensive performance. The real-time streaming protocol (RTSP) was configured to acquire real-time video streams for the real-time detection and recognition of deceased chickens among caged egg-laying chickens. The improved YOLOv8n model was successfully deployed on the edge device of the inspection robot, in order to validate the stability, applicability, and real-time performance. This finding can provide the technical support and reference to detect the dead chickens in the facility environment using edgedevices of robots.