BERT-Based Agricultural Crop Prediction System Using Soil and Weather Parameters with Interactive Streamlit Deployment
DOI:
https://doi.org/10.63503/acset.126Keywords:
BERT, Precision Agriculture, Crop Recommendation, Soil-Climate Analysis, Explainable AI, Streamlit DeploymentAbstract
The proper choice of crops is a necessary aspect of enhancing agricultural performance, effective use of resources, and sustainable food production in changing climatic conditions. Conventional recommendation systems are based mostly on statistical and shallow machine learning models, in which soil and climatic parameters are used as independent variables, thereby restricting their capacity to form contextual associations among agronomic factors. The research is a BERT-based predictive agricultural crop model that uses contextual language representations to predict complex relationships among soil nutrients and weather conditions. Numerical agricultural data, such as Nitrogen (N), Phosphorus (P), Potassium (K), soil pH, temperature, humidity, rainfall, and soil type, are transformed into text-structured descriptors and input into an already-trained Bidirectional Encoder Representations from Transformers (BERT) model. The contextual embeddings obtained with the frozen BERT encoder are sent to a light model neural classification head of fully connected layers, dropout regularization, and LogSoftmax activation to make predictions that will choose the best crop among 22 classes. The model is coded in PyTorch and deployed as an interactive Streamlit application, enabling real-time user interaction and crop suggestions. It is experimentally shown that contextual embedding-based modeling enhances classification strength and is able to contribute to interpretable agricultural decision-making. The system illustrates how transformer-based architecture can be used in precision agriculture and decision support systems.
References
[1] K. Xiao, “Research on Crop Growth Detection and Prediction in Farmland Based on Agricultural Big Data,” 2024 International Conference on Telecommunications and Power Electronics (TELEPE), Frankfurt, Germany, 2024, pp. 500–505, doi: 10.1109/TELEPE64216.2024.00095.
[2] V. K., S. G., R. P. P., and R. M., “Enhancing Predictive Accuracy for Agricultural Crop Yields in Indian States Using Power Transformation in Machine Learning Models,” 2024 10th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 2024, pp. 2403–2408, doi: 10.1109/ICACCS60874.2024.10716829.
[3] R. Tamilkodi, N. Madhuri, G. G. D. Bhavani, K. M. Yadav, and P. Sayandh, “Crop Yield Prediction with Suitable Fertilization Using Deep Learning,” 2025 International Conference on Machine Learning and Autonomous Systems (ICMLAS), Prawet, Thailand, 2025, pp. 47–52, doi: 10.1109/ICMLAS64557.2025.10967862.
[4] T. Deshmukh, A. S. Rajawat, and A. Potgantwar, “Machine Learning Technique for Crop Selection and Prediction of Crop Cultivation,” 2023 International Conference on Advanced Computing Technologies and Applications (ICACTA), Mumbai, India, 2023, pp. 1–7, doi: 10.1109/ICACTA58201.2023.10392348.
[5] N. Kumar, K. Kaur, A. Kaur, and C. Sharma, “Revolutionizing Crop Yield Prediction with Machine Learning: A Sustainable Approach to Minimizing Agricultural Waste,” 2024 International Conference on Cybernation and Computation (CYBERCOM), Dehradun, India, 2024, pp. 394–398, doi: 10.1109/CYBERCOM63683.2024.10803268.
[6] M. Shilpa et al., “Enhancing Crop Yield and Growth Prediction Using IoT-Based Smart Irrigation Systems and Machine Learning Algorithms,” 2024 Second International Conference on Networks, Multimedia and Information Technology (NMITCON), Bengaluru, India, 2024, pp. 1–5, doi: 10.1109/NMITCON62075.2024.10698825.
[7] V. Choudhary and A. Thakur, “Comparative Analysis of Machine Learning Techniques for Disease Prediction in Crops,” 2022 IEEE 11th International Conference on Communication Systems and Network Technologies (CSNT), Indore, India, 2022, pp. 190–195, doi: 10.1109/CSNT54456.2022.9787661.
[8] S. Kumar, V. Gupta, V. Partap, and A. Kumar, “Crop Yield Prediction for Smart Farming,” 2025 3rd International Conference on Communication, Security, and Artificial Intelligence (ICCSAI), Greater Noida, India, 2025, pp. 610–614, doi: 10.1109/ICCSAI64074.2025.11064531.
[9] S. M. G. Paudel, R. Nakarmi, P. Giri, and S. B. Karki, “Prediction of Crop Yield Based on Soil Moisture Using Machine Learning Algorithms,” 2022 2nd International Conference on Technological Advancements in Computational Sciences (ICTACS), Tashkent, Uzbekistan, 2022, pp. 491–495, doi: 10.1109/ICTACS56270.2022.9988186.
[10] R. Arumuga Arun, T. Saraswathi, D. Meeha, and G. Sugeerthi, “A Machine Learning-Based Agricultural Yield Forecasting System for Predicting Crop Yield Before Planting,” 2023 12th International Conference on Advanced Computing (ICoAC), Chennai, India, 2023, pp. 1–6, doi: 10.1109/ICoAC59537.2023.10249364.
[11] N. M. Basavaraju, U. B. Mahadevaswamy, and S. Mallikarjunaswamy, “Design and Implementation of Crop Yield Prediction and Fertilizer Utilization Using IoT and Machine Learning,” 2024 Second International Conference on Networks, Multimedia and Information Technology (NMITCON), Bengaluru, India, 2024, pp. 1–6, doi: 10.1109/NMITCON62075.2024.10699184.
[12] D. Balakrishnan et al., “Agricultural Crop Recommendation System,” 2023 3rd International Conference on Intelligent Technologies (CONIT), Hubli, India, 2023, pp. 1–5, doi: 10.1109/CONIT59222.2023.10205756.
[13] D. Kholiya, A. K. Mishra, and N. K. Pandey, “Prediction of Crops Based on Characteristics Using Feature Selection Algorithm,” 2023 11th International Conference on Intelligent Systems and Embedded Design (ISED), Dehradun, India, 2023, pp. 1–5, doi: 10.1109/ISED59382.2023.10444580.
[14] M. S. Ali et al., “Crop Prediction and Fertilizer Recommendation Using AODE Algorithm,” 2024 IEEE 9th International Conference for Convergence in Technology (I2CT), Pune, India, 2024, pp. 1–5, doi: 10.1109/I2CT61223.2024.10543894.
[15] L. Yang et al., “A Framework for Digital Crop Growing Modeling Based on Agricultural Internet of Things,” 2022 IEEE Intl Conf on Dependable, Autonomic and Secure Computing, Falerna, Italy, 2022, pp. 1–6, doi: 10.1109/DASC/PiCom/CBDCom/Cy55231.2022.9927809.
[16] J. Lahari, V. Lavanya, and K. B. Manikandan, “Crop Prediction to Aid Farmers Using Hybrid Model,” 2024 8th International Conference on Inventive Systems and Control (ICISC), Coimbatore, India, 2024, pp. 705–710, doi: 10.1109/ICISC62624.2024.00125.
[17] V. Bala Krishnan and S. Gokila, “Exploring the Impact of Learning Layers within Recurrent Neural Networks on Crop Yield Prediction,” 2024 Second International Conference on Data Science and Information System (ICDSIS), Hassan, India, 2024, pp. 1–5, doi: 10.1109/ICDSIS61070.2024.10594512.
[18] P. Kumar, S. Agarwal, S. K. Gupta, and G. Kaur, “Agricultural Crop Yield Prediction Using Regression Models with Prominent Feature,” 2023 3rd International Conference on Innovative Mechanisms for Industry Applications (ICIMIA), Bengaluru, India, 2023, pp. 384–389, doi: 10.1109/ICIMIA60377.2023.10426396.
[19] S. Srivastava et al., “AI-Based Smart Crop Prediction System for Karnataka State,” 2024 IEEE 11th Uttar Pradesh Section International Conference on Electrical, Electronics and Computer Engineering (UPCON), Lucknow, India, 2024, pp. 1–6, doi: 10.1109/UPCON62832.2024.10983065.
[20] S. M. et al., “Analysis of Hydroponic System Crop Yield Prediction and Crop IoT-Based Monitoring System for Precision Agriculture,” 2022 International Conference on Edge Computing and Applications (ICECAA), Tamil Nadu, India, 2022, pp. 575–578, doi: 10.1109/ICECAA55415.2022.9936473.
Downloads
Published
Conference Proceedings Volume
Section
License
Copyright (c) 2026 Adroid Conference Series: Engineering and Technology

This work is licensed under a Creative Commons Attribution 4.0 International License.