Portable Crop Recommendation System with Probability Calibration and Abstention
B. AmmanniDepartment of Computer Science and Engineering, GITAM (Deemed to be University), Hyderabad, India. bammanni@gitam.in0009-0007-4904-0555
Sreerama Murty MaturiAssistant Professor, Department of Computer Science and Engineering, GITAM (Deemed to be University), Hyderabad, India. sreeramsssit@gmail.com0000-0003-0029-1672
Problem: Crop advisories issued at soil-testing laboratories and field extension points must remain dependable on low-cost, intermittently connected hardware, yet most data-driven recommenders use only N–P–K and pH, are validated on random splits that leak spatial and seasonal information, and return uncalibrated scores with no mechanism to withhold low-confidence advice. Methodology: A portable crop recommendation system is presented that fuses twelve laboratory soil descriptors (pH, EC, OC, N, P2O5, K2O, S, Fe, Cu, Mn, Zn, B) with 15- and 30-day rainfall, temperature and humidity windows. Three learners, LightGBM (ML), a multilayer perceptron (DL) and CatBoost (Pro-ML), are trained under StratifiedGroupKFold (K = 5) grouped by mandal–season. A soft electrical-conductivity penalty discourages salt-sensitive crops on saline plots, post-hoc temperature scaling calibrates posteriors, and a Top-k rule with confidence threshold τ enables abstention. The pipeline is exposed through a REST endpoint backed by Parquet/DuckDB for laptop-class and mobile clients. Results: On 487 plot records covering 17 crop classes from 20 mandals of Kadapa district, the DL model reached 96.84% accuracy, 98.50% Top-3 accuracy and 0.97 macro-F1, exceeding LightGBM (92.61%, 97.13%) by 4.23 percentage points and CatBoost (90.14%, 97.33%) by 6.70 percentage points. Temperature scaling reduced the expected calibration error of the DL model from 0.031 to 0.012 and negative log-likelihood from 0.142 to 0.109 without altering rankings. At τ = 0.7, the DL model retained 94.1% coverage while selective risk fell from 3.16% to 1.3%. Ablation showed that extending N–P–K–pH inputs with EC, OC, micronutrients and weather windows raised accuracy from 81.27% to 96.84%. Conclusion: Calibrated, abstention-aware recommendation delivers dependable and auditable crop advice on portable hardware and provides a reproducible template for uncertainty-aware decision support in field environments.