Graph-Attention Federated Analytics for Non-IID Dairy Farm Monitoring and Compliance Prediction
DOI:
https://doi.org/10.63646/AQEC8238Keywords:
federated learning, graph attention network, non-IID data, dairy farm monitoring, compliance prediction, edge intelligence, Byzantine resilience, sensor fusionAbstract
Dairy farm monitoring across distributed smallholder operations presents a fundamental statistical challenge: the heterogeneous distributions of sensor readings, cattle breeds, climatic conditions, and management practices generate persistently non-IID (non-independent and identically distributed) data that degrade the performance of standard federated learning aggregation schemes. This paper proposes a Graph-Attention Federated Analytics (GA-FA) framework designed to address the non-IID problem in dairy compliance prediction. GA-FA integrates a Graph Attention Network (GAT) module that dynamically clusters participating farms based on context-feature similarity, a DBSCAN-based outlier filter that provides Byzantine-resilient aggregation by excluding anomalous local updates, and a cluster-stratified FedAvg aggregation protocol that maintains personalization while converging toward a globally consistent compliance model. Federated training keeps raw sensor records local. Update exchange limits direct disclosure of those records, although the study does not quantify what can be inferred from the updates. Validated on a dataset derived from the Shahhet28121 cattle health benchmark extended to 16 farm-level parameters across five heterogeneous farm environments, the GA-FA framework achieves a global classification accuracy of 96.94%, an F1 score of 0.967, and a communication payload of 4.25 KB per federated round—representing a 97.7% reduction relative to standard FL baselines. Ablation experiments confirm that the GAT clustering module contributes an accuracy gain of 4.63 percentage points. The framework is evaluated under Gaussian sensor noise up to 20% standard deviation, maintaining accuracy above 90%, and demonstrates stable convergence within 18 federated rounds. These findings describe five simulated farm partitions, including their specified sensor offsets and class distributions. They provide estimates for this benchmark rather than field measurements from independent farms.
How to Cite
References
Blanchard, P., Mhamdi, E. M. E., Guerraoui, R., & Stainer, J. (2017). Byzantine-Tolerant Machine Learning. arXiv. https://doi.org/10.48550/arxiv.1703.02757
Cao, X., Fang, M., Liu, J., & Gong, N. Z. (2021). FLTrust: Byzantine-robust Federated Learning via Trust Bootstrapping. Proceedings 2021 Network and Distributed System Security Symposium. https://doi.org/10.14722/ndss.2021.24434
Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: Synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16, 321–357. https://doi.org/10.1613/jair.953
Chen, M., Shlezinger, N., Poor, H.V., Eldar, Y.C., & Cui, S. (2021). Communication-efficient federated learning. Proceedings of the National Academy of Sciences, 118(17), e2024789118. https://doi.org/10.1073/pnas.2024789118
Chen, F., Li, P., Miyazaki, T., & Wu, C. (2022). FedGraph: Federated Graph Learning With Intelligent Sampling. IEEE Transactions on Parallel and Distributed Systems, 33(8), 1775–1786. https://doi.org/10.1109/tpds.2021.3125565
Dayan, I., Roth, H. R., Zhong, A., Harouni, A., Gentili, A., Abidin, A. Z., et al. (2021). Federated learning for predicting clinical outcomes in patients with COVID-19. Nature Medicine, 27(10), 1735–1743. https://doi.org/10.1038/s41591-021-01506-3
De Silva, L.C., Morikawa, C., & Petra, I.M. (2012). State of the art of smart homes. Engineering Applications of Artificial Intelligence, 25(7), 1313–1321. https://doi.org/10.1016/j.engappai.2012.05.002
Fuentes, S., Gonzalez Viejo, C., Cullen, B., Tongson, E., Chauhan, S. S., & Dunshea, F. R. (2020). Artificial intelligence applied to a robotic dairy farm to model milk productivity and quality based on cow data and daily environmental parameters. Sensors, 20(10), 2975. https://doi.org/10.3390/s20102975
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
Ghosh, A., Chung, J., Yin, D., & Ramchandran, K. (2022). An Efficient Framework for Clustered Federated Learning. IEEE Transactions on Information Theory, 68(12), 8076–8091. https://doi.org/10.1109/tit.2022.3192506
Hamilton, W.L., Ying, R., & Leskovec, J. (2017). Inductive representation learning on large graphs. Advances in Neural Information Processing Systems, 30, 1024–1034. Author version. https://doi.org/10.48550/arxiv.1706.02216
He, C., Li, S., So, J., Zeng, X., Zhang, M., Wang, H., Wang, X., Vepakomma, P., Singh, A., Qiu, H., Zhu, X., Wang, J., Shen, L., Zhao, P., Kang, Y., Liu, Y., Raskar, R., Yang, Q., Annavaram, M., & Avestimehr, S. (2020). FedML: A research library and benchmark for federated machine learning. arXiv preprint arXiv:2007.13518. https://doi.org/10.48550/arxiv.2007.13518
Ho, J., Jain, A., & Abbeel, P. (2020). Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33, 6840–6851. Author version. https://doi.org/10.48550/arxiv.2006.11239
Kairouz, P., McMahan, H. B., Avent, B., Bellet, A., Bennis, M., Bhagoji, A. N., et al. (2021). Advances and open problems in federated learning. Foundations and Trends in Machine Learning, 14(1–2), 1–210. https://doi.org/10.1561/2200000083
Karimireddy, S. P., Kale, S., Mohri, M., Reddi, S. J., Stich, S. U., & Suresh, A. T. (2019). SCAFFOLD: Stochastic Controlled Averaging for Federated Learning. arXiv. https://doi.org/10.48550/arxiv.1910.06378
Kontar, R., Shi, N., Yue, X., Chung, S., Byon, E., Chowdhury, M., Jin, J., Kontar, W., Masoud, N., Nouiehed, M., Okwudire, C. E., Raskutti, G., Saigal, R., Singh, K., & Ye, Z.-S. (2021). The internet of federated things (IoFT). IEEE Access, 9, 156071–156113. https://doi.org/10.1109/access.2021.3127448
Krause, A., & Guestrin, C. (2007). Nonmyopic active learning of Gaussian processes: an exploration-exploitation approach. Proceedings of the 24th international conference on Machine learning, 449–456. https://doi.org/10.1145/1273496.1273553
LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539
Lezoche, M., Panetto, H., Kacprzyk, J., Hernandez, J.E., & Alemany Diaz, M.M.E. (2020). Agri-food 4.0: A survey of the supply chains and technologies for the future agriculture. Computers in Industry, 117, 103187. https://doi.org/10.1016/j.compind.2020.103187
Li, T., Sahu, A. K., Zaheer, M., Sanjabi, M., Talwalkar, A., & Smith, V. (2018). Federated Optimization in Heterogeneous Networks. arXiv. https://doi.org/10.48550/arxiv.1812.06127
Li, T., Sanjabi, M., Beirami, A., & Smith, V. (2019). Fair Resource Allocation in Federated Learning. arXiv. https://doi.org/10.48550/arxiv.1905.10497
Li, D., & Wang, J. (2019). FedMD: Heterogeneous federated learning via model distillation. Proceedings of NeurIPS Workshops 2019. Author version. https://doi.org/10.48550/arxiv.1910.03581
Li, X., Gu, Y., Dvornek, N., Staib, L. H., Ventola, P., & Duncan, J. S. (2020c). Multi-site fMRI analysis using privacy-preserving federated learning and domain adaptation: ABIDE results. Medical Image Analysis, 65, 101765. https://doi.org/10.1016/j.media.2020.101765
Li, Q., He, B., & Song, D. (2021). Model-contrastive federated learning. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 10713–10722. https://doi.org/10.1109/cvpr46437.2021.01057
Li, Q., Diao, Y., Chen, Q., & He, B. (2022). Federated learning on non-IID data silos: An experimental study. Proceedings of the IEEE 38th International Conference on Data Engineering, 965–978. https://doi.org/10.1109/icde53745.2022.00077
Li, Z., Bilal, M., Xu, X., Jiang, J., & Cui, Y. (2023). Federated learning-based cross-enterprise recommendation with graph neural networks. IEEE Transactions on Industrial Informatics, 19(1), 673–682. https://doi.org/10.1109/tii.2022.3203395
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
Lin, Y., Han, S., Mao, H., Wang, Y., & Dally, W.J. (2017). Deep gradient compression: Reducing the communication bandwidth for distributed training. arXiv preprint arXiv:1712.01887. https://doi.org/10.48550/arxiv.1712.01887
Liu, W., Chen, L., Chen, Y., & Zhang, W. (2020). Accelerating federated learning via momentum gradient descent. IEEE Transactions on Parallel and Distributed Systems, 31(8), 1754–1766. https://doi.org/10.1109/tpds.2020.2975189
McMahan, H. B., Moore, E., Ramage, D., Hampson, S., & Arcas, B. A. Y. (2016). Communication-Efficient Learning of Deep Networks from Decentralized Data. arXiv. https://doi.org/10.48550/arxiv.1602.05629
Morota, G., Ventura, R.V., Silva, F.F., Koyama, M., & Fernando, S.C. (2018). Big data analytics and precision animal agriculture symposium: Machine learning and data mining advance predictive big data analysis in precision animal agriculture. Journal of Animal Science, 96(4), 1540–1550. https://doi.org/10.1093/jas/sky014
Nguyen, D. C., Pham, Q.-V., Pathirana, P. N., Ding, M., Seneviratne, A., Lin, Z., Dobre, O. A., & Hwang, W.-J. (2023). Federated learning for smart healthcare: A survey. ACM Computing Surveys, 55(3), Article 60, 1–37. https://doi.org/10.1145/3501296
Pivoto, D.G.S., de Almeida, L.F.F., da Rosa Righi, R., Rodrigues, J.J.P.C., Lugli, A.B., & Alberti, A.M. (2021). Cyber-physical systems architectures for industrial internet of things applications in Industry 4.0: A literature review. Journal of Manufacturing Systems, 58, 176–192. https://doi.org/10.1016/j.jmsy.2020.11.017
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
Schubert, E., Sander, J., Ester, M., Kriegel, H. P., & Xu, X. (2017). DBSCAN Revisited, Revisited: Why and How You Should (Still) Use DBSCAN. ACM Transactions on Database Systems, 42(3), 1–21. https://doi.org/10.1145/3068335
Shoham, N., Avidor, T., Keren, A., Israel, N., Benditkis, D., Mor-Yosef, L., & Zeitak, I. (2019). Overcoming forgetting in federated learning on non-IID data. arXiv preprint arXiv:1910.07796. https://doi.org/10.48550/arxiv.1910.07796
Talaviya, T., Shah, D., Patel, N., Yagnik, H., & Shah, M. (2020). Implementation of artificial intelligence in agriculture for optimisation of irrigation and application of pesticides and herbicides. Artificial Intelligence in Agriculture, 4, 58–73. https://doi.org/10.1016/j.aiia.2020.04.002
Veličković, P., Cucurull, G., Casanova, A., Romero, A., Liò, P., & Bengio, Y. (2017). Graph Attention Networks. arXiv. https://doi.org/10.48550/arxiv.1710.10903
Wang, J., Liu, Q., Liang, H., Joshi, G., & Poor, H.V. (2020). Tackling the objective inconsistency problem in heterogeneous federated optimization. Advances in Neural Information Processing Systems, 33, 7611–7623. Author version. https://doi.org/10.48550/arxiv.2007.07481
Weng, J., Weng, J., Zhang, J., Li, M., Zhang, Y., & Luo, W. (2019). DeepChain: Auditable and Privacy-Preserving Deep Learning with Blockchain-based Incentive. IEEE Transactions on Dependable and Secure Computing, 1–1. https://doi.org/10.1109/tdsc.2019.2952332
Wolfert, S., Ge, L., Verdouw, C., & Bogaardt, M.J. (2017). Big data in smart farming: A review. Agricultural Systems, 153, 69– 80. https://doi.org/10.1016/j.agsy.2017.01.023
Yao, X., Huang, C., & Sun, L. (2018). Two-stream federated learning: Reduce the communication costs. Proceedings of the IEEE Visual Communications and Image Processing, 1–4. https://doi.org/10.1109/vcip.2018.8698609
Yin, D., Chen, Y., Ramchandran, K., & Bartlett, P. (2018). Byzantine-Robust Distributed Learning: Towards Optimal Statistical Rates. arXiv. https://doi.org/10.48550/arxiv.1803.01498
Yu, H., Liu, Z., Liu, Y., Chen, T., Cong, M., Weng, X., Niyato, D., & Yang, Q. (2020). A fairness-aware incentive scheme for federated learning. Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society, 393–399. https://doi.org/10.1145/3375627.3375840
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







