
==== Front
Poult Sci
Poult Sci
Poultry Science
0032-5791
1525-3171
Elsevier

S0032-5791(24)00701-6
10.1016/j.psj.2024.104122
104122
ANIMAL WELL-BEING AND BEHAVIOR
Research note: A method for recognizing and evaluating typical behaviors of laying hens in a thermal environment
Yan Yu *
Sheng Zheya †‡
Gu Yue *
Heng Yifan *
Zhou Haobo †‡
Wang Shucai wsc01@mail.hzau.edu.cn
*1
⁎ College of Engineering, Huazhong Agricultural University, Wuhan 430070, China
† College of Animal Science & Technology and College of Veterinary Medicine, Huazhong Agricultural University, Wuhan 430070, China
‡ Key Laboratory of Agricultural Animal Genetics, Breeding and Reproduction, Ministry of Education, Wuhan 430070, China
1 Corresponding author: wsc01@mail.hzau.edu.cn
29 7 2024
11 2024
29 7 2024
103 11 1041229 6 2024
24 7 2024
© 2024 Published by Elsevier Inc. on behalf of Poultry Science Association Inc.
2024

https://creativecommons.org/licenses/by-nc-nd/4.0/ This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Automatically identifying abnormal behaviors of caged laying hens in a thermal environment improves manual management efficiency. It also provides reference indicators for breeding heat-tolerant hens. In this study, we propose a deep learning-based method for automatic recognition and evaluation of typical heat stress behaviors in hens. We developed a lightweight object detection algorithm, YOLO-HGP, based on the YOLOv8n as the baseline model. YOLO-HGP achieves Precision (P), Recall (R), and mean average precision (mAP) of 95.952%, 94.127%, and 97.667%, respectively, effectively detecting typical heat stress behaviors in hens. Compared to the original YOLO v8n, YOLO-HGP improves R, and mAP by 6.257%, and 1.963%, respectively. The FLOPs (floating point operations) and parameter count of YOLO-HGP are 4.3G and 1.729M, reducing by 47.56% and 42.58% compared to the original model. Additionally, we introduce the “ORC-ratio” (The ratio of the combined frequency of open-beak breathing and retching behaviors to the frequency of closed-beak behaviors.) as an evaluation indicator for the frequency of typical heat stress behaviors in hens and combine it with the Hybrid-SORT multiobject tracking algorithm to achieve tracking detection of individual hens. The study demonstrates that the proposed model effectively identifies and quantitatively evaluates typical behaviors of hens in a thermal environment, providing an effective approach for the automated recognition of heat stress behaviors in hens.

Key words

laying hen
heat stress
behavior recognition
animal welfare
deep learning
==== Body
pmcINTRODUCTION

Temperature is a crucial parameter in intensive cage production of laying hens, and unfavorable temperature conditions have a great impact of the hens (Fathi et al., 2022). Due to the absence of sweat glands, open beak panting is the most direct heat dissipation method for birds in high-temperature environments (Goel et al., 2021). This makes laying hens highly susceptible to heat stress during hot summer periods. Panting allows birds to regulate their body temperature effectively (Oluwagbenga and Fraley, 2023; Fang et al., 2023). Therefore, under intensive cage housing conditions, it is meaningful to employ automated methods to quickly identify abnormal laying hens in a thermal environment and evaluate the severity of their abnormal behaviors.

There is evidence that open beak panting and retching are typical behaviors of laying hens in a hot environment (Lara et al., 2013; Ruff et al., 2020). In this study, we propose a deep learning-based method to identify these 2 behaviors. Firstly, we develop a lightweight object detection algorithm, YOLO-HGP, based on YOLOv8n and RT-DETR. This model is utilized to detect “beak-open panting behavior,” “beak-close behavior,” and “beak-open retching behavior” in laying hens’ head. Finally, the “opening-retching-closing ratio (ORC-ratio)” of laying hens was introduced as a quantitative metric, and in combination with the target tracking network Hybrid-SORT, a method for quantifying typical abnormal behaviors of laying hens in a hot environment was established.

MATERIALS AND METHODS

Collection of Infrared Thermal Images

The experimental data was collected at the Huazhong Agricultural University Experimental Poultry Farm. The subjects of the study were laying hens kept in cages. The data collection took place in December 2023. The temperature inside the chicken house was raised to 32 ± 1°C using a heating plate, with an environmental humidity of 57 ± 5%. The hens were approximately 350 days old and consisted of 2 breeds, Xinhua laying hens and Jingmen Black Feather Green Shell laying hens, totaling 93 individuals. The experimental cages for the laying hens were of H-type. The infrared thermal camera used for image acquisition was the FLIR T530, with an infrared resolution of 320×240 pixels, a wavelength range of 7.5 to 14.0μm, a measurement temperature range of -20°C to 120°C, and a lens focal length of 17 mm (24°). The thermal sensitivity was less than 30 mk. As shown in Figure 1A, the infrared thermal imaging device was mounted on an inspection robot for caged laying hens.Figure 1 Process of behavior recognition and evaluation method. Figure 1A illustrates the process of video data collection using a robot and an infrared thermal imaging camera, along with the algorithmic flow for behavior recognition and evaluation. Figure 1B shows the structure of YOLO-HGP, where the backbone has been replaced with the Ghost-HGNetv2 backbone structure, and the head has been replaced with the PC-Head structure. Figure 1C shows the specific structure of the Ghost-HGBlock. Figure 1D illustrates the New Head Structure PC-Head. Figure 1E displays the Partial convolution structure. Cp is the number of channels participating in the convolution. * is the convolution operation. h, w are the height and width dimensions of the feature map.

Figure 1

The captured videos were processed using the Potplayer software, resulting in 4,782 dataset images after removing the frames without the target. The dataset was divided into a validation set (10%), a test set (20%), and a training set (70%). The “opening-beak head”, “closing-beak head” and “retching head” were annotated using the MAKE SENCE software. The 3 target categories are labeled as “open-head,” “close-head,” and “retching-head.” Among them, there were 2167 images of the “open-head,” 1956 images of the “close-head,” and 659 images of the “retching-head.”

YOLO-HGP OBJECT DETECTION ALGORITHM MODEL

This study presents YOLO-HGP, a lightweight object detection algorithm developed based on YOLO v8n. Our approach focuses on 2 main aspects: lightweight processing of the backbone network and lightweight modifications to the algorithm's head. For the backbone network, as shown in Figure 1C, we replaced the original CSPDarknet53 with the HGNetv2 backbone network from the Real-Time Detection Transformer (RT-DETR) algorithm (Zhao et al., 2023). To further enhance the lightweight nature of the network, we integrated Ghost-Conv blocks from the lightweight network GhostNet (Han et al., 2020), replacing the regular convolutional blocks in HGNetv2. In terms of the algorithm's head, as shown in Figure 1D, we introduced a Coupled-Head structure, which is a redesigned version of the Head section. Moreover, as shown in Figure 1E, we replaced the regular 3×3 convolutions with Partial Convolution (Partial Conv) from FasterNet (Chen et al., 2023), allowing us to construct a new head structure named PC-Head. The overall architecture of the YOLO-HGP algorithm is depicted in Figure 1B. This lightweight object detection algorithm facilitates deployment on robots.

Typical Behavior Recognition Method Based on ORC-Ratio

To quantify the occurrence level of typical behaviors in laying hens under heat stress, this study conducted frame-by-frame counting of 3 behaviors based on the object detection results. The frame counts of beak opening, retching, and beak closing behaviors in the videos were then subjected to the computation described by Equation (1) in real-time.(1) KORC=fo+fRfc,(fc∈N≥1)

In Equation (1), KORC represents the ORC-Ratio of typical behaviors in laying hens under heat stress. fO denotes the number of frames in which the beak opening behavior of the hens occurs. fR represents the number of frames in which the retching behavior is observed, and fC indicates the number of frames in which the hens exhibit beak closing behavior.

Multi Objects Individual Recognition Method

In this study, combining Hybrid-SORT (Yang et al., 2024), we extract the results of target detection and tracking, respectively calculating the ratio of typical abnormal frames of heat stress for individual chickens in the video, achieving the detection of abnormal behaviors in individual chickens. The data collection process and the complete algorithm structure are illustrated in Figure 1.

RESULTS AND DISCUSSION

Algorithm Training Experimental Setting

The experiments were conducted on a platform equipped with an Intel(R) Core (TM) i5-10200H CPU operating at 2.40GHz, an NVIDIA GeForce GTX 1650Ti GPU, 16 GB RAM, and a 64-bit Windows 10 operating system. The computational environment incorporated Pytorch version 1.10.1 and CUDA version 11.3 to facilitate efficient deep learning processes. To ensure uniformity across comparative analyses, standardized training parameters were adopted consistently for all evaluated object detection models. During the training process, each model was trained for 100 epochs with a batch size of 32. Mosaic augmentation was applied to enhance the data for the first 10 epochs. The stochastic gradient descent (SGD) optimizer was utilized during the model training.

YOLO-HGP Object Detection Algorithm Model

To evaluate the detection performance of the YOLO-HGP model, this study compares it with the original YOLO v8n model and 5 other 1-stage object detection models (YOLO v5s, YOLO v5n, YOLO v6n, YOLO v7, YOLOX-Tiny). The evaluation is based on Map@0.5 (mean average precision, where IoU threshold is set to 0.5), Precision, Recall, FLOPs (floating-point operations), and the number of parameters. The experiments are conducted on the same dataset with an equal number of training iterations.

The results show that YOLO-HGP achieves a Map@0.5 of 97.667%, precision of 95.952%, recall of 94.127%, FLOPs of 4.3G, and a parameter count of 1.729M. In comparison, YOLO v8n has a Map@0.5 of 95.704%, precision of 96.440%, recall of 87.870%, FLOPs of 8.2G, and a parameter count of 3.011M. The descriptive comparison demonstrates that YOLO-HGP outperforms YOLO v8n in overall detection performance while significantly reducing the model's FLOPs and parameter count.

To evaluate the performance improvement of the models, this study compared the loss function results on the validation set. Figure 2A presents the comparison of the box loss, classification loss, and distribution focal loss for the 2 models. The improved model YOLO-HGP demonstrates almost identical convergence in terms of box loss and classification loss. However, the YOLO-HGP exhibits significantly faster convergence in distribution focal loss. This indicates that the YOLO-HGP can quickly adjust its weight parameters from the initial state within a shorter training time. In other words, the YOLO-HGP possesses better learning capabilities and adaptability. It effectively saves time and computational resources, contributing to overall cost reduction.Figure 2 Comparison of experimental results. (A) shows the comparison of training loss values between YOLO-HGP and YOLO v8n. Box, Cls, and Dfl represent box loss, classification loss, and distribution focal loss, respectively. (B and C) shows the recognition confusion matrix of YOLO-HGP and YOLO v8n. “open,” “close,” and “retching” represent the beak opening, beak closing, and retching behaviors of the chicken. (D and E) shows Objects tracking and behavior detection results. In each image, the bottom left corner displays the ID, class, and ORC-Ratio of each chicken. The target box of each chicken also displays the ID, confidence (conf), and class (c). In the class representation, 0 represents opening-beak, 1 represents closing-beak, and 2 represents retching. (F and G) represents the ORC Ratio curve of 2 groups of laying hens with time under normal temperature and high temperature.

Figure 2

Figures 2B and 2C displays the confusion matrix comparing the performance of the models before and after improvement, specifically showcasing the results of the model's classification detection. It can be observed that the YOLO-HGP outperforms the previous model in terms of false detections for the 3 behaviors as well as the background.

Furthermore, when compared to YOLO v5s (Map@0.5: 94.409%, precision: 91.123%, recall: 90.681%, FLOPs: 23.8G, parameters: 9.11M), YOLO v5n (Map@0.5: 93.310%, precision: 94.591%, recall: 90.182%, FLOPs: 7.2G, parameters: 2.5M), YOLO v6n (Map@0.550: 91.307%, precision: 84.136%, recall: 91.273%, FLOPs: 11.9G, parameters: 4.238M), YOLO v7 (Map@0.5: 91.495%, precision: 95.175%, recall: 64.44%, FLOPs: 106.472G, parameters: 37.62M), and YOLOX-Tiny (Map@0.5: 94.880%, precision: 91.735%, recall: 86.395%, FLOPs: 3.809G, parameters: 5.033M), the YOLO-HGP demonstrates lower FLOPs and parameter count. Additionally, YOLO-HGP exhibits superior performance in terms of average precision, precision, and recall.

In conclusion, the proposed YOLO-HGP model achieves excellent detection performance while achieving lightweight characteristics. It outperforms the compared models in terms of average precision, precision, and recall. The model effectively balances lightweight implementation and detection performance.

Comparison of detection Between Normal and High-Temperature Environments

This study randomly selected 24 healthy laying hens for a comparative experiment. The hens were evenly divided into 2 groups, with 1 group exposed to an environmental temperature of 32°C and the other group to 26°C, while keeping all other environmental conditions the same. Both groups of hens were exposed to the environment for 180 min, with infrared thermal imaging capturing hen images every 30 min for a duration of 10 seconds each time. The captured videos were inputted into the algorithm model developed in this study, and partial detection results are shown in Figure 2, Figure 2. It can be observed from the images that the target ID, category, and bounding box of each hen could be successfully recognized. The lower-left corner of the images displays the individual ID, behavior category, and ORC-Ratio. Figure 2, Figure 2 correspond to the detection images under 32°C and 26°C environments, respectively. According to the ORC-Ratio displayed in the lower-left corner of the images, the ORC-Ratio of the 2 hens in Figure 2D were 1.41 and 1.03, while the ORC-Ratio of the hens in Figure 2E was 0.03. Therefore, the proposed algorithm model in this study provides an intuitive approach for recognizing and evaluating laying hen behaviors in a hot environment.

Comparison of ORC-Ratio Between Normal and High-Temperature Environments

To further observe the difference in ORC-Ratio of laying hens under normal and high temperatures, the ORC-Ratio variation curves for each hen in different experiments were recorded. Figure 2F shows the ORC-Ratio variation curve of hens under 32°C conditions. It can be observed that the ORC-Ratio of all 12 hens was initially close to 0 during the heating process. With increasing heating time, the ORC-Ratio of each hen showed an increasing trend. After 180 min of heating, the ORC-Ratio values for the 12 hens were 20.80, 5.58, 30.65, 1.02, 5.51, 26.68, 18.60, 5.80, 38.50, 5.50, 36.88, and 51.85, respectively. Each hen exhibited varying degrees of open-beak breathing in the hot environment. The minimum ORC-Ratio value was 1.02 for the NO.4 hen, while the maximum ORC-Ratio value was 51.85 for the NO.12 hen. The higher the ORC-Ratio of the laying hen in the hot environment, the more frequent the occurrence of typical heat stress behaviors. Therefore, the NO.4 hen exhibited the least heat stress behaviors, while the NO.12 hen experienced the most severe heat stress behaviors. Figure 2G displays the ORC-Ratio variation curve of hens under 26°C conditions. It can be observed that the ORC-Ratio curves of hens in this environment fluctuated insignificantly, indicating that they did not require prolonged open-beak exhalation to facilitate heat dissipation. Comparing Figure 2, Figure 2, it is evident that the ORC-Ratio significantly increases in a hot environment, demonstrating the effectiveness of using ORC-Ratio to assess the degree of heat stress behaviors in laying hens.

In conclusion, this study focuses on detecting abnormal behaviors in caged laying hens under a hot environment and proposes a recognition and quantitative evaluation method using deep learning techniques. In terms of behavior recognition, the study improves a lightweight object detection algorithm, which demonstrates excellent performance in detecting abnormal behaviors. Additionally, by incorporating object tracking algorithms, individual tracking and recognition of different hens are achieved. For the quantitative evaluation of abnormal behaviors, a calculation method based on the “ORC-Ratio” is introduced. This method calculates the proportion of typical heat stress behaviors occurring in laying hens in a hot environment. By combining this calculation method with the deep learning model, automatic recognition and quantitative evaluation of abnormal behaviors in laying hens under a hot environment are achieved. Comparative experiments reveal differences in ORC-Ratio between hens in different temperature environments. Therefore, this research provides valuable insights for the automated inspection of heat-stressed laying hens in intensive cage systems.

DISCLOSURES

None of the authors have any conflicts of interest to declare.

Appendix Supplementary materials

Image, video 1

Image, video 2

Image, video 3

ACKNOWLEDGMENTS

This study was supported by Biological Breeding-National Science and Technology Major Project (grant number: 2023ZD0407106 ); Biological Breeding-National Science and Technology Major Project (grant number: 2023ZD0405203 ).

Author Contributions: Y. Y., Methodology, Writing—original draft; Z. S., Methodology, Writing—original draft; Y. G., Writing—review and editing; Y. H., Writing—review and editing; H. Z., Data curation; S. W., Methodology, Writing—original draft.

Supplementary material associated with this article can be found in the online version at doi:10.1016/j.psj.2024.104122.
==== Refs
REFERENCES

Chen J. Kao S. He H. Zhuo W. Wen S. Lee C. Chan S.-H.G. Run, don't walk: chasing higher FLOPS for faster neural networks Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition 2023 12021 12031
Fang X. Nong K. Qin X. Effect of purple sweet potato-derived anthocyanins on heat stress response in Wenchang chickens and preliminary mechanism study Poult. Sci. 102 2023 102861
Fathi M.M. Galal A. Radwan L.M. Abou-Emera O.K. Al-Homidan I.H. Using major genes to mitigate the deleterious effects of heat stress in poultry: an updated review Poult. Sci. 101 2022 102157
Goel A. Heat stress management in poultry J. Anim. Physiol. Anim. Nutr. 105 2021 1136 1145
Han K. Wang Y. Tian Q. Guo J. Xu C. Xu C. Ghostnet: More features from cheap operations Proceedings of the IEEE/CVF conference on computer vision and pattern recognition 2020 1580 1589
Lara L.J. Rostagno M.H. Impact of heat stress on poultry production Animals 3 2013 356 369 26487407
Oluwagbenga E.M. Fraley G.S. Heat stress and poultry production: A comprehensive review Poult. Sci. 2023 2023 103141
Ruff J. Barros T.L. Tellez Jr G. Blankenship J. Lester H. Graham B.D. Selby C.A.M. Vuong C.N. Dridi S. Greene E.S. Hernandez-Velasco X. Hargis B.M. Tellez-Isaias G. Research Note: Evaluation of a heat stress model to induce gastrointestinal leakage in broiler chickens Poult. Sci. 99 2020 1687 1692 32115037
Yang M. Han G. Yan B. Zhang W. Qi J. Lu H. Wang D. Hybrid-sort: Weak cues matter for online multi-object tracking In Proceed. AAAI Conf. Artif. Intell. 38 2024 6504 6512
Zhao, Y., W. Lv, S. Xu, J. Wei, G. Wang, Q. Dang, Y. Liu and J. Chen. 2023. Detrs beat yolos on real-time object detection.
