BORS-CRP: a Bayesian optimized stacking framework for crop recommendation in precision agriculture
摘要
Precision agriculture is increasingly adopting data-driven decision-support systems to enhance crop productivity while maintaining soil health. Soil nutrient levels and environmental factors like nitrogen (N), phosphorus (P), potassium (K), temperature, humidity, pH, and rainfall are used as structured inputs for crop recommendation systems. However, many existing approaches exhibit sensitivity to hyperparameters and lack robust evaluation protocol. This paper presents a Bayesian-optimized stacking-based crop recommendation framework (BORS-CRP), which combines diverse base learners using a stacking ensemble model and optimizes their hyperparameters using Bayesian optimization. To provide a rigorous and leakage-free performance assessment, a nested cross-validation strategy with repeated stratified folds (5 × 5 outer folds with 3-fold inner validation) is used. Performance is measured in terms of mean ± standard deviation over outer evaluations. Experimental performance on a publicly available dataset with 22 crop classes shows that BORS-CRP performs well on various evaluation metrics such as accuracy (0.9957 ± 0.0026), macro-precision (0.9960 ± 0.0023), macro-recall (0.9957 ± 0.0026), macro-F1 (0.9957 ± 0.0026), Cohen’s Kappa (0.9955 ± 0.0027), and Matthews Correlation Coefficient (0.9955 ± 0.0027). Statistical analysis using the Wilcoxon signed-rank test indicates that while the proposed method consistently performs at the top level, its improvement over strong baselines such as random forest is not statistically significant.