Accurate Recognition and Counting of Laying Hens in a Complex Environment Using an Improved Yolov5s Model

Yongsheng Wang,Duanli Yang,Hui Chen,Erdong Sun,Dan Zeng
DOI: https://doi.org/10.2139/ssrn.4224453
2022-01-01
SSRN Electronic Journal
Abstract:The counting of laying hens is a crucial task in large-scale production management and asset valuation of hen farms. A method to identify and count laying hens using an improved YOLOv5s model is proposed. Images of laying hens were extracted as frames from captured video datasets and augmented using a random selection of noise addition, rotation, scaling, luminance transformation, and mirroring to create an experimental dataset of 2292 images. The dataset was divided into a training set, validation set and test set in the ratio of 6:2:2 for training to identify individual laying hens. A counting function was added to the detection port to count the hens. A small target detection head was added to the output layer of the model to improve detection performance and to overcome the difficulty of recognizing small objects with uneven distribution. Changes were made to improve the model to better balance feature information at different scales. A weighted bi-directional feature pyramid network (BiFPN) was used to improve the feature fusion capability. A convolutional block attention module (CBAM) was added to the feature extraction and feature fusion sections to increase the feature learning capability of the network model and obtain more detailed features. The EIOU loss function replaced the original YOLOv5s CIOU loss function to increase detection accuracy. The experimental results show that P(89.21%), R(82.29%) and mAP (87.42%) of the improved model were respectively 1.06%, 6.24% and 6.37% greater than those of the original YOLOv5s model and respectively 5.81%, 7.03%, and 7.28% greater than those of the YOLOv7-tiny model. The improved model had a mean accuracy of 92.35% for counting at a confidence threshold of 0.40. The improved YOLOv5s model accurately counted laying hens in a complex environment and so will serve as an efficient method for breeders to count laying hens.
What problem does this paper attempt to address?