English

中国农机化学报

中国农机化学报 ›› 2023, Vol. 44 ›› Issue (9): 214-221.DOI: 10.13733/j.jcam.issn.2095-5553.2023.09.030

• 农业智能化研究 • 上一篇    下一篇

基于迁移学习和改进ResNet34的猪个体识别方法

吴潇,杨颖,刘刚,张倩,宁远霖   

  1. 中国农业大学信息与电气工程学院,北京市,100083
  • 出版日期:2023-09-15 发布日期:2023-10-07
  • 基金资助:
    科技创新2030——“新一代人工智能”重大项目(2021ZD0113800)

Pig individual recognition method based on transfer learning and improved ResNet34 for real environment

Wu Xiao, Yang Ying, Liu Gang, Zhang Qian, Ning Yuanlin   

  • Online:2023-09-15 Published:2023-10-07

摘要: 猪个体识别技术可以有效提高大规模猪场的管理效率,降低饲养成本,减少养殖场的经济损失。真实养殖场景中猪个体姿态多变,样本采集困难,且很难获取含有全部猪脸信息的端正姿态。为实现真实猪舍环境下的小样本的非接触式猪个体的快速准确识别,提出一种基于迁移学习和改进神经网络模型的猪个体识别方法,在ResNet34网络模型基础上,优化部分卷积层,设计新的全连接层并且引入Dropout方法,再结合迁移学习方法以及参数调优对模型进行训练。试验结果表明改进ResNet34模型对单张图片平均识别耗时为0.003 2s,验证准确率及测试准确率分别为98.7%、97.8%,改进后模型的浮点运算量降低了约25.3%,总参数量降低了约10.3%,识别准确率提高1.9%,平均检测时间和训练时间分别减少15.8%和14.3%,并且,改进后的ResNet34模型综合性能优于AlexNet、GoogleNet、VGG16等模型。本文提出的方法在30头猪的测试试验中,准确率和精确率分别为97.8%和98.1%。因此,本文提出的模型可以较为精准地实现真实复杂猪舍背景下的猪个体实时识别,为生猪智能化养殖以及追根溯源的研究提供参考。

关键词: 猪个体识别, 深度学习, 迁移学习, 智能养殖

Abstract: Pig individual identification technology can effectively improve the management efficiency of largescale pig farms, reduce feeding costs and the economic losses of farms. The individual pig postures in real farming scenarios are variable, which makes it difficult to collect samples and obtain a proper posture with all the pig face information.To realize the noncontact pig individual recognition of small samples in the real pig house environment, a pig individual recognition method based on transfer learning and an improved neural network model is proposed in this paper. Based on ResNet34 network model, some convolution layers are optimized, the original singlelayer full connection layer is replaced by a doublelayer full connection layer, and the Dropout method is added. Combined with the transfer learning method and parameter optimization, the model is trained. The experimental results show that the average recognition time of the improved ResNet34 model is 0.0032s. The verification accuracy and test accuracy are 98.7% and 97.8%, respectively. After the improvement, the floatingpoint operation amount of the model is reduced by about 25.3%, the total parameters are reduced by about 10.3%, the recognition accuracy is increased by 1.9%,and the average detection time and training time are reduced by 15.8% and 14.3%, respectively.In addition, the overall performance of the improved ResNet34 model is better than that of AlexNet, GoogleNet, VGG16, and other models.The method proposed in this paper shows an accuracy and precision of 97.8% and 98.1%, respectively, in a test trial of 30 pigs.Therefore, the model proposed in this paper can accurately realize the individual recognition of pigs under the background of real and complex pig houses, and provide a reference for the intelligent breeding and traceability research of pigs.

Key words: pig individual identification, deep learning, transfer learning, intelligent breeding

中图分类号: