Background: Cross-regional deployment of crop recommendation models is challenging because differences in soil and climatic conditions can cause distributional shifts between training and deployment domains. This study assessed the cross-regional behaviour of Random Forest (RF), Multi-Layer Perceptron (MLP) and TabNet under deployment in Kurukshetra, Haryana.

Methods: Three classifiers were evaluated on a 3,000-sample Kurukshetra deployment dataset constructed from field-survey soil measurements and NASA POWER meteorological records, with controlled Gaussian perturbation of meteorological features used to expand the dataset, using a 33,000-sample, 33-crop benchmark dataset. A feature-level OOD percentage (OOD%) metric quantified domain mismatch. Top-K (K=5) ranking retained the five most probable crop candidates per sample, followed by weighted consensus. Model confidence, inter-model agreement, season-wise recommendations and correspondence with Haryana agricultural sources were assessed.

Result: RF achieved the highest benchmark performance (CV F1=96.55%, Test F1=96.93%, AUC=0.9995), followed by MLP (95.31% Test F1) and TabNet (95.07%). Severe mismatch occurred for nitrogen (48.3%) and potassium (38.6%), whereas temperature and humidity remained within the benchmark range. MLP and TabNet showed higher mean top-1 confidence (0.974 and 0.955) than RF (0.346), while agreement among all three models was 13.9%. Weighted consensus ranked sugarcane, chillies, maize, wheat, cabbage and sunflower highest; five of six consensus recommendations showed manual agronomic correspondence with published regional agricultural evidence (83.3%). Season-wise analysis identified violations associated with the absence of seasonal constraints in the training data, supporting explicit OOD assessment and multi-model consensus for cautious, region-specific crop recommendation under distributional shift.

Cross-regional deployment of crop recommendation models-training in one geographic domain and applying them to another with different soil and climatic profiles-remains insufficiently addressed. Although ML systems perform strongly on structured soil-climate datasets, most studies use geographically homogeneous data and provide limited evidence on cross-regional performance under distributional shift (Grinsztajn et al., 2022; Shwartz-Ziv and Armon, 2022).
       
This question is particularly relevant for North India, where Kurukshetra District, Haryana, represents a challenging deployment setting. The district has alkaline alluvial soils with high nitrogen (mean 190.65 kg/ha vs. 89.32 kg/ha in the training domain) and potassium (177.38 vs. 63.34 kg/ha), with mean monthly rainfall of 45.62 mm vs. 76.64 mm (Sheoran et al., 2024; NASA POWER, 2025).
       
A further challenge is how ML and DL classifiers behave on out-of-distribution (OOD) deployment data, as most crop recommendation studies are evaluated within their training distribution. A previous benchmark study established the 33,000-sample, 33-crop benchmark and identified Random Forest as a high-performing classifier under rigorous multi-model evaluation (Khavari et al., 2026). The present study therefore evaluates RF, MLP and TabNet under quantified cross-regional domain shift. It is important to distinguish that the OOD% metric used in this study is a univariate feature-range extrapolation indicator- quantifying the extent to which deployment feature ranges exceed training ranges-rather than a complete statistical or model-based OOD detection method. No independent field-level crop suitability observations were collected for Kurukshetra; the agronomic correspondence assessment is based on published regional agricultural sources.
 
Recent developments in crop recommendation
 
Machine learning-based crop recommendation has been widely studied in Indian agro-climatic settings. Prity et al., (2024) reported 99.31% accuracy with Random Forest, while Shastri et al., (2025) achieved 99.27% with Gradient Boosting and SHAP-based interpretation. However, these studies used geographically homogeneous benchmark datasets. Tree-based ensembles show strong performance on medium-sized tabular data (Grinsztajn et al., 2022; Shwartz-Ziv and Armon, 2022), while recent agricultural studies combine machine learning with soil and weather variables for regional crop recommendation (Gimba and Mishra, 2026; Aggarwal and Sharma, 2022; Kumar et al., 2025) and deep learning for agricultural prediction (Padmanayaki and Geetha, 2026). Real-time soil monitoring has also used soil pH, temperature and moisture for crop prediction (Pandey et al., 2023). Recent reviews highlight the expanding role of AI and deep learning in agriculture (Mehta et al., 2025).
 
Key contributions
 
This study evaluates RF, MLP and TabNet in Kurukshetra, with four contributions:
1. OOD% assessment: Feature-level quantification of domain shift.
2. ML-DL comparison: Confidence and recommendations under N (48.3%) and K (38.6%) mismatch.
3. Top-K consensus: Weighted K=5 recommendations from 3,000 samples.
4. Agronomic correspondence: Manual assessment against published regional agricultural evidence yielded 83.3% correspondence.
This study was conducted at the Department of Computer Science and Applications, Kurukshetra University, Haryana, India (2025-2026). The deployment pipeline (Fig 1) comprised Kurukshetra dataset construction, OOD% quantification, three-model deployment (Optuna-tuned RF, MLP, TabNet), confidence analysis, Top-K weighted consensus, season-wise recommendation and agronomic correspondence assessment.

Fig 1: Deployment pipeline for RF, MLP and TabNet on the Kurukshetra dataset, including OOD% analysis, Top-K recommendation, season-wise recommendation and external agronomic correspondence assessment.


 
Random forest
 
The primary deployed classifier was an Optuna-tuned Random Forest trained on the Mendeley dataset (Thangatamilan, 2025), comprising 33,000 samples, 33 classes and seven features. Benchmark preparation and evaluation followed Khavari et al., (2026). Optuna TPE (50 trials) identified n_estimators=348, max_depth=31, min_samples_split=12, min_samples_leaf=2 and max_ features=log2. The model was retrained on all 33,000 samples for Kurukshetra deployment.
 
Multi-layer perceptron (MLP)-Deep learning baseline
 
The MLP was a fully connected PyTorch network trained on the 26,400-sample training partition of the 33,000-sample benchmark dataset, with three hidden layers [512, 256, 128], ReLU, batch normalisation, dropout=0.3 and a 33-unit softmax output. Adam (lr=0.001, weight_decay=1e-4), batch size=256, early stopping (patience=15) and a 200-epoch maximum were used with a 10% validation split. Inputs were standardised using a StandardScaler fitted on the training partition. Seed 42 was applied to PyTorch, NumPy and Python random modules for reproducibility.
 
TabNet-attention-based deep learning
 
TabNet (Arik and Pfister, 2021) uses sequential attention for sparse feature selection. Configuration: n_d=n_a=32, n_steps=5, gamma=1.5, lambda_sparse=1e-4. Training used Adam (lr=0.02), StepLR, batch size=1,024, maximum 100 epochs and early stopping (patience=15). The same StandardScaler and seed 42 were used as for MLP. All models were evaluated on the locked 6,600-sample test set before deployment.
 
Kurukshetra deployment dataset
 
The Kurukshetra deployment dataset comprised 3,000 samples from Babain and Ladwa. Soil N, P, K and pH were obtained from Sheoran et al., (2024) and temperature, relative humidity and precipitation from NASA POWER monthly data (2001-2025) for Babain (30.07°N, 76.98°E) and Ladwa (29.99°N, 77.05°E). Base samples from Sheoran et al., (2024) and NASA POWER monthly records (2001-2025) were expanded to 3,000 using additive Gaussian noise (σ = 3% of each feature mean) applied only to meteorological features; this was intended to reflect sub-monthly variability within observed seasonal ranges. Soil features were not perturbed. Month (1-12) was assigned by cycling NASA POWER monthly observations for seasonal disaggregation. Random seed 42 was used throughout. Feature statistics are shown in Table 1.

Table 1: Feature statistics and OOD% domain-shift analysis between the benchmark training and Kurukshetra deployment domains.


 
OOD% domain shift metric (Eq. 1)
 
The OOD% metric quantified feature-level distributional mismatch between training and deployment domains.


 
 Here,
μ = Benchmark training range. [μ_min, μ_max]. 
κ = Kurukshetra deployment range [κ_min, κ_max].                                    

OOD%=0% indicates full containment within the training range. Thresholds were <5% (Good), 5-30% (Moderate) and >30% (Severe), providing a per-feature measure of extrapolation. OOD% is a univariate feature-range extrapolation indicator rather than a complete statistical or model-based OOD detection method. These thresholds were defined operationally for this study and are not derived from a universally accepted external standard.
 
Three-model deployment and comparison
 
For benchmark comparison, RF performance from the previous study was retained (Khavari et al., 2026), whereas the Optuna-tuned RF was retrained on all 33,000 samples for Kurukshetra deployment. RF used raw features; MLP and TabNet used the StandardScaler fitted on the benchmark training partition. Each model produced a 3,000×33 predict_proba matrix. Evaluation included top-1 confidence, threshold exceedance (>0.50 and >0.70), top-1 crop frequencies and agreement among all three models.

Top-K recommendation and weighted consensus
 
Top-K retained the five most probable crops per sample because of the severe N and K shift. Each model generated 15,000 ranked recommendations across 3,000 samples. No confidence threshold was applied; all candidates were retained to characterise model behaviour under OOD conditions. The weighted consensus probability matrix was computed as:
 
                Pconsensus = WRF × PRF + WMLP × PMLP + WTabNet × PTabNet         ..(2)
 
Weights were proportional to benchmark Test F1: w_RF=0.337, w_MLP=0.332 and w_TabNet=0.331.
 
Season-wise recommendation framework
 
Season-aware disaggregation used monthly NASA POWER data. Based on the ICAR (2021) crop calendar, samples were classified as Rabi (October-March), Kharif (June-October) and Zaid (March-June), with 5,000, 6,250 and 3,750 recommendations, respectively. Consensus recommendations were calculated independently for each season.
 
Agronomic correspondence assessment
 
Consensus recommendations were assessed against Government of India (GoI, 2024), Kurukshetra District Government (2024), SLBC Haryana (2023) and CCS Haryana Agricultural University (CCS HAU, 2015); Igrain (2025) provided supplementary state-level production evidence. Crops were classified as Confirmed when supported by clear Haryana/Kurukshetra evidence and Partial when evidence was limited or less district-specific. The confirmed correspondence rate was the proportion of consensus Top-6 crops classified as Confirmed.
Benchmark evaluation: RF vs. MLP vs. TabNet
 
Table 2 presents benchmark performance for RF, MLP and TabNet on 33,000 samples (26,400 training; 6,600 test; 33 classes) using 7-fold stratified cross-validation.

Table 2: Benchmark evaluation: RF vs. MLP vs. TabNet (26,400 train | 6,600 test | 33 classes | 7-fold CV).


       
RF achieved the highest CV and Test F1 (Table 2), consistent with the previous benchmark (Khavari et al., 2026). TabNet had the smallest CV-Test gap (0.26%) and all models achieved AUC ≥0.9994, indicating high discriminative capacity across 33 classes. The RF–DL differences were modest (RF-MLP=2.26 pp; RF-TabNet=1.22 pp in CV F1).
 
Domain shift analysis (OOD%)
 
Table 1 presents the OOD% values for all seven features. The OOD% analysis reveals a highly asymmetric domain shift profile. This pattern is consistent with the broader principle that crop suitability is strongly influenced by site-specific soil characteristics and their associated limitations (Yadav et al., 2024). Nitrogen showed the most severe mismatch (OOD%=48.3%), with Kurukshetra values well above the training range (Table 1), consistent with the high nitrogen levels of intensively cropped alluvial soils under the wheat-rice rotation system. Potassium showed the second most severe mismatch (OOD%=38.6%), reflecting the same high-fertility alluvial soil profile. Temperature and humidity showed no mismatch (0.0%), so the deployment scenario is characterised by severe soil mismatch but adequate meteorological coverage.
 
Classifier confidence under domain shift
 
The confidence statistics for the three models are presented in Table 3.

Table 3: Confidence distribution comparison: RF vs. MLP vs. TabNet over 3,000 samples of Kurukshetra.


       
MLP and TabNet showed substantially higher prediction confidence than RF under domain shift (Table 3): >98% of DL predictions exceeded 0.50 confidence versus 10.2% for RF. RF produced lower and more variable confidence under the observed OOD conditions. Agreement among all three models was 13.9%, with pairwise agreement of 15.4% (RF-MLP) to 28.1% (RF-TabNet), supporting consensus over reliance on a single model. The substantially higher predictive confidence of MLP (mean top-1: 0.974) and TabNet (0.955) relative to RF (0.346) despite severe nitrogen (OOD%=48.3%) and potassium (OOD%=38.6%) mismatch may indicate potential confidence overestimation under distributional shift. Calibration analysis-such as reliability diagrams or expected calibration error (ECE)-would be a valuable direction for future work to assess whether DL confidence scores remain well-calibrated under OOD deployment conditions.
 
Top-K crop recommendations and consensus
 
Sugarcane, chillies and cabbage appeared in the Top-6 outputs of all three models, whereas maize was supported by MLP and TabNet (Table 4). Sugarcane was RF’s top recommendation and is cultivated over 12,000 ha in the district (Kurukshetra District Government, 2024). In the weighted consensus, sugarcane, chillies and cabbage had High consensus; maize Moderate; and wheat and sunflower low, reflecting differing responses to domain shift.

Table 4: Weighted consensus Top-6 crop recommendations (Eq. 2; weights: RF=0.337, MLP=0.332, TabNet=0.331).


 
Season-wise recommendations
 
Table 5 presents the season-wise weighted consensus Top-K recommendations for Rabi, Kharif and Zaid, together with their agronomic validity assessments.

Table 5: Season-wise weighted consensus Top-6 crop recommendations (Rabi: Oct-Mar; Kharif: Jun-Oct; Zaid: Mar-Jun).


       
Season-wise analysis (Table 5) identified valid recommendations and violations associated with absent seasonal metadata. Cabbage and sunflower were valid Rabi recommendations, while sugarcane and maize were valid in Kharif/Zaid. Violations included pearl millet and maize in Rabi, wheat in Kharif/Zaid and jute in Kharif because classifiers use soil-climate features without explicit seasonal constraints (Jaiswal et al., 2026).
 
External agronomic correspondence assessment
 
Table 6 presents the agronomic correspondence assessment of the consensus Top-6 crops against published Haryana agricultural evidence. Results represent correspondence with published regional agricultural evidence, not independent field-level ground-truth observations. Confirmed = supported by clear, regionally relevant authoritative agricultural evidence; Partial = supported by limited or less district-specific evidence. Sources: GoI (2024); SLBC Haryana (2023); CCS HAU (2015); Kurukshetra District Government (2024); Igrain (2025).

Table 6: Agronomic correspondence assessment of consensus Top-6 recommendations against published Haryana agricultural evidence.


       
Manual agronomic correspondence assessment confirmed five of six consensus recommendations (83.3%; Table 6) as documented crops in Kurukshetra or Haryana. No independent field-level crop suitability data were available; results therefore represent correspondence with published regional agricultural evidence rather than field-validated ground truth. Sugarcane, wheat, sunflower, cabbage and maize were supported by regional evidence; chillies received Partial correspondence because district-specific evidence was limited. The automated script reported 1/6 because of case-sensitive crop-label mismatches; manual assessment was therefore used for interpretation. The consensus framework produced regionally supported recommendations despite severe N and K mismatch.
 
Comparative analysis with prior studies
 
Compared with previous crop-recommendation studies, the present work evaluates cross-regional deployment under quantified feature-range shift, compares ML and DL confidence and performs an external agronomic correspondence assessment. Prity et al., (2024) and Shastri et al., (2025) reported 99.31% and 99.27% accuracy on homogeneous 22-class datasets, whereas the present study evaluates 33 crops under cross-regional shift with explicit OOD% assessment.
This study evaluated RF, MLP and TabNet for cross-regional crop recommendation in Kurukshetra with explicit domain-shift quantification. OOD% identified severe nitrogen (48.3%) and potassium (38.6%) mismatch, while temperature and humidity remained within the benchmark range. RF achieved Test F1=96.93%, whereas MLP and TabNet showed higher mean top-1 confidence (0.974 and 0.955) than RF (0.346) under deployment. Low agreement among all three models (13.9%) supported weighted Top-K consensus. The consensus Top-6 achieved 83.3% manual agronomic correspondence, with chillies showing partial correspondence; season-wise analysis identified violations associated with absent seasonal constraints. Limitations included the synthetic range-based deployment dataset-which restricts generalizability to regions with similar soil-climate profiles and should not be interpreted as evidence of deployment readiness-the exclusion of mustard and potato from the 33-class training set, the absence of explicit seasonal constraints in model training (which directly caused the season-wise recommendation violations identified in Table 5) and lack of domain adaptation. These limitations indicate a proof-of-concept cross-regional assessment rather than a deployable recommendation system. Future work should incorporate validated regional soil data, seasonal constraints and domain adaptation. Overall, OOD screening combined with multi-model consensus provides a reproducible approach for cautious, region-specific recommendation.
The authors received no external funding. They thank the Department of Computer Science and Applications, Kurukshetra University, for institutional support and acknowledge Thangatamilan (2025) for the public benchmark dataset and NASA POWER for meteorological data.
 
Data and code availability
 
All code used for data processing, model development, evaluation, OOD analysis and crop recommendation is available at:https://github.com/AliAsgharKhavari/kurukshetra- crop-recommendation.
       
The benchmark dataset was obtained from the Mendeley Data Repository (Thangatamilan, 2025): https://data.mendeley.com/datasets/vynxnppr7j/1
       
The Kurukshetra deployment dataset was constructed from field-survey data reported by Sheoran et al. (2024) and meteorological data obtained from NASA POWER. The derived deployment dataset and analytical outputs are available from the corresponding author upon reasonable request.
 
Credit author contributions
 
Ali Asghar Khavari: Conceptualisation, Methodology, Software, Formal Analysis, Investigation, Data Curation, Visualisation, Writing-Original Draft, Writing-Review and Editing. Shuchita Upadhyaya: Conceptualisation, Methodology, Supervision. Pardeep Kumar: Conceptualisation, Methodology, Supervision. Monika Poriye: Conceptualisation, Project Administration, Supervision.
 
Disclaimers
 
The views and conclusions are solely those of the authors and do not necessarily represent their affiliated institutions. The authors are responsible for the accuracy and completeness of the information but accept no liability for direct or indirect losses resulting from use of this content.
 
Informed consent
 
Not applicable. This study did not involve human participants or animals.
The authors declare no conflict of interest.

  1. Aggarwal, A. and Sharma, D. (2022). IoT-based recommender engine for yielding better crops. Bhartiya Krishi Anusandhan Patrika. 37(4): 363-368. doi: 10.18805/BKAP540.

  2. Arik, S.Ö. and Pfister, T. (2021). TabNet: Attentive interpretable tabular learning. Proceedings of the AAAI Conference on Artificial Intelligence. 35(8): 6679-6687. https://doi.org/10.1609/aaai.v35i8.16826.

  3. CCS Haryana Agricultural University. (2015). Horticulture Development in Haryana: Major Vegetable Growing Districts. HSHAD Report. CCS Haryana Agricultural University.

  4. Gimba, A.M. and Mishra, P.K. (2026). Explainable AI-enabled mixed- crop recommendation model using hybrid machine learning and ant colony optimization. Indian Journal of Agricultural Research. 60(6): 936-942. doi: 10.18805/IJARe.A-6497.

  5. Government of India. (2024). Agricultural Statistics at a Glance 2024. Ministry of Agriculture and Farmers’ Welfare, Directorate of Economics and Statistics. https://desagri.  gov.in 

  6. Grinsztajn, L., Oyallon, E. and Varoquaux, G. (2022). Why do tree- based models still outperform deep learning on typical tabular data? Advances in Neural Information Processing Systems. 35: 507-520. https://doi.org/10.48550/arXiv.2207.08815.

  7. Igrain. (2025, July 11). Mixed Trend in Haryana’s 2024-25 Crop Output. https://igrain.in/posts/mixed-trend-in-haryanas- 2024-25-crop-output.

  8. Indian Council of Agricultural Research. (2021). Handbook of Agriculture (7th ed.). Indian Council of Agricultural Research, New Delhi.

  9. Jaiswal, A., Thakur, R. and Jaswal, A. (2026). Investigating the influence of temporal dynamics and nutrient levels on soil health, plant uptake and yield attributes of toria in the Trans-Gangetic region of Punjab towards sustainable development goals. Agricultural Science Digest. 46(2): 301-307. doi: 10.18805/ag.D-6155.

  10. Khavari, A.A., Upadhyaya, S., Kumar, P. and Poriye, M. (2026). A statistically rigorous multi-classifier benchmark for crop recommendation: K-fold selection criterion, Friedman- Nemenyi testing and Optuna TPE optimisation. Indian Journal of Agricultural Research. doi: 10.18805/IJARe.A-6614.

  11. Kumar, S., Khanna, P., Pragya and Verma, S. (2025). Expert recommender system for mapping optimum crop type. Agricultural Science Digest. 45(4): 571-580. doi: 10.18805/ag.D-5530.

  12. Kurukshetra District Government. (2024). Agriculture and Farmers’ Welfare-Kurukshetra District. https://kurukshetra.gov.in/ agriculture/.

  13. Mehta, A.R., Kumar, P., Prem, G., Aggarwal, S. and Kumar, R. (2025). AI-powered innovations in agriculture: A systematic review on plant disease detection and classification. Indian Journal of Agricultural Research. 59(9): 1321- 1330. doi: 10.18805/IJARe.A-6371.

  14. NASA POWER. (2025). NASA POWER Project: Prediction of World wide Energy Resources. NASA. https://power.larc.nasa. gov/.

  15. Padmanayaki, S. and Geetha, K. (2026). Fixed-adaptive temporal attention network for predicting crop yield. Agricultural Science Digest. doi: 10.18805/ag.D-6468.

  16. Pandey, Y., Khan, M.F., Vishal, Pandey, A.K. and Singh, S P. (2023). Real-time soil monitoring with IoT enabled system for crop prediction. Agricultural Science Digest. doi: 10.18805/ag.D-5705.

  17. Prity, F.S., Hasan, M.M., Saif, S. H., Hossain, M.M., Bhuiyan, S.H., Islam, M.A. and Lavlu, M.T.H. (2024). Enhancing agricultural productivity: A machine learning approach to crop recommendations. Human-Centric Intelligent Systems. 4: 497-510. https://doi.org/10.1007/s44230-024-00081-3.

  18. Shastri, S., Kumar, S., Mansotra, V. and Salgotra, R. (2025). Advancing crop recommendation system with supervised machine learning and explainable artificial intelligence. Scientific Reports. 15: 25498. https://doi.org/10.1038/s41598-025-07003-8.

  19. Sheoran, D., Garhwal, R.S., Sharma, M., Karuna and Arun. (2024). Assessment and mapping of nutrients in soils of Babain and Ladwa blocks of Kurukshetra using GIS. International Journal of Plant and Soil Science. 36(7): 720-732. https://doi.org/10.9734/ijpss/2024/v36i74784.

  20. Shwartz-Ziv, R. and Armon, A. (2022). Tabular data: Deep learning is not all you need. Information Fusion. 81: 84-90. https://doi.org/10.1016/j.inffus.2021.11.011.

  21. SLBC Haryana. (2023). Agriculture-major Crops and Production Statistics of Haryana. State Level Bankers’ Committee, Punjab National Bank. https://slbcharyana.pnb.in/agriculture/.

  22. Thangatamilan, S. (2025). Crop recommendation (Version 1) [Data set]. Mendeley Data. https://doi.org/10.17632/vynxnp pr7j.1

  23. Yadav, M.B.N., Patil, P.L., Prasad, V. and Vyas, R.D.V. (2024). Suitability evaluation for cultivation of cotton in Ganjigatti sub- watershed of Karnataka using GIS, remote sensing and detailed survey. Agricultural Science Digest. doi: 10.18805/ag.D-5954.

Background: Cross-regional deployment of crop recommendation models is challenging because differences in soil and climatic conditions can cause distributional shifts between training and deployment domains. This study assessed the cross-regional behaviour of Random Forest (RF), Multi-Layer Perceptron (MLP) and TabNet under deployment in Kurukshetra, Haryana.

Methods: Three classifiers were evaluated on a 3,000-sample Kurukshetra deployment dataset constructed from field-survey soil measurements and NASA POWER meteorological records, with controlled Gaussian perturbation of meteorological features used to expand the dataset, using a 33,000-sample, 33-crop benchmark dataset. A feature-level OOD percentage (OOD%) metric quantified domain mismatch. Top-K (K=5) ranking retained the five most probable crop candidates per sample, followed by weighted consensus. Model confidence, inter-model agreement, season-wise recommendations and correspondence with Haryana agricultural sources were assessed.

Result: RF achieved the highest benchmark performance (CV F1=96.55%, Test F1=96.93%, AUC=0.9995), followed by MLP (95.31% Test F1) and TabNet (95.07%). Severe mismatch occurred for nitrogen (48.3%) and potassium (38.6%), whereas temperature and humidity remained within the benchmark range. MLP and TabNet showed higher mean top-1 confidence (0.974 and 0.955) than RF (0.346), while agreement among all three models was 13.9%. Weighted consensus ranked sugarcane, chillies, maize, wheat, cabbage and sunflower highest; five of six consensus recommendations showed manual agronomic correspondence with published regional agricultural evidence (83.3%). Season-wise analysis identified violations associated with the absence of seasonal constraints in the training data, supporting explicit OOD assessment and multi-model consensus for cautious, region-specific crop recommendation under distributional shift.

Cross-regional deployment of crop recommendation models-training in one geographic domain and applying them to another with different soil and climatic profiles-remains insufficiently addressed. Although ML systems perform strongly on structured soil-climate datasets, most studies use geographically homogeneous data and provide limited evidence on cross-regional performance under distributional shift (Grinsztajn et al., 2022; Shwartz-Ziv and Armon, 2022).
       
This question is particularly relevant for North India, where Kurukshetra District, Haryana, represents a challenging deployment setting. The district has alkaline alluvial soils with high nitrogen (mean 190.65 kg/ha vs. 89.32 kg/ha in the training domain) and potassium (177.38 vs. 63.34 kg/ha), with mean monthly rainfall of 45.62 mm vs. 76.64 mm (Sheoran et al., 2024; NASA POWER, 2025).
       
A further challenge is how ML and DL classifiers behave on out-of-distribution (OOD) deployment data, as most crop recommendation studies are evaluated within their training distribution. A previous benchmark study established the 33,000-sample, 33-crop benchmark and identified Random Forest as a high-performing classifier under rigorous multi-model evaluation (Khavari et al., 2026). The present study therefore evaluates RF, MLP and TabNet under quantified cross-regional domain shift. It is important to distinguish that the OOD% metric used in this study is a univariate feature-range extrapolation indicator- quantifying the extent to which deployment feature ranges exceed training ranges-rather than a complete statistical or model-based OOD detection method. No independent field-level crop suitability observations were collected for Kurukshetra; the agronomic correspondence assessment is based on published regional agricultural sources.
 
Recent developments in crop recommendation
 
Machine learning-based crop recommendation has been widely studied in Indian agro-climatic settings. Prity et al., (2024) reported 99.31% accuracy with Random Forest, while Shastri et al., (2025) achieved 99.27% with Gradient Boosting and SHAP-based interpretation. However, these studies used geographically homogeneous benchmark datasets. Tree-based ensembles show strong performance on medium-sized tabular data (Grinsztajn et al., 2022; Shwartz-Ziv and Armon, 2022), while recent agricultural studies combine machine learning with soil and weather variables for regional crop recommendation (Gimba and Mishra, 2026; Aggarwal and Sharma, 2022; Kumar et al., 2025) and deep learning for agricultural prediction (Padmanayaki and Geetha, 2026). Real-time soil monitoring has also used soil pH, temperature and moisture for crop prediction (Pandey et al., 2023). Recent reviews highlight the expanding role of AI and deep learning in agriculture (Mehta et al., 2025).
 
Key contributions
 
This study evaluates RF, MLP and TabNet in Kurukshetra, with four contributions:
1. OOD% assessment: Feature-level quantification of domain shift.
2. ML-DL comparison: Confidence and recommendations under N (48.3%) and K (38.6%) mismatch.
3. Top-K consensus: Weighted K=5 recommendations from 3,000 samples.
4. Agronomic correspondence: Manual assessment against published regional agricultural evidence yielded 83.3% correspondence.
This study was conducted at the Department of Computer Science and Applications, Kurukshetra University, Haryana, India (2025-2026). The deployment pipeline (Fig 1) comprised Kurukshetra dataset construction, OOD% quantification, three-model deployment (Optuna-tuned RF, MLP, TabNet), confidence analysis, Top-K weighted consensus, season-wise recommendation and agronomic correspondence assessment.

Fig 1: Deployment pipeline for RF, MLP and TabNet on the Kurukshetra dataset, including OOD% analysis, Top-K recommendation, season-wise recommendation and external agronomic correspondence assessment.


 
Random forest
 
The primary deployed classifier was an Optuna-tuned Random Forest trained on the Mendeley dataset (Thangatamilan, 2025), comprising 33,000 samples, 33 classes and seven features. Benchmark preparation and evaluation followed Khavari et al., (2026). Optuna TPE (50 trials) identified n_estimators=348, max_depth=31, min_samples_split=12, min_samples_leaf=2 and max_ features=log2. The model was retrained on all 33,000 samples for Kurukshetra deployment.
 
Multi-layer perceptron (MLP)-Deep learning baseline
 
The MLP was a fully connected PyTorch network trained on the 26,400-sample training partition of the 33,000-sample benchmark dataset, with three hidden layers [512, 256, 128], ReLU, batch normalisation, dropout=0.3 and a 33-unit softmax output. Adam (lr=0.001, weight_decay=1e-4), batch size=256, early stopping (patience=15) and a 200-epoch maximum were used with a 10% validation split. Inputs were standardised using a StandardScaler fitted on the training partition. Seed 42 was applied to PyTorch, NumPy and Python random modules for reproducibility.
 
TabNet-attention-based deep learning
 
TabNet (Arik and Pfister, 2021) uses sequential attention for sparse feature selection. Configuration: n_d=n_a=32, n_steps=5, gamma=1.5, lambda_sparse=1e-4. Training used Adam (lr=0.02), StepLR, batch size=1,024, maximum 100 epochs and early stopping (patience=15). The same StandardScaler and seed 42 were used as for MLP. All models were evaluated on the locked 6,600-sample test set before deployment.
 
Kurukshetra deployment dataset
 
The Kurukshetra deployment dataset comprised 3,000 samples from Babain and Ladwa. Soil N, P, K and pH were obtained from Sheoran et al., (2024) and temperature, relative humidity and precipitation from NASA POWER monthly data (2001-2025) for Babain (30.07°N, 76.98°E) and Ladwa (29.99°N, 77.05°E). Base samples from Sheoran et al., (2024) and NASA POWER monthly records (2001-2025) were expanded to 3,000 using additive Gaussian noise (σ = 3% of each feature mean) applied only to meteorological features; this was intended to reflect sub-monthly variability within observed seasonal ranges. Soil features were not perturbed. Month (1-12) was assigned by cycling NASA POWER monthly observations for seasonal disaggregation. Random seed 42 was used throughout. Feature statistics are shown in Table 1.

Table 1: Feature statistics and OOD% domain-shift analysis between the benchmark training and Kurukshetra deployment domains.


 
OOD% domain shift metric (Eq. 1)
 
The OOD% metric quantified feature-level distributional mismatch between training and deployment domains.


 
 Here,
μ = Benchmark training range. [μ_min, μ_max]. 
κ = Kurukshetra deployment range [κ_min, κ_max].                                    

OOD%=0% indicates full containment within the training range. Thresholds were <5% (Good), 5-30% (Moderate) and >30% (Severe), providing a per-feature measure of extrapolation. OOD% is a univariate feature-range extrapolation indicator rather than a complete statistical or model-based OOD detection method. These thresholds were defined operationally for this study and are not derived from a universally accepted external standard.
 
Three-model deployment and comparison
 
For benchmark comparison, RF performance from the previous study was retained (Khavari et al., 2026), whereas the Optuna-tuned RF was retrained on all 33,000 samples for Kurukshetra deployment. RF used raw features; MLP and TabNet used the StandardScaler fitted on the benchmark training partition. Each model produced a 3,000×33 predict_proba matrix. Evaluation included top-1 confidence, threshold exceedance (>0.50 and >0.70), top-1 crop frequencies and agreement among all three models.

Top-K recommendation and weighted consensus
 
Top-K retained the five most probable crops per sample because of the severe N and K shift. Each model generated 15,000 ranked recommendations across 3,000 samples. No confidence threshold was applied; all candidates were retained to characterise model behaviour under OOD conditions. The weighted consensus probability matrix was computed as:
 
                Pconsensus = WRF × PRF + WMLP × PMLP + WTabNet × PTabNet         ..(2)
 
Weights were proportional to benchmark Test F1: w_RF=0.337, w_MLP=0.332 and w_TabNet=0.331.
 
Season-wise recommendation framework
 
Season-aware disaggregation used monthly NASA POWER data. Based on the ICAR (2021) crop calendar, samples were classified as Rabi (October-March), Kharif (June-October) and Zaid (March-June), with 5,000, 6,250 and 3,750 recommendations, respectively. Consensus recommendations were calculated independently for each season.
 
Agronomic correspondence assessment
 
Consensus recommendations were assessed against Government of India (GoI, 2024), Kurukshetra District Government (2024), SLBC Haryana (2023) and CCS Haryana Agricultural University (CCS HAU, 2015); Igrain (2025) provided supplementary state-level production evidence. Crops were classified as Confirmed when supported by clear Haryana/Kurukshetra evidence and Partial when evidence was limited or less district-specific. The confirmed correspondence rate was the proportion of consensus Top-6 crops classified as Confirmed.
Benchmark evaluation: RF vs. MLP vs. TabNet
 
Table 2 presents benchmark performance for RF, MLP and TabNet on 33,000 samples (26,400 training; 6,600 test; 33 classes) using 7-fold stratified cross-validation.

Table 2: Benchmark evaluation: RF vs. MLP vs. TabNet (26,400 train | 6,600 test | 33 classes | 7-fold CV).


       
RF achieved the highest CV and Test F1 (Table 2), consistent with the previous benchmark (Khavari et al., 2026). TabNet had the smallest CV-Test gap (0.26%) and all models achieved AUC ≥0.9994, indicating high discriminative capacity across 33 classes. The RF–DL differences were modest (RF-MLP=2.26 pp; RF-TabNet=1.22 pp in CV F1).
 
Domain shift analysis (OOD%)
 
Table 1 presents the OOD% values for all seven features. The OOD% analysis reveals a highly asymmetric domain shift profile. This pattern is consistent with the broader principle that crop suitability is strongly influenced by site-specific soil characteristics and their associated limitations (Yadav et al., 2024). Nitrogen showed the most severe mismatch (OOD%=48.3%), with Kurukshetra values well above the training range (Table 1), consistent with the high nitrogen levels of intensively cropped alluvial soils under the wheat-rice rotation system. Potassium showed the second most severe mismatch (OOD%=38.6%), reflecting the same high-fertility alluvial soil profile. Temperature and humidity showed no mismatch (0.0%), so the deployment scenario is characterised by severe soil mismatch but adequate meteorological coverage.
 
Classifier confidence under domain shift
 
The confidence statistics for the three models are presented in Table 3.

Table 3: Confidence distribution comparison: RF vs. MLP vs. TabNet over 3,000 samples of Kurukshetra.


       
MLP and TabNet showed substantially higher prediction confidence than RF under domain shift (Table 3): >98% of DL predictions exceeded 0.50 confidence versus 10.2% for RF. RF produced lower and more variable confidence under the observed OOD conditions. Agreement among all three models was 13.9%, with pairwise agreement of 15.4% (RF-MLP) to 28.1% (RF-TabNet), supporting consensus over reliance on a single model. The substantially higher predictive confidence of MLP (mean top-1: 0.974) and TabNet (0.955) relative to RF (0.346) despite severe nitrogen (OOD%=48.3%) and potassium (OOD%=38.6%) mismatch may indicate potential confidence overestimation under distributional shift. Calibration analysis-such as reliability diagrams or expected calibration error (ECE)-would be a valuable direction for future work to assess whether DL confidence scores remain well-calibrated under OOD deployment conditions.
 
Top-K crop recommendations and consensus
 
Sugarcane, chillies and cabbage appeared in the Top-6 outputs of all three models, whereas maize was supported by MLP and TabNet (Table 4). Sugarcane was RF’s top recommendation and is cultivated over 12,000 ha in the district (Kurukshetra District Government, 2024). In the weighted consensus, sugarcane, chillies and cabbage had High consensus; maize Moderate; and wheat and sunflower low, reflecting differing responses to domain shift.

Table 4: Weighted consensus Top-6 crop recommendations (Eq. 2; weights: RF=0.337, MLP=0.332, TabNet=0.331).


 
Season-wise recommendations
 
Table 5 presents the season-wise weighted consensus Top-K recommendations for Rabi, Kharif and Zaid, together with their agronomic validity assessments.

Table 5: Season-wise weighted consensus Top-6 crop recommendations (Rabi: Oct-Mar; Kharif: Jun-Oct; Zaid: Mar-Jun).


       
Season-wise analysis (Table 5) identified valid recommendations and violations associated with absent seasonal metadata. Cabbage and sunflower were valid Rabi recommendations, while sugarcane and maize were valid in Kharif/Zaid. Violations included pearl millet and maize in Rabi, wheat in Kharif/Zaid and jute in Kharif because classifiers use soil-climate features without explicit seasonal constraints (Jaiswal et al., 2026).
 
External agronomic correspondence assessment
 
Table 6 presents the agronomic correspondence assessment of the consensus Top-6 crops against published Haryana agricultural evidence. Results represent correspondence with published regional agricultural evidence, not independent field-level ground-truth observations. Confirmed = supported by clear, regionally relevant authoritative agricultural evidence; Partial = supported by limited or less district-specific evidence. Sources: GoI (2024); SLBC Haryana (2023); CCS HAU (2015); Kurukshetra District Government (2024); Igrain (2025).

Table 6: Agronomic correspondence assessment of consensus Top-6 recommendations against published Haryana agricultural evidence.


       
Manual agronomic correspondence assessment confirmed five of six consensus recommendations (83.3%; Table 6) as documented crops in Kurukshetra or Haryana. No independent field-level crop suitability data were available; results therefore represent correspondence with published regional agricultural evidence rather than field-validated ground truth. Sugarcane, wheat, sunflower, cabbage and maize were supported by regional evidence; chillies received Partial correspondence because district-specific evidence was limited. The automated script reported 1/6 because of case-sensitive crop-label mismatches; manual assessment was therefore used for interpretation. The consensus framework produced regionally supported recommendations despite severe N and K mismatch.
 
Comparative analysis with prior studies
 
Compared with previous crop-recommendation studies, the present work evaluates cross-regional deployment under quantified feature-range shift, compares ML and DL confidence and performs an external agronomic correspondence assessment. Prity et al., (2024) and Shastri et al., (2025) reported 99.31% and 99.27% accuracy on homogeneous 22-class datasets, whereas the present study evaluates 33 crops under cross-regional shift with explicit OOD% assessment.
This study evaluated RF, MLP and TabNet for cross-regional crop recommendation in Kurukshetra with explicit domain-shift quantification. OOD% identified severe nitrogen (48.3%) and potassium (38.6%) mismatch, while temperature and humidity remained within the benchmark range. RF achieved Test F1=96.93%, whereas MLP and TabNet showed higher mean top-1 confidence (0.974 and 0.955) than RF (0.346) under deployment. Low agreement among all three models (13.9%) supported weighted Top-K consensus. The consensus Top-6 achieved 83.3% manual agronomic correspondence, with chillies showing partial correspondence; season-wise analysis identified violations associated with absent seasonal constraints. Limitations included the synthetic range-based deployment dataset-which restricts generalizability to regions with similar soil-climate profiles and should not be interpreted as evidence of deployment readiness-the exclusion of mustard and potato from the 33-class training set, the absence of explicit seasonal constraints in model training (which directly caused the season-wise recommendation violations identified in Table 5) and lack of domain adaptation. These limitations indicate a proof-of-concept cross-regional assessment rather than a deployable recommendation system. Future work should incorporate validated regional soil data, seasonal constraints and domain adaptation. Overall, OOD screening combined with multi-model consensus provides a reproducible approach for cautious, region-specific recommendation.
The authors received no external funding. They thank the Department of Computer Science and Applications, Kurukshetra University, for institutional support and acknowledge Thangatamilan (2025) for the public benchmark dataset and NASA POWER for meteorological data.
 
Data and code availability
 
All code used for data processing, model development, evaluation, OOD analysis and crop recommendation is available at:https://github.com/AliAsgharKhavari/kurukshetra- crop-recommendation.
       
The benchmark dataset was obtained from the Mendeley Data Repository (Thangatamilan, 2025): https://data.mendeley.com/datasets/vynxnppr7j/1
       
The Kurukshetra deployment dataset was constructed from field-survey data reported by Sheoran et al. (2024) and meteorological data obtained from NASA POWER. The derived deployment dataset and analytical outputs are available from the corresponding author upon reasonable request.
 
Credit author contributions
 
Ali Asghar Khavari: Conceptualisation, Methodology, Software, Formal Analysis, Investigation, Data Curation, Visualisation, Writing-Original Draft, Writing-Review and Editing. Shuchita Upadhyaya: Conceptualisation, Methodology, Supervision. Pardeep Kumar: Conceptualisation, Methodology, Supervision. Monika Poriye: Conceptualisation, Project Administration, Supervision.
 
Disclaimers
 
The views and conclusions are solely those of the authors and do not necessarily represent their affiliated institutions. The authors are responsible for the accuracy and completeness of the information but accept no liability for direct or indirect losses resulting from use of this content.
 
Informed consent
 
Not applicable. This study did not involve human participants or animals.
The authors declare no conflict of interest.

  1. Aggarwal, A. and Sharma, D. (2022). IoT-based recommender engine for yielding better crops. Bhartiya Krishi Anusandhan Patrika. 37(4): 363-368. doi: 10.18805/BKAP540.

  2. Arik, S.Ö. and Pfister, T. (2021). TabNet: Attentive interpretable tabular learning. Proceedings of the AAAI Conference on Artificial Intelligence. 35(8): 6679-6687. https://doi.org/10.1609/aaai.v35i8.16826.

  3. CCS Haryana Agricultural University. (2015). Horticulture Development in Haryana: Major Vegetable Growing Districts. HSHAD Report. CCS Haryana Agricultural University.

  4. Gimba, A.M. and Mishra, P.K. (2026). Explainable AI-enabled mixed- crop recommendation model using hybrid machine learning and ant colony optimization. Indian Journal of Agricultural Research. 60(6): 936-942. doi: 10.18805/IJARe.A-6497.

  5. Government of India. (2024). Agricultural Statistics at a Glance 2024. Ministry of Agriculture and Farmers’ Welfare, Directorate of Economics and Statistics. https://desagri.  gov.in 

  6. Grinsztajn, L., Oyallon, E. and Varoquaux, G. (2022). Why do tree- based models still outperform deep learning on typical tabular data? Advances in Neural Information Processing Systems. 35: 507-520. https://doi.org/10.48550/arXiv.2207.08815.

  7. Igrain. (2025, July 11). Mixed Trend in Haryana’s 2024-25 Crop Output. https://igrain.in/posts/mixed-trend-in-haryanas- 2024-25-crop-output.

  8. Indian Council of Agricultural Research. (2021). Handbook of Agriculture (7th ed.). Indian Council of Agricultural Research, New Delhi.

  9. Jaiswal, A., Thakur, R. and Jaswal, A. (2026). Investigating the influence of temporal dynamics and nutrient levels on soil health, plant uptake and yield attributes of toria in the Trans-Gangetic region of Punjab towards sustainable development goals. Agricultural Science Digest. 46(2): 301-307. doi: 10.18805/ag.D-6155.

  10. Khavari, A.A., Upadhyaya, S., Kumar, P. and Poriye, M. (2026). A statistically rigorous multi-classifier benchmark for crop recommendation: K-fold selection criterion, Friedman- Nemenyi testing and Optuna TPE optimisation. Indian Journal of Agricultural Research. doi: 10.18805/IJARe.A-6614.

  11. Kumar, S., Khanna, P., Pragya and Verma, S. (2025). Expert recommender system for mapping optimum crop type. Agricultural Science Digest. 45(4): 571-580. doi: 10.18805/ag.D-5530.

  12. Kurukshetra District Government. (2024). Agriculture and Farmers’ Welfare-Kurukshetra District. https://kurukshetra.gov.in/ agriculture/.

  13. Mehta, A.R., Kumar, P., Prem, G., Aggarwal, S. and Kumar, R. (2025). AI-powered innovations in agriculture: A systematic review on plant disease detection and classification. Indian Journal of Agricultural Research. 59(9): 1321- 1330. doi: 10.18805/IJARe.A-6371.

  14. NASA POWER. (2025). NASA POWER Project: Prediction of World wide Energy Resources. NASA. https://power.larc.nasa. gov/.

  15. Padmanayaki, S. and Geetha, K. (2026). Fixed-adaptive temporal attention network for predicting crop yield. Agricultural Science Digest. doi: 10.18805/ag.D-6468.

  16. Pandey, Y., Khan, M.F., Vishal, Pandey, A.K. and Singh, S P. (2023). Real-time soil monitoring with IoT enabled system for crop prediction. Agricultural Science Digest. doi: 10.18805/ag.D-5705.

  17. Prity, F.S., Hasan, M.M., Saif, S. H., Hossain, M.M., Bhuiyan, S.H., Islam, M.A. and Lavlu, M.T.H. (2024). Enhancing agricultural productivity: A machine learning approach to crop recommendations. Human-Centric Intelligent Systems. 4: 497-510. https://doi.org/10.1007/s44230-024-00081-3.

  18. Shastri, S., Kumar, S., Mansotra, V. and Salgotra, R. (2025). Advancing crop recommendation system with supervised machine learning and explainable artificial intelligence. Scientific Reports. 15: 25498. https://doi.org/10.1038/s41598-025-07003-8.

  19. Sheoran, D., Garhwal, R.S., Sharma, M., Karuna and Arun. (2024). Assessment and mapping of nutrients in soils of Babain and Ladwa blocks of Kurukshetra using GIS. International Journal of Plant and Soil Science. 36(7): 720-732. https://doi.org/10.9734/ijpss/2024/v36i74784.

  20. Shwartz-Ziv, R. and Armon, A. (2022). Tabular data: Deep learning is not all you need. Information Fusion. 81: 84-90. https://doi.org/10.1016/j.inffus.2021.11.011.

  21. SLBC Haryana. (2023). Agriculture-major Crops and Production Statistics of Haryana. State Level Bankers’ Committee, Punjab National Bank. https://slbcharyana.pnb.in/agriculture/.

  22. Thangatamilan, S. (2025). Crop recommendation (Version 1) [Data set]. Mendeley Data. https://doi.org/10.17632/vynxnp pr7j.1

  23. Yadav, M.B.N., Patil, P.L., Prasad, V. and Vyas, R.D.V. (2024). Suitability evaluation for cultivation of cotton in Ganjigatti sub- watershed of Karnataka using GIS, remote sensing and detailed survey. Agricultural Science Digest. doi: 10.18805/ag.D-5954.
In this Article
Published In
Agricultural Science Digest

Editorial Board

View all (0)