Skip to Content
  • Proceeding Paper
  • Open Access

25 November 2026

10 Pages

Privacy-Preserving Distributed Predictive Modeling: A Comparative Study of Federated and Centralized Machine Learning for Crop Yield Prediction †

,
and
1
Department of Computer Science and Engineering, GIET University, Gunupur 765022, India
2
Department of CSM, Aditya Institute of Technology and Management (AITM), Tekkali 532203, India
*
Author to whom correspondence should be addressed.
†
Presented at the 13th International Electronic Conference on Sensors and Applications, 18–20 November 2026; Available online: https://sciforum.net/event/ECSA-13.
Eng. Proc.2026, 163(1), 118;https://doi.org/10.3390/engproc2026163118 
(registering DOI)
This article belongs to the Proceedings of The 13th International Electronic Conference on Sensors and Applications

Abstract

Background: Predicting crop yield is a challenging task for farmers. Machine learning models are used to predict crop yield early. However, traditional centralized learning necessitates gathering and storing data from various sources in one place. Federated learning helps train the model across distributed data sources while keeping the data local. This work compares centralized learning and federated learning to estimate predictive performance for crop yield prediction. This study also examined ten ML models to investigate the effects of data decentralization on prediction accuracy, error, and processing cost. Objective: In this paper, we aim to predict crop yield using ten ML models under FL settings. Material/method: The models used in this study are: ExtraTrees (ET), RandomForest (RF), GradientBoosting (GB), XGBoost, Decision Tree (DT), LightGBM (LGBM), Linear Regression (LR), Ridge Regression, K-Nearest Neighbors (KNN), and Multilayer Perceptron (MLP). We evaluated these ten models using performance metrics such as RMSE, MAE, and R2. Result: Our experimental observations show that tree-based ensemble models performed well in both learning environments. In the FL environment, the ET model performed well, with an RMSE of 13,145.82 tons, an MAE of 9859.36, and an R2 of 0.9320. Similarly, under a centralized learning environment, the average R2 ranged from 0.7730 to 0.9010 while substantially reducing the average RMSE and MAE. In the FL environment, five models performed well with R2 values above 0.90. This means that these learning models can deliver competitive prediction performance despite the computational overhead and constraints associated with decentralized data. In addition, category-wise analysis demonstrated that tree-ensemble models were the most resilient to data partitioning, while KNN and MLP were more susceptible to the federated environment.

1. Introduction

Nowadays, accurate and efficient crop yield prediction is one of the most challenging tasks for farmers. It requires better agricultural planning, environmental conditions, and timely decision-making to predict crop yield prediction. To improve crop production, farmers need to consider many factors, such as soil-related data (N, P, K, pH, soil quality, temperature, humidity) in precision farming. Farmers still practice traditional farming methods. It is very difficult and time-consuming to understand the complex relationships between the physicochemical properties of the land. However, agricultural data are often compiled and maintained across geographically dispersed sources, making centralized data collection difficult because of data ownership, privacy, and sharing restrictions. These constraints encourage the use of privacy-preserving distributed learning technologies, particularly federated learning, which allows models to be jointly trained without necessitating the direct exchange of raw data. As farming becomes increasingly data-driven, machine learning (ML) helps predict crop yield effectively. Early prediction is now possible through AI (artificial intelligence) to understand farming data behaviors and develop predictive models to improve model accuracy. During the literature we observed that the authors have systematically reviewed crop yield prediction using machine learning (ML) techniques, including Random Forest (RF), Gradient Boosting (GB), and Deep Learning (DL). Models performance was evaluated through the RMSE, MAE and (R2) [1]. We used machine learning models to predict crop yield, called conventional crop yield, which followed the centralized learning (CL) approach. In this approach, we collect data from different sources and keep it in a common repository. These data are then used to train a single predictive model. Agricultural data are being generated at an increasing rate across regional data repositories, sensors, agricultural institutions, and geographically dispersed farms. The direct pooling of such data may be restricted by data ownership, confidentiality, privacy, governance, and communication limitations. Federated learning is used to protect the farmers’ data properly. It allows multiple clients to train a shared model. It ensures that only weights and biases from different clients are shared during local training. Then those weights and biases go to the central server for aggregation and updating. The FedAvg algorithm is used to update the client data, which is called the decentralized learning approach [2]. Here, FL allows the collaborative training of the model without sharing farmers’ raw data. However, it faces challenges in handling client data heterogeneity and communication overhead. This study does not handle these challenges in FL. Privacy preservation is the farmers’ main concern when protecting their data. Agricultural data are spread across farms and different regions. Researchers widely use FL applications in agriculture. Recent studies, especially those on crop recommendation using FL, have emerged as a research area where authors discuss the privacy preservation of farm data [3]. Utku, A. et al. [4] present yield prediction using federated learning under an Edge–Fog–Cloud framework. The authors’ objective was to preserve the data. This study considered three types of techniques: centralized, federated, and hybrid learning. Their study covered time-aware forecasting schemes from 1990 to 2022. Finally, they observed that the central classical ML model performed well for crop yield prediction. Köksal, D. D. et al., [5] explored how crop yield prediction can be possible by utilizing centralized and vertical federated learning mechanisms. In the experimental results, VFL (vertical federated learning) shows a slight decrease in performance (R2 = 0.765–0.897), whereas CFL (centralized federated learning) achieves maximum prediction accuracy (R2 = 0.88–0.91). The authors presented the different ways to enhance crop yield prediction using FL. This study emphasize how FL integrates with graph and recurrent neural networks for crop yield prediction. Results show that the FL-AGRN model achieves good precision with a mean absolute error (MAE) of 1.2341 and a root mean square error (RMSE) of 1.4493. From the experimental results, it has been observed that there is a strong correlation between the actual and predicted variables. We observed that the coefficient of correlation (R2)between them is 0.9889. As well as correlation coefficient (r) obtained of 0.9946 [6].
This paper is organized into three subsections to describe crop yield prediction. Section 1 introduces crop yield prediction, the drawbacks of traditional farming, and how ML models can overcome them in an FL environment. Also, this section describes the state of the art in crop yield prediction. In Section 2, we propose a model that helps predict crop yield in centralized learning and federated learning environments. Section 3 discusses the crop yield prediction results, followed by the conclusions.

Major Contributions of the Study

These are the followings major contributions:
  • This study presents the comprehensive framework that helps compare centralized learning and federated learning for crop yield prediction under the common experimental work.
  • In this paper, we have used the ten ML regressors (tree-based ensemble methods (ET, RF, GBoosting, XGB, DT), linear models (LR, Ridge), a neighbor-based model such as KNN and a neural network-based model like MLP for crop yield prediction. We compared them to understand the behaviors of the two different learning environments for crop yield prediction.
  • The study offers practical advice for choosing suitable regression models when centralized data sharing is limited and privacy-preserving distributed learning is necessary. It also presents empirical evidence on the accuracy–privacy–computational trade-off associated with federated crop yield prediction.

2. Proposed Model for Crop Yield Prediction

This study presents the proposed model for crop yield prediction. We have utilized both traditional and federated learning mechanisms for crop yield prediction. Figure 1 presents the proposed architecture for crop yield prediction under the distributed environment. We consider the federated learning and centralized learning environment for crop yield prediction.
Figure 1. Proposed architecture for crop yield prediction under Federated and Centralized Machine Learning Environment.
Phase 1: Data Collection: In this phase, we used the publicly available dataset from medley repository. The name of the dataset is SPAS-Dataset-BD for precision agriculture and crop prediction purposes. The dataset was primarily collected from Bangladesh through the survey-based data collection method across the diverse region of the Bangladesh. The objective of this work is to predict the crop yield. We passed the input parameter for predictive model building. Phase 2: Data Pre-processing: The nature of the dataset indicates that the features are heterogeneous, such as climatic, geographical, and crop-related attributes. These features are appropriate to be handled by the ML models in centralized and federated learning environments. The raw dataset was forwarded for data pre-processing and analysis purpose. We converted some of the features into numerical forms using encoding techniques. Finally, this phase produced a clean dataset after scaling and encoding. Phase 3: Candidate Model Selection: In this phase, we utilized ML models to predict the yield. This study presented ten ML models based on regression, such as linear models, tree-ensemble models, and K-Nearest Neighbors. Finally, all ten models were evaluated under identical dataset and experimental settings. This ensured a fair comparison of multiple model categories and allowed for performance analysis using both the federated learning and centralized learning frameworks. Phase 4: Federated Learning Model Development: This part of the study utilized federated learning concepts to predict the yield as well as briefly compare centralized and federated learning performances regarding yield prediction. The pre-processed data was divided into multiple local data partitions. Each partition was termed as a client. Each client kept its own data, and the raw data were not sent straight to a central site. This method facilitates distributed model training while minimizing the necessity for direct data transfer. We trained all ten ML classifiers in the local model and did not send them to the server. The raw data were not sent to the global server. Finally, the global server updates were based on the local observations. The FedAvg algorithm was used for aggregation. Our objective is to combine local model updates to create a better global model. This iterative process continued until the required number of communication rounds was completed. The global models were evaluated based on RMSE, MAE, R2, and training duration. This step produced the federated learning performance of all ten models, which were then compared to the matching centralized learning results. Phase 5: Centralized Learning Model Development: In this phase, the same pre-processed dataset was combined into a centralized training environment. Unlike federated learning, all training data were available in a single location, allowing models to learn directly from the entire dataset. In this phase, the same ten ML models were trained and models were evaluated using performance metrics such as RMSE, MAE, R2, and training time. The output of this phase was the centralized performance results of all ten models. These results then moved into the final phase for a detailed comparison with the federated learning results. The centralized learning results served as a benchmark for evaluating the models’ prediction effectiveness and computational efficiency. Phase 6: Comparative Performance Evaluation: In this phase, we compared the FL and CL models systematically. We have evaluated the ten models and estimated the models’ performance using RMSE, MAE, R2 and training time. These metrics were used to measure the prediction error. The model having the lower MAE and RMSE is the best model and the model having a higher R2 is the best model. Finally, the models were ranked based on their overall performance, and the findings were broken down by model type, which included tree-ensemble, linear, neighbor-based, and neural network-based models. This phase gave a thorough grasp of the trade-offs between prediction accuracy, computing efficiency, and distributed learning.

3. Result and Discussion

Federated Learning Experimental Setup

In this FL environment, all experimental work was carried out using the configuration listed below. There were five clients. There were 30 communication rounds, each with five local epochs. Adam Optimizer’s batch size was 32. This study used a learning rate of 0.0001 and the FedAvg aggregation method.
For aggregation, we employed the FedAvg algorithms with client updates and sample-size-weighted averaging. Only model parameters were shared between clients and the server in each round; raw records were never sent from a client.
The training data were distributed among five virtual federated clients using two explicit scenarios: an IID scenario (random, approximately equal split) and a non-IID scenario (Dirichlet (α = 0.5) allocation per crop class). We report per-client sample counts and quantify the ensuing distributional variability using Jensen–Shannon divergence against the global training distribution.
The above-mentioned Table 1 presents the client characterization for IID and Dirichlet non-IID. We divided our dataset into a training and a testing part. A total of 3308 samples of the training data are distributed across the five virtual federated clients under each of the two partitioning scenarios evaluated in this study. For the IID scenario, samples are randomly and evenly distributed among clients, resulting in nearly comparable client sizes (661–662 samples each). In the non-IID scenario, samples are distributed using a Dirichlet (α = 0.5) distribution across crop classes, resulting in significantly uneven client sizes (varying from 523 to 840 samples). We use the JSD to quantify how much the crop condition deviates from the overall crop composition.
Table 1. Client characterization (IID vs. Dirichlet non-IID).
Table 2 Federated Learning Performance Analysis: In this section, we performed federated learning for crop yield prediction. This study also compared the performance metrics such as RMSE, R2, and MAE. We also observed their training time during evaluation and these are presented below Table 2.
Table 2. Performance metrics for crop yield prediction.
Table 2 presents the performance metrics of ten different ML models for crop yield prediction. This study utilized the ML models and evaluated them in the FL environment. From experimental result we have observed that the tree-based model performed well. The ET (Extra Tree) model performed consistently performed well with an RMSE score of 13,145.82, while MAE = 9859.36 and R2 = 0.9320. In comparison to the other models, ET achieved the highest score and consistent performance in crop yield prediction. We also observed that the linear model performance is moderate. Overall, these results show that tree-ensemble models are the most dependable model family for the suggested federated prediction framework. They also show that there is a clear trade-off between training cost and predictive performance because the best-performing models typically required longer training times. Figure 2 presents an RMSE comparison of the federated learning environment for crop yield prediction. From our experimental work, tree-based models such as ET showed the lowest prediction error of 13,145.82 tons, but MLP achieved the highest RMSE score. This means that this model’s predictive performance is very poor for crop yield prediction. Thus, MLP’s error was nearly 3.8 times that of ExtraTrees, indicating a significant performance difference. Overall, the results show that tree-based ensemble models have significantly lower prediction errors in the federated learning environment. Illustrations in the Figure 3 below present the comparison of R2 values for different ML classifiers for crop recommendation in the FL environment. The R2 comparison further confirms the dominance of ET, which achieved the highest explanatory power, followed by GradientBoosting and RandomForest. Most tree-based models achieved R2 values above 0.90, whereas KNN and MLP showed substantially lower values.
Figure 2. Federated learning RMSE comparison.
Figure 3. Comparison of R2 in an FL environment for crop yield prediction.
Figure 4 highlights the crop yield prediction in the FL environment. This study examines the performance of the models and found that the metrics MAE score of is very low. Among all the models, MLP exhibits the highest MAE score of 40,038.06. The obtained score is the four times greater than that of the ET model. The big difference in errors between these models shows that tree-based ensemble methods make more stable and accurate predictions when federated learning is used.
Figure 4. MAE comparison of FL model for crop yield prediction.
From the experimental results we confirm that tree-based ensemble models preform well under federated learning.
The below Figure 5 presents a quantitative view of two different learning mechanisms for crop yield prediction, FL and CL. This study compared and analyzed the performance gap between the two learning environments. Our experimental observations revealed that the XGB model obtained the largest RMSE gaps in comparison to the other models. For R2, the most substantial performance degradation under FL was reported for MLP (58.0%) and KNN (31.0%), whereas the tree-based models showed relatively lower gaps, ranging from 5.2% to 10.1%.
Figure 5. Performance gap between the federated learning and centralized learning environments for crop yield prediction.
Figure 6 presents the category-wise performance comparison between federated and centralized learning for crop yield prediction. This analysis clearly demonstrates that the impact of federated learning varies significantly between model families. This comparison demonstrates that ensemble learning models perform well in crop yield prediction in both federated and centralized environments. The average R2 improved from 0.9146 under FL to 0.9835 under CL. The average RMSE decreased from 15,321.42 to 6419.89, and the average MAE decreased from 11,491.06 to 4814.92. Overall, this study demonstrates that tree ensembles are the most consistently resilient model type. In contrast, neighbor-based and neural network models are far more sensitive to data decentralization and benefit greatly from centralized training.
Figure 6. Category-wise performance comparison between federated and centralized learning.
In Table 3, we compare the performance among RMSE, R2, MAE on an identical, fully isolated 827-sample test set across three settings. Federated runs used the same design, optimizer (Adam), and hyperparameters as the centralized reference model. There was also a federated model trained for an IID client scenario and a federated model trained for a Dirichlet (± = 0.5) non-IID client scenario. Both techniques utilized the FedAvg algorithm over five clients and 30 communication rounds. The per-round test-set R2 was 0.780, 0.858, 0.896, 0.911, 0.917, and 0.920 at rounds 5, 10, 15, 20, 25, and 30 under the IID scenario, and 0.761, 0.834, 0.869, 0.883, 0.891, and 0.895 under the non-IID scenario.
Table 3. Centralized vs. federated learning results by scenario.
The above revised implementation is based on privacy evaluation using a loss-based membership inference attack (MIA) against the trained models [7].

4. Conclusions

In this paper, we presented a comprehensive comparative analysis of the two types of learning for crop yield prediction. This study meticulously analyzes FL and CL using ten regression models. These models include tree-ensemble, linear, neighbor-based, and neural network-based models. The experiment results highlight that the learning paradigm has a major impact on predictive performance. The results also showed that centralized learning performed well in overall accuracy and consistency across all assessed models. In the FL environment, the ET model performed well and obtained an RMSE of 13,145.82, an MAE of 9859.36, and an R2 of 0.9320. However, in the case of centralized learning (CL), XGBoost was the best performer with an RMSE of 4840.22, an MAE of 3630.16, and an R2 of 0.9911. The overall comparison also revealed that the average MAE dropped from 18,331.70 to 10,607.53 and the average RMSE dropped from 23,576.28 in FL to 13,368.22 in CL. Our analysis also revealed that the average R2 also increased from 0.7730 under FL to 0.9010 under CL. Apart from these facts, the R2 distribution analysis presents that centralized learning produced stable outcomes with a mean of R2 of 0.950 and lower variability when compared with FL. Among the model categories, tree-ensemble approaches performed best and most consistently in both learning contexts, whereas KNN and MLP were more sensitive to decentralized training. The results specifically emphasize ExtraTrees as a stable choice for federated contexts, and XGBoost as the best successful model for centralized training.
Limitation: This study has the following limitations:
We did not do our implementation setup in a real-time environment. The dataset was divided into different partitions and each partition was called a client. Our objective was to demonstrate how farmers preserve their data without sharing their raw data. For this, we implemented federated learning. This study was purely based on the comparison of a publicly available dataset.

Author Contributions

Conceptualization, P.K.M. and R.P.; methodology, P.K.M.; software, P.K.M.; validation, R.P.; formal analysis, P.K.M.; investigation, R.P.; resources, D.A.; data curation, D.A.; writing—original draft preparation P.K.M.; writing—review and editing, R.P.; visualization, P.K.M.; supervision, R.P.; project administration, R.P.; funding acquisition, R.P. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data support the findings of this study are openly available in “Mendeley Data” at: https://data.mendeley.com/datasets/cphdw4z5kw/1 (accessed on 15 January 2026).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Shawon, S.M.; Ema, F.B.; Mahi, A.K.; Niha, F.L.; Zubair, H.T. Crop yield prediction using machine learning: An extensive and systematic literature review. Smart Agric. Technol. 2025, 10, 100718. [Google Scholar] [CrossRef] [Scilit]
  2. McMahan, B.; Moore, E.; Ramage, D.; Hampson, S.; y Arcas, B.A. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics; PMLR: Cambridge, MA, USA, 2017; pp. 1273–1282. [Google Scholar]
  3. Hiremani, V.; Devadas, R.M.; Sapna, R.; Sowmya, T.; Gujjar, P.; Rani, N.S.; Bhavya, K.R. Federated learning for crop yield prediction: A comprehensive review of techniques and applications. MethodsX 2025, 14, 103408. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Utku, A.; Barut, A.; Alofaysan, H.; Henni, M.D.; Amoozegar, A. Federated agricultural yield forecasting under an Edge–Fog–Cloud framework: A multi-country privacy-preserving approach. Discov. Comput. 2026, 29, 359. [Google Scholar] [CrossRef] [Scilit]
  5. Köksal, D.D.; Bennin, K.E.; Tekinerdoğan, B. Centralized and vertical federated learning for Climate-Based crop yield prediction. Comput. Electron. Agric. 2026, 249, 111851. [Google Scholar] [CrossRef] [Scilit]
  6. Nirosha, U.; Vennila, G. Enhancing crop yield prediction for agriculture productivity using federated learning integrating with graph and recurrent neural networks model. Expert Syst. Appl. 2025, 289, 128312. [Google Scholar] [CrossRef] [Scilit]
  7. Shokri, R.; Stronati, M.; Song, C.; Shmatikov, V. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy (SP); IEEE: New York, NY, USA, 2017; pp. 3–18. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.