Exploring Attributions in Convolutional Neural Networks for Cow Identification
Abstract
:1. Introduction
2. Materials and Methods
- Compute the Shapley value of the accuracy of the model for the foreground and the background;
- Compute the average contribution for a pixel in the foreground and in the background;
- Compare the previous two values.
- Foreground: The foreground was left and the background was replaced with white noise for both the test and reference images; is the accuracy of the model over these images.
- Background: The process was executed as previously mentioned, but there the background was left and the foreground was replaced with white noise.
- Empty set: is set to the expected probability of being correct if the individual is guessed at random.
- Foreground and background: is the accuracy of the model on the original images.
3. Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Meng, Y.; Yoon, S.; Han, S.; Fuentes, A.; Park, J.; Jeong, Y.; Park, D.S. Improving Known-Unknown Cattle’s Face Recognition for Smart Livestock Farm Management. Animals 2023, 13, 3588. [Google Scholar] [CrossRef] [PubMed]
- Kühl, H.S.; Burghardt, T. Animal Biometrics: Quantifying and Detecting Phenotypic Appearance. Trends Ecol. Evol. 2013, 28, 432–441. [Google Scholar] [CrossRef] [PubMed]
- Kumar, S.; Singh, S.K. Cattle Recognition: A New Frontier in Visual Animal Biometrics Research. Proc. Natl. Acad. Sci. India Sect. A Phys. Sci. 2019, 90, 689–708. [Google Scholar] [CrossRef]
- El Abbadi, N.K.; Alsaadi, E.M.T.A. An Automated Vertebrate Animals Classification Using Deep Convolution Neural Networks. In Proceedings of the 2020 International Conference on Computer Science and Software Engineering (CSASE), Duhok, Iraq, 16–18 April 2020; pp. 72–77. [Google Scholar] [CrossRef]
- Samabth, M.; Lella, G.; Arulalan, K.; Rathinavel, M.; Aravindhar, D.J.; Ravi, S. Automated Face Authentication and Alert System Using AI. Alinteri J. Agric. Sci. 2021, 36, 181–186. [Google Scholar] [CrossRef]
- Hiby, L.; Lovell, P. Computer-Aided Matching of Natural Markings: A Prototype System for Grey Seals. In Proceedings of the Report of the International Whaling Commission, Washington, DC, USA, 2 December 1990; pp. 57–61. [Google Scholar]
- Chen, G.; Han, T.X.; He, Z.; Kays, R.; Forrester, T. Deep convolutional neural network based species recognition for wild animal monitoring. In Proceedings of the 2014 IEEE International Conference on Image Processing (ICIP), Paris, France, 27–30 October 2014; pp. 858–862. [Google Scholar] [CrossRef]
- Islam, S.B.; Valles, D. Identification of Wild Species in Texas from Camera-trap Images using Deep Neural Network for Conservation Monitoring. In Proceedings of the 2020 10th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, USA, 6–8 January 2020; pp. 0537–0542. [Google Scholar] [CrossRef]
- Ráduly, Z.; Sulyok, C.; Vadászi, Z.; Zölde, A. Dog Breed Identification Using Deep Learning. In Proceedings of the 2018 IEEE 16th International Symposium on Intelligent Systems and Informatics (SISY), Subotica, Serbia, 13–15 September 2018; pp. 000271–000276. [Google Scholar] [CrossRef]
- Abu Jwade, S.; Guzzomi, A.; Mian, A. On-Farm Automatic Sheep Breed Classification Using Deep Learning. Comput. Electron. Agric. 2019, 167, 105055. [Google Scholar] [CrossRef]
- Hansen, M.F.; Smith, M.L.; Smith, L.N.; Salter, M.G.; Baxter, E.M.; Farish, M.; Grieve, B.D. Towards On-Farm Pig Face Recognition Using Convolutional Neural Networks. Comput. Ind. 2018, 98, 145–152. [Google Scholar] [CrossRef]
- Marsot, M.; Mei, J.; Shan, X.; Ye, L.; Feng, P.; Yan, X.; Li, C.; Zhao, Y. An Adaptive Pig Face Recognition Approach Using Convolutional Neural Networks. Comput. Electron. Agric. 2020, 173, 105386. [Google Scholar] [CrossRef]
- Kumar, S.; Tiwari, S.; Singh, S.K. Face Recognition of Cattle: Can It Be Done? Proc. Natl. Acad. Sci. India Sect. A Phys. Sci. 2016, 86, 137–148. [Google Scholar] [CrossRef]
- Noviyanto, A.; Arymurthy, A.M. Beef Cattle Identification Based on Muzzle Pattern Using a Matching Refinement Technique in the SIFT Method. Comput. Electron. Agric. 2016, 99, 77–84. [Google Scholar] [CrossRef]
- Yao, L.; Hu, Z.; Liu, C.; Liu, H.; Kuang, Y.; Gao, Y. Cow Face Detection and Recognition Based on Automatic Feature Extraction Algorithm. In Proceedings of the ACM Turing Celebration Conference, Chengdu, China, 17–19 May 2019; pp. 1–5. [Google Scholar] [CrossRef]
- El-Bakry, H.; El-Henawy, I.; El-Hadad, H. Muzzle Classification Using Neural Networks. Int. Arab. J. Inf. Technol. 2017, 14, 464–472. [Google Scholar]
- Zin, T.T.; Phyo, C.N.; Tin, P.; Hama, H.; Kobayashi, I. Image Technology Based Cow Identification System Using Deep Learning. In Proceedings of the International MultiConference of Engineers and Computer Scientists (IMECS2018), Hong Kong, China, 14–16 March 2018; pp. 320–323. [Google Scholar]
- Wang, H.; Qin, J.; Hou, Q.; Gong, S. Cattle Face Recognition Method Based on Parameter Transfer and Deep Learning. J. Phys. Conf. Ser. 2020, 1453, 012054. [Google Scholar] [CrossRef]
- Xu, F.; Gao, J.; Pan, X. Cow Face Recognition for a Small Sample Based on Siamese DB Capsule Network. IEEE Access 2022, 10, 63189–63198. [Google Scholar] [CrossRef]
- de Lima Weber, F.; de Moraes Weber, V.A.; Menezes, G.V.; da Silva Oliveira Junior, A.; Alves, D.A.; de Oliveira, M.V.M.; Matsubara, E.T.; Pistori, H.; de Abreu, U.G.P. Recognition of Pantaneira cattle breed using computer vision and convolutional neural networks. Comput. Electron. Agric. 2020, 175, 105548. [Google Scholar] [CrossRef]
- Andrew, W.; Gao, J.; Mullan, S.; Campbell, N.; Dowsey, A.W.; Burghardt, T. Visual identification of individual Holstein-Friesian cattle via deep metric learning. Comput. Electron. Agric. 2021, 185, 106133. [Google Scholar] [CrossRef]
- Chen, X.; Yang, T.; Mai, K.; Liu, C.; Xiong, J.; Kuang, Y.; Gao, Y. Holstein Cattle Face Re-Identification Unifying Global and Part Feature Deep Network with Attention Mechanism. Animals 2022, 12, 1047. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet Classification with Deep Convolutional Neural Networks. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Lake Tahoe, NV, USA, 3–6 December 2012; pp. 1097–1105. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Montreal, QC, Canada, 7–12 December 2015; pp. 91–99. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar] [CrossRef]
- Schroff, F.; Kalenichenko, D.; Philbin, J. FaceNet: A Unified Embedding for Face Recognition and Clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 7–12 June 2015; pp. 815–823. [Google Scholar] [CrossRef]
- Wang, C.C.; Hung, C.W.; Yan, S.J.; Ho, C.C. Application of YOLO and Custom-Designed Intelligent Teaching Aids in Robotic Arm-Based Fruit Classification and Grasping Instruction. Preprints 2025. [Google Scholar] [CrossRef]
- Bloch, V.; Frondelius, L.; Arcidiacono, C.; Mancino, M.; Pastell, M. Development and Analysis of a CNN- and Transfer-Learning-Based Classification Model for Automated Dairy Cow Feeding Behavior Recognition from Accelerometer Data. Sensors 2023, 23, 2611. [Google Scholar] [CrossRef]
- Lipton, Z.C. The Mythos of Model Interpretability. In Proceedings of the 2016 ICML Workshop on Human Interpretability in Machine Learning, New York, NY, USA, 23 June 2016; pp. 96–100. [Google Scholar]
- Neethirajan, S. The Role of Sensors, Big Data and Machine Learning in Modern Animal Farming. Sens. Bio-Sens. Res. 2020, 29, 100367. [Google Scholar] [CrossRef]
- Schneider, S.; Taylor, G.W.; Kremer, S.C. Similarity learning networks for animal individual re-identification-beyond the capabilities of a human observer. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision Workshops, Snowmass Village, CO, USA, 1–5 March 2020; pp. 44–52. [Google Scholar]
- Qiao, Y.; Clark, C.; Lomax, S.; Kong, H.; Su, D.; Sukkarieh, S. Automated Individual Cattle Identification Using Video Data: A Unified Deep Learning Architecture Approach. Front. Anim. Sci. 2021, 2, 759147. [Google Scholar] [CrossRef]
- Xu, B.; Wang, W.; Guo, L.; Chen, G.; Wang, Y.; Zhang, W.; Li, Y. Evaluation of Deep Learning for Automatic Multi-View Face Detection in Cattle. Agriculture 2021, 11, 1062. [Google Scholar] [CrossRef]
- Ghorbani, A.; Zou, J. Data Shapley: Equitable Valuation of Data for Machine Learning. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 10–15 June 2019; pp. 2242–2251. [Google Scholar]
- Li, S.; Fu, L.; Sun, Y.; Mu, Y.; Chen, L.; Li, J.; Gong, H. Individual Dairy Cow Identification Based on Lightweight Convolutional Neural Network. PloS ONE 2021, 16, e0260510. [Google Scholar] [CrossRef] [PubMed]
- Qiao, L.; Geng, Y.; Zhang, Y.; Zhang, S.; Xu, C. MobiCFNet: A Lightweight Model for Cattle Face Recognition in Nature. In Proceedings of the International Conference on Artificial Intelligence and Soft Computing, Zakopane, Poland, 19–23 June 2022. [Google Scholar] [CrossRef]
- Yadav, C.S.; Peixoto, A.A.T.; Rufino, L.A.L.; Silveira, A.B.; Alexandria, A.R.d. Intelligent Classifier for Identifying and Managing Sheep and Goat Faces Using Deep Learning. AgriEngineering 2024, 6, 3586–3601. [Google Scholar] [CrossRef]
- Pavithra, M.; Surya Karthikesh, P.; Jahnavi, B.; Navyalokesh, M.C.R.; Lokesh Krishna, K. Implementation of Enhanced Security System using Roboflow. In Proceedings of the 2024 11th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions) (ICRITO), Noida, India, 14–15 March 2024; pp. 1–5. [Google Scholar]
- Khmelnytskyi National University. Method of Creating Custom Dataset to Train Convolutional Neural Network. Comput. Syst. Inf. Technol. 2024. [Google Scholar] [CrossRef]
- Samuel, S.; Kamakshi, V.; Lodhi, N.; Krishnan, N. Evaluation of Saliency-based Explainability Method. arXiv 2021, arXiv:2106.12773. [Google Scholar] [CrossRef]
- Chen, J.; Hajimirsadeghi, H.; Mori, G. Adapting Grad-CAM for Embedding Networks. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Snowmass Village, CO, USA, 1–5 March 2020; pp. 1–6. [Google Scholar]
- Bachhawat, M. Generalizing GradCAM for Embedding Networks. arXiv 2024, arXiv:2402.00909. [Google Scholar] [CrossRef]
- Shobeiri, S.; Aajami, M. Shapley value in convolutional neural networks (CNNs): A Comparative Study. Am. J. Sci. Eng. 2021, 2, 9–14. [Google Scholar] [CrossRef]
- Boneh-Shitrit, T.; Amir, S.; Bremhorst, A.; Mills, D.S.; Riemer, S.; Fried, D.; Zamansky, A. Deep Learning Models for Automated Classification of Dog Emotional States from Facial Expressions. arXiv 2022, arXiv:2206.05619. [Google Scholar] [CrossRef]
- Simonyan, K.; Vedaldi, A.; Zisserman, A. Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps. arXiv 2013, arXiv:1312.6034. [Google Scholar]
- Smilkov, D.; Thorat, N.; Kim, B.; Viégas, F.; Wattenberg, M. SmoothGrad: Removing noise by adding noise. In Proceedings of the 34th International Conference on Machine Learning (ICML), Sydney, Australia, 6–11 August 2017. [Google Scholar]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; pp. 618–626. [Google Scholar] [CrossRef]
- Banzato, T.; Bernardini, M.; Cherubini, G.; Zotti, A. A Methodological Approach for Deep Learning to Distinguish Between Meningiomas and Gliomas on Canine MR-Images. BMC Vet. Res. 2018, 14, 317. [Google Scholar] [CrossRef]
- Marzahl, C.; Aubreville, M.; Bertram, C.A.; Stayt, J.; Jasensky, A.K.; Bartenschlager, F.; Fragoso-Garcia, M.; Barton, A.K.; Elsemann, S.; Jabari, S.; et al. Deep Learning-Based Quantification of Pulmonary Hemosiderophages in Cytology Slides. Sci. Rep. 2020, 10, 9795. [Google Scholar] [CrossRef]
- Zheng, Y.; Li, G.; Li, Y. Survey of Application of Deep Learning in Image Recognition. Comput. Eng. Appl. 2019, 55, 20–36. [Google Scholar]
- Biercher, A.; Meller, S.; Wendt, J.; Caspari, N.; Schmidt-Mosig, J.; De Decker, S.; Volk, H.A. Using Deep Learning to Detect Spinal Cord Diseases on Thoracolumbar Magnetic Resonance Images of Dogs. Front. Vet. Sci. 2021, 8, 721167. [Google Scholar] [CrossRef]
- Biourge, V.; Delmotte, S.; Feugier, A.; Bradley, R.; McAllister, M.; Elliott, J. An artificial neural network-based model to predict chronic kidney disease in aged cats. J. Vet. Intern. Med. 2020, 34, 1920–1931. [Google Scholar] [CrossRef] [PubMed]
- Kukartsev, V.V.; Ageev, R.A.; Borodulin, A.S.; Gantimurov, A.P.; Kleshko, I.I. Deep Learning for Object Detection in Images Development and Evaluation of the YOLOv8 Model Using Ultralytics and Roboflow Libraries. In Software Engineering Methods Design and Application; Silhavy, R., Silhavy, P., Eds.; Springer: Cham, Switzerland, 2024; pp. 629–637. [Google Scholar]
- Dumortier, L.; Guépin, F.; Delignette-Muller, M.-L.; Boulocher, C.; Grenier, T. Deep Learning in Veterinary Medicine: An Approach Based on CNN to Detect Pulmonary Abnormalities from Lateral Thoracic Radiographs in Cats. Sci. Rep. 2022, 12, 11418. [Google Scholar] [CrossRef]
- Schmid, D.; Scholz, V.B.; Kircher, P.R.; Lautenschlaeger, I.E. Employing Deep Convolutional Neural Networks for Segmenting the Medial Retropharyngeal Lymph Nodes in CT Studies of Dogs. Vet. Radiol. Ultrasound 2022, 63, 763–770. [Google Scholar] [CrossRef]
- Badhe, T.; Borde, J.; Waghmare, B.; Thakur, V.; Chaudhari, A. Study of Deep Learning Algorithms to Identify and Detect Endangered Species of Animals. Int. J. Eng. Res. Technol. 2022, 11. [Google Scholar] [CrossRef]
- Pastell, M.E.; Kujala, M. A Probabilistic Neural Network Model for Lameness Detection. J. Dairy Sci. 2007, 90, 2283–2292. [Google Scholar] [CrossRef]
- Porter, I.R.; Wieland, M.; Basran, P.S. Feasibility of the Use of Deep Learning Classification of Teat-End Condition in Holstein Cattle. J. Dairy Sci. 2021, 104, 4529–4536. [Google Scholar] [CrossRef]
- Salvi, M.; Molinari, F.; Iussich, S.; Muscatello, L.V.; Pazzini, L.; Benali, S.; Banco, B.; Abramo, F.; De Maria, R.; Aresu, L. Histopathological Classification of Canine Cutaneous Round Cell Tumors Using Deep Learning: A Multi-Center Study. Front. Vet. Sci. 2021, 8, 640944. [Google Scholar] [CrossRef]
- Ancona, M.; Ceolini, E.; Öztireli, C.; Gross, M. Gradient-Based Attribution Methods. In Explainable AI: Interpreting, Explaining and Visualizing Deep Learning; Samek, W., Montavon, G., Vedaldi, A., Hansen, L.K., Müller, K.R., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 169–191. [Google Scholar]
- Simpson, L.; Costanza, F.; Millar, K.; Cheng, A.; Lim, C.C.; Chew, H.G. Tangentially Aligned Integrated Gradients for User-Friendly Explanations. arXiv 2025, arXiv:2503.08240. [Google Scholar]
- Polat, H.E.; Gerdan Koc, D.; Ertuğrul, O.; Koc, C.; Ekinci, K. Deep Learning based Individual Cattle Face Recognition using Data Augmentation and Transfer Learning. J. Agric. Sci. 2025, 31, 137–150. [Google Scholar] [CrossRef]
- Tanfoni, M.; Ceroni, E.G.; Marziali, S.; Pancino, N.; Maggini, M.; Bianchini, M. Generated or Not Generated (GNG): The Importance of Background in the Detection of Fake Images. Electronics 2024, 13, 3161. [Google Scholar] [CrossRef]
- Mahamud, E.; Fahad, N.; Assaduzzaman, M.; Zain, S.; Goh, K.O.M.; Morol, M.K. An explainable artificial intelligence model for multiple lung diseases classification from chest X-ray images using fine-tuned transfer learning. Decis. Anal. J. 2024, 12, 100499. [Google Scholar] [CrossRef]
- Dhore, V.; Bhat, A.; Nerlekar, V.; Chavhan, K.; Umare, A. Enhancing Explainable AI: A Hybrid Approach Combining GradCAM and LRP for CNN Interpretability. arXiv 2024, arXiv:2405.12175. [Google Scholar] [CrossRef]
- Lundberg, S.M.; Lee, S.I. A Unified Approach to Interpreting Model Predictions. In Advances in Neural Information Processing Systems 30; Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2017; pp. 4765–4774. [Google Scholar]
- Yoon, Y.; Hwang, T.; Lee, H. Prediction of radiographic abnormalities by the use of bag-of-features and convolutional neural networks. Vet. J. 2018, 237, 43–48. [Google Scholar]
- Shinde, S.; Himpalnerkar, A.; Shendurkar, S.; Deshmane, S.; Jadhav, S. Cattle Disease Detection using VGG16 CNN Architecture. In Proceedings of the 15th International Conference on Computing Communication and Networking Technologies (ICCCNT), Kamand, India, 24–28 June 2024; pp. 1–6. [Google Scholar] [CrossRef]
- Breaking the barriers of technology adoption: Explainable AI for requirement analysis and technology design in smart farming. Smart Agric. Technol. 2024, 9, 100658. [CrossRef]
Original | Background | Foreground | Empty | |
---|---|---|---|---|
Model accuracy | 92.2% | 50.0% | 40.2% | 2.0% |
Shapley value | 92.2% | 86.3% | 76.5% | 2.0% |
Foreground:Background | |
---|---|
Shapley value | 80.4% |
Vanilla gradient | 100.0% |
Average Grad-CAM | 98.8% |
EmbeddingCAM | 117.7% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Tanchev, D.; Marazov, A.; Balieva, G.; Lazarova, I.; Rankova, R. Exploring Attributions in Convolutional Neural Networks for Cow Identification. Appl. Sci. 2025, 15, 3622. https://doi.org/10.3390/app15073622
Tanchev D, Marazov A, Balieva G, Lazarova I, Rankova R. Exploring Attributions in Convolutional Neural Networks for Cow Identification. Applied Sciences. 2025; 15(7):3622. https://doi.org/10.3390/app15073622
Chicago/Turabian StyleTanchev, Dimitar, Alexander Marazov, Gergana Balieva, Ivanka Lazarova, and Ralitsa Rankova. 2025. "Exploring Attributions in Convolutional Neural Networks for Cow Identification" Applied Sciences 15, no. 7: 3622. https://doi.org/10.3390/app15073622
APA StyleTanchev, D., Marazov, A., Balieva, G., Lazarova, I., & Rankova, R. (2025). Exploring Attributions in Convolutional Neural Networks for Cow Identification. Applied Sciences, 15(7), 3622. https://doi.org/10.3390/app15073622