Benchmarking ROI Strategies for Real-Time Chicken Counting Using YOLOv8 and LLM-Assisted Development in Industrial Slaughterhouses
Main Article Content
Abstract
Accurate chicken counting is essential for operational efficiency and compliance in poultry processing. Manual counting methods are prone to error and unsuitable for high-speed production. This study presents the validation of automated chicken counting in an industrial slaughterhouse using YOLOv8 detection with SORT tracking and ROI-based strategies. While the core pipeline follows established computer vision methods, the novelty lies in systematically benchmarking three ROI strategies under high-speed conveyor conditions where occlusion, motion blur, and unstable lighting are major challenges. Tested on real production line footage, the system was evaluated using precision, recall, and F1-score against ground truth counts. Video-based strategies centred on the conveyor line achieved the highest accuracy, with F1-scores up to 0.998 and a Mean Absolute Error (MAE) of 2.30, a Mean Absolute Percentage Error (MAPE) of 0.74%, and a Root Mean Square Error (RMSE) of 2.70, while image-based approaches undercounted by up to 13%. Confidence variability was markedly lower in video-based methods (CV < 9%), demonstrating robustness under dynamic production conditions. Beyond methodological integration, this work introduces LLM-driven code generation for rapid development of industrial vision systems. The findings provide practical guidance for camera positioning, threshold settings, and deployment in high-speed slaughterhouse environments, establishing a foundation for scalable, high-accuracy poultry processing automation.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
Bewley, A., Ge, Z., Ott, L., Ramos, F., and Upcroft, B. (2016). Simple online and realtime tracking. In 2016 IEEE International Conference on Image Processing (ICIP). https://doi.org/10.1109/ICIP.2016.7533003
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., and Amodei, D. (2020). Language models are few-shot learners. arXiv preprint arXiv:2005.14165. https://doi.org/10.48550/arXiv.2005.14165
Bumbálek, R., Umurungi, S. N., Ufitikirezi, J. D. D. M., Zoubek, T., Kuneš, R., Stehlík, R., Lin, H.-I., and Bartoš, P. (2025). Deep learning in poultry farming: comparative analysis of yolov8, yolov9, yolov10, and yolov11 for dead chickens detection. Poultry Science, 104(9):105440. https://doi.org/10.1016/j.psj.2025.105440
Chen, B., Zhang, Z., Langrené, N., and Zhu, S. (2023). Unleashing the potential of prompt engineering in large language models: a comprehensive review. arXiv preprint arXiv:2310.14735. https://doi.org/10.48550/arXiv.2310.14735
Cheng, T., Song, L., Ge, Y., Liu, W., and Wang, X. (2024). Yolo-world: Real-time open-vocabulary object detection. In 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). https://doi.org/10.1109/CVPR52733.2024.01599
Cruz, E., Hidalgo-Rodriguez, M., Acosta-Reyes, A. M., Rangel, J. C., and Boniche, K. (2024). Ai-based monitoring for enhanced poultry flock management. Agriculture, 14(12):2187. https://doi.org/10.3390/agriculture14122187
Farjon, G., Huijun, L., and Edan, Y. (2023). Deep-learning-based counting methods, datasets, and applications in agriculture: a review. Precision Agriculture, 24(5):1683–1711. https://doi.org/10.1007/s11119-023-10034-8
Feng, Y., Pallerla, C., Lin, X., Sohrabipour, S., Crandall, P., Shou, W., She, Y., and Wang, D. (2025). Synthetic data augmentation for enhanced chicken carcass instance segmentation. arXiv preprint arXiv:2507.18558. https://doi.org/10.48550/arXiv.2507.18558
Garcia-Garcia, B., Bouwmans, T., and Silva, A. J. R. (2020). Background subtraction in real applications: Challenges, current models and future directions. Computer Science Review, 35:100204. https://doi.org/10.48550/arXiv.1901.03577
Gu, J., Han, Z., Chen, S., Beirami, A., He, B., Zhang, G., Liao, R., Qin, Y., Tresp, V., and Torr, P. (2023). A systematic survey of prompt engineering on vision-language foundation models. arXiv preprint arXiv:2307.12980. https://doi.org/10.48550/arXiv.2307.12980
Guo, Y., Aggrey, S. E., Yang, X., Oladeinde, A., Qiao, Y., and Chai, L. (2023). Detecting broiler chickens on litter floor with the yolov5-cbam deep learning model. Artificial Intelligence in Agriculture, 9:36–45. https://doi.org/10.1016/j.aiia.2023.08.002
Iseki, H., Furukawa, E., Shimasaki, T., and Higaki, S. (2025). Automatic monitoring of activity intensity in a chicken flock using a computer vision-based background image subtraction technique: An experimental infection study with fowl adenovirus. Smart Agricultural Technology, 10:100821.https://doi.org/10.1016/j.atech.2025.100821
Jiang, B., Tang, W., Cui, L., and Deng, X. (2023). Precision livestock farming research: A global scientometric review. Animals, 13(13):2096. https://www.mdpi.com/2076-2615/13/13/2096
Khanal, R., Choi, Y., and Lee, J. (2024). Transforming poultry farming: A pyramid vision transformer approach for accurate chicken counting in smart farm environments. Sensors, 24(10):2977. https://www.mdpi.com/1424-8220/24/10/2977
Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, volume 25. https://doi.org/10.1145/3065386
Li, Y., Zhang, X., and Chen, D. (2018). Csrnet: Dilated convolutional neural networks for understanding the highly congested scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition CVPR). https://doi.org/10.1109/CVPR.2018.00120
Lv, J., Wang, J., Peng, C., and Huang, Q. (2023). Dfccnet: A dense flock of chickens counting network based on density map regression. Animals, 13(23):3729.https://www.mdpi.com/2076-2615/13/23/3729
Novus International, Inc. (2025). Perspectives on Thailand’s poultry industry. Retrieved July 27, 2025 from https://www.novusint.com/resources/perspectives-on-thailands-poultry-industry/
Okinda, C., Nyalala, I., Korohou, T., Okinda, C., Wang, J., Achieng, T., and Shen, M. (2020). A review on computer vision systems in monitoring of poultry: A welfare perspective. Artificial Intelligence in Agriculture, 4:184–208. https://doi.org/10.1016/j.aiia.2020.09.002
Pangestu, G. (2025). Real-time chicken counting system using yolo for FCR optimization in small and medium poultry farms. Computational Agriculture Review, 9(1):1–9. https://doi.org/10.28926/jdr.v9i1.436
Public Relations Department of Thailand (2024). Thai chicken exports rise by almost 5 percent in the first 10 months of 2024. Retrieved July 27, 2025, from https://thailand.prd.go.th/en/content/category/detail/id/48/iid/346892
Qin, W., Yang, X., Wang, Y., Wei, Y., Zhou, Y., and Zheng, W. (2025). Yolopoul: Performance evaluation of a novel yolo object detectors benchmark for multi-class manure identification to warn about poultry digestive diseases. Smart Agricultural Technology, 12:101145. https://doi.org/10.1016/j.atech.2025.101145
Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016). You only look once: Unified, real-time object detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 779–788. https://doi.org/10.48550/arXiv.1506.02640
Reuters (2025). Thai poultry industry poised for growth on Brazil bird flu, lower feed costs. Retrieved July 27, 2025, from https://www.reuters.com/business/healthcare-pharmaceuticals/thai-poultry-industry-poised-growth-brazil-bird-flu-lower-feed-costs-2025-05-30/
Sahoo, P., Singh, A., Saha, S., Jain, V., Mondal, S., and Chadha, A. (2024). A systematic survey of prompt engineering in large language models: Techniques and applications. https://doi.org/10.13140/RG.2.2.13032.65286
Siriani, A. L. R., Miranda, I. B. d. C., Mehdizadeh, S. A., and Pereira, D. F. (2023). Chicken tracking and individual bird activity monitoring using the bot-sort algorithm. AgriEngineering, 5(4):1677–1693. https://www.mdpi.com/2624-7402/5/4/104
Stopassola, G., de Santana Weizenmann, G., and Costa, M. (2021). Machine vision algorithm for continuous counting of poultry in slaughterhouses. In Proceedings of the 2021 ABCM International Congress of Mechanical Engineering (COBEM). https://doi.org/10.26678/ABCM.COBEM2021.COB2021-1707
The Observatory of Economic Complexity (2025). Thailand poultry meat trade profile. Retrieved July 27, 2025, from https://oec.world/en/profile/bilateral-product/poultry-meat/reporter/tha
Wojke, N., Bewley, A., and Paulus, D. (2017). Simple online and realtime tracking with a deep association metric. In 2017 IEEE International Conference on Image Processing (ICIP), pages 3645–3649. https://doi.org/10.48550/arXiv.1703.07402
Wu, Z., Yang, J., Zhang, H., and Fang, C. (2025). Enhanced methodology and experimental research for caged chicken counting based on yolov8. Animals (Basel), 15(6). https://doi.org/10.3390/ani15060853
Xue, E., Huang, Z., Ji, Y., and Wang, H. (2025). Improve: Iterative model pipeline refinement and optimization leveraging LLM experts.https://doi.org/10.48550/arXiv.2502.18530
Yang, X., Bist, R., Paneru, B., and Chai, L. (2024). Monitoring activity index and behaviors of cage-free hens with advanced deep learning technologies. Poultry Science, 103(11):104193. https://doi.org/10.1016/j.psj.2024.104193
Zhang, L., Gray, H., Ye, X., Collins, L., and Allinson, N. (2019). Automatic individual pig detection and tracking in pig farms. Sensors, 19:1188. https://doi.org/10.3390/s19051188
Zhu, X., Wu, C., Yang, Y., Yao, Y., and Wu, Y. (2022). Automated chicken counting using yolo-v5x algorithm. In 2022 IEEE International Conference on Smart Agriculture and Intelligent Systems (ICSAI). https://doi.org/10.1109/ICSAI57119.2022.10005522
Zivkovic, Z. and van der Heijden, F. (2006). Efficient adaptive density estimation per image pixel for the task of background subtraction. Pattern Recognition Letters, 27(7):773–780. https://doi.org/10.1016/j.patrec.2005.11.005