Data-Driven Risk Scoring for Dairy Farm Compliance Using Multimodal Sensor Streams and Federated Analytics
DOI:
https://doi.org/10.63646/VRHQ7625Keywords:
Dairy compliance monitoring; Risk scoring; Federated learning; Multimodal sensor fusion; Graph attention network; Differential privacy; Internet of Things; Precision livestock farmingAbstract
Continuous compliance monitoring in dairy farming remains impeded by episodic inspection protocols and fragmented sensor data management. This paper proposes FedRS, a data-driven composite risk scoring framework that integrates multimodal sensor streams—body temperature, accelerometer-derived activity patterns, ambient ammonia concentration, and milk pH—through attention-weighted late fusion and gradient-boosted risk scoring to produce a continuous probability-of-violation signal at five-minute inference intervals. Risk scores are computed on-device at farm nodes and aggregated across heterogeneous farm populations through a privacy-preserving federated analytics protocol incorporating Graph Attention Network (GAT)-based cluster formation, DBSCAN outlier exclusion, and DP-SGD differential privacy. Evaluated on a 20-farm federated simulation derived from the Shahhet28121 livestock dataset, FedRS achieves 94.7% classification accuracy, 0.967 AUC-ROC, and a false-negative compliance violation rate of 1.9%, outperforming standard FedAvg by 3.4 percentage points while reducing per-round communication overhead by 97.7% to 4.25 KB. The framework maintains accuracy above 90% under sensor noise levels up to σ = 0.20, and ablation analysis confirms that GAT-based cluster-aware aggregation is the dominant performance driver. FedRS provides a technically rigorous, privacy-preserving, and communication-efficient foundation for automated dairy compliance monitoring systems compatible with low-bandwidth rural IoT deployments.
How to Cite
References
Abadi, M., Chu, A., Goodfellow, I., McMahan, H. B., Mironov, I., Talwar, K., & Zhang, L. (2016). Deep learning with differential privacy. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, 308–318. https://doi.org/10.1145/2976749.2978318
Altman, E. I. (1968). Financial ratios, discriminant analysis and the prediction of corporate bankruptcy. Journal of Finance, 23(4), 589–609. https://doi.org/10.1111/j.1540-6261.1968.tb00843.x
Arcidiacono, C., Porto, S. M. C., Mancino, M., & Cascone, G. (2017). Development of a threshold-based classifier for real-time recognition of cow feeding and standing behavioural activities from accelerometer data. Computers and Electronics in Agriculture, 134, 124–134. https://doi.org/10.1016/j.compag.2017.01.021
Bhanja, S., & Das, A. (2018). Impact of data normalization on deep neural network for time series forecasting. arXiv preprint arXiv:1812.05519. https://doi.org/10.48550/arXiv.1812.05519
Cavero, D., Tölle, K. H., Henze, C., Buxadé, C., & Krieter, J. (2008). Mastitis detection in dairy cows by application of neural networks. Livestock Science, 114(2–3), 280–286. https://doi.org/10.1016/j.livsci.2007.05.012
Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794. https://doi.org/10.1145/2939672.2939785
De Mol, R. M., & Woldt, W. E. (2001). Application of fuzzy logic in automated cow status monitoring. Journal of Dairy Science, 84(2), 400–410. https://doi.org/10.3168/jds.S0022-0302(01)74490-6
Diao, E., Ding, J., & Tarokh, V. (2021). HeteroFL: Computation and communication efficient federated learning for heterogeneous clients. International Conference on Learning Representations. https://doi.org/10.48550/arXiv.2010.01264
Dwork, C., & Roth, A. (2014). The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science, 9(3–4), 211–487. https://doi.org/10.1561/0400000042
FAO. (2022). The State of Food and Agriculture 2022. Food and Agriculture Organization of the United Nations. https://doi.org/10.4060/cb9479en
Garro, R. J., Wilson, C. S., Swain, D. L., Pordomingo, A. J., & Wibowo, S. (2025). A systematic literature review on the applications of federated learning and enabling technologies for livestock management. Computers and Electronics in Agriculture, 234, 110180. https://doi.org/10.1016/j.compag.2025.110180
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press. https://www.deeplearningbook.org/
Haas, C. N., Rose, J. B., & Gerba, C. P. (2014). Quantitative Microbial Risk Assessment (2nd ed.). Wiley. https://doi.org/10.1002/9781118910030
Hamilton, W. L., Ying, R., & Leskovec, J. (2017). Inductive representation learning on large graphs. Advances in Neural Information Processing Systems, 30. https://doi.org/10.48550/arXiv.1706.02216
Kamble, S. S., Gunasekaran, A., & Sharma, R. (2020). Modeling the blockchain enabled traceability in agriculture supply chain. International Journal of Information Management, 52, 101967. https://doi.org/10.1016/j.ijinfomgt.2019.05.023
Kamphuis, C., Sherlock, R., Jago, J., Mein, G., & Hogeveen, H. (2008). Automatic detection of clinical mastitis is improved by in-line monitoring of somatic cell count. Journal of Dairy Science, 91(12), 4560–4570. https://doi.org/10.3168/jds.2008-1160
Knaus, W. A., Draper, E. A., Wagner, D. P., & Zimmerman, J. E. (1985). APACHE II: A severity of disease classification system. Critical Care Medicine, 13(10), 818–829. https://doi.org/10.1097/00003246-198510000-00009
Konečný, J., McMahan, H. B., Ramage, D., & Richtárik, P. (2016). Federated optimization: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527. https://doi.org/10.48550/arXiv.1610.02527
Koutsoumanis, K., Lambropoulou, K., & Nychas, G.-J. E. (1999). A predictive model for the non-thermal inactivation of Salmonella enteritidis in a food model system supplemented with a natural antimicrobial. International Journal of Food Microbiology, 49(1–2), 63–74. https://doi.org/10.1016/S0168-1605(99)00054-9
LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539
Li, T., Sahu, A. K., Zaheer, M., Sanjabi, M., Talwalkar, A., & Smith, V. (2020). Federated optimization in heterogeneous networks. Proceedings of Machine Learning and Systems, 2, 429–450. https://doi.org/10.48550/arXiv.1812.06127
Liakos, K. G., Busato, P., Moshou, D., Pearson, S., & Bochtis, D. (2018). Machine learning in agriculture: A review. Sensors, 18(8), 2674. https://doi.org/10.3390/s18082674
McMahan, H. B., Moore, E., Ramage, D., Hampson, S., & Agüera y Arcas, B. (2017). Communication-efficient learning of deep networks from decentralized data. Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, 54, 1273–1282. https://doi.org/10.48550/arXiv.1602.05629
Motarjemi, Y., Moy, G., & Todd, E. (Eds.). (2014). Encyclopedia of Food Safety. Academic Press. https://www.sciencedirect.com/science/referenceworks/9780123786135
Ngiam, J., Khosla, A., Kim, M., Nam, J., Lee, H., & Ng, A. Y. (2011). Multimodal deep learning. Proceedings of the 28th International Conference on Machine Learning, 689–696. https://ai.stanford.edu/~jngiam/papers/NgiamKhoslaKimNamLeeNg2011.pdf
Qu, Y., Pokhrel, S. R., Garg, S., Gao, L., & Xiang, Y. (2021). A blockchained federated learning framework for cognitive computing in industry 4.0 networks. IEEE Transactions on Industrial Informatics, 17(4), 2964–2973. https://doi.org/10.1109/TII.2020.3007817
Rieke, N., Hancox, J., Li, W., Milletari, F., Roth, H. R., Albarqouni, S., Bakas, S., Galtier, M. N., Landman, B. A., Maier-Hein, K., Ourselin, S., Sheller, M., Summers, R. M., Trask, A., Xu, D., Baust, M., & Cardoso, M. J. (2020). The future of digital health with federated learning. npj Digital Medicine, 3(1), 119. https://doi.org/10.1038/s41746-020-00323-1
Sattler, F., Müller, K.-R., & Samek, W. (2021). Clustered federated learning: Model-agnostic distributed multitask optimization under privacy constraints. IEEE Transactions on Neural Networks and Learning Systems, 32(8), 3710–3722. https://doi.org/10.1109/TNNLS.2020.3015958
Schaefer, A. L., Cook, N., Tessaro, S. V., Deregt, D., Desroches, G., Dubeski, P. L., Tong, A. K. W., & Godson, D. L. (2004). Early detection and prediction of infection using infrared thermography. Canadian Journal of Animal Science, 84(1), 73–80. https://doi.org/10.4141/A02-104
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., & Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30. https://doi.org/10.48550/arXiv.1706.03762
Veličković, P., Cucurull, G., Casanova, A., Romero, A., Liò, P., & Bengio, Y. (2018). Graph attention networks. International Conference on Learning Representations. https://doi.org/10.48550/arXiv.1710.10903
Wu, F., Groopman, J. D., & Pestka, J. J. (2014). Public health impacts of foodborne mycotoxins. Annual Review of Food Science and Technology, 5, 351–372. https://doi.org/10.1146/annurev-food-030713-092431
Xiao, Y., Zhang, N., Li, J., Lou, W., & Hou, Y. T. (2020). PrivacyGuard: Enforcing private data usage control with blockchain and attested off-chain contract execution. In L. Chen, N. Li, K. Liang, & S. Schneider (Eds.), Computer Security – ESORICS 2020 (Lecture Notes in Computer Science, Vol. 12309, pp. 610–629). Springer. https://doi.org/10.1007/978-3-030-59013-0_30
Zhao, Y., Li, M., Lai, L., Suda, N., Civin, D., & Chandra, V. (2018). Federated learning with non-IID data. arXiv preprint arXiv:1806.00582. https://doi.org/10.48550/arXiv.1806.00582
Zhu, H., Xu, J., Liu, S., & Jin, Y. (2021). Federated learning on non-IID data: A survey. Neurocomputing, 465, 371– 390. https://doi.org/10.1016/j.neucom.2021.07.098