Architecture
Architecture
The user
enters values like Nitrogen, Phosphorus, Potassium, pH level, Rainfall, State, and City. The system processes this input,
checks its completeness, and prepares it for prediction. The dataset used for training is split into training and testing sets
to build and validate the model. Important features are extracted to focus only on useful information. Finally, the system
uses the Random Forest algorithm, which creates multiple decision trees, and the most suggested crop is given as the
final result.
The Fertilizer Recommendation Module helps users identify the right fertilizer based on the selected crop and soil
nutrient values. The user enters NPK values and crop name. The system processes this input by comparing it with ideal
NPK values stored in a dataset. It calculates the difference to find out which one is most unbalanced. The feature with
the biggest difference is selected, and the system checks whether it is too low or too high. Using rule-based logic, a key
like "Nlow" or "Phigh" is generated and matched with a suggestion from a dictionary.
The Plant Disease Detection Module checks if a tomato leaf is healthy or infected by analyzing a test image selected by
the user. The system first pre-processes the image by resizing and removing background noise, followed by
segmentation to focus only on the leaf area. It then extracts important features like color, shape, and texture to detect
signs of disease. Using the ResNet-9 deep learning model (a type of CNN), the image is compared with thousands of
trained examples. The system finally displays the disease name along with a helpful treatment suggestion.
1) Contribution
I mainly worked on the plant disease detection module. I helped with using the tomato leaf images, checking how the
model gives results, and understanding how the system detects the disease from the leaf. I also worked for website
design, like how the pages should look, where to place buttons, and how to make it easy for users to use. Apart from
that, I also helped in preparing the black book by writing the working process, system architecture, and arranging the
content neatly and I was also involved in writing our research paper. So, I contributed to both the technical and
documentation parts of the project.
So primarily, I’ve worked on plant disease detection module where the module checks if the tomato leaf is healthy or
infected by analyzing a test image selected by user. I also worked for website design so that we can make a better
interface for user. Apart from that, I also helped in preparing the black book and writing the research paper. So, I
contributed to both the technical and documentation parts of the project.
ResNet-9 is a type of deep learning model used to recognize patterns in images. The name “ResNet” stands for Residual
Network, and the number 9 means it has 9 layers inside it. These layers help the model understand and learn small
details like shapes, colors, and textures in images.
In our project, ResNet-9 is used to check tomato leaf images and identify if the leaf is healthy or has a disease — just like
how our eyes can spot spots or marks, but this model does it using mathematics.
For each disease, we have around 2,000 images, and in total, our dataset has more than 15,000 images. All the images
are already stored in the system, and the model has been trained using them. When a user selects a test image, the
model compares it with what it has learned and then shows the name of the disease along with a treatment suggestion.
We faced some confusion in the beginning while planning the flow of the project and deciding who will do what.
Sometimes we also got stuck while putting everything together. But by discussing with the team and taking small steps
one by one, we managed to solve the problems and complete the project on time.
9. How does your system give output from the given input?
It compares the user's input with stored data or passes it through a trained model. Based on that, it shows the best crop,
correct fertilizer, or disease name.
14. Did you face any difficulties? How did you solve them?
Yes, we faced a few challenges while connecting all parts of the system and designing the user interface. We solved
them by discussing with each other, taking guidance, and testing everything step by step.
16. What is a research paper and how is it different from the black book?
A research paper is a short, technical summary of the project written in a standard format. The black book is more
detailed and includes the entire project documentation.
19. How did you divide the modules among team members?
We divided the modules based on interest and strengths. Each member worked on a separate part like crop, fertilizer,
plant module, and documentation.
4. Why did you choose Machine Learning and Deep Learning for this project?
o These techniques analyze large datasets, predict outcomes, and recognize patterns that are hard to
detect manually.
5. Can you explain the role of Random Forest in crop recommendation?
o It predicts the best crops by analyzing historical data on soil, weather, and yields.
6. What is DeepFM, and why is it useful in this context?
o DeepFM captures both simple and complex interactions between features like soil and crop yield,
improving accuracy.
7. How does the CNN model detect diseases from crop images?
o CNNs recognize patterns in images to detect diseases by training on healthy and diseased crop images.
8. What is the accuracy of your crop disease detection system? How can it be improved?
o The system has 98.4% accuracy, which can be improved by adding diverse datasets and enhancing image
preprocessing.
9. How does the system handle missing or incomplete data?
o It uses techniques like Random Forest and Factorization Machines, which work well with sparse data.
15. How do you plan to improve or scale this system in the future?
o By adding more local datasets and expanding the system to handle multiple crops.
16. What challenges did you face during the development of this system?
o Challenges included obtaining accurate data and handling regional differences in farming practices.
8. What type of user interface does the website have, and how easy is it for farmers to use?
o The website has a simple, intuitive interface designed for easy navigation, even for users with minimal
technical skills.
22. How can small-scale farmers benefit from this system, especially in low-resource settings?
Small-scale farmers can easily access the website from a basic device with an internet connection, making it
affordable and scalable.
The future scope of the project includes expanding the system to handle more crops, fertilizers, and diseases by
integrating additional datasets and real-time data sources. It can also offer region-specific recommendations, support
multiple languages, and improve disease detection accuracy. Additionally, future integration with IoT sensors and
advanced AI models can enhance the system's performance and scalability.
The Crop Recommendation Module helps farmers choose the best crop to grow based on their soil condition and
location. The user enters values like Nitrogen (N), Phosphorus (P), Potassium (K), pH level, Rainfall, and selects the
State and City. These inputs are submitted through a form on the website.
In the Data Processing step, the system arranges and formats the input properly. It checks if all required values are
entered and prepares the data for the next step. This helps avoid any issues during prediction.
Next is the Splitting of Data, where the main crop dataset is divided into two parts — training data and testing data. The
training data is used to teach the model how different conditions affect crop growth. The testing data checks how well
the model has learned.
In the Feature Extraction step, the system picks only the important details such as N, P, K, pH, Rainfall, State, and City.
These features are used to make the prediction more focused and accurate. It helps the model to ignore any unneeded
data.
The final step is Prediction, where the system gives the best crop suggestion using the Random Forest algorithm. This
algorithm creates many decision trees, and each tree gives a crop suggestion. The crop with the most votes becomes the
final output.
Example:
Imagine you are a farmer in Maharashtra and you “Which crop should I grow based on my soil?” So you open our
system and enter values say
Nitrogen (N): 50
Phosphorus (P): 40
Potassium (K): 30
pH: 6.8
Rainfall: 250 mm
State: Maharashtra
City: Pune
➡️The Random Forest model creates multiple decision trees using this input.
➡️Each tree gives a crop suggestion:
Tree 1 → Rice
Tree 2 → Wheat
Tree 3 → Rice
Tree 4 → Rice
➡️Since most trees suggest Rice, the final output is: “Rice is the best crop to grow.”
The Fertilizer Recommendation Module helps users find out which fertilizer is needed based on the selected crop and
soil nutrients. The user enters values for Nitrogen (N), Phosphorus (P), Potassium (K) and selects a Crop name from the
list. These details are submitted through a form on the website.
In the Data Processing step, the system reads the ideal NPK values for the selected crop from the stored dataset. It then
compares the user’s entered values with these ideal values. This helps the system understand what the soil is lacking or
has in excess.
The system then checks the difference between the ideal and actual values for each nutrient. It calculates how much
Nitrogen, Phosphorus, and Potassium are lower or higher than needed. This step helps identify which nutrient needs
correction.
In the Feature Extraction step, the system picks the nutrient that shows the biggest difference. It then checks if that
nutrient is too low or too high. Based on this condition, the system creates a key like "Nlow" or "Phigh".
Finally, in the Prediction step, the system uses rule-based logic to match the key with a predefined message stored in a
dictionary. It then shows the user a helpful fertilizer suggestion. This process is simple, fast, and doesn't use machine
learning.
Example:
Let’s say the user selects Tomato as the crop and enters:
Nitrogen (N): 40
Phosphorus (P): 20
Potassium (K): 30
➡️The system checks ideal values for Tomato: N = 60, P = 40, K = 35
➡️It calculates the difference:
Nitrogen is low by 20
Phosphorus is low by 20
Potassium is low by 5
➡️Since Nitrogen and Phosphorus are both low by 20, the system picks one — say Nitrogen.
➡️It creates the key "Nlow" and finds the matching suggestion.
➡️Final output: "Your soil lacks Nitrogen. Use Urea or Ammonium Sulphate to improve it."
The Plant Disease Detection Module helps check whether a crop leaf is healthy or infected with a disease. The user
selects a test image of a tomato leaf and this image is sent to the model for further analysis.
In the Pre-processing step, the image is resized and cleaned so the system can read it properly. It removes any extra
background or noise. This helps the model focus only on the leaf part.
The system then performs Segmentation, where it separates the leaf from the background. This highlights only the
affected area. After that, the image moves to the next step for learning.
In the Feature Extraction step, the system checks details like color, shape, and texture of the leaf. These small features
help the model identify any changes caused by disease. The model uses these features to understand what it is looking
at.
Finally, the image goes through the Prediction step using the ResNet-9 deep learning model, which is a type of
Convolutional Neural Network (CNN). This model compares the image with thousands of leaf images it learned during
training. It gives the disease name and shows a treatment tip on the result page.
Example:
Let’s say the user selects an image of a tomato leaf from the test set. The leaf has brown spots and looks infected.
➡️The system pre-processes the image and focuses only on the leaf.
➡️It extracts features like the shape of the spots and leaf color.
➡️The ResNet-9 model compares the image with known disease images.