Modelling greenhouse gas emissions from dairy farms through unsupervised learning

MacKenzie, Jack and Stankovic, Vladimir and Stankovic, Lina and Kuhnert, Matthias (2026) Modelling greenhouse gas emissions from dairy farms through unsupervised learning. In: AIBIO-UK 3rd Annual Conference 2026, 2026-06-08 - 2026-06-09, King’s College Conference Centre, University of Aberdeen.

[thumbnail of MacKenzie-etal-AIBIO-UK-2026-Modelling-greenhouse-gas-emissions-from-dairy]
Preview
Text. Filename: MacKenzie-etal-AIBIO-UK-2026-Modelling-greenhouse-gas-emissions-from-dairy.pdf
Accepted Author Manuscript
License: Creative Commons Attribution 4.0 logo

Download (1MB)| Preview

Abstract

Reducing greenhouse gas (GHG) emissions in agriculture is essential to meeting net-zero targets, yet the sector remains a major contributor: livestock systems occupy approximately 30% of global nonfrozen land, and the food supply chain is estimated to have produced ~13.7 billion tonnes of CO₂ annually. In the UK, there's been a massive decrease in CH4 and N2O emissions but an increase in CO2 emissions within the agriculture sector due to land management, inorganic fertilisation, deforestation, fuel and machinery since 1990. Existing tools for farm-level GHG emission assessment typically rely on coarse annual data or require detailed monitoring that is time consuming, motivating the development of scalable, data-driven approaches using readily available inputs such as smart meter data, weather, livestock, and farm characteristics. This paper presents an unsupervised machine learning framework to derive representative daily energy profiles for dairy farms, linking electricity import/export behaviour to environmental drivers. Half-hourly data between 01/01/2021–29/11/2024 from a UK dairy farm with on-site hydroelectric generation is analysed. K-means clustering is applied to identify typical load and generation patterns, with cluster selection informed by cluster quality metrics and effect size–based evaluation (η²) to quantify associations between cluster membership and weather variables (precipitation, temperature, wind speed). Analysis shows a strong relationship between precipitation and on-site generation, with lower rainfall associated with reduced hydro output. While standard metrics suggest k = 2–3 clusters, η² analysis supports a higher resolution (k ≈ 7) to better capture weather-driven variability. Precipitation is most explanatory when modelled with a one-day lag, reflecting delayed hydrological response. Temperature contributes to shaping demand profiles, likely due to heating and refrigeration processes, whereas wind speed exhibits limited influence. These findings demonstrate the potential to generate farm-specific energy and GHG weighting factors using accessible data. Future work will extend validation across diverse farm types enabling informed economic decisions.

ORCID iDs

MacKenzie, Jack, Stankovic, Vladimir ORCID logoORCID: https://orcid.org/0000-0002-1075-2420, Stankovic, Lina ORCID logoORCID: https://orcid.org/0000-0002-8112-1976 and Kuhnert, Matthias;