Validation of an alternate method for monitoring the presence of cows at the feed bunk in a Calan Broadbent Feeding System using a 3-axis, data-logging accelerometer

Graphical Abstract Summary: A method was developed using a 3-axis accelerometer to detect cow presence at the bunk in a Calan Broadbent feeding system to characterize feeding behavior. The sensor was at 0° when the door was closed and near 60° when the door was open, allowing clear distinction of the presence of a cow at the feed bunk, in very high agreement with visual observations. In conclusion, accelerometers provided robust monitoring of the presence of cows in the feed gate in the Calan Broadbent feeding system, and this approach allows for economical and reasonable observation of feeding behavior.

D aily DMI is a key observation in dairy nutrition and is a function of the number and size of meals that is the result of hunger and satiety signals that vary across the day (Allen, 2014).
Monitoring feeding behavior provides an understanding of the physiological controls of feed intake in dairy cattle (Allen, 2014). Furthermore, the number of meals per day has been shown to be positively associated with milk fat yield and tends to be associated with DMI and milk production in lactating dairy cows (Johnston and DeVries, 2018). The timing of feed intake across the day is also important in the entrainment of central and peripheral circadian rhythms in lactating dairy cows, including regulation of the mammary gland (Niu et al., 2014;Salfer and Harvatine, 2020). The Calan Broadbent Feeding System (American Calan) is commonly used to observe individual DMI in group-housed cows, but it does not allow observation of feeding behavior without modification by installation of change-of-state sensors or labor-intensive visual observation methods (Vasilatos and Wangsness, 1980;Krawczel et al., 2012).
Feeding behavior observation systems are available for grouphoused animals, but they vary in complexity and cost. Time-lapse video photography has been validated to monitor feeding behavior in lactating dairy cows (Vasilatos and Wangsness, 1980;Overton et al., 2002) but requires considerable time and labor for data processing. Automated commercial monitoring systems, such as the GrowSafe (GrowSafe Systems; Mendes et al., 2011) or RIC-2Discover (Hokofarm Group;Chapinal et al., 2007), are available, and custom systems can be built (Bach et al., 2004) but require a substantial investment. Krawczel et al. (2012) utilized a change-of-state sensor to monitor door position in Calan Broadbent doors to observe feeding behavior. Based on this principle, we report an alternative method using a 3-axis accelerometer data logger to measure the degree of tilt of the sensors as a proxy of when the cow is in the Calan gate (i.e., feeding door is open) and subsequently estimate meal characteristics such as frequency and length. The first objective of the study was to develop and validate an alternative method to observe feeding behavior in a Calan Broadbent Feeding System based on the movement of the feeding door using the HOBO Pendant G data logger (Onset Computer Corp.). These accelerometers are commonly used to measure lying time and behavior in cows (Ledgerwood et al., 2010) and calves (Costa et al., 2021), thus providing multiple applications after their purchase. The second objective was to determine the minimum intermeal interval, also known as meal criterion. The minimum intermeal interval is used to define when 2 feeding events are considered to be a single meal or 2 separate meals.
A HOBO Pendant G accelerometer was hung between the feeding door and the divider between feed bunks. Specifically, a sensor Validation of an alternate method for monitoring the presence of cows at the feed bunk in a Calan Broadbent Feeding System using a 3-axis, data-logging accelerometer Cesar Matamoros, Rebecca A. Bomberger, and Kevin J. Harvatine* bracket was made from approximately 8-cm-long pieces of 5.1-cmdiameter schedule 40 polyvinyl chloride (PVC) construction pipe. The pipe was cut into 3 pieces through the transverse plane ( Figure  1A). A hole was drilled at each end for attachment to the door and feed divider and in the middle to attach the sensor. The sensor was attached to the PVC pipe piece with nylon cable ties and an elastic band was placed at one end ( Figure 1A). A 25.4 mm × 25.4 mm self-adhesive nylon cable tie mounting pad was adhered approximately to the center of the upper edge of the fiberglass door of the feeding system ( Figure 1B-1). A 6.3 mm × 50.8 mm zinc-plated steel eye bolt was fixed approximately perpendicular to the mounting pad in the right lateral wood panel of each feed bunk ( Figure  1B-5) and the sensor bracket was loosely attached with a nylon cable tie. A braided nylon string ( Figure 1B-2) was used to tie the sensor bracket ( Figure 1B-4) from the elastic band ( Figure 1B-3) to the cable tie mounting pad. When tying the sensor system, the tension was set to be lower than the tension of the spring that closes the fiber glass door in the feeding system to prevent interference with closure of the door. Sensors were checked twice daily to correct visible sag due to loss of tension and ensure the sensors stayed in position. Sensors were programmed to record position in all 3 axes every 30 s to allow calculation of tilt angle.
All experimental procedures were approved by The Pennsylvania State University Institutional Animal Care and Use Committee (PROTO201900784). Twenty-four multiparous and 24 primiparous cows were arranged in a crossover design in a concurrent trial investigating the interaction between genetic polymorphisms and dietary acetate supplementation (data not shown). Cows were housed in a freestall barn at the Pennsylvania State University Dairy Production Research and Teaching Center equipped with a Calan Broadbent Feeding System. Cows were milked twice daily at 0600 and 1800 h and fed once daily at approximately 0800 h. Cows were locked out of the feed alleyway at 0500 h daily to allow for cleaning and weighing orts. Cows were also restricted from accessing the bunks upon return from morning milking until all bunks had feed to prevent a bias in the data caused by anticipatory behavior while feed was being delivered to the bunks. Experimental periods were 14 d with a 10-d washout period in between, and the sensors were set up during the last 7 d of each experimental period and installed while cows were out of the pen for milking.
Recording was programmed to start before feeding on the first day of deployment and terminated after retrieval on the last day of each period. The sensors' recording missions were set up using the same computer in all instances to synchronize timestamps of each recorded observation (Dell Latitude E5570 with Windows 10 Education ver. 21H1 with United States regional settings and UTC-05:00 as the local time zone). Two sensors malfunctioned during one of the observation periods, resulting in complete data loss (likely battery failure). A total of 11 d of data were lost because of sensors becoming detached from the Calan feeding door. The sensors were not accessible to the cows, and malfunctions were not caused by interference of the cows.
Data were downloaded from each sensor and plotted with HOBOware ver. 3.7.20 (Onset Computer Corp.) to visually assess data viability. Tilt angle at each axis was automatically calculated [tilt angle = 180° -ArcCos (acceleration in g)]. Sensor setup was designed to best capture the movement of the door on the Z-axis, thus the tilt at the Z-axis was exported. It is important to note that the sensor has the capability of measuring tilt angle on all 3 axes, thus the setup can be adapted to capture the movement of the door in other axes if needed. The data from each sensor were then divided into experimental days as the 24-h period between feed delivery (i.e., approximately between 0500 h of adjacent days) using the subset function in R ver. 4.0.1 (https: / / www .r -project .org/ ).
A minimum Z-tilt angle threshold was used to determine when the door was opened or closed. By design, when the door was The sensor is strung between the door feeding divider. It is attached to the door using a self-adhesive nylon cable tie mounting pad (1), and a braided nylon string (2) is fastened to the rubber band (3) attached to the sensor support (4). The sensor support is then loosely attached with a nylon zip tie to a zinc-plated steel eye bolt (5) in the wood wall of the feed bunk. Scale bars were added using ImageJ 1.53e (https: / / imagej .nih .gov/ ij/ ). closed, the sensor read ~0° Z-tilt angle and when fully open, it read >60° Z-tilt angle ( Figure 1A). A threshold of 30° was used to define an open door to account for when the sensor sagged during the observation period. Using a threshold of 30° did not exclude events in which the cows were eating in the bunk, as the feed was inaccessible in this position. Furthermore, the first 3 bins of the count distribution of all raw Z-tilt angles >0° are most likely Z-tilt observations of a closed door with a sensor contraption that has sagged or a sensor that was not near 0° in its resting state ( Figure  1B). When the first 3 bins were ignored, 30° was below the 2.5th percentile of the distribution. Thus, when the sensor read a Z-tilt angle <30°, the measurement was coded as "0" to represent that the door was closed; if the sensor read ≥30°, it was coded as "1" to represent that the door is open in a new column created with the "mutate" function in the dplyr package in R (Hadley et al., 2020). The running series of consecutive annotations was then calculated with the "streak_run" function in the runner package in R (Kaledkowski, 2020) to calculate the between-feeding intervals. An annotated sample of the R code used to process the data is available at the "Door Sensor Feeding Behavior" public GitHub repository (https: / / github .com/ cesarimg/ HarvatineLab .git) or upon request to the corresponding author.
The sensor system was validated by comparison with visual feeding behavior monitoring. Briefly, the sensors were set up as described above in 48 Calan Broadbent doors, and recording was programmed to record an observation in all 3 axes once per second to allow calculation of tilt angle. Tilt angle on the Z-axis was used as above to determine whether the door was open or closed. Three trained observers manually recorded (in Google Docs) whether the doors were closed or open due to feeding activity for 6 h starting immediately after morning feeding (0800 h) for 1 d. Average recording frequency for the visual observations was 1 visual observation every 2 min and 50 s. A time stamp was automatically recorded with entry of each observation, and data from the sensor and visual observations were aligned based on the time stamps. The mode of the 5 previous and following sensor observations was used to correct for any disturbances to the cow's behavior from the observer's presence and movement in the barn. Cohen's κ was calculated using the frequency of open-close determination by both methods to test the agreement between them, as described by Watson and Petrie (2010; Figure 1C). The calculated κ value was 0.92 ± 0.014 (estimate ± 95% CI), suggesting very high agreement between methods. The positive predictive value of the sensors, which is the probability of the measurement of an open state by the sensor being correct, was 98%. The negative predictive value of the sensors, which is the probability of the measurement of a closed state being correct, was 97%. Therefore, the sensor system accurately determines the state of the door compared with visual observations. It is important to note that the system was validated for observation of the presence of a cow in the feeding gate, not that the cow was eating. Future work should further validate time at the feed bunk with eating.
To characterize meals in feeding behavior analysis, it is necessary to determine a minimum intermeal interval, also known as the meal criterion, which is the minimum length required between 2 feeding bouts to be considered separate events. Calculating this criterion is important because it directly affects characterization of meals. The minimum intermeal interval differs between feeding systems and was determined by fitting multiple normal distributions to the log-transformed intervals, as described by Tolkamp et al. (2011). The normal distributions were fit using the continuous fit mode in the distribution module of JMP Pro 14.3.0 (SAS Institute Inc.). Two and 3 normal distribution models were fit, and the best fit was determined by the lowest value of maximum likelihood and corrected Akaike's and Bayesian information criteria (AICc and BIC, respectively; Schwarz, 1978;Sugiura, 1978). The minimum intermeal interval was defined as the point at which the Gaussian probability density functions intersect (C), which was calculated using a derivative of the quadratic formula as in Anderson et al. (2009), using the distribution parameters if µ µ 1 2 < and σ σ 1 2 ≠ : where μ 1 and σ 1 and μ 2 and σ 2 are the mean (μ) and standard deviation (σ) of the utmost right distributions in the data. Meal length was calculated as the summation of intervals between events where the door was closed for more than the minimum intermeal interval. Meal frequency was calculated by cow within day by calculating the running series of meals within days as above. Distribution analysis for meal length and frequency was done in JMP PRO 15.0.0 (SAS Institute Inc.). The sensors were not observed to interfere with normal operation of the door. The design is minimally intrusive and does not permanently modify the door system. The sensors did sag slightly over time with approximately 5% of the data points (approximately 83,000 observations from a total of ~1.5 million observations) resulting in Z-tilt between 0° and 30°, but sufficient dynamics between open and closed remained to allow analysis. It is recommended that the sensors be monitored during experiments and tightened if needed.
Defining the minimum intermeal interval is essential to determining meals. There was a considerable number of "door closed" intervals less than 2 min in the raw data (10,974 intervals of a total 17,468 intermeal intervals or ~63% of observed intervals). These were omitted when fitting the normal distributions to define a minimal intermeal interval because it has been characterized to be at least 8 min in other systems (Dado and Allen, 1993;Niu et al., 2017). Additionally, tilt angle was only observed every 30 s, and some of the intervals are expected to be less than 30 s. Adequately characterizing the distribution of short intermeal intervals would require a smaller recording frequency than that of the shortest expected interval (Tolkamp et al., 1998). The sensors allow for higher recording frequencies (up to recordings every second), but have limited memory so data must be downloaded more often. Fill time of the sensor's memory is a function of how many axes are being logged and the recording frequency (number of samples/s), and can be estimated with the following equation: where memory size is approximately 65 kB and the typical output header size is 500 kB (Onset Computer Corp., 2013). Thus, increasing the recording frequency of the sensors should be weighted by the amount of time desired for observation. The selected 30-s resolution allowed collection of 7.5 d of data and was 1.5% of the estimated minimum intermeal intervals, indicating sufficient resolution for characterization of meal bouts.
In characterizing the minimum intermeal interval, the distribution that best fit the log-transformed intervals was a mixture of 3 Gaussian distributions 729.3,AICc = 20,745.3,and BIC = 20,799.5; Figure 2B). Using the intersection of the last 2 distributions (μ 1 = 6.34, σ 1 = 0.61, μ 2 = 8.77, σ 2 = 0.63), the minimum intermeal interval was calculated to be approximately 31.3 min, which is similar to that reported for cows in free housing [DeVries et al. (2003) reported 27.7 min, Huzzey et al. (2005) reported 33.3 min, DeVries et al. (2007 reported 26 min, Tolkamp et al. (2011) reported 30 min, and Moore and DeVries (2020) reported an average of 29.7 min]. The interval in grouphoused cows appears to be substantially different from that in tie stalls, as Dado and Allen (1993) reported a minimum intermeal interval of 7.5 min for electronic observations based on a chew halter and variation in a hanging feed tub, and Niu et al. (2017) reported a minimum meal interval of 8 min using feed tubs suspended from load monitors in tie stall-housed cows. The minimum intermeal interval in the current project was consistent when considering the second-best fitting distribution, a mixture of 2 Gaussian distributions 160.5,AICc = 21,170.5,and BIC = 21,204.4; Figure 2B), which resulted in a minimum intermeal interval of 27.4 min (μ 1 = 5.97, σ 1 = 0.69, μ 2 = 8.75, σ 2 = 0.65). The distribution clusters are most likely characterizing the inter-and intrameal intervals and pauses taken from eating to drink water (Tolkamp et al., 2011).
Using the minimum intermeal interval of 31.3 min, the computed meal length averaged 37.3 ± 28 min with 10th and 90th percentiles of 11 and 78 min/meal, respectively. Meal frequency averaged 7.3 ± 1.4 meals/d with 10th and 90th percentiles of 6 and 9 meals/d, respectively (mean ± SD for both; Figure 3). This agrees with DeVries et al. (2007) and Moore and DeVries (2020) for cows housed in similar conditions. Feeding behavior analysis also commonly uses a defined minimum meal size or length. Sensitivity analysis has shown that the calculated DMI accounted for by feeding behavior systems decreases as the minimum meal size and length criteria increase (Heinrichs and Conrad, 1987). To the best of our knowledge, there is no published objective methodology to determine minimum meal size or length. Authors usually rely on subjective predetermined thresholds such as a minimum meal size (as-fed basis) of 1 kg and a minimum meal length of 30 s (see, for example, Harvatine and Allen, 2006). Minimum meal length, the secondary criterion for the described system, has not been reported to our knowledge. The frequency distribution did not appear to include multiple clear populations precluding use of modeling multiple distributions similar to the minimum intermeal interval. In total, 0.42% of meals were 30 s or less, 0.79% were less than 60 s, and 1.61% were 120 s or less. Meals that had a length of 30 s were excluded from the final analysis (total of 15 out of 3,537 meals) because there was no way to confirm whether the cow was in the bunk for the entirety of the 30 s, effectively making our minimum meal length criteria of >30 s. Future work should be conducted to determine a physiologically relevant minimum meal length.  Frequency distribution of the log-transformed between-feeding intervals divided by bin width (0.5 log e -units; gray bars) and the fit of a probability density function containing a mixture of 2 (red line) or 3 (black line) Gaussian distributions.
In conclusion, a data-logging 3-axis accelerometer is adequate to monitor feeding behavior in Calan Broadbent Feeding System similar to that previously validated using a change-of-state sensor. When validated against manual observations, the sensor system was in very high agreement with manual observations. The minimum intermeal interval of ~30 min agrees with previous reports in freestall-housed lactating dairy cows and allows for reasonable estimations of meal length and frequency. The design uses commonly available components and minimal setup and labor and should serve as a blueprint that future users can modify or improve to suit other specific constraints. This will allow collection of important information on the effect of treatments on feeding behavior in experiments using the Calan Broadbent Feeding System. Matamoros et al. | Feeding observation in Calan gates