Table of Contents
Fetching ...

Evaluating transfer learning strategies for improving dairy cattle body weight prediction in small farms using depth-image and point-cloud data

Jin Wang, Angelo De Castro, Yuxi Zhang, Lucas Basolli Borsatto, Yuechen Guo, Victoria Bastos Primo, Ana Beatriz Montevecchio Bernardino, Gota Morota, Ricardo C Chebel, Haipeng Yu

TL;DR

Results indicate that pretrained representations generalize well across farms with differing imaging conditions and dairy cattle populations, and suggest that transfer learning is well suited for small farm prediction scenarios where cross-farm data sharing is limited by privacy, logistical, or policy constraints.

Abstract

Computer vision provides automated, non-invasive, and scalable tools for monitoring dairy cattle, thereby supporting management, health assessment, and phenotypic data collection. Although transfer learning is commonly used for predicting body weight from images, its effectiveness and optimal fine-tuning strategies remain poorly understood in livestock applications, particularly beyond the use of pretrained ImageNet or COCO weights. In addition, while both depth images and three-dimensional point-cloud data have been explored for body weight prediction, direct comparisons of these two modalities in dairy cattle are limited. Therefore, the objectives of this study were to 1) evaluate whether transfer learning from a large farm enhances body weight prediction on a small farm with limited data, and 2) compare the predictive performance of depth-image- and point-cloud-based approaches under three experimental designs. Top-view depth images and point-cloud data were collected from 1,201, 215, and 58 cows at large, medium, and small dairy farms, respectively. Four deep learning models were evaluated: ConvNeXt and MobileViT for depth images, and PointNet and DGCNN for point clouds. Transfer learning markedly improved body weight prediction on the small farm across all four models, outperforming single-source learning and achieving gains comparable to or greater than joint learning. These results indicate that pretrained representations generalize well across farms with differing imaging conditions and dairy cattle populations. No consistent performance difference was observed between depth-image- and point-cloud-based models. Overall, these findings suggest that transfer learning is well suited for small farm prediction scenarios where cross-farm data sharing is limited by privacy, logistical, or policy constraints, as it requires access only to pretrained model weights rather than raw data.

Evaluating transfer learning strategies for improving dairy cattle body weight prediction in small farms using depth-image and point-cloud data

TL;DR

Results indicate that pretrained representations generalize well across farms with differing imaging conditions and dairy cattle populations, and suggest that transfer learning is well suited for small farm prediction scenarios where cross-farm data sharing is limited by privacy, logistical, or policy constraints.

Abstract

Computer vision provides automated, non-invasive, and scalable tools for monitoring dairy cattle, thereby supporting management, health assessment, and phenotypic data collection. Although transfer learning is commonly used for predicting body weight from images, its effectiveness and optimal fine-tuning strategies remain poorly understood in livestock applications, particularly beyond the use of pretrained ImageNet or COCO weights. In addition, while both depth images and three-dimensional point-cloud data have been explored for body weight prediction, direct comparisons of these two modalities in dairy cattle are limited. Therefore, the objectives of this study were to 1) evaluate whether transfer learning from a large farm enhances body weight prediction on a small farm with limited data, and 2) compare the predictive performance of depth-image- and point-cloud-based approaches under three experimental designs. Top-view depth images and point-cloud data were collected from 1,201, 215, and 58 cows at large, medium, and small dairy farms, respectively. Four deep learning models were evaluated: ConvNeXt and MobileViT for depth images, and PointNet and DGCNN for point clouds. Transfer learning markedly improved body weight prediction on the small farm across all four models, outperforming single-source learning and achieving gains comparable to or greater than joint learning. These results indicate that pretrained representations generalize well across farms with differing imaging conditions and dairy cattle populations. No consistent performance difference was observed between depth-image- and point-cloud-based models. Overall, these findings suggest that transfer learning is well suited for small farm prediction scenarios where cross-farm data sharing is limited by privacy, logistical, or policy constraints, as it requires access only to pretrained model weights rather than raw data.
Paper Structure (28 sections, 3 equations, 3 figures, 3 tables)

This paper contains 28 sections, 3 equations, 3 figures, 3 tables.

Figures (3)

  • Figure 1: Three experimental designs were evaluated, together with their corresponding training-flow illustrations, using depth CSV files converted to images as model inputs. ConvNeXt-Tiny was used as an example backbone, followed by a shared regression head consisting of global average pooling, a fully connected layer with ReLU activation, dropout, and a final linear layer that outputs body weight. In the single-source learning setting, models were trained using only the small-farm training set. In joint learning, the small-farm training set was combined with data from the medium-farm, large-farm, or both to train all network layers end-to-end. Transfer learning was conducted in a two-step process. First, the backbone and regression head were pretrained using external training data. Second, the model was fine-tuned on the small-farm training set by updating the entire regression head and only the last N layers of the backbone. The value of N was determined through grid search using the small-farm validation set. Model performance was evaluated using predictions generated on the small-farm testing set.
  • Figure 2: An illustration of the two-stage model training procedure. Stage 1 trains the model head while the backbone is frozen. Stage 2 trains both the backbone and the head together. This procedure was applied to the single-source learning design, the joint learning design, and the first step of the transfer learning design.
  • Figure 3: Comparison of joint learning and transfer learning for improving body weight (BW) prediction performance on the small-farm. Joint learning trains a BW prediction model by combining image data and scale-based body weights from both the small-farm and the external large-farm. This approach requires farms to share raw images and scale-based body weights. In contrast, transfer learning trains a model on the external farm and then provides only the pretrained model weights to the small-farm. The small-farm uses its own training data to complete model training. This approach avoids sharing raw data while still improving prediction performance for the small-farm.