Automatic identification, segmentation, and percentage calculation of healthy and unhealthy bovine lung tissue using machine learning algorithms
Main Article Content
Abstract
Respiratory syndromes are a major cause of morbidity and mortality in the feedlot industry, making the accurate identification of lung lesions essential for effective health management. This study proposes an automated approach for identifying and segmenting pulmonary structures and lesions using a visual machine learning model trained on a limited dataset of post-mortem images captured at a slaughterhouse. The implementation was performed using Python 3.12 with computer vision libraries and the Ultralytics framework employing YOLO11n-seg. Training incorporated both dorsal and ventral views to identify lungs, trachea and extra tissues, and lesions (designated as “findings”). Data augmentation and k-fold cross-validation were applied to address the data limitations. In addition, we developed an automated algorithm that quantifies lung health by calculating the proportion of affected versus healthy tissue through a pixel overlap comparison between segmented lung regions and detected lesions. The proposed method enables objective and reproducible assessments of pulmonary conditions from different anatomical perspectives. The results demonstrate strong performance in both anatomical segmentation and lesion detection, while also highlighting the challenges inherent in data-constrained conditions. These findings contribute to the development of computer-aided tools for veterinary diagnostics.
Article Details

This work is licensed under a Creative Commons Attribution 4.0 International License.
References
Adekunle, A., & Kaniyamattam, K. (2026). Bovine respiratory disease: Epidemiological drivers, transmission dynamics, and economic implications in beef production systems. Agriculture, 16(3), 311. https://doi.org/10.3390/agriculture16030311
Almeraya Soberanes, S., Mora Flores, J. S., García Salazar, J. A., Hernández Mendo, O., & Almeraya Quintero, S. X. (2024). Caracterización de la cadena de abasto de ganado bovino producido en la zona norte de Veracruz. Agricultura, Sociedad y Desarrollo, 21(2). https://doi.org/10.22231/asyd.v21i2.1602.
Bello, R.-W., Owolawi, P. A., Van Wyk, E. A., & Tu, C. (2024). Transfer learning-driven cattle instance segmentation using deep learning models. Agriculture, 14(12), 2282. https://doi.org/10.3390/agriculture14122282
Blakebrough-Hall, C., McMeniman, J. P., & González, L. A. (2020). An evaluation of the economic effects of bovine respiratory disease on animal performance, carcass traits, and economic outcomes in feedlot cattle defined using four BRD diagnosis methods. Journal of Animal Science, 98(2), skaa005. https://doi.org/10.1093/jas/skaa005
Bortoluzzi, E., Schmidt, P., Brown, R., Jensen, M., Mancke, M., Larson, R., Lancaster, P., & White, B. (2023). Image classification and automated machine learning to classify lung pathologies in deceased feedlot cattle. Veterinary Sciences, 10(2), 113. https://doi.org/10.3390/vetsci10020113
Bumbálek, R., Zoubek, T., Ufitikirezi, J. D. D. M., Umurungi, S. N., Stehlík, R., Havelka, Z., Kuneš, R., & Bartoš, P. (2025). Implementation of machine vision methods for cattle detection and activity monitoring. Technologies, 13(3), 116. https://doi.org/10.3390/technologies13030116
Casella, E., Cantor, M. C., Setser, M. M. W., Silvestri, S., & Costa, J. H. C. (2023). A machine learning and optimization framework for the early diagnosis of bovine respiratory disease. IEEE Access, 11, 71164-71179. https://doi.org/10.1109/ACCESS.2023.3291348
Chien, R. C., Sorensen, N. J., Payton, M. E., & Confer, A. W. (2022). Comparative histopathology of bovine acute interstitial pneumonia and bovine respiratory syncytial virus-associated interstitial pneumonia. Journal of Comparative Pathology, 192, 23-32. https://doi.org/10.1016/j.jcpa.2022.01.005
Espinoza-Cantú, J., Rojas-Hernández, S., Olivares-Pérez, J., Romero-Rosales, T., Damian Valdez, M. A., & Aguirre-Flores, V. (2026). Evaluating perception of animal welfare among owners of family farming units on dry tropical lands. Agro Productividad, XII. https://doi.org/10.32854/ewmkm125
Guarnido-Lopez, P., Pi, Y., Tao, J., Mendes, E. D. M., & Tedeschi, L. O. (2024). Computer vision algorithms to help decision-making in cattle production. Animal Frontiers, 14(6), 11-22. https://doi.org/10.1093/af/vfae028.
Gupta, J., Pathak, S., & Kumar, G. (2022). Deep Learning (CNN) and transfer learning: A review. Journal of Physics. Conference Series, 2273(1), 012029. https://doi.org/10.1088/1742-6596/2273/1/012029
Houssein, E. H., Emam, M. M., & Ali, A. A. (2021). An efficient multilevel thresholding segmentation method for thermography breast cancer imaging based on improved chimp optimization algorithm. Expert Systems with Applications, 185, 115651. https://doi.org/10.1016/j.eswa.2021.115651
Instituto Nacional de Estadística y Geografía (INEGI). (n.d.). Mexico—Censo agropecuario 2022, resultados definitivos. Retrieved April 07, 2026, from https://www.inegi.org.mx/rnm/index.php/catalog/867
Jia, N., Kootstra, G., Koerkamp, P. G., Shi, Z., & Du, S. (2021). Segmentation of body parts of cows in RGB-depth images based on template matching. Computers and Electronics in Agriculture, 180, 105897. https://doi.org/10.1016/j.compag.2020.105897
Kamel, M. S., Davidson, J. L., & Verma, M. S. (2024). Strategies for bovine respiratory disease (Brd) diagnosis and prognosis: A comprehensive overview. Animals, 14(4), 627. https://doi.org/10.3390/ani14040627
Kufel, J., Bargieł-Łączek, K., Kocot, S., Koźlik, M., Bartnikowska, W., Janik, M., Czogalik, Ł., Dudek, P., Magiera, M., Lis, A., Paszkiewicz, I., Nawrat, Z., Cebula, M., & Gruszczyńska, K. (2023). What is machine learning, artificial neural networks and deep learning? —Examples of practical applications in medicine. Diagnostics, 13(15), 2582. https://doi.org/10.3390/diagnostics13152582
Liu, Y., Zhang, Z., Liu, X., Wang, L., & Xia, X. (2021). Efficient image segmentation based on deep learning for mineral image classification. Advanced Powder Technology, 32(10), 3885-3903. https://doi.org/10.1016/j.apt.2021.08.038
MSD Animal Health Republic of Ireland. (n.d.). Bovine respiratory disease. Retrieved March 28, 2026, from https://www.msd-animal-health.ie/species/cattle/bovine-respiratory-disease/
O’Donoghue, S., Waters, S. M., Morris, D. W., & Earley, B. (2025). A comprehensive review: Bovine respiratory disease, current insights into epidemiology, diagnostic challenges, and vaccination. Veterinary Sciences, 12(8), 778. https://doi.org/10.3390/vetsci12080778
Puig, A., Ruiz, M., Bassols, M., Fraile, L., & Armengol, R. (2022). Technological tools for the early detection of bovine respiratory disease in farms. Animals, 12(19), 2623. https://doi.org/10.3390/ani12192623
Recchia, M., Scuri, L., Allegri, C., Romeo, C., Scali, F., Maisano, A. M., Santucci, G., Bontempi, G., Canesi, S., Sala, L., Recordati, C., Scanziani, E., Panseri, S., Ghidini, S., Zanardi, E., Ianieri, A., Alban, L., & Alborali, G. L. (2025). Application of computer vision for automated detection of different lesions in pig lungs: An exploratory study. Preventive Veterinary Medicine, 245, 106672. https://doi.org/10.1016/j.prevetmed.2025.106672
Rossi, C. A. S., Grossi, S., Fortuna, M., Schiavon, E., Fava, E., Adami, S., & Compiani, R. (2022). Sanitary, environmental and nutritional management to reduce the incidence of bovine respiratory disease and the use of antibiotics in fattening beef cattle. Large Animal Review, 28(2), 65-72. https://www.largeanimalreview.com/index.php/lar/article/view/451
Sharifani, K., & Amini, M. (2023). Machine learning and deep learning: A review of methods and applications. World Information Technology and Engineering Journal, 10(7), 3897–3904. https://ssrn.com/abstract=4458723
Singh, D., Singh, R., Gehlot, A., Bhandari, G., Verma, A., Gangwar, P., & Pandey, P. S. (2025). Sensor and computer vision based cattle health monitoring and management. International Journal of Electrical and Electronics Engineering, 12(1), 94-103. https://doi.org/10.14445/23488379/IJEEE-V12I1P109
Trigka, M., & Dritsas, E. (2025). A comprehensive survey of machine learning techniques and models for object detection. Sensors, 25(1), 214. https://doi.org/10.3390/s25010214
Ultralytics. (n.d.-a). Data Augmentation Using YOLO Ultralytics. Retrieved April 10, 2026, from https://docs.ultralytics.com/guides/yolo-data-augmentation/
Ultralytics. (n.d.-b). Performance metrics deep dive. Retrieved April 11, 2026, from https://docs.ultralytics.com/guides/yolo-performance-metrics/TABLES
Wu, D., Han, M., Song, H., Song, L., & Duan, Y. (2023). Monitoring the respiratory behavior of multiple cows based on computer vision and deep learning. Journal of Dairy Science, 106(4), 2963-2979. https://doi.org/10.3168/jds.2022-22501
Xiao, S., Dhand, N. K., Wang, Z., Hu, K., Thomson, P. C., House, J. K., & Khatkar, M. S. (2025). Review of applications of deep learning in veterinary diagnostics and animal health. Frontiers in Veterinary Science, 12, 1511522. https://doi.org/10.3389/fvets.2025.1511522
Yang, S. X., Han, Y., Ma, W., Tulpan, D., Li, J., Li, J., & Yue, Y. (2025). Review of computer vision for livestock body conformation assessment. Agriculture Communications, 3(3), 100099. https://doi.org/10.1016/j.agrcom.2025.100099
https://orcid.org/0009-0003-8773-505X