Agricultural Sciences
Vol.09 No.01(2018), Article ID:81781,16 pages

How does the Behaviour of Dairy Cows during Recording Affect an Image Processing Based Calculation of the Udder Depth?

Jennifer Salau1, Jan Henning Haas2, Wolfgang Junge1, Georg Thaller1

1Institute of Animal Breeding and Husbandry, Kiel University, Kiel, Germany

2Inflammation at Interfaces’ Cluster Office, Kiel University, Kiel, Germany

Copyright © 2018 by authors and Scientific Research Publishing Inc.

This work is licensed under the Creative Commons Attribution International License (CC BY 4.0).

Received: November 30, 2017; Accepted: January 14, 2018; Published: January 17, 2018


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.


Dairy Cow, Sensor Data, Image Processing, Animal Temperament, Measurement Precision

1. Introduction

As the world population is growing rapidly, Precision Livestock Farming addresses the task of providing a sustainable food production [1] . The objective of Precision Livestock Farming is to automatically inform farmers on the current health [2] or welfare status [3] of their animals and to help them make decisions based on analysed sensor data. Many developments have been presented in multidisciplinary studies using various cameras [4] [5] , microphones [6] , accelerometers [7] [8] , and different other kinds of sensors. Unfortunately, most projects were never successfully implemented in the field. On the one hand, all developments need to be accepted and handled by the farmers [9] . Even if farmers are motivated to enhance their performance, they often lack time or experience to change operating procedures [10] . On the other hand, many projects do not reach the state of full development. Problems that arise are for example impractically high computational costs of a working solution or too much unexplained variance in the results as well as between animal variations in the measurement precision with regard to the target variable. The present study investigates the possible influence of animal behaviour during the collection of sensor data on the target variable.

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 [11] [12] do not only affect welfare or herd status, but also the performance of farm animals [13] . Behavioural traits are already taken into account in breeding decisions regarding for example the behaviour in the milking parlour or performance related temperament traits as part of the breeding goal [14] . Additionally, animal behaviour is an issue of human animal interaction in terms of work safety [15] . Reference [16] suggests that animal behaviour could be assessed through sensor data. However, the effect of individual animal temperament on the sensor data that is used to address specific target variables has so far not been investigated. Usually, the sensor data that is modelled and analysed in Precision Livestock Farming to obtain the desired target variable was measured from the animal directly and was already animal related information (for example ultrasound measurements of backfat thickness), or raw sensor data from the animal was gathered to calculate information from it. The latter, exemplarily, takes place with camera based studies. Reference [17] presented the concept of a 3D cow scanner that combined the fields of view of six Microsoft Kinect cameras to collect 3D information of the surface of walking cows. That project aimed at an objective evaluation of the animals’ body measures, as dairy cattle breeding decisions are based on manual and visual classification of cows’ exterior [18] . Especially during the recording of walking cows, individual animal behaviour is expressed. In the present study as elementary behavioural traits the time spans the cows avoided the recording unit or needed to pass it as well as the number of times the cows stopped walking during recording are used. It is investigated how the cows adjust to being recorded with the cow scanner without any conspecifics present. Furthermore, the target variable “udder depth” calculated from the recordings is analysed with respect to an effect of the behaviour of the recorded cow.

2. Material and Methods

2.1. Recording Unit

As recording unit (Figure 1) a framework with 2.08 m passage height and 2.05 m passage width was equipped with six Microsoft Kinect v1 cameras. On both sides single Kinect cameras were located in 0.6 m height to deliver a close up of udder, rump, and legs (sideview cameras). Additionally, paired Kinect cameras were positioned in the upper corners of the framework (topview cameras). As they are mounted with an angle of 56˚ between their fronts, one camera of each pair saw the approaching cow and the other camera recorded the cow after it has passed the center of the framework. A more detailed description of the recording unit can be found in [17] .

Recording Chamber

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 (Figure 2). An additional video camera (Creative Live! Cam Chat HD, 720pUSB Webcam, run by Central 3 Lite software) was installed on one end of the passage through the scanner and gathered video footage of the scene during recording took place. From this footage parameters regarding the behaviour of the cows during recording (behavioural traits) were assessed (section 2.2.3) by visual inspection. The round path was divided into the areas Scanner passage, Avoidance, and Unseen. Scanner passage was the area in which the cow was in the field of view of at least one of the Kinect cameras. Avoidance was the area the cows stepped in when entering the recording chamber. Both

Figure 1. True to scale technical drawing of the recording unit. Left: A framework was equipped with six Kinect cameras. Middle: On each side one Kinect camera was mounted in sideview position. Right: Pairs of Kinect cameras were fixated in topview positions.

Figure 2. Schematic representation of the installation of the recording unit. The cows could access the recording chamber directly from the stable. Spring gates (dashed grey lines) and pipes (solid grey lines) formed a round path that guided them through the framework. Imaginary lines (thin black lines) partition the round path in the areas Avoidance, Scanning passage, and Unseen. A video camera was mounted at the right end of Scanning passage. The surveilled area is covered in grey.

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.

2.2. Data Collection

2.2.1. Recorded Cows

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 [19] . Due to loss of video footage no behavioural traits were available for another three cows. The remaining 14 cows completed 9 to 11 cycles (10.1 ± 0.5) through the scanner. Cows were in their first to fifth lactation (2.6 ± 1.3) and between 144 cm and 149 cm in height (146.6 ± 1.9 cm). The milk yields during morning milking on the day of recording ranged from 13.5 kg to 32.7 kg (23.6 ± 6.9 kg). The body mass of the cows after morning milking on the day of recording varied between 540 kg and 831 kg (659.1 ± 72.1 kg).

2.2.2. Calculating “Udder Depth”

For each cow all recorded material was processed. The images were tested to be suitable by preprocessing methods [19] before object recognition was applied. All suitable images in which the udder could be found were handed on to the calculation of “udder depth”. The height of the udder bottom above the scenery’s floor was defined as “udder depth”. A detailed description on the algorithm for “udder depth” determination can be found in [19] . Cow wise means UD in “udder depth” were calculated from all suitable images.

2.2.3. Behavioural Traits

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)

2.3. Statistical Analysis

All statistical calculations were conducted using [20] .

2.3.1. Statistical Analysis of Cycle Wise Values

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; [21] ) were calculated where the p-value did not exceed 0.07. As the effect size η2 is prone to overestimating the proportion of explained variance, ω2 was proposed by [22] which is determined by using unbiased estimators of the variance components associated with the sources of variation in the design. However, comparability across analyses is limited with ω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 = dffactor ∗ (MSfactor − MSerror)/SSfactor+ (N − dffactor) ∗ MSerror (5)

was used [23] , where dffactor, MSfactor, and SSfactor denote the degrees of freedom, the mean squares, and the sum of squares due to the corresponding factor. MSerror and SSerror denote mean squares and sum of squares of the error, and N denotes the total number of observations.

2.3.2. Statistical Analysis of Cycle Wise Values

Data set. The data set held cow wise means in “udder depth” (UD). As a parameter for the measurement precision, the standard error (SEUD) 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 (compUD, min (compUD) = 0.62, max (compUD) = 1, mean (compUD) = 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 Table 1. The categorical variables were named Cat_Avoid, Cat_Run, Cat_Total, and Cat_Stops and were included in the data set.

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 SEUD with respect to the categorical variables Cat_Avoid, Cat_Run, Cat_Total, and Cat_Stops (Table 1). Boxplots were generated. To explain the calculated linear traits and their measurement precision in terms of behavioural traits and animal related parameters, multiple linear regression models for UD and SEUD 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 (adjR2), the statistic (Fstat) of the F-test that checks if at least one coefficient is nonzero as well as the corresponding p-value (pFstat), and root mean squared error (RMSE). Furthermore, for UD and SEUD 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 SEUD the categorical variable Cat_Run and compUD were included as covariates. 3D barplots were generated to illustrate the dependencies from the factors.

3. Results

Interaction between the factors “cow” and “cycle” for avoidance, runtime, and totaltime are presented in Figure 3. Qualitative and quantitative interactions were present for all three parameters. For six cows (5017, 5048, 5790, 5967, 6009, 6037) higher values in all three parameters were observed in “cycles ≥ 6” compared to “cycles 1 - 5”. Another group of six cows (4771, 4843, 4939, 5820, 6129, 6169) show increases from “cycles ≥ 6” to “cycles 1 - 5” in two of the parameters but a decrease in the third. For only two cows (4508, 6147) the values in all three parameters were decreasing. No parallel lines were found. The descriptive statistics as well as the results of the analyses of variance concerning the cycle wise parameters avoidance, runtime, totaltime, and stops can be found in Table 2.

Table 1. The behavioural traits Avoid_time, Run_time, Total_time, and No_stops were split into two categories each, defining the categorical variables Cat_Avoid, Cat_Run, Cat_Total, and Cat_Stops.

Figure 3. Interaction plots illustrating the interaction between the factors “cow” and “cycle” with regard to the cycle wise parameters avoidance (left), runtime (middle), and totaltime (right).

Table 2. Descriptive statistics, p-value regarding the effects of “cow” and “cycle”, and effect sizes ω P 2 for cycle wise gathered parameters in cow behaviour.1

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 (Figure 4, top row) revealed monotonous increases from second to fourth and fifth lactation in both traits. In No_stops the highest mean was observed for primiparous cows, whilst cows in their fourth or fifth lactation showed the highest mean in Total_time. Significant effects of the behavioural traits Avoid_time and Run_time on SEUD 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 (Figure 4, bottom row). The model with the best Goodness-of-Fit measures for UD was given by

UDijklm = µ + LacNoi + massj + milkKGk + Cat_Runl + STm + εijklm, (6)

where UDijklm are the cow wise means of the “udder depth”, µ is the overall mean, LacNoi is the fixed effect of ith lactation, massj is the fixed effect of the jth body mass after morning milking on the day of recording, milk KGk is the fixed effect of the kth milk yield during morning milking on the day of recording, Cat_Runl is the fixed effect of the lth category of the behavioural trait Run_time, STm 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 SEUD was given by

SE i j k l UD = µ + LacNoi + Cat_Avoidj + Cat_Runk + comp l UD + εijkl, (7)

where SE i j k l UD are the standard errors of UD, µ is the overall mean, LacNoi is the fixed effect of ith lactation, Cat_Avoidj is the fixed effect of the jth category of the variable Avoid_time, Cat_Runk 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 Table 3.

Figure 5 presents dependencies of the lsmeans for UD and SEUD 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

Figure 4. The boxes upper and lower boundaries mark the 75% and 25% quartiles, respectively. The black line denotes the medians. Whisker lengths correspond to 1.5 times the boxes’ interquartile ranges. Outliers are marked with rectangles. Top row: Boxplots illustrating the differences in Total_time (left) and No_stops (right) depending on the lactation number. Bottom row: Boxplots illustrating the differences in standard error of UD depending on the behavioural traits Avoid_time (left) and Run_time (right).

Table 3. Goodness-of-Fit measures for the multiple linear regression models describing UD and SEUD.2

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

Figure 5. 3D barplots of the least square means of UD (left) and SEUD (right) regarding the factors lactation number and Run_time, respectively, Avoid_time. For the sake of better visibility, the arrangement of bars with respect to the lactation number was reversed in the left 3D barplot. The statistics for the models applied to calculate the least square means for UD and SEUD were adjusted coefficient of determination adjR2 = 0.82, F-test statistic Fstat = 7.39, and p-value pFstat = 0.06, respectively, adjR2 = 0.53, Fstat = 3.43, and pFstat = 0.06.

adjusted cow wise means in SEUD increased monotonously with increasing lactation number. For every laction number, the lsmeans in SEUD 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 SEUD were adjusted coefficient of determination adjR2 = 0.82, F-test statistic Fstat = 7.39, and p-value pFstat = 0.06, respectively, adjR2 = 0.53, Fstat = 3.43, and pFstat = 0.06.

4. Discussion

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 [12] . Since [24] found that learning behaviour of calves depended on their temperament, it was also expected that the animal reactions changed individually during repeated scanner passages. Although the interaction term was not significant for avoidance and runtime, it remained in the model, because in this way the effect of “cycle” could be interpreted depending on the effect “cow” [25] . As illustrated by Figure 3, qualitative interactions between the factors “cow” and “cycle” were present in the analyses of variance with regard to avoidance, runtime, and totaltime. This refers to the fact that lines with positive and negative gradients intersected in all interaction plots, meaning that in the later cycles longer time spans in avoidance, runtime, and totaltime compared to the earlier cycles were noted for some animals and for other cows the higher values were noted in the first five completed cycles. Lines with negative gradient might indicate cows that adapted to passing the scanner after the fear of novelty subsided, whereas lines with positive gradient possibly correspond to the cows’ unwillingness to participate any longer. Possible stressors might have been the length of the data collection and that recording was carried out without returning to the conspecifics between the completion of cycles. Reference [26] stated that cows showed stronger attention towards the task to perform with a conspecific demonstrator present. It was also proven, that cows adjust their behaviour to external motivation like the access to pasture [27] or food reward [28] . In contrast, the presented setting did not provide any motivation for the cows to participate. As the recorded cows were kept in a loose-housing barn, locomotor activity was no motivation itself [29] . Frustration in cows was, thus, likely to occur. Within specific subgroups of cows change in parameter values had the same sign but differed in amount (quantitative interaction), but similarities between the respective cows were not explained by herd management data (lactation number, height, body mass, and milk yield; results not shown). The recorded cows also behaved inhomogeneously when avoidance, runtime, and totaltime were considered simultaneously. Exemplarily, higher values in avoidance, runtime, and totaltime in “cycles ≥ 6” were observed for half of the animals, indicating that these cows expressed unwillingness within every section of the round path (Figure 2). However, the second main group of animals showed increases in two of the three parameters, but a decrease from “cycles 1 - 5” to “cycles ≥ 6” in the third one. Again, no significant differences in lactation number, height, body mass or milk yield were indicated between these groups of cows (results not shown) to provide an explanation. The findings were likely to be related to the animals temperament regarding fear, social behaviour, and stress resistance [13] [14] . As no temperament tests were performed in this study, and no former evaluation of the temperament of the recorded cows was available, it remained an item for specially designed future studies to reaffirm these connections. The dependency on the individual animal is supported by the effect sizes ω P 2 . According to “Cohen’s rule of thumb” [30] , the “cow” effect was large for the parameters avoidance and totaltime and medium for runtime. In contrast, the effect sizes for “cycle” and the interaction term were small to medium. Interestingly, runtime, i.e. the time to pass the scanner, exhibited the smallest “cow” effect compared to avoidance and totaltime. This might indicate that the cows tried to pass the unknown cow scanner quickly once they stopped avoiding the scanner passage. The cycle wise parameter stops was possibly not influenced by “cow” or “cycle”, because external stimuli like sounds from outside the recording chamber might have caused the animals to stop. On the contrary, the cow wise averaged behavioural trait No_stops significantly depended on the lactation number of the cow. A relatively high p-value (p = 0.07) was observed. However, the authors decided on reporting this finding, because it illustrated that analyzing the changes in animal behaviour during recording does not necessarily reveal the same information than an investigation of the overall performance of this animal. Assuming that external stimuli led to unexplained variance in stops, these might carry less weight in the averaged behavioural trait No_stops, and the effect of the age in terms of lactation number became visible (Figure 4, top row). The significant differences in Total_time due to lactation number might be explained by dissimilar agility and experience of cows of different ages. The primiparous cows were less experienced and, thus, more uncertain of the situation. They probably acted more hesitantly which led to a reduced total time compared to cows in their second to third lactation. The individual walking speed of younger cows might have been higher than that of animals in the fourth or fifth lactation due to juvenile energy and, because less pregnancies strained the locomotor system.

When it came to the effects of cow behaviour on the calculated “udder depth” and its measurement precision, significant dependency of SEUD on Avoid_time and Run_time, i.e. cow wise averaged avoidance and runtime, was observed. The standard error SEUD served as a measure of precision in the determination of cow wise averaged “udder depth” UD, whereat low SEUD 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 SEUD increased with increasing Avoid_time and decreased with increasing Run_time (Figure 4, bottom row). A reason for this might be that Avoid_time did not only depend on walking speed but a high Avoid_time corresponded to cows that were trying to avoid passing the scanner. Reference [11] stated that the exit velocity after being held in squeeze chute was valuable for assessing temperament and stress responsiveness in animal handling events. Although cows were not held in a squeeze chute in the area Avoidance, the animals associated with high Avoid_time might have been more stressed out while passing the scanner. They might have started the passage at a higher speed which could have affected their posture and the homogeneity of their gate leading to suboptimal recordings of the udder. In the same way high Run_time values were not only caused by low walking speed but time spend standing within the Scanner passage also led to increased Run_time. In this way, udders might have been recorded in standstill which increased the quality of the recordings [31] and hence the measurement precision [32] [33] . In fitting the multiple linear regression model for UD and SEUD, 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 SEUD 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 Figure 5 supported this assertion. When it came to the behavioural traits, large differences in least square means between categories I and II in Avoid_time (Table 1) were observed for SEUD, 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 [19] . Least square means in SEUD 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 [34] and refilling, and occurrences of mastitis which affected the udder firmness [35] were more likely with increasing lactation number. Stretched tissue and less firm udders varied more strongly during animal movement and were less defined in shape, leading to reduced precision in object recognition as well as udder bottom definition and, thus, to reduced measurement precision in UD.

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.

5. Conclusion

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.

Cite this paper

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.


  1. 1. Berckmans, D. (2008) Precision Livestock Farming (PLF). Computers and Electronics in Agriculture, 62, 1.

  2. 2. Neethirajan, S. (2017) Recent Advances in Wearable Sensors for Animal Health Management. Sensing and Bio-Sensing Research, 12, 15-29.

  3. 3. Fournel, S., Rousseau, A.N. and Laberge, B. (2017) Rethinking Environment Control Strategy of Confined Animal Housing Systems through Precision Livestock Farming. Biosystems Engineering, 155, 96-123.

  4. 4. Snoek, D.J.W., Hofstee, J.W., van Dueren den Hollander, A.W., Vernooij, R.E., Ogink, N.W.M. and Groot Koerkamp, P.W.G. (2017) Quantification of Simulated Cow Urine Puddle Areas using a Thermal IR Camera. Computers and Electronics in Agriculture, 137, 23-28.

  5. 5. Weber, A., Salau, J., Haas, J.H., Junge, W., Bauer, U., Harms, J., Suhr, O., SchÖnrock, K., Rothfuß, H., Bieletzki, S. and Thaller, G. (2014) Estimation of Backfat Thickness using Extracted Traits from an Automatic 3D Optical System in Lactating Holstein-Friesian Cows. Livestock Science, 165, 129-137.

  6. 6. Meen, G.H., Schellekens, M.A., Slegers, M.H.M., Leenders, N.L.G., van Erp-van der Kooij, E. and Noldus, L.P.J.J. (2015) Sound Analysis in Dairy Cattle Vocalisation as a Potential Welfare Monitor. Computers and Electronics in Agriculture, 118, 111-115.

  7. 7. Kruse, L., Salau, J., Traulsen, I. and Krieter, J. (2012) Application of Wavelet Filtering to Analyze Acceleration Time Curves of Horses Trotted on Different Surfaces. Journal of Equine Veterinary Science, 32, 696-703.

  8. 8. Shahriar, S., Smith, D., Rahman, A., Freeman, M., Hills, J., Rawnsley, R., Henry, D. and Bishop-Hurley, G. (2016) Detecting Heat Events in Dairy Cows using Accelerometers and Unsupervised Learning. Computers and Electronics in Agriculture, 128, 20-26.

  9. 9. Van Hertem, T., Rooijakkers, L., Berckmans, D., Fernández, A.P., Norton, T., Berckmans, D. and Vranken, E. (2017) Appropriate Data Visualisation Is Key to Precision Livestock Farming Acceptance. Computers and Electronics in Agriculture, 138, 1-10.

  10. 10. Hesse, A., Bertulat, S. and Heuwieser, W. (2017) Survey of Work Processes on German Dairy Farms. Journal of Dairy Science, 100, 6583-6591.

  11. 11. Curley, K.O., Paschal, J.C., Welsh, T.H. and Randel, R.D. (2006) Technical Note: Exit Velocity as a Measure of Cattle Temperament Is Repeatable and Associated with Serum Concentration of Cortisol in Brahman Bulls. Journal of Animal Science, 84, 3100-3103.

  12. 12. Gibbons, J., Lawrence, A. and Haskell, M.J. (2009) Responsiveness of Dairy Cows to Human Approach and Novel Stimuli. Applied Animal Behaviour Science, 116, 163-173.

  13. 13. Café, L.M., Robinson, D.L., Ferguson, D.M., McIntyre, B.L., Geesink, G.H. and Greenwood, P.L. (2011) Cattle Temperament: Persistence of Assessments and Associations with Productivity, Efficiency, Carcass and Meat Quality Traits. Journal of Animal Science, 89, 1452-1465.

  14. 14. Haskell, M.J., Simm, G. and Turner, S.P. (2014) Genetic Selection for Temperament Traits in Dairy and Beef Cattle. Frontiers in Genetics, 5, 1-18.

  15. 15. Lindahl, C., Pinzke, S., Herlin, A. and Keeling, L.J. (2016) Human-Animal Interactions and Safety during Dairy Cattle Handling—Comparing Moving Cows to Milking and Hoof Trimming. Journal of Dairy Science, 99, 2131-2141.

  16. 16. MacKay, J.R.D., Haskell, M.J., Deag, J.M. and van Reenen, K. (2014) Fear Responses to Novelty in Testing Environments Are Related to Day-to-Day Activity in the Home Environment in Dairy Cattle. Applied Animal Behaviour Science, 152, 7-16.

  17. 17. Salau, J., Haas, J.H., Junge, W. and Thaller, G. (2016) Extrinsic Calibration of a Multi-Kinect Camera Scanning Passage for Measuring Functional Traits in Dairy Cows. Biosystems Engineering, 151, 409-424.

  18. 18. International Committee for Animal Recording (2015) Conformation Recording Dairy and Beef Cattle.

  19. 19. Salau, J., Haas, J.H., Junge, W. and Thaller, G. (2017) Automated Calculation of Udder Depth and Rear Leg Angle in Holstein-Friesian Cows using a Multi-Kinect Cow Scanning System. Biosystems Engineering, 160, 154-169.

  20. 20. Ihaka, R. and Gentleman, R. (1993) The R Project for Statistical Computing.

  21. 21. Olejnik, S. and Algina, J. (2000) Measures of Effect Size for Comparative Studies: Applications, Interpretations, and Limitations. Contemporary Educational Psychology, 25, 241-286.

  22. 22. Hays, W.L. (1973) Statistics for the Social Sciences. 2nd Edition, Holt, Rinehart & Winston of Canada, Vancouver.

  23. 23. Olejnik, S. and Algina, J. (2003) Generalized Eta and Omega Squared Statistics: Measures of Effect Size for Some Common Research Designs. Psychological Methods, 8, 434-447.

  24. 24. Webb, L.E., van Reenen, C.G., Bak Jensen, M., Schmitt, O. and Bokkers, E.A. (2015) Does Temperament Affect Learning in Calves? Applied Animal Behaviour Science, 165, 33-39.

  25. 25. Brambor, T., Clark, W.R. and Golder, M. (2006) Understanding Interaction Models: Improving Empirical Analyses. Political Analysis, 14, 63-82.

  26. 26. Veissier, I. (1993) Observational Learning in Cattle. Applied Animal Behaviour Science, 35, 235-243.

  27. 27. Charlton, G.L., Rutter, S.M., East, M. and Sinclair, L.A. (2013) The Motivation of Dairy Cows for Access to Pasture. Journal of Dairy Science, 96, 4387-4396.

  28. 28. Hirata, M., Tomita, C. and Yamada, K. (2016) Use of a Maze Test to Assess Spatial Learning and Memory in Cattle: Can Cattle Traverse a Complex Maze? Applied Animal Behaviour Science, 180, 18-25.

  29. 29. Veissier, I., Andanson, S., Dubroeucq, H. and Pomiès, D. (2008) The Motivation of Cows to Walk as Thwarted by Tethering. Journal of Animal Science, 86, 2723-2729.

  30. 30. Cohen, J. (1988) Statistical Power Analysis for the Behavioral Sciences. 2nd Edition, Lawrence Erlbaum Associates, Hillsdale, NJ.

  31. 31. Andersen, M.R., Jensen, T., Lisouski, P., Mortensen, A.K., Hansen, M.K., Gregersen, T. and Ahrent, P. (2012) Kinect Depth Sensor Evaluation for Computer Vision Applications (Technical Report No. ECE-TR6). Aarhus University, Aarhus.

  32. 32. Salau, J., Bauer, U., Haas, J.H., Thaller, G., Harms, J. and Junge, W. (2015) Quantification of the Effects of Fur, Fur Color, and Velocity on Time-of-Flight Technology in Dairy Production. SpringerPlus, 4, 1-14.

  33. 33. Salau, J., Haas, J.H., Junge, W. and Thaller, G. (2017) A Multi-Kinect Cow Scanning System: Calculating Linear Traits from Manually Marked Recordings of Holstein-Friesian Dairy Cows. Biosystems Engineering, 157, 92-98.

  34. 34. Bobic, T., Mijic, P., Gantner, V., šperanda, M. and Gregic, M. (2016) Machine-Induced Changes on Cow’s Udder Tissue. Stockbreeding: Journal of Animal Improvement, 1, 25-32.

  35. 35. Rees, A., Fischer-Tenhagen, C. and Heuwieser, W. (2017) Udder Firmness as a Possible Indicator for Clinical Mastitis. Journal of Dairy Science, 100, 2170-2183.