Call for Paper - November 2022 Edition
IJCA solicits original research papers for the November 2022 Edition. Last date of manuscript submission is October 20, 2022. Read More

Classification of Thermal Images of Bovine Mastitis by Computer Vision

International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Year of Publication: 2021
Rodes Angelo B. Da Silva, Borko Stosic, Héliton Pandorfi, Gledson Luiz P. De Almeida, Marcos Vinícius Da Silva, Pedro Henrique Dias Batista

Rodes Angelo Da B Silva, Borko Stosic, Héliton Pandorfi, Gledson Luiz De P Almeida, Marcos Vinícius Da Silva and Pedro Henrique Dias Batista. Classification of Thermal Images of Bovine Mastitis by Computer Vision. International Journal of Computer Applications 174(31):41-45, April 2021. BibTeX

	author = {Rodes Angelo B. Da Silva and Borko Stosic and Héliton Pandorfi and Gledson Luiz P. De Almeida and Marcos Vinícius Da Silva and Pedro Henrique Dias Batista},
	title = {Classification of Thermal Images of Bovine Mastitis by Computer Vision},
	journal = {International Journal of Computer Applications},
	issue_date = {April 2021},
	volume = {174},
	number = {31},
	month = {Apr},
	year = {2021},
	issn = {0975-8887},
	pages = {41-45},
	numpages = {5},
	url = {},
	doi = {10.5120/ijca2021921256},
	publisher = {Foundation of Computer Science (FCS), NY, USA},
	address = {New York, USA}


This study was conducted with the objective of developing a software program, based on image processing and computer vision techniques, as a tool to aid in the monitoring and early detection of clinical manifestations of bovine mastitis. Twenty-four lactating Girolando cows and distinct clinical conditions (healthy, subclinical mastitis and clinical mastitis) were selected. Thermal images of the udder surface of the animals were taken using an infrared thermal imager from the left anterolateral, right anterolateral, posterior and inferior views, four images per animal, totaling 96 thermal images. The images were preprocessed by thresholding, implementing the Hoshen-Kopelman algorithm, to organize the data through the size of the clusters, labeled between 34 and 38 ºC. The developed software program proved to be efficient in classifying thermal images for detecting the clinical pictures of mastitis, with accuracy of 90.9%, specificity of 57.14% and sensitivity of 85.71%; however, it was observed that the angles at which the images were recorded may influence the classification result.


  1. Acharya, U. R, Ng, E.Y.; Tan, J.H. and Sree, S.V. (2012) Thermography based breast cancer detection using texture features and support vector machine. Journal of medical systems, Springer, v. 36, n. 3, p. 1503–1510, 2012
  2. Azevedo, E. and Conci, A. (2003). Computação gráfica: teoria e prática. Computação gráfica: teoria e prática. Rio de. Janeiro: Elsevier, 353p.
  3. Baffa, M.F.O., Cheloni, D.J.M., Lattari, L.G. and Coelho, M.A.N. (2016). Segmentação Automática de Mamas em Imagens infravermelhas utilizando limiarização com refinamento adaptativo em bases multivariadas. Revista de Informática Aplicada, 12(2).
  4. Borchartt, T. B., Conci, A., Lima, R.C.F., Resmini, R and Sanchez, A. (2015). Breast thermography from an image processing viewpoint: A survey. Signal Processing, Elsevier, 93(10), 2785–2803
  5. Bortolami, A., Fiore, E; Gianesella, M., Corro, M., Catania, S. And Morgante, M. (2015). Evaluation of the udder health status in subclinical mastitis affected dairy cows through bacteriological culture, somatic cell count and thermographic imaging. Polish Journal of Veterinary Sciences, 18( 4), 799-805,.
  6. Digiovani, D.B., Borges, M.H.F.,Galdioli, V.H.G., Matias, B.F., Bernardo, G.M.,Silva, T.R.; Fávaro, P.C.; Júnior, F.A.B.,Lopes, F.G.; Júnior, C.K. and Ribeiro, E.L.A. (2016) Infrared thermography as diagnostic tool for bovine subclinical mastitis detection. Revista Brasileira de Higiene e Sanidade animal,10(4), 685-692.
  7. Gloster, J., Ebert, K., Gubbins, S.,Bashiruddin, J. and Paton, D.J. (2011) Normal variation in thermal radiated temperature in cattle: implications for foot-and-mouth disease detection. BMC Veterinary Research, 7, 1746-6148,.
  8. Hoshen, J. and Kopelmann, R. (1976). Percolation and cluster distribution. I. Cluster multiple labeling technique and critical concentration algorithm. Physical Review B. Volume 14, Number 8,1976
  9. IBGE, Instituto Brasileiro de Geografia e Estatística. Censo Agropecuário 2017. Available at: Accessed on Nov 6, 2017.
  10. Langoni, H., Salina, A., Oliveira, G.C., Junqueira, N.B., Menozzi, B.D. and Joaquim, S.F. (2017). Considerações sobre o tratamento das mastites. Pesquisa Veterinária Brasileira ,37(11), 1261-1269.
  11. Melo, G.J.A., Neto, B.A.M., Gomes, V., Almeida, L.A.L. and Lima, A.C.C. (2014). Método de limiarização automática para a contagem de células somáticas em imagens microscópicas. Revista GEINTEC.4(3),1283 -1291.
  12. Pezeshki, A., Stordeur, P., Wallemacq, H., Schynts, F., Stevens, M., Boutet, P., Peelman, L.J., Spiegeleer, B., Duchateau, L., Bureau, F. And Burvenich, C. (2011) Variation of inflammatory dynamics and mediators in primiparous cows after intramammary challenge with Escherichia coli. Veterinary Research, 42(15).
  13. Polat, B.,Colak, A.,Cengiz, M.,Yanmaz, L.E.,Oral, H., Bastan, A.,Kaya, S. and Hayrli, A. (2010). Sensitivity and specificity of infrared thermography in detection of subclinical mastitis in dairy cows. Journal Dairy Science. Source: Journal of dairy science. 93(8), 3525-3532.
  14. Rasband, W. ImageJ documentation. Available at: < > Accessed on March 25, 2019.
  15. Redaelli, V.,Bergero, D.,Zucca, E., Ferrucci, F.,Nanni, L.,Crosta and L.,Luzi, F. (2013) Use of Thermography Techniques in Equines: Principles and Applications. Journal of Equine Veterinary Science, 1-6.
  16. Sá, J.P.N., Figueiredo, C.H.A., Neto, O.L.S., Roberto, S.B.A., Gadelha, H.S. and Alencar, M.C.B.. (2018). Revista Brasileira de Gestão Ambiental, 12(1),01- 13, 2018.
  17. Vianello, R. L. And Alves, A. R. (1991). Meteorologia básica e aplicações. Viçosa: UFV – Imprensa Universitária. 449 p.
  18. Warrick, A.W. and Nielsen, D.R. (1998). Spatial variability of soil physic properties in the field. New York: Academic, 655-675.


dairy cattle, computer program, animal health, infrared thermography