Empowering Dairy Farmers: A Transformer-Based Framework for Informed Decision Making in Dairy Agriculture

Authors: V. Naghashi and M. Boukadoum and A. B. Diallo

Date: 2024-07-01

Status: Published

View External Publication


In precision livestock, the decision of animal replacement requires an estimation of the lifetime profit of the animal based on multiple factors and operational conditions. In dairy farms, this can be associated with the milk income corresponding to milk production, health condition and herd management costs, which in turn may be a function of other factors including genetics and weather conditions. Estimating the cumulative income from a cow's milk production can be posed as a multivariate time-series prediction task where a late-milk income of a cow can be predicted based on early dairy factors recorded in a sequence of time-steps (lactation months). Furthermore, the predicted milk income would serve as an input to a decision making system for deciding whether to keep or remove an animal in the next lactation period. In this work, a Transformer based model is proposed to predict the cumulative dairy income over the incoming lactation period and further a recommendation procedure is devised for decision making in order to reduce the farmers cost and save their time. In the Transformer, both temporal and inter-variable correlations are captured thanks to the temporal and spatial multi-head attention modules. The proposed framework is assessed using 47749 dairy cows corresponding to more than 5000 herds and the results are compared with the other state-of-the-art models. Our Transformer model outperforms the previous baselines and provides a promising prediction performance with the highest accuracy of 76%, opening the way of better resource management in the dairy industry.