Agriculture is an important part of our economy and ensures food security. However, farmers often struggle to decide which crops to grow, what fertilizers to use, and how to manage pests effectively. These decisions are usually based on experience, which may not always lead to the best results. To address this issue, this paper introduces a Smart Agriculture Advisor. This web-based application uses Machine Learning (ML) and Deep Learning (DL) to help farmers make better decisions. The system includes four main features: soil classification, crop recommendation, fertilizer suggestion, and pesticide identification. Farmers can upload soil images, and a deep learning model identifies the soil type. Based on soil conditions, weather, and nutrient levels, the system recommends suitable crops. It also suggests appropriate fertilizers, identifies plant diseases from leaf images using convolutional neural networks (CNNs), and recommends suitable pesticides. By combining ML and DL techniques, the system provides accurate and practical guidance. It is user-friendly and helps farmers improve productivity, use resources efficiently, and promote sustainable farming practices
Introduction
The study proposes a Smart Agriculture Advisor, a web-based decision-support system that uses Machine Learning (ML), Deep Learning (DL), Convolutional Neural Networks (CNNs), real-time weather data, and a knowledge-based recommendation engine to help farmers make better agricultural decisions.
The system addresses common farming challenges such as poor soil fertility, inappropriate crop selection, excessive fertilizer use, unpredictable weather, and crop diseases or pests. Its main contribution is integrating several agricultural services into a single platform rather than treating soil classification, crop recommendation, fertilizer recommendation, and disease detection as separate systems.
Main Components
The Smart Agriculture Advisor provides four major functions:
Soil Classification
Farmers upload an image of their soil.
A CNN identifies the soil type.
The predicted soil class is subsequently used for crop and fertilizer recommendations.
The model was trained on 1,600 soil images using an 80:20 training/testing split.
It achieved a test accuracy of 83.48%.
Crop Recommendation
A Random Forest classifier recommends suitable crops based on soil type, NPK values, temperature, humidity, rainfall, and wind conditions.
The dataset contains approximately 2,200 records covering 22 crop types.
The model achieved approximately 99.45% mean cross-validation accuracy.
Accuracy, precision, recall, and F1-score were all approximately 99%.
The system provides the top three recommended crops with confidence scores.
Fertilizer Recommendation
The system recommends suitable fertilizer based on soil characteristics, crop type, and environmental conditions.
Around 1,000 records were used for model development.
Several algorithms were evaluated, including Random Forest and XGBoost.
Random Forest achieved approximately 98% accuracy and was selected as the final model.
The system generates a fertilizer recommendation based on the user's inputs.
Pesticide/Disease Recommendation
Farmers upload a crop leaf image.
A CNN identifies the disease affecting the plant.
The study uses a Rice Leaf Disease Dataset containing 4,684 images across three classes: Leaf Smut, Bacterial Blight, and Brown Spot.
The images were resized to 224 × 224 pixels, normalized, and augmented through rotation, flipping, and zooming.
The CNN achieved 96.37% validation accuracy.
After disease identification, a rule-based mapping provides an appropriate treatment/pesticide recommendation.
System Architecture
The proposed architecture follows a modular, service-oriented design. Users interact with the system through a web or mobile application. Their inputs are securely transmitted through an HTTPS API Gateway to the backend.
The Main Backend Controller coordinates the different services:
User Input → API Gateway → Backend Controller → ML Models / Weather API → Recommendation Engine → User
The system can obtain real-time temperature, humidity, rainfall, and wind speed through an external weather API. Image-based inputs are processed by the ML Model Service, which contains the soil classification and disease detection models.
The Recommendation Engine combines model predictions, real-time environmental information, and agricultural knowledge stored in a database to generate recommendations. Uploaded images can also be stored in cloud storage to support scalability and future model improvements.
Experimental Results
The reported results demonstrate strong predictive performance across the different modules:
Module
Model
Dataset
Performance
Soil classification
CNN
1,600 images
83.48% test accuracy
Crop recommendation
Random Forest
~2,200 records
99.45% CV accuracy
Fertilizer recommendation
Random Forest
~1,000 records
~98% accuracy
Disease/pesticide recommendation
CNN
4,684 images
96.37% validation accuracy
Overall Contribution
The key contribution of the research is the integration of multiple AI-based agricultural services into one accessible platform. Instead of requiring farmers to use separate systems for soil identification, crop selection, fertilizer management, and disease detection, the Smart Agriculture Advisor combines these functions and incorporates real-time weather information.
The system therefore acts as an AI-powered agricultural decision-support platform, potentially helping farmers make more informed decisions, reduce inappropriate input use, identify crop diseases earlier, and improve productivity.
In short: the project combines CNN-based image analysis + Random Forest machine learning + real-time weather data + a recommendation engine to create an integrated smart-farming assistant. The reported results are particularly strong for crop recommendation (~99.45%), fertilizer recommendation (~98%), and disease detection (96.37%), while soil classification (83.48%) represents the main area with greater scope for improvement.
Conclusion
This paper presents a Smart Agriculture Advisor system that integrates soil classification, crop recommendation, fertilizer recommendation, and pesticide recommendation into a single platform. Machine learning and deep learning techniques are used to analyze soil images, environmental conditions, and crop data to support agricultural decision-making. The experimental results show that the proposed models achieve reliable prediction performance. By combining multiple agricultural decision-support modules, the system helps farmers make informed choices, improve crop productivity, and promote sustainable farming practices.
References
[1] Dhruvi Gosai, Chintal Raval, Rikin Nayak, Hardik Jayswal, and Axat Pate,“Crop Recommendation System using Machine Learning” ,IJSRCSEIT, Vol. 7, Issue 3, 2021, DOI: 10.32628/CSEIT2173129.
[2] Asit Ghosh, Sunil Kumar Mohapatra, Pritam Pattanaik, Prasant Kumar Dash, “A Comprehensive Crop Recommendation System Integrating Machine Learning and Deep Learning Models”, 2024 International Conference on Cognitive, Green, and Ubiquitous Computing (IC-CGU), DOI: 10.1109/IC-CGU58078.2024.10530724
[3] Abeje, B.T., Salau, A.O., Gela, B.M. et al. Soil type identification model using a hybrid computer vision and machine learning approach. Multimed Tools Appl 83, 575–589 (2024). https://doi.org/10.1007/s11042-023-15692-44
[4] S. M. Jasvanth and E. J. T. Fredrik, \"Soil Image Classification and Crop Recommendation Using Convolutional Neural Networks,\" 2024 2nd International Conference on Computing and Data Analytics (ICCDA), Shinas, Oman, 2024, pp. 1-6, doi: 10.1109/ICCDA64887.2024.10867325.
[5] 5. Sakila Akhilesh, Brahma Tejaswini Abburi, Peyyela Somya, Raghukula Mohana Sai Krishna, and Talari Srihari, \"Fertilizer Recommendation for Agriculture using Machine Learning,\" International Journal of Multidisciplinary Research and Growth Evaluation, vol. 6, no. 2, pp. 756–760, Mar.–Apr. 2025, doi: 10.54660/.IJMRGE.2025.6.2.756-760
[6] 6. Varshitha D. N. and Savita Choudhary, \"The new machine learning feature selection method used in fertilizer recommendation,\" Bulletin of Electrical Engineering and Informatics, vol. 13, no. 5, pp. 3455–3462, Oct. 2024, doi: 10.11591/eei.v13i5.7198
[7] 7. Shoaib M, Sadeghi-Niaraki A, Ali F, Hussain I and Khalid S (2025) Leveraging deep learning for plant disease and pest detection: a comprehensive review and future directions. Front. Plant Sci. 16:1538163. doi: 10.3389/fpls.2025.1538163
[8] 8. Ashurov AY, Al-Gaashani MSAM, Samee NA, Alkanhel R, Atteia G, Abdallah HA and Saleh Ali Muthanna M (2025) Enhancing plant disease detection through deep learning: a Depthwise CNN with squeeze and excitation integration and residual skip connections. Front. Plant Sci. 15:1505857. doi: 10.3389/fpls.2024.1505