School of Computer Science and Engineering
Course Code: B22EF0801 Project work Methodology Academic Year: 2025-2026
Semester: 8th
Project Group Members Details
Group No: C12 Group Name:
Sl. SRN Full Name Sec Mobile No. Email_ID Sign
No
1 R22EF130 Naveen Gowda P R C 7892043397 ugcet220655@[Link]
2 R22EF155 Pramod V Naik C 7483506305 ugcet220529@[Link]
3 R22EF177 Samarth Firangi C 6360877440 ugcet220541@[Link]
4 R22EF179 Sameer C C 9380594351 ugcet220557@[Link]
Task Distribution
Project Leader Naveen Gowda P R
Documenter Lead: Pramod V Naik
Development Lead: Samarth Firangi, Sameer C
Project Details
Project Title: Smart Agriculture: An AI System for Crop Disease Detection and Treatment
Recommendation
Type of Project Software
Guide Details: Name: Dr. Anooja Ali Mobile No: 8050779104
Designation: Associate Professor
Place of Project
Work:
External Guide: Name: Designation: Mobile No:
Remarks by Guide: Guide Signature Date:
Abstract:
Crop diseases continue to remain a major threat to global agricultural productivity, causing substantial yield losses and
directly impacting food security, farmer income, and sustainability. Traditional disease detection approaches rely heavily on
manual observation and expert consultation, both of which are often slow, subjective, and inaccessible to many small and
medium-scale farmers. To address this critical challenge, the AI-Driven Crop Disease Prediction and Management System
leverages the power of Artificial Intelligence and Deep Learning to provide fast, accurate, and automated crop disease
diagnosis using leaf images.
The system employs a Convolutional Neural Network (CNN) model trained on diverse and real-world leaf datasets to classify
diseases with high accuracy. A user-friendly web application—developed using Flask—allows farmers to upload leaf images,
receive predictions instantly, and view detailed disease descriptions, symptoms, and recommended treatments. To enhance
contextual decision-making, the system integrates real-time weather API data, enabling farmers to understand environmental
conditions that may influence disease spread or crop stress. Furthermore, an AI-powered chatbot is included to assist users
with personalized suggestions, cultivation guidance, pesticide recommendations, and answers to general agricultural
queries.
By combining image-based analysis, weather intelligence, and AI-driven advisory support, this system transforms crop
disease management from a reactive manual process into a proactive digital solution. It reduces the dependency on experts,
minimizes misdiagnosis, and promotes sustainable farming by helping farmers optimize pesticide usage and adopt timely
interventions. The proposed system is scalable, cost-effective, and accessible to users with limited technical knowledge.
Overall, the project demonstrates the impact of AI in precision agriculture and provides a practical tool that can significantly
help farmers improve crop health, reduce losses, and increase productivity.
METHODOLOGY
Figure 1:System Architecture for Plant Disease Detection and Fertilizer Recommendation
The proposed system, Smart Agriculture: An AI-Based Crop Disease Detection and Treatment
Recommendation System, is designed using a modular, scalable, and data-driven architecture.
The methodology integrates deep learning, image processing, environmental analysis, and
decision-support mechanisms into a unified pipeline. The complete workflow is divided into
multiple stages to ensure accuracy, robustness, and usability.
1. Data Acquisition and Dataset Preparation
The first stage involves collecting a comprehensive dataset of crop leaf images representing
both healthy and diseased conditions across multiple crop types. The images are obtained from
public agricultural datasets and real-world field data. Each image is labeled with crop type and
disease category.
The dataset must include a wide variety of conditions such as different lighting, backgrounds,
and leaf orientations to improve generalization. A large dataset (typically more than 10,000
images) is required to train a robust deep learning model.
2. Image Preprocessing
Before feeding images into the model, preprocessing is performed to standardize and enhance
image quality.
- Resizing: All images are resized to a fixed dimension (e.g., 224×224 pixels) to maintain
uniformity.
- Normalization: Pixel values are scaled to a standard range (0–1) to improve training
efficiency.
- Noise Removal: Filters such as Gaussian or median filtering are applied to remove noise.
- Image Enhancement: Contrast adjustment and color transformations are applied to highlight
important features.
- Data Augmentation: Techniques such as rotation, flipping, zooming, and brightness
adjustment are used to increase dataset diversity and prevent overfitting.
3. CNN Model Design and Training
Figure 2:CNN-based crop disease detection pipeline
A Convolutional Neural Network (CNN) is used for classification due to its effectiveness in
image analysis.
The CNN architecture includes:
- Input layer for receiving images
- Convolutional layers for feature extraction
- ReLU activation functions for non-linearity
- Max-pooling layers for dimensionality reduction
- Fully connected layers for classification
- Softmax output layer for predicting class probabilities
Training is performed using:
- Loss Function: Categorical Cross-Entropy
- Optimizer: Adam or SGD
- Batch size: 32–64
- Multiple epochs until convergence
Model performance is evaluated using accuracy, precision, recall, and F1-score.
4. System Architecture Integration
The system is divided into frontend and backend components.
- Frontend: A web interface where users upload images and input crop, soil, and nutrient details.
- Backend: Implemented using Flask, responsible for handling requests, processing images,
and generating predictions.
- Model Inference Engine: Executes the trained CNN model to classify diseases.
- External APIs: Used for fetching real-time weather data.
5. Disease Detection Workflow
The workflow for disease detection follows these steps:
1. Image acquisition from the user
2. Image preprocessing
3. CNN-based inference
4. Prediction of disease class
5. Generation of confidence score
6. Determination of plant health status
The system outputs the disease name along with prediction confidence.
6. Fertilizer Recommendation Module
Figure 3:Architecture of the NPK-based fertilizer recommendation system with validated
This module provides recommendations based on agricultural inputs.
Inputs:
- Crop type
- Soil type
- NPK (Nitrogen, Phosphorus, Potassium) values
Processing:
- Rule-based or machine learning-based analysis is used to determine nutrient deficiencies.
Outputs:
- Recommended fertilizer type
- Required quantity
- Application guidelines
7. Weather Integration Module
Real-time weather data is integrated using APIs. Parameters such as temperature, humidity, and
rainfall are used to improve disease prediction and optimize fertilizer usage.
This helps in understanding environmental conditions affecting crop health.
8. AI Chatbot Module
An AI-based chatbot is integrated to provide assistance to farmers. It uses natural language
processing to answer queries related to:
- Crop diseases
- Fertilizer usage
- Agricultural practices
The chatbot acts as a virtual assistant for real-time support.
9. End-to-End Workflow
The complete system workflow is as follows:
1. User uploads crop leaf image through the web interface
2. Backend validates and preprocesses the image
3. CNN model predicts the disease
4. System provides disease name, confidence score, symptoms, and treatment suggestions
5. User inputs soil and nutrient data
6. Fertilizer recommendation module generates suggestions
7. Weather data is fetched and incorporated
8. Chatbot provides additional support
9. Final results are displayed to the user
10. Implementation Details
The system is implemented using:
- Python 3.8
- TensorFlow and Keras for deep learning
- Flask for backend development
- Bootstrap for frontend interface
The model is trained on a dataset containing over 10,000 images and achieves high
classification accuracy.
This methodology ensures accurate disease detection, efficient resource usage, and improved
decision-making for farmers, contributing to sustainable agriculture practices.