College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China.
Sensors (Basel). 2020 Feb 17;20(4):1085. doi: 10.3390/s20041085.
The detection of pig behavior helps detect abnormal conditions such as diseases and dangerous movements in a timely and effective manner, which plays an important role in ensuring the health and well-being of pigs. Monitoring pig behavior by staff is time consuming, subjective, and impractical. Therefore, there is an urgent need to implement methods for identifying pig behavior automatically. In recent years, deep learning has been gradually applied to the study of pig behavior recognition. Existing studies judge the behavior of the pig only based on the posture of the pig in a still image frame, without considering the motion information of the behavior. However, optical flow can well reflect the motion information. Thus, this study took image frames and optical flow from videos as two-stream input objects to fully extract the temporal and spatial behavioral characteristics. Two-stream convolutional network models based on deep learning were proposed, including inflated 3D convnet (I3D) and temporal segment networks (TSN) whose feature extraction network is Residual Network (ResNet) or the Inception architecture (e.g., Inception with Batch Normalization (BN-Inception), InceptionV3, InceptionV4, or InceptionResNetV2) to achieve pig behavior recognition. A standard pig video behavior dataset that included 1000 videos of feeding, lying, walking, scratching and mounting from five kinds of different behavioral actions of pigs under natural conditions was created. The dataset was used to train and test the proposed models, and a series of comparative experiments were conducted. The experimental results showed that the TSN model whose feature extraction network was ResNet101 was able to recognize pig feeding, lying, walking, scratching, and mounting behaviors with a higher average of 98.99%, and the average recognition time of each video was 0.3163 s. The TSN model (ResNet101) is superior to the other models in solving the task of pig behavior recognition.
猪行为的检测有助于及时有效地发现疾病和危险动作等异常情况,对保障猪的健康和福利起着重要作用。工作人员对猪行为的监测既耗时,又主观,且不切实际。因此,迫切需要实施自动识别猪行为的方法。近年来,深度学习逐渐应用于猪行为识别的研究。现有的研究仅基于猪在静态图像帧中的姿势来判断猪的行为,而没有考虑行为的运动信息。然而,光流可以很好地反映运动信息。因此,本研究将视频中的图像帧和光流作为双流输入对象,充分提取时间和空间行为特征。提出了基于深度学习的双流卷积网络模型,包括膨胀三维卷积网络(I3D)和时间分段网络(TSN),其特征提取网络分别为 Residual Network(ResNet)或 Inception 架构(如带批归一化的 Inception(BN-Inception)、InceptionV3、InceptionV4 或 InceptionResNetV2),以实现猪行为识别。创建了一个包含 1000 个视频的标准猪视频行为数据集,这些视频记录了自然条件下猪的 5 种不同行为动作(进食、躺卧、行走、搔痒和爬跨)的行为。该数据集用于训练和测试所提出的模型,并进行了一系列对比实验。实验结果表明,特征提取网络为 ResNet101 的 TSN 模型能够以 98.99%的平均准确率识别猪的进食、躺卧、行走、搔痒和爬跨行为,且每个视频的平均识别时间为 0.3163s。与其他模型相比,TSN 模型(ResNet101)在解决猪行为识别任务方面表现更优。