DOI: 10.5281/zenodo.11103086
title: Goat-CNN: A Lightweight Convolutional Neural Network for Pose-Independent Body Condition Score Estimation in Goats

description: Here we introduce the dataset utilized in our published paper entitled "Goat-CNN: A Lightweight Convolutional Neural Network for Pose-Independent Body Condition Score Estimation in Goats".

Contained within the "bcs" folder are all the videos collected for this study. Each video file is named with a format denoting its respective details. The first number signifies the sequence of collection, the second denotes the ear tag, and the final figure represents the body condition score (BCS) value.

For example: "1_158734_2.50" indicates the first sampling of an animal with the ear tag "158734" and a BCS value of "2.50".

Additionally, we provide two Python scripts in this repository. The first script, "Video2Frame.py", facilitates the splitting of videos into individual frames. The second script, "Frames2npy.py", converts these frames into two numpy-friendly files with the extension ".npy". These files contain both the images ("X_train_bcs300.npy") and their corresponding labels ("Y_train_bcs300.npy").

Furthermore, for the convenience of swift experimentation, we have included the desired .npy files within the repository.

To load these files into your Python environment, you can use the following code snippet:



th4figs = '/content/drive/MyDrive/compag_2023/'


path4images = "/content/drive/MyDrive/CodeRefarm/datasets/BCS/X_train_bcs300.npy"

Xtrain = np.load(path4images)


path4labels = "/content/drive/MyDrive/CodeRefarm/datasets/BCS/Y_train_bcs300.npy"

Ytrain = np.load(path4labels).astype(float)


print("X train : ", Xtrain.shape)

print("Y train : ", Ytrain.shape)













 


 





















X train :  (5332, 300, 300, 3)
Y train :  (5332,)
description: If you want to cite this work you can use the following text:

@article{TEMENOS2024101174,title = {Goat-CNN: A lightweight convolutional neural network for pose-independent body condition score estimation in goats},journal = {Journal of Agriculture and Food Research},volume = {16},pages = {101174},year = {2024},issn = {2666-1543},doi = {https://doi.org/10.1016/j.jafr.2024.101174},url = {https://www.sciencedirect.com/science/article/pii/S2666154324002114},author = {Anastasios Temenos and Athanasios Voulodimos and Vera Korelidou and Athanasios Gelasakis and Dimitrios Kalogeras and Anastasios Doulamis and Nikolaos Doulamis},keywords = {Body condition score, Artificial intelligence, Convolutional neural network, Precision livestock farming, Goat, Animal, Signal processing, Computer vision},abstract = {Modern livestock farming systems face the challenge of meeting the growing demand for dairy and meat products while ensuring the well-being of animals. Body Condition Scoring serves as a vital process for assessing the body reserves in animals, impacting their health, welfare, and productivity. However, traditional body condition score (BCS) evaluation methods via observation and palpation of specific anatomical regions are labor-intensive and subjective, hindering their widespread adoption. To address this issue, Precision Livestock Farming (PLF) techniques, particularly those involving Internet of Things (IoT) devices and artificial intelligence (AI), have emerged as promising solutions. In this work, we explore the use of AI, specifically Convolutional Neural Networks (CNNs), to automate the assessment of BCS in goats utilizing imagery data. Our model was trained on 5000 images illustrating the dorsal view of the backside of goats achieving an overall accuracy of 97.94 % which was the highest compared to other popular deep learning architectures from literature (e.g. VGG16, ResNet34, ResNet50, DenseNet, GoogleNet). The proposed custom CNN model for goat-specific BCS estimation overcomes the limitations of manual sketching, providing automatic region identification for BCS assessment. Moreover, it is a lightweight model specifically designed for seamless integration with IoT devices, allowing for efficient on-board processing via cameras. The model's pose-independent nature and adaptability to environmental constraints make it a valuable tool for efficient and sustainable goat farming. This research advances the application of AI as a precision livestock farming tool, contributing to the reinforcement of the animal welfare and productivity, and supporting evidence-based decision-making processes to increase farms' resilience.}}

Anastasios Temenos, Athanasios Voulodimos, Vera Korelidou, Athanasios Gelasakis, Dimitrios Kalogeras, Anastasios Doulamis, Nikolaos Doulamis,Goat-CNN: A lightweight convolutional neural network for pose-independent body condition score estimation in goats,Journal of Agriculture and Food Research,Volume 16,2024,101174,ISSN 2666-1543,https://doi.org/10.1016/j.jafr.2024.101174.(https://www.sciencedirect.com/science/article/pii/S2666154324002114)Abstract: Modern livestock farming systems face the challenge of meeting the growing demand for dairy and meat products while ensuring the well-being of animals. Body Condition Scoring serves as a vital process for assessing the body reserves in animals, impacting their health, welfare, and productivity. However, traditional body condition score (BCS) evaluation methods via observation and palpation of specific anatomical regions are labor-intensive and subjective, hindering their widespread adoption. To address this issue, Precision Livestock Farming (PLF) techniques, particularly those involving Internet of Things (IoT) devices and artificial intelligence (AI), have emerged as promising solutions. In this work, we explore the use of AI, specifically Convolutional Neural Networks (CNNs), to automate the assessment of BCS in goats utilizing imagery data. Our model was trained on 5000 images illustrating the dorsal view of the backside of goats achieving an overall accuracy of 97.94 % which was the highest compared to other popular deep learning architectures from literature (e.g. VGG16, ResNet34, ResNet50, DenseNet, GoogleNet). The proposed custom CNN model for goat-specific BCS estimation overcomes the limitations of manual sketching, providing automatic region identification for BCS assessment. Moreover, it is a lightweight model specifically designed for seamless integration with IoT devices, allowing for efficient on-board processing via cameras. The model's pose-independent nature and adaptability to environmental constraints make it a valuable tool for efficient and sustainable goat farming. This research advances the application of AI as a precision livestock farming tool, contributing to the reinforcement of the animal welfare and productivity, and supporting evidence-based decision-making processes to increase farms' resilience.Keywords: Body condition score; Artificial intelligence; Convolutional neural network; Precision livestock farming; Goat; Animal; Signal processing; Computer vision