HCIProject, 2025

CattleNet-XAI: Explainable Cattle Weight Estimation from Images

CattleNet-XAI: Explainable Cattle Weight Estimation from Images

Livestock is essential to the agricultural economy of Bangladesh, which has an estimated 23.78 million cattle. Accurate estimation of cattle weight is essential for farm management, health assessment and productivity, but traditional manual methods are labor-intensive, time-consuming and prone to inaccuracies. Regression models such as Random Forest and Linear Regression struggle to capture the complex, nonlinear relationships within image data. CattleNet-XAI is a framework for efficient and explainable cattle weight estimation from images using a custom Convolutional Neural Network (CNN).

The study used 2,052 original images of 513 cattle from the Cow Image Dataset (CID), each annotated with attributes such as breed, height and weight. For the CNN approach, images were preprocessed with normalization and histogram equalization. The custom CNNs were compared with a pretrained EfficientNetB3 model and with Random Forest and Linear Regression, for which YOLOv5 was first used to extract features from the cattle images.

Overview of the CNN-based and feature extraction approaches compared in this study
Overview of the CNN-based and feature extraction approaches compared in this study.

One variation of the custom CNN, 3Conv3Dense, outperformed the other models, with a mean absolute error (MAE) of 18.02 kg and a root mean squared error (RMSE) of 19.85 kg. LIME visualizations and error case analysis show which parts of each image the model relies on and where its predictions deviate.

Sample predictions of cattle weight using the proposed 3Conv3Dense model
Sample predictions of cattle weight using the proposed 3Conv3Dense model.
LIME visualizations for the 3Conv3Dense model, providing insight into its prediction process
LIME visualizations for the 3Conv3Dense model, providing insight into its prediction process.

Future work will incorporate more diverse datasets, conduct breed-specific evaluations and assess robustness under varying environmental and image-capturing conditions.

By automating weight estimation and explaining its predictions, CattleNet-XAI offers a practical approach to livestock management for farms in Bangladesh.

Team: Md Junayed Hossain, Jannatul Ferdaus, Ashraful Islam, PhD, Prof. M Ashraful Amin, PhD

  • Cattle Weight Estimation
  • Livestock
  • Precision Livestock Farming
  • Agriculture
  • Computer Vision
  • Deep Learning
  • Convolutional neural network
  • Explainable AI
  • LIME

Team

Related publications