Abstract:Abstract: Rapid and accurate detection of pigs has been critical to intelligent monitoring of health status within a group-housed breeding environment on large-scale farms. However, a large number of parameters make it difficult to achieve real-time performance in edge computing platforms for practical production. In this study, an improved CenterNet model (named MF-CenterNet) was proposed to detect pigs in group-housed breeding conditions, in order to improve the real-time performance of detection and the accuracy of localizing pigs with body occluded and small body size. An anchor-free CenterNet was also used to ensure the accuracy of detection, especially for the pig with body occluded. A lightweight MobileNet network was first introduced into the CenterNet (instead of ResNet50), as the backbone network of feature extraction for the smaller model size and higher detection speed. In addition, the feature pyramid structure (FPN) was then added to improve the ability of feature extraction for small pig objects. As such, the CenterNet was integrated with the MobileNet and FPN, named MF-CenterNet (i.e., MobileNet-FPN-CenterNet, MF-CenterNet). An image dataset of a private pig was collected to evaluate the performance of MF-CenterNet. All images were then captured from Jincheng Farm, Qiqihar City, Heilongjiang Province, China. Specifically, 1683 video frames were extracted from the video recording of pigs collected in the commercial pig farm, and 6732 images were obtained with the operation of the data argument. All pig objects within the images were then labeled with the labeling tool. The experimental results show that the size of the MF-CenterNet model was only 21MB, which satisfied the deployment of the model to an edge computing platform. The mean average precision (mAP) of pig detection was 94.30%, and the detection speed was up to 69 frames/s. The model of CenterNet integrated with MobileNetv2 achieved the best performance, in terms of accuracy, speed, and model size, where different versions of Mobile Net were combined. The CenterNet model integrated with the MobileNetv2 and FPN (MF-CenterNet) further improved the detection performance, indicating more robust in detecting the pig objects with small body size and body occluded. The improved MF-CenterNet greatly increased the mAP by 0.63 percentage points , and the speed by 42 frames/s, while the size of the model was reduced by 104 MB, compared with the original CenterNet. Furthermore, the mAP detection was improved by 6.39, 4.46, 6.01, and 2.74 percentage points , while, the detection speed was improved by 54, 47, 45, and 43 frames/s, respectively, compared with the common CNN-based object detection models, including Farster RCNN, SSD, YOLOV3, and YOLOV4 model. Consequently, the MF-CenterNet achieved the state-of-the-art mAP performance, higher detection speed, and the deployability of the model in a substantial manner. Therefore, this lightweight object detection model, MF-CenterNet, can meet the requirements of real-time, rapid, and high accuracy of detection on the group-housed pigs. The finding can also be expected to serve as a new way for real-time detection and prerequisite model in the behavior analysis of pigs during modern intensive production.