District-Level Crop Yield Prediction for Smallholder Farmers in Uttar Pradesh Using a Hybrid Random Forest–XGBoost Ensemble: A Transparent and Accessible Decision Support Framework
Abstract
Delivering tailored agricultural advice for efficient use by farmers requires precise, localized crop production forecasts under data-constrained conditions. Most AI-based tools that are currently available are only useful at the state or national level and don't show validation metrics, which makes it harder to reproduce scientific results and trust them in real life. In order to estimate crop yields at the district level in all 75 districts of Uttar Pradesh (UP), India, this research suggests a hybrid ensemble machine learning framework that combines an XGBoost regressor and a Random Forest regressor through optimized linear blending. A carefully selected multi-source dataset covering eight agricultural years (2018–2025), 23 engineered features, and four main crop categories—rice, wheat, sugarcane, and pulses—is used to train the framework. While integrated modules provide soil-test-based fertilizer recommendations, crop disease and lodging risk alerts, and thorough economic profitability analysis, a triple-score intelligence layer assesses soil suitability, weather appropriateness, and growth-stage readiness to convert predictive outputs into practical farm decisions. In order to directly address the digital literacy and connectivity issues that 72% of UP's smallholder agricultural population faces, the system is implemented as a privacy-preserving progressive online application with multilingual voice support in Hindi, Awadhi, and English. According to a simulated economic analysis, there might be an annual benefit of about ?15,220 per hectare, which would increase to ?2,905.19 crore with 10% adoption throughout UP (based on 23.86 million smallholder farmers with an average holding of 0.8 ha). Publishing the whole methodology, hyperparameters, and validation metrics makes this work a clear and repeatable standard for AI-driven agricultural decision support in smallholder settings in South Asia.