Machine Learning Image Classification model to Identify Cattle in Kenya

by Benard Onyango, Kennedy Ondimu, Obadiah Musau

Published: October 25, 2025 • DOI: 10.51244/IJRSI.2025.1208004131

Abstract

Classifying cattle using muzzle images is an emerging technology in livestock management for recognition and classification. This study used Convolutional Neural Networks (CNN) algorithm to uniquely identify cattle by using their muzzle patterns which are unique to every single cattle. The study used a dataset of 4,923 muzzle images of different cattle breeds which were pre-processed to improve the dataset’s performance and reduce overfitting. The Convolution Neural Network used several convolutional layers to capture muzzle patterns, pooling and dense layers to differentiate breeds. Adam optimizer and categorical cross-entropy loss were employed for model training. The results revealed high accuracy, verifying muzzle images as an effective biometric method for cattle identification. Transfer learning via pre-trained models positively impacted model accuracy and generalization. The technology can be integrated into livestock management and breeding programs, as well as agricultural and farming systems.