Predicting methane emission in Canadian Holstein dairy cattle using milk mid-infrared reflectance spectroscopy and other commonly available predictors via artificial neural networks

J Dairy Sci. 2022 Oct;105(10):8272-8285. doi: 10.3168/jds.2021-21176. Epub 2022 Aug 31.


Interest in reducing eructed CH4 is growing, but measuring CH4 emissions is expensive and difficult in large populations. In this study, we investigated the effectiveness of milk mid-infrared spectroscopy (MIRS) data to predict CH4 emission in lactating Canadian Holstein cows. A total of 181 weekly average CH4 records from 158 Canadian cows and 217 records from 44 Danish cows were used. For each milk spectra record, the corresponding weekly average CH4 emission (g/d), test-day milk yield (MY, kg/d), fat yield (FY, g/d), and protein yield (PY, g/d) were available. The weekly average CH4 emission was predicted using various artificial neural networks (ANN), partial least squares regression, and different sets of predictors. The ANN architectures consisted of 3 training algorithms, 1 to 10 neurons with hyperbolic tangent activation function in the hidden layer, and 1 neuron with linear (purine) activation function in the hidden layer. Random cross-validation was used to compared the predictor sets: MY (set 1); FY (set 2); PY (set 3); MY and FY (set 4); MY and PY (set 5); MY, FY, and PY (set 6); MIRS (set 7); and MY, FY, PY, and MIRS (set 8). All predictor sets also included age at calving and days in milk, in addition to country, season of calving, and lactation number as categorical effects. Using only MY (set 1), the predictive accuracy (r) ranged from 0.245 to 0.457 and the root mean square error (RMSE) ranged from 87.28 to 99.39 across all prediction models and validation sets. Replacing MY with FY (set 2; r = 0.288-0.491; RMSE = 85.94-98.04) improved the predictive accuracy, but using PY (set 3; r = 0.260-0.468; RMSE = 86.95-98.47) did not. Adding FY to MY (set 4; r = 0.272-0.469; RMSE = 87.21-100.76) led to a negligible improvement compared with sets 1 and 3, but it slightly decreased accuracy compared with set 2. Adding PY to MY (set 5; r = 0.250-0.451; RMSE = 87.66-100.94) did not improve prediction ability. Combining MY, FY, and PY (set 6; r = 0.252-0.455; RMSE = 87.74-101.93) yielded accuracy slightly lower than sets 2 and 3. Using only MIRS data (set 7; r = 0.586-0.717; RMSE = 69.09-96.20) resulted in superior accuracy compared with all previous sets. Finally, the combination of MIRS data with MY, FY, and PY (set 8; r = 0.590-0.727; RMSE = 68.02-87.78) yielded similar accuracy to set 7. Overall, sets including the MIRS data yielded significantly better predictions than the other sets. To assess the predictive ability in a new unseen herd, a limited block cross-validation was performed using 20 cows in the same Canadian herd, which yielded r = 0.229 and RMSE = 154.44, which were clearly much worse than the average r = 0.704 and RMSE = 70.83 when predictions were made by random cross-validation. These results warrant further investigation when more data become available to allow for a more comprehensive block cross-validation before applying the calibrated models for large-scale prediction of CH4 emissions.

Keywords: Holstein cows; machine learning; methane; mid-infrared spectroscopy.

MeSH terms

  • Animals
  • Canada
  • Cattle
  • Female
  • Lactation* / metabolism
  • Methane / metabolism
  • Milk* / chemistry
  • Neural Networks, Computer
  • Purines
  • Spectrophotometry, Infrared / veterinary


  • Purines
  • Methane