Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm

Accurate detection of key body parts of cattle is of great significance to Precision Livestock Farming (PLF), using artificial intelligence for video analysis. As the background image in cattle livestock farms is complex and the target features of the cattle are not obvious, traditional object-detec...

Full description

Bibliographic Details
Main Authors: Dangguo Shao, Zihan He, Hongbo Fan, Kun Sun
Format: Article
Language:English
Published: MDPI AG 2023-05-01
Series:Agriculture
Subjects:
Online Access:https://www.mdpi.com/2077-0472/13/6/1110
_version_ 1797596664487215104
author Dangguo Shao
Zihan He
Hongbo Fan
Kun Sun
author_facet Dangguo Shao
Zihan He
Hongbo Fan
Kun Sun
author_sort Dangguo Shao
collection DOAJ
description Accurate detection of key body parts of cattle is of great significance to Precision Livestock Farming (PLF), using artificial intelligence for video analysis. As the background image in cattle livestock farms is complex and the target features of the cattle are not obvious, traditional object-detection algorithms cannot detect the key parts of the image with high precision. This paper proposes the Filter_Attention attention mechanism to detect the key parts of cattle. Since the image is unstable during training and initialization, particle noise is generated in the feature graph after convolution calculation. Therefore, this paper proposes an attentional mechanism based on bilateral filtering to reduce this interference. We also designed a Pooling_Module, based on the soft pooling algorithm, which facilitates information loss relative to the initial activation graph compared to maximum pooling. Our data set contained 1723 images of cattle, in which labels of the body, head, legs, and tail were manually entered. This dataset was divided into a training set, verification set, and test set at a ratio of 7:2:1 for training the model proposed in this paper. The detection effect of our proposed module is proven by the ablation experiment from mAP, the AP value, and the F1 value. This paper also compares other mainstream object detection algorithms. The experimental results show that our model obtained 90.74% mAP, and the F1 value and AP value of the four parts were improved.
first_indexed 2024-03-11T02:53:22Z
format Article
id doaj.art-ff0acbe53a4e4a729f0b96d8eb4f3856
institution Directory Open Access Journal
issn 2077-0472
language English
last_indexed 2024-03-11T02:53:22Z
publishDate 2023-05-01
publisher MDPI AG
record_format Article
series Agriculture
spelling doaj.art-ff0acbe53a4e4a729f0b96d8eb4f38562023-11-18T08:50:29ZengMDPI AGAgriculture2077-04722023-05-01136111010.3390/agriculture13061110Detection of Cattle Key Parts Based on the Improved Yolov5 AlgorithmDangguo Shao0Zihan He1Hongbo Fan2Kun Sun3Faculty of Information Engineering and Automation, Yunnan Province Key Laboratory of Computer, Kunming University of Science and Technology, Kunming 650500, ChinaFaculty of Information Engineering and Automation, Yunnan Province Key Laboratory of Computer, Kunming University of Science and Technology, Kunming 650500, ChinaFaculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650300, ChinaFaculty of Information Engineering and Automation, Yunnan Province Key Laboratory of Computer, Kunming University of Science and Technology, Kunming 650500, ChinaAccurate detection of key body parts of cattle is of great significance to Precision Livestock Farming (PLF), using artificial intelligence for video analysis. As the background image in cattle livestock farms is complex and the target features of the cattle are not obvious, traditional object-detection algorithms cannot detect the key parts of the image with high precision. This paper proposes the Filter_Attention attention mechanism to detect the key parts of cattle. Since the image is unstable during training and initialization, particle noise is generated in the feature graph after convolution calculation. Therefore, this paper proposes an attentional mechanism based on bilateral filtering to reduce this interference. We also designed a Pooling_Module, based on the soft pooling algorithm, which facilitates information loss relative to the initial activation graph compared to maximum pooling. Our data set contained 1723 images of cattle, in which labels of the body, head, legs, and tail were manually entered. This dataset was divided into a training set, verification set, and test set at a ratio of 7:2:1 for training the model proposed in this paper. The detection effect of our proposed module is proven by the ablation experiment from mAP, the AP value, and the F1 value. This paper also compares other mainstream object detection algorithms. The experimental results show that our model obtained 90.74% mAP, and the F1 value and AP value of the four parts were improved.https://www.mdpi.com/2077-0472/13/6/1110key parts detection of cattleYoloFilter_AttentionSoftpoolingdeep learning
spellingShingle Dangguo Shao
Zihan He
Hongbo Fan
Kun Sun
Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm
Agriculture
key parts detection of cattle
Yolo
Filter_Attention
Softpooling
deep learning
title Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm
title_full Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm
title_fullStr Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm
title_full_unstemmed Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm
title_short Detection of Cattle Key Parts Based on the Improved Yolov5 Algorithm
title_sort detection of cattle key parts based on the improved yolov5 algorithm
topic key parts detection of cattle
Yolo
Filter_Attention
Softpooling
deep learning
url https://www.mdpi.com/2077-0472/13/6/1110
work_keys_str_mv AT dangguoshao detectionofcattlekeypartsbasedontheimprovedyolov5algorithm
AT zihanhe detectionofcattlekeypartsbasedontheimprovedyolov5algorithm
AT hongbofan detectionofcattlekeypartsbasedontheimprovedyolov5algorithm
AT kunsun detectionofcattlekeypartsbasedontheimprovedyolov5algorithm