^{1}

^{2}

^{1}

^{1}

Precision Livestock Farming studies are based on data that was measured from animals via technical devices. In the means of automation, it is usually not accounted for the animals’ reaction towards the devices or individual animal behaviour during the gathering of sensor data. In this study, 14 Holstein-Friesian cows were recorded with a 2D video camera while walking through a scanning passage comprising six Microsoft Kinect 3D cameras. Elementary behavioural traits like how long the cows avoided the passage, the time they needed to walk through or the number of times they stopped walking were assessed from the video footage and analysed with respect to the target variable “udder depth” that was calculated from the recorded 3D data using an automated procedure. Ten repeated passages were recorded of each cow. During the repetitions, the cows adjusted individually (p < 0.001) to the recording situations. The averaged total time to complete a passage (p = 0.05) and the averaged number of stops (p = 0.07) depended on the lactation numbers of the cows. The measurement precision of target variable “udder depth” was affected by the time the cows avoided the recording (p = 0.06) and by the time it took them to walk through the scanning passage (p = 0.03). Effects of animal behaviour during the collection of sensor data can alter the results and should, thus, be considered in the development of sensor based devices.

As the world population is growing rapidly, Precision Livestock Farming addresses the task of providing a sustainable food production [

Animal behaviour has become an important field of scientific investigation. To express individual and species appropriate behaviour is an issue of animal welfare. But predispositions towards stress, fear of novelty or humans as well as sociability [

As recording unit (

On the research farm Karkendamm of Kiel University, a separate room (12.5 m × 4.9 m) with a direct entrance to the cow’s stable was designed as a recording chamber. The cow scanner was installed along the side of the room and a firm round path was constructed to guide the cows through the cow scanner without being led by halter (

areas Avoidance and Scanner passage were in the field of view of the video camera. Unseen was the area in which the cows were not recorded by the video camera.

In total 18 Holstein-Frisian cows were recorded once a month between November 2015 and May 2016. The cows were led into the recording chamber and walked through the scanner counter clockwise. The same handling person was present for every recording and only motivating the cow to move again, once it stopped walking. One cow was excluded from analysis, because it was randomly chosen as source for the udder model that was needed for the model based 3D object recognition [

For each cow all recorded material was processed. The images were tested to be suitable by preprocessing methods [

The video recordings were analysed by visual inspection to determine parameters regarding the behaviour the cows showed during recording with the cow scanner. The cycle wise gathered parameters (avoidance, runtime, totaltime, stops) are listed below:

Parameters regarding the behaviour observed during a cycle C

・ avoidance(C): The time in seconds the cow spend in the area Avoidance during cycle C, i.e. the time the cow avoided to approach the cow scanner.

・ runtime(C): The time in seconds the cow spend in the area Scanner passage during cycle C, i.e. the time the cow needed to pass the scanner.

・ totaltime(C): The sum consisting of avoidance(C), runtime(C) and the time the cow spend in the area Unseen, i.e. the time it took the cow to complete cycle C.

・ stops(C): The number of times the cow stopped within the Scanner passage during cycle C.

avoidance(C) started as soon as the front end of the cow appeared in the field of view of the video camera and ended when the cow stepped into Scanner passage with the front legs. runtime(C) ended when the rear end of the cow disappeared from Scanner passage. To receive animal wise behavioural traits, the cycle wise gathered parameters were for each animal (cow) averaged over all cycles the respective cow had performed ( n cow ). Definitions can be found in Equations (1)-(4):

Avoid_time (cow) := 1 / n cow * ∑ C = 1 n cow a v o i d a n c e ( C ) (1)

Run_time (cow) := 1 / n cow * ∑ C = 1 n cow r u n t i m e ( C ) (2)

Total_time (cow) := 1 / n cow * ∑ C = 1 n cow t o t a l t i m e ( C ) (3)

No_stops (cow) := 1 / n cow ∑ C = 1 n cow s t o p s ( C ) (4)

All statistical calculations were conducted using [

For all four parameters avoidance, runtime, totaltime, and stops (Section 2.2.3) two-factorial analyses of variance were performed. The factors under investigation were the animal (“cow”) and the number of the cycle that the parameter was gathered in (“cycle”). The factor “cycle” was defined with two levels: “cycles 1 - 5” and “cycles ≥ 6”. The interaction term between “cow” and “cycle” was also included in the analyses, and interaction plots were generated. Given the null hypothesis that all groups equal in means, the R-procedure aov() calculates the conditional probability (p-value), that the data under analysis is consistent with the null hypothesis. Small p-values suggest that the null hypothesis can be rejected. Effect sizes ω P 2 (partial ω^{2}; [^{2} is prone to overestimating the proportion of explained variance, ω^{2} was proposed by [^{2}, because the total variance of the analysis―used as denominator in the computation of ω^{2}―changes with the design of the study. As a solution to the comparability problem ω P 2 was recommended. With regard to the within-subject design of the analyses the formula,

ω P 2 = df_{factor} ∗ (MS_{factor} − MS_{error})/SS_{factor}+ (N − df_{factor}) ∗ MS_{error} (5)

was used [_{factor}, MS_{factor}, and SS_{factor} denote the degrees of freedom, the mean squares, and the sum of squares due to the corresponding factor. MS_{error} and SS_{error} denote mean squares and sum of squares of the error, and N denotes the total number of observations.

Data set. The data set held cow wise means in “udder depth” (UD). As a parameter for the measurement precision, the standard error (SE^{UD}) was merged as well as the percentage of images used for the calculation of UD regarding the total number of images available for the respective cow (comp^{UD}, min (comp^{UD}) = 0.62, max (comp^{UD}) = 1, mean (comp^{UD}) = 0.89 ± 0.09). The lactation number (LacNo) of the cows, the sacrum heights (ST), the body mass (mass) after morning milking on the day of recording, and the milk yield (milk KG) during morning milking on the day of recording were also included. The cow wise behavioural traits Avoid_time, Run_time, Total_time, and No_stops were merged to the data set. Additionally, each behavioural trait was transformed into a two-class categorical variable. The class distinction is presented in

Statistical calculations. Kruskal-Wallis tests were conducted for the behavioural traits (Equations (1)-(4)) with respect to a grouping after lactation numbers. The R-procedure kruskal. test() was used and p-values were calculated. The fourth and fifth lactations were combined in one group in order to achieve a more balanced design. The corresponding boxplots were generated. In addition, Wilcoxon rank-sum tests were carried out for the variables UD and SE^{UD} with respect to the categorical variables Cat_Avoid, Cat_Run, Cat_Total, and Cat_Stops (^{UD} were build using the remaining data set variables as predictors. The models were evaluated due to the Goodness-of-Fit measures Akaike’s An Information Criterion (AIC), Bayesian Information Criterion (BIC), adjusted coefficient of determination (adjR^{2}), the statistic (Fstat) of the F-test that checks if at least one coefficient is nonzero as well as the corresponding p-value (p_{Fstat}), and root mean squared error (RMSE). Furthermore, for UD and SE^{UD} least square means (lsmeans) with respect to the factors LacNo and Run_time, respectively, LacNo and Avoid_time were computed. The covariates mass, milkKG, and ST were included for UD. For SE^{UD} the categorical variable Cat_Run and comp^{UD} were included as covariates. 3D barplots were generated to illustrate the dependencies from the factors.

Interaction between the factors “cow” and “cycle” for avoidance, runtime, and totaltime are presented in

Categorical variable | Category I | Category II |
---|---|---|

Cat_Avoid | Avoid_time ≤ 12 s | Avoid_time > 12 s |

Cat_Run | run_time ≤ 15 s | Run_time > 15 s |

Cat_Total | Total_time ≤ 45 s | Total_time > 45 s |

Cat_Stops | No_stops ≤ 1 | No_stops > 1 |

Cycle wise parameter | N | Min | Max | Mean | SD | |
---|---|---|---|---|---|---|

avoidance (s) | 152 | 3 | 65 | 13.3 | 10.6 | |

runtime (s) | 152 | 6 | 53 | 14.8 | 8.5 | |

totaltime (s) | 152 | 18 | 137 | 43.6 | 18.6 | |

stops | 152 | 0 | 8 | 1.2 | 1.3 | |

Cycle wise parameter | Factor “cow” | Factor “cycle” | Interaction “cow * cycle” | |||

p | ω P 2 | p | ω P 2 | p | ω P 2 | |

avoidance | <0.001 | 0.15 | 0.07 | 0.02 | N.S. | - |

runtime | 0.04 | 0.07 | 0.04 | 0.02 | N.S. | - |

totaltime | <0.001 | 0.28 | <0.001 | 0.09 | 0.05 | 0.06 |

stops | N.S. | - | N.S. | - | N.S. | - |

^{1}: The number of observations (N), minimum (Min), maximum (Max), mean value (Mean), and standard deviation (SD) are given (rows 1 - 5). Rows 6 - 11 hold p-values and effect sizes ( ω P 2 ). N.S. denotes that the factor had no significant effect.

The behavioural traits Total_time and No_Stops significantly depended on the lactation number with p-values p = 0.05 and p = 0.07, respectively. Both traits were observed on a higher level in the first and the combined fourth and fifth lactation than the second and third lactation. The boxplots (^{UD} were found with p-values p = 0.06 and p = 0.03, respectively. While higher standard errors in UD were observed with the cows that avoided to pass the scanner longer than 12 seconds, a Run_time greater than 15 seconds led to lower standard errors in UD (

UD_{ijklm} = µ + LacNo_{i} + mass_{j} + milkKG_{k} + Cat_Run_{l} + ST_{m} + ε_{ijklm}, (6)

where UD_{ijklm} are the cow wise means of the “udder depth”, µ is the overall mean, LacNo_{i} is the fixed effect of ith lactation, mass_{j} is the fixed effect of the jth body mass after morning milking on the day of recording, milk KG_{k} is the fixed effect of the kth milk yield during morning milking on the day of recording, Cat_Run_{l} is the fixed effect of the lth category of the behavioural trait Run_time, ST_{m} is the fixed effect of the mth sacrum height, and ε_{ijklm} is the random residual effect. The model with the best Goodness-of-Fit measures for SE^{UD} was given by

SE i j k l UD = µ + LacNo_{i} + Cat_Avoid_{j} + Cat_Run_{k} + comp l UD + ε_{ijkl}, (7)

where SE i j k l UD are the standard errors of UD, µ is the overall mean, LacNo_{i} is the fixed effect of ith lactation, Cat_Avoid_{j} is the fixed effect of the jth category of the variable Avoid_time, Cat_Run_{k} is the fixed effect of the kth category of the behavioural trait Run_time, comp l UD is the fixed effect of the lth percentage of images from which a value for “udder depth” was computed, and ε_{ijkl} is the random residual effect. Goodness-of-Fit measures for both models can be found in

^{UD} across the factors LacNo and Run_time, respectively, Avoid_time. For both categories of Run_time, the adjusted means in UD were strictly monotonously decreasing with increasing lactation number. For every lactation number, smaller lsmeans in UD were observed with Run_time values lower or equal to 15 seconds. The

Model | AIC | BIC | adjR^{2} | Fstat | p_{Fstat} | RMSE |
---|---|---|---|---|---|---|

Model for UD | 51.52 | 54.31 | 0.89 | 18.33 | 0.003 | 1.33 |

Model for SE^{UD} | 6.08 | 9.91 | 0.64 | 6.67 | 0.009 | 1.33 |

^{2}: Given are Akaike’s An Information Criterion (AIC), Bayesian Information Criterion (BIC), adjusted coefficient of determination (adjR^{2}), F-test statistic (Fstat) and p-value (p_{Fstat}) regarding the test if at least on coefficient is nonzero, and root mean squared error (RMSE).

adjusted cow wise means in SE^{UD} increased monotonously with increasing lactation number. For every laction number, the lsmeans in SE^{UD} were smaller with Avoid_time values lower or equal to 12 seconds. The statistics for the models applied to calculate the least square means for UD and SE^{UD} were adjusted coefficient of determination adjR^{2} = 0.82, F-test statistic Fstat = 7.39, and p-value p_{Fstat} = 0.06, respectively, adjR^{2} = 0.53, Fstat = 3.43, and p_{Fstat} = 0.06.

The goal of this study was to analyse how the recorded image data and the results calculated from it were affected by individual animal behaviour during recording. In the analyses of cycle wise gathered parameters the factors “cow” and “cycle” were considered. The interaction between these factors needed to be taken into account as well, because it was likely that animal temperament, age or herd status influenced the reactions to the repeated passages through the scanner. It was anticipated that cows had individual walking speeds and experienced individual amounts of fear or curiosity towards the cow scanner as a novel object [

When it came to the effects of cow behaviour on the calculated “udder depth” and its measurement precision, significant dependency of SE^{UD} on Avoid_time and Run_time, i.e. cow wise averaged avoidance and runtime, was observed. The standard error SE^{UD} served as a measure of precision in the determination of cow wise averaged “udder depth” UD, whereat low SE^{UD} corresponded to high measurement precision. The p-value with regard to Avoid_time (p = 0.06) was again larger than the usually reported limit 0.05. However, the authors considered it an interesting observation that SE^{UD} increased with increasing Avoid_time and decreased with increasing Run_time (^{UD}, it could be distinguished between information not directly related to cow behaviour (lactation number, height, body mass, milk yield) and information directly related to the behavior during recording process. The most successful―in terms of Goodness-of-Fit measures―model describing UD only held the categorised Run_time as behaviour related information, but three predictors that were not directly related to cow behaviour. In contrast, the most successful model describing SE^{UD} held only the lactation number as information that was not directly related to cow behaviour. This indicated that the measurement precision depended on the behaviour of the animal more strongly than the linear trait itself. A closer inspection of ^{UD}, but UD was only slightly larger for the category with longer Run_time values. Least square means of UD further showed that the udder lowered towards the ground with increasing lactation number. This was expected, and was already found and discussed in [^{UD} were increasing with increasing lactation number indicating that measurement precision decreased. Since the udder tissue became more stretched with every additional lactation, this was anticipated. The udder tissue was stressed during milking [

In Precision Livestock Farming studies often the question arose why implemented analyzing algorithms produced precise and meaningful results for some animals whilst with other animals an additional source of variance seemed to have altered the results, although the measuring conditions were the same for all animals. Using the cow scanner recordings as an example, the authors’ aim was to show that successful analyses of sensor based data in an animal related context might not only depend on the precision of the sensor, but also on the behaviour of the animals during gathering the sensor data. Individual animal temperament is likely to introduced variance to the sensor data that might be difficult to explain during data analysis. However, developments that might be sold to farmers later need to deliver reliable results for the whole herd. As it was with most sensors impossible to measure animal temperament during data collection or to conduct contemporary external temperament tests, it seemed difficult to model the target variable including the temperament. The authors recommend to record general behavioural traits during test phases of product development in order to quantify the effects and to be able to better understand and report the variability in measurement precision across animals.

In this study, it was analysed how body traits calculated from image material that was recorded with a scanning passage (cow scanner) depended on animal behaviour during recording. Behaviour related parameters were observed during recording with the cow scanner and analysed with regard to their effect on the actual target variable automatically calculated “udder depth”. Qualitative and quantitative interactions between the effect of the cow and the effect of repeatedly passing the scanner were found, indicating that animal individuality led to different ways the cows adjusted to the scanner. The observed behavioural traits significantly affected the measurement precision in cow wise averaged “udder depth”. As information on animal temperament is often unavailable while the target variable is calculated, behavioural parameters should be observed during the test phase of a developed product so that the underlying effect on the measurement precision can in retrospect be described.

Gratitude is expressed to Stiftung Schleswig-Holsteinische Landschaft and to Rinderzucht Schleswig-Holstein eG for advice and financial support.

Salau, J., Haas, J.H., Junge, W. and Thaller, G. (2018) How does the Behaviour of Dairy Cows during Recording Affect an Image Processing Based Calculation of the Udder Depth? Agricultural Sciences, 9, 37-52. https://doi.org/10.4236/as.2018.91004