Pig Detection Using Computer Vision Models Trained on Synthetic Datasets
Resumo
Pork is a major commodity in the global food industry, yet monitoring pigs in their living spaces remains a challenge due to the scarcity of annotated datasets for AI models. In this study, an existing method for generating training datasets by utilizing a limited number of annotated images is adapted for pig detection, with the goal of enabling accurate pig counting in future applications. Using the COCO dataset and the Multi-Camera Pig Dataset, we applied Digital Image Processing and Meta’s Segment Anything Model 2 (SAM2) to augment data. A YOLO model trained on the generated datasets demonstrated that manual annotation can be reduced by 40% with minimal performance loss, significantly decreasing dataset production effort.Referências
Abou Akar, C., Tekli, J., Jess, D., Khoury, M., Kamradt, M., and Guthe, M. (2022). Synthetic object recognition dataset for industries. In 2022 35th SIBGRAPI conference on graphics, patterns and images (SIBGRAPI), volume 1, pages 150–155. IEEE.
Bhuiyan, M. R. and Wree, P. (2023). Animal behavior for chicken identification and monitoring the health condition using computer vision: A systematic review. IEEE access, 11:126601–126610.
Clark, A. (2015). Pillow (pil fork) documentation.
de Mello, J. P. V., Tabelini, L., Berriel, R. F., Paixao, T. M., De Souza, A. F., Badue, C., Sebe, N., and Oliveira-Santos, T. (2021). Deep traffic light detection by overlaying synthetic context on arbitrary natural images. Computers & Graphics, 94:76–86.
EUR-Lex (2024). Animal welfare.
Forsyth, D. A. and Ponce, J. (2002). Computer vision: a modern approach. prentice hall professional technical reference.
Girshick, R. (2015). Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440–1448.
Guo, Q., Sun, Y., Orsini, C., Bolhuis, J. E., de Vlieg, J., Bijma, P., and de With, P. H. (2023). Enhanced camera-based individual pig detection and tracking for smart pig farms. Computers and Electronics in Agriculture, 211:108009.
Jaoukaew, A., Suwansantisuk, W., and Kumhom, P. (2024). Robust individual pig tracking. International Journal of Electrical and Computer Engineering (IJECE), 14(1):279–293.
Khan, A. A., Laghari, A. A., and Awan, S. A. (2021). Machine learning in computer vision: A review. EAI Endorsed Transactions on Scalable Information Systems, 8(32).
Kim, S. W., Gormley, A., Jang, K. B., and Duarte, M. E. (2024). Current status of global pig production: an overview and research trends. Animal Bioscience, 37(4):719.
Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., and Zitnick, C. L. (2014). Microsoft coco: Common objects in context. In Computer vision–ECCV 2014: 13th European conference, zurich, Switzerland, September 6-12, 2014, proceedings, part v 13, pages 740–755. Springer.
MAFF (2023). Farm animal management in consideration of animal welfare.
Man, K. and Chahl, J. (2022). A review of synthetic image data and its use in computer vision. Journal of Imaging, 8(11):310.
Paulin, G. and Ivasic-Kos, M. (2023). Review and analysis of synthetic dataset generation methods and techniques for application in computer vision. Artificial intelligence review, 56(9):9221–9265.
Ravi, N., Gabeur, V., Hu, Y.-T., Hu, R., Ryali, C., Ma, T., Khedr, H., Rädle, R., Rolland, C., Gustafson, L., Mintun, E., Pan, J., Alwala, K. V., Carion, N., Wu, C.-Y., Girshick, R., Dollár, P., and Feichtenhofer, C. (2024). Sam 2: Segment anything in images and videos. arXiv preprint arXiv:2408.00714.
Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016). You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 779–788.
Roppa, L., Duarte, M. E., and Kim, S. W. (2024). Pig production in latin america. Animal Bioscience, 37(4):786.
Sager, C., Janiesch, C., and Zschech, P. (2021). A survey of image labelling for computer vision applications. Journal of Business Analytics, 4(2):91–110.
SEBRAE (2016). Bem-estar animal na produção de suínos.
Shirke, A., Saifuddin, A., Luthra, A., Li, J., Williams, T., Hu, X., Kotnana, A., Kocabalkanli, O., Ahuja, N., Green-Miller, A., et al. (2021). Tracking grow-finish pigs across large pens using multiple cameras. arXiv preprint arXiv:2111.10971.
Szeliski, R. (2022). Computer vision: algorithms and applications. Springer Nature.
Tabelini, L., Berriel, R., Paixão, T. M., De Souza, A. F., Badue, C., Sebe, N., and Oliveira-Santos, T. (2022). Deep traffic sign detection and recognition without target domain real images. Machine Vision and Applications, 33(3):50.
Tassinari, P., Bovo, M., Benni, S., Franzoni, S., Poggi, M., Mammi, L. M. E., Mattoccia, S., Di Stefano, L., Bonora, F., Barbaresi, A., et al. (2021). A computer vision approach based on deep learning for the detection of dairy cows in free stall barn. Computers and Electronics in Agriculture, 182:106030.
Tian, Y., Ye, Q., and Doermann, D. (2025a). Yolov12: Attention-centric real-time object detectors.
Tian, Y., Ye, Q., and Doermann, D. (2025b). Yolov12: Attention-centric real-time object detectors. arXiv preprint arXiv:2502.12524.
Van der Zande, L. E., Guzhva, O., and Rodenburg, T. B. (2021). Individual detection and tracking of group housed pigs in their home pen using computer vision. Frontiers in animal science, 2:669312.
Whitnall, T. and Pitts, N. (2019). Global trends in meat consumption. Agricultural Commodities, 9(1):96–99.
Zhao, X., Wang, L., Zhang, Y., Han, X., Deveci, M., and Parmar, M. (2024). A review of convolutional neural networks in computer vision. Artificial Intelligence Review, 57(4):99.
Zhuang, F., Qi, Z., Duan, K., Xi, D., Zhu, Y., Zhu, H., Xiong, H., and He, Q. (2020). A comprehensive survey on transfer learning. Proceedings of the IEEE, 109(1):43–76.
Bhuiyan, M. R. and Wree, P. (2023). Animal behavior for chicken identification and monitoring the health condition using computer vision: A systematic review. IEEE access, 11:126601–126610.
Clark, A. (2015). Pillow (pil fork) documentation.
de Mello, J. P. V., Tabelini, L., Berriel, R. F., Paixao, T. M., De Souza, A. F., Badue, C., Sebe, N., and Oliveira-Santos, T. (2021). Deep traffic light detection by overlaying synthetic context on arbitrary natural images. Computers & Graphics, 94:76–86.
EUR-Lex (2024). Animal welfare.
Forsyth, D. A. and Ponce, J. (2002). Computer vision: a modern approach. prentice hall professional technical reference.
Girshick, R. (2015). Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 1440–1448.
Guo, Q., Sun, Y., Orsini, C., Bolhuis, J. E., de Vlieg, J., Bijma, P., and de With, P. H. (2023). Enhanced camera-based individual pig detection and tracking for smart pig farms. Computers and Electronics in Agriculture, 211:108009.
Jaoukaew, A., Suwansantisuk, W., and Kumhom, P. (2024). Robust individual pig tracking. International Journal of Electrical and Computer Engineering (IJECE), 14(1):279–293.
Khan, A. A., Laghari, A. A., and Awan, S. A. (2021). Machine learning in computer vision: A review. EAI Endorsed Transactions on Scalable Information Systems, 8(32).
Kim, S. W., Gormley, A., Jang, K. B., and Duarte, M. E. (2024). Current status of global pig production: an overview and research trends. Animal Bioscience, 37(4):719.
Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., and Zitnick, C. L. (2014). Microsoft coco: Common objects in context. In Computer vision–ECCV 2014: 13th European conference, zurich, Switzerland, September 6-12, 2014, proceedings, part v 13, pages 740–755. Springer.
MAFF (2023). Farm animal management in consideration of animal welfare.
Man, K. and Chahl, J. (2022). A review of synthetic image data and its use in computer vision. Journal of Imaging, 8(11):310.
Paulin, G. and Ivasic-Kos, M. (2023). Review and analysis of synthetic dataset generation methods and techniques for application in computer vision. Artificial intelligence review, 56(9):9221–9265.
Ravi, N., Gabeur, V., Hu, Y.-T., Hu, R., Ryali, C., Ma, T., Khedr, H., Rädle, R., Rolland, C., Gustafson, L., Mintun, E., Pan, J., Alwala, K. V., Carion, N., Wu, C.-Y., Girshick, R., Dollár, P., and Feichtenhofer, C. (2024). Sam 2: Segment anything in images and videos. arXiv preprint arXiv:2408.00714.
Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016). You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 779–788.
Roppa, L., Duarte, M. E., and Kim, S. W. (2024). Pig production in latin america. Animal Bioscience, 37(4):786.
Sager, C., Janiesch, C., and Zschech, P. (2021). A survey of image labelling for computer vision applications. Journal of Business Analytics, 4(2):91–110.
SEBRAE (2016). Bem-estar animal na produção de suínos.
Shirke, A., Saifuddin, A., Luthra, A., Li, J., Williams, T., Hu, X., Kotnana, A., Kocabalkanli, O., Ahuja, N., Green-Miller, A., et al. (2021). Tracking grow-finish pigs across large pens using multiple cameras. arXiv preprint arXiv:2111.10971.
Szeliski, R. (2022). Computer vision: algorithms and applications. Springer Nature.
Tabelini, L., Berriel, R., Paixão, T. M., De Souza, A. F., Badue, C., Sebe, N., and Oliveira-Santos, T. (2022). Deep traffic sign detection and recognition without target domain real images. Machine Vision and Applications, 33(3):50.
Tassinari, P., Bovo, M., Benni, S., Franzoni, S., Poggi, M., Mammi, L. M. E., Mattoccia, S., Di Stefano, L., Bonora, F., Barbaresi, A., et al. (2021). A computer vision approach based on deep learning for the detection of dairy cows in free stall barn. Computers and Electronics in Agriculture, 182:106030.
Tian, Y., Ye, Q., and Doermann, D. (2025a). Yolov12: Attention-centric real-time object detectors.
Tian, Y., Ye, Q., and Doermann, D. (2025b). Yolov12: Attention-centric real-time object detectors. arXiv preprint arXiv:2502.12524.
Van der Zande, L. E., Guzhva, O., and Rodenburg, T. B. (2021). Individual detection and tracking of group housed pigs in their home pen using computer vision. Frontiers in animal science, 2:669312.
Whitnall, T. and Pitts, N. (2019). Global trends in meat consumption. Agricultural Commodities, 9(1):96–99.
Zhao, X., Wang, L., Zhang, Y., Han, X., Deveci, M., and Parmar, M. (2024). A review of convolutional neural networks in computer vision. Artificial Intelligence Review, 57(4):99.
Zhuang, F., Qi, Z., Duan, K., Xi, D., Zhu, Y., Zhu, H., Xiong, H., and He, Q. (2020). A comprehensive survey on transfer learning. Proceedings of the IEEE, 109(1):43–76.
Publicado
29/09/2025
Como Citar
MARTINS, Alvaro V.; PAIXÃO, Thiago M.; BOLDT, Francisco A.; CONDOTTA, Isabella C..
Pig Detection Using Computer Vision Models Trained on Synthetic Datasets. In: ENCONTRO NACIONAL DE INTELIGÊNCIA ARTIFICIAL E COMPUTACIONAL (ENIAC), 22. , 2025, Fortaleza/CE.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 915-926.
ISSN 2763-9061.
DOI: https://doi.org/10.5753/eniac.2025.14272.
