Zeng Fanguo, Zhu Jun, Wang Haifeng, Jia Nan, Zhao Yuliang, Zhao Wenwen, Li Bin. Typical behavior recognition of herd pigs based on improved frame difference and deep learning[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2022, 38(15): 170-178. DOI: 10.11975/j.issn.1002-6819.2022.15.018
    Citation: Zeng Fanguo, Zhu Jun, Wang Haifeng, Jia Nan, Zhao Yuliang, Zhao Wenwen, Li Bin. Typical behavior recognition of herd pigs based on improved frame difference and deep learning[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2022, 38(15): 170-178. DOI: 10.11975/j.issn.1002-6819.2022.15.018

    Typical behavior recognition of herd pigs based on improved frame difference and deep learning

    • Typical behavior of herd pigs is one of the most important indicators to evaluate the adaptability of pigs to the environment. This study aims to improve the accuracy and efficiency of herd behavior recognition. A novel recognition system was proposed for the typical behavior of herd pigs (such as eating, lying, standing, and fighting) using an improved frame differential-deep learning. The video image data was collected from two pens of group-fed Landrace pigs. A total of 18 Landrace pigs aged 50~115 days were selected with nine pigs per pen. 1117 video frames were collected. Then, a total of 4468 images were obtained after image enhancement as the dataset. Firstly, five models of typical deep learning (including Faster-RNN, SSD, Retinanet, Detection Transformer, and YOLOv5) were selected for posture detection. An optimal model of posture was determined after the comparative analysis. Secondly, a pixel feature extraction was implemented on the pig activity to promote the traditional frame differential approach, such as, the slow motion pigs were easy to miss the detection, and more holes were detected in the pigs. Finally, the Proportion of Fighting Activities (PFA) and Proportion of Fighting Behavior (PFB) were used to optimize the pig fighting behavior in the recognition model. An optimal behavior model was determined during this time. The result showed that the average accuracy of YOLOv5 reached 93.80% for the typical posture detection of group-reared pigs. Among them, the model size was 14.40 MB, and the detection speed was 32.00 f/s, indicating that the detection speed fully met the demand for real-time posture detection. Once the Intersection over Union (IoU) threshold was set as 0.50, the mean average accuracy of YOLOv5 increased by 1.10, 3.23, 4.15, and 21.20 percentage points, respectively, and the model size was reduced by 87.31%, 85.09%, 90.15%, and 97.10%, respectively, compared with the Faster-RNN, SSD, Retinanet, and Detection Transformer models. Meanwhile, the original frame difference was expanded from the frame difference of 2, to 4 after experimental analysis. The improved frame difference was utilized to effectively eliminate the fine holes that were produced by the slow-moving pigs and background interference, such as lighting, as well as the outstandingly retained pixel characteristics of vigorous movement activities, when the pigs were fighting. The better performance of detection was achieved close to the actual movement targets. The pig eating, lying, and standing behaviors were directly discriminated by the single-frame posture images of pigs. Furthermore, 100 video frames containing fighting behavior (frame speed of 30 f/s, duration of 5~60s) and video frames without fighting behavior were selected to verify the accuracy of the pig fighting behavior recognition. The reason was that the pig fighting behavior was a continuous process. The test results showed that the best average value of typical behavior recognition accuracy was 94.45%, when the two optimized indexes of PFA and PFB were set as 10% and 40%, respectively. Therefore, the high accuracy, small model size, and fast recognition can provide technical support and strong reference for the accurate and efficient identification of typical behaviors of herd pigs in group breeding.
    • loading

    Catalog

      /

      DownLoad:  Full-Size Img  PowerPoint
      Return
      Return