0% found this document useful (0 votes)
35 views12 pages

NM Report-1

Report

Uploaded by

pranavsivasamy37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views12 pages

NM Report-1

Report

Uploaded by

pranavsivasamy37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NADAR SARASWATHI COLLEGE

OF ENGINEERING AND
TECHNOLOGY
VADAPUDUPATTI, THENI-625531

NAME : __________________________________________________
REGISTER NUMBER : __________________________________________________
BRANCH : __________________________________________________
YEAR/SEM : __________________________________________________
[Link] : ___________________________________________________
NADAR SARASWATHI COLLEGE OF ENGINEERING
AND TECHNOLOGY,
VADAPUDUPATTI. THENI – 625 531

Department of Artificial Intelligence and Data Science

Bonafide Record of work done by ___________________________________________


[Link]._________________ on the AI AND GREEN SKILLS ( NM1067 ) -NAAN
MUDHALVAN Laboratory of Nadar Saraswathi College of Engineering and Technology,
Vadapudupatti, Theni during the year 2024- 2025.

Staff In – Charge Head of the Department

Submitted for the Practical Examination held on _____________ of Nadar Saraswathi College
of Engineering and Technology, Vadapudupatti, Theni, during the year 2024- 2025.

Internal Examiner External Examiner


Nadar Saraswathi College of Engineering and Technology
Department of Artificial Intelligence and Data Science
College Code: 9210
Completed the project named as

Crop Recommendation System

Group Members:
1. S. KARAN -3rd AI & DS (aut921022AI09) - 921022243010
2.M. JAYA GOKUL -3rd AI & DS (aut921022AI08) - 921022243009
3.S. PRANAV -3rd AI & DS (aut921022AI14) - 921022243015
ABSTRACT
Sustainable agriculture stands as a cornerstone of food security and
environmental conservation. As the global population continues to grow,
ensuring efficient farming practices has become imperative. One of the major
challenges faced by farmers is the uncertainty regarding the type of crop to
cultivate under varying environmental and soil conditions. Traditional
knowledge, though valuable, may not always align with modern-day
complexities, especially when dealing with unpredictable weather patterns and
soil quality.

This project introduces a Crop Recommendation System powered by machine


learning, aiming to support farmers in making data-driven decisions. The system
analyses multiple environmental parameters including nitrogen (N), phosphorus
(P), potassium (K), temperature, humidity, pH, and rainfall to recommend the
most appropriate crop for cultivation. The model uses a Random Forest Classifier
to process input data and produce accurate recommendations.

By integrating scientific methodologies with accessible technology, this system


promotes sustainable farming, optimizes yield, and reduces the risk of crop
failure. The significance of this model lies not only in its high accuracy but also
in its potential to bridge the gap between modern agricultural technology and
grassroots farming practices. This tool can be a game-changer in revolutionizing
how farming decisions are made, especially in regions where access to
agricultural experts and advanced analytics is limited.
PROBLEM STATEMENT
Agricultural productivity in many regions continues to suffer due to a lack of
timely and informed decision-making tools for farmers. Traditionally, crop
selection is often based on generational experience, local beliefs, or generalized
advice, which may not reflect the current soil and environmental conditions
accurately. With the increasing variability in climate and decreasing soil fertility
in several areas, such conventional methods lead to low yields or even complete
crop failure.

The core problem lies in the absence of a data-driven decision-support system


that can guide farmers in choosing the most suitable crops based on real-time and
localized environmental data. Farmers often do not have access to experts who
can provide personalized recommendations. Furthermore, the lack of easy-to-use
tools exacerbates the issue, especially for those unfamiliar with complex
technologies.

This project addresses this gap by developing a machine learning-based Crop


Recommendation System. The proposed solution provides a simple and user-
friendly web interface where farmers or agricultural officers can input
environmental parameters and receive a suggestion for the most appropriate crop.
The goal is to reduce the dependence on guesswork and offer a reliable alternative
powered by data science and artificial intelligence, making modern agricultural
intelligence more accessible.
OBJECTIVE
The primary objective of this project is to design and develop a robust machine
learning-based web application that aids farmers in selecting the most suitable
crop for cultivation under given environmental conditions. The tool aims to
simplify the decision-making process using input parameters such as soil nutrient
levels, temperature, humidity, pH, and rainfall.

Key goals include:

 Creating a system that accepts inputs for nitrogen (N), phosphorus (P),
potassium (K), temperature, humidity, soil pH, and rainfall levels.

 Using machine learning techniques to analyze this data and predict the
most appropriate crop.

 Ensuring the model is highly accurate and minimizes the risk of


recommending unsuitable crops.

 Providing an intuitive, easy-to-use interface that can be used by farmers


with minimal technical knowledge.

 Supporting sustainable agriculture practices by promoting efficient land


use and resource management.

By achieving these objectives, the system will assist in enhancing productivity,


improving food security, and enabling farmers to make well-informed, scientific
choices. It will also pave the way for future innovations such as integrating
weather APIs, mobile applications, and expanding the dataset for broader
applicability.
DATA COLLECTION AND PREPARATION
The effectiveness of any machine learning model heavily depends on the quality
and relevance of the data used during training. For this project, a synthetic dataset
was generated to simulate realistic agricultural scenarios. This dataset comprises
samples for seven common crops: Rice, Wheat, Maize, Cotton, Sugarcane,
Millet, and Barley.

Each crop has been represented by 100 samples, making a total of 700 data points.
The key features included in this dataset are nitrogen (N), phosphorus (P),
potassium (K), temperature (in Celsius), humidity (in percentage), pH (of the
soil), and rainfall (in milli meters). These features are among the most influential
factors in determining the suitability of a crop in a specific environment.

To ensure data quality, preprocessing steps were undertaken:

 Data cleaning involved handling missing or null values.

 Validation checks were done to confirm feature values were within


expected agronomic ranges.

 The dataset was then split into training and testing subsets using an 80:20
ratio to enable effective model training and evaluation.

This careful preparation of data ensured that the model was trained on diverse
and representative inputs, allowing it to generalize better when exposed to new
data.
METHODOLOGY
The Crop Recommendation System follows a comprehensive methodology,
beginning from data preparation to deployment. The pipeline ensures systematic
processing and reliable outputs.

1. Data Loading & Cleaning: The dataset is first imported in CSV format.
The data is checked for null values and validated to ensure that the
parameters lie within realistic agricultural ranges. Any anomalies are
corrected or removed.

2. Exploratory Data Analysis (EDA): Various techniques are used to


understand the relationships between features. Visual tools like histograms,
boxplots, and heatmaps are used to identify patterns and correlations
among the variables.

3. Model Selection: Multiple algorithms were tested, including Decision


Trees, K-Nearest Neighbours (KNN), and Support Vector Machines
(SVM). The Random Forest Classifier emerged as the best-performing
model due to its high accuracy, robustness to noise, and interpretability.

4. Training and Testing: The dataset is split into 80% training and 20%
testing. The Random Forest Classifier is trained on the training data and
evaluated on the testing data to assess generalization performance.

5. Web Interface Deployment: Using the Streamlit framework, the model is


deployed on a web interface. Users can input soil and climate values in the
form, and the model instantly provides the recommended crop.

This end-to-end methodology ensures that the system is efficient, scalable, and
user-friendly.
MODEL PERFORMANCE EVALUATION
The evaluation of the machine learning model is critical to verify its effectiveness
and reliability in real-world scenarios. The Random Forest Classifier was chosen
for its ensemble approach, which combines multiple decision trees to improve
predictive accuracy and control overfitting.

1. Accuracy: The model achieved an impressive accuracy of 98% on the test


dataset. This indicates that the model can correctly predict the appropriate
crop for most combinations of input parameters.

2. Precision, Recall, F1-Score: These metrics were evaluated for each class
(crop type). Precision measures the correctness of positive predictions,
recall reflects the model's ability to identify all relevant crops, and the F1-
score balances both. All these metrics consistently showed values above
95% for most crops.

3. Confusion Matrix: A confusion matrix was plotted to visualize the


model's performance across different classes. Minimal misclassifications
were observed, confirming the reliability of the model.

4. Overfitting Check: Since the data was synthetically generated, efforts


were taken to introduce randomness and diversity. This minimized the risk
of overfitting and allowed the model to generalize better.

Overall, the model demonstrated strong performance, justifying its deployment


for practical use.
SCREENSHOTS / DEMONSTRATION
FUTURE SCOPE
While the current version of the Crop Recommendation System provides a solid
foundation, several improvements can be implemented to enhance its
effectiveness and reach:

1. Integration with Real-time APIs: Incorporating weather APIs like


OpenWeatherMap can provide live temperature and rainfall updates,
improving the accuracy of recommendations.

2. Expanding Crop Database: Adding more crops, especially region-


specific ones, will allow the model to cater to diverse agricultural zones.

3. Image-based Soil Analysis: Using computer vision, farmers could upload


images of their soil to analyze texture and quality, further refining the crop
suggestions.

4. Mobile Application: Deploying the model as an Android app will improve


accessibility, especially in remote and rural regions.

5. Multilingual Support: Including local language options will make the


system more user-friendly and inclusive for farmers with varying
educational backgrounds.

6. Offline Functionality: Developing an offline version of the application


could benefit users in areas with limited internet access.

These enhancements can transform the system into a comprehensive farming


assistant.
CONCLUSION
The Crop Recommendation System represents a step forward in bringing
precision agriculture to the grassroots level. By leveraging machine learning, this
project bridges the gap between traditional farming practices and modern data
science.

The system accurately recommends crops based on critical environmental and


soil parameters, offering a reliable decision-support tool for farmers. It promotes
sustainable agriculture by ensuring that the land is used optimally and efficiently.
The web-based interface ensures accessibility, and the model’s high accuracy
builds trust in its predictions.

This project underscores the importance of integrating technology into


agriculture, especially in regions where traditional methods are proving
insufficient. As future enhancements are incorporated, the system could evolve
into a full-scale platform offering end-to-end farming solutions.

Ultimately, this initiative holds promise in contributing to food security,


environmental sustainability, and the economic empowerment of farmers through
informed, intelligent crop planning.

You might also like