0% found this document useful (0 votes)
5 views

MiniProject-Report (9)

The document presents a mini project report on a Crop Recommendation and Soil Enhancement System using Machine Learning, aimed at optimizing agricultural productivity by providing tailored crop and fertilizer recommendations based on soil and climate conditions. It highlights the challenges faced by farmers due to climate change and soil degradation, and the importance of data-driven insights for informed decision-making. The project combines data collection, preprocessing, and predictive analytics to promote sustainable farming practices and improve crop yields.

Uploaded by

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

MiniProject-Report (9)

The document presents a mini project report on a Crop Recommendation and Soil Enhancement System using Machine Learning, aimed at optimizing agricultural productivity by providing tailored crop and fertilizer recommendations based on soil and climate conditions. It highlights the challenges faced by farmers due to climate change and soil degradation, and the importance of data-driven insights for informed decision-making. The project combines data collection, preprocessing, and predictive analytics to promote sustainable farming practices and improve crop yields.

Uploaded by

appupavan13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 31

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belgaum-590014, KARNATAKA, INDIA

A Mini Project Report on

Crop Recommendation and Soil


Enhancement System Using Machine
Learning
A mini project report submitted in partial fulfillment of the requirements for
the award of the degree of Bachelor of Engineering in Computer Science
and Engineering of Visvesvaraya Technological University, Belguam.

Submitted by:
Pavan A
Prasanna P
Siddharth Kote
Under the Guidance of:
Ms. kavya
Assistant Professor, Dept. of CSE

Department of Computer Science and Engineering


AMC Engineering College
18th K.M, Bannerghatta Main Road, Bangalore-560083
2024-2025
AMCENGINEERINGCOLLEGE
18th K.M, Bannerghatta Main Road, Bangalore-560083
2024-2025
Department of Computer Science and Engineering

CERTIFICATE

Certified that the mini project report entitled Crop Recommendation and Soil

Enhancement System Using Machine Learning carried out by Monal Khatri

(1AM22CS115), Navya Narayan Panicker (1AM22CS122), Riya Debnath (1AM22CS160),

Sanchitha Ravi Bharadwaj (1AM22CS170), bonafide students of AMC Engineering

College in partial fulfillment for the award of Bachelor of Technology in Computer

Science and Engineering of the Visvesvaraya Technological University, Belgaum during

the year 2024-25. It is certified that all corrections/suggestions indicated for Internal

Assessment have been incorporated in the Report. The project report has been approved

as it satisfies the academic requirements in respect of Project work prescribed for the

said degree.

HOD Principal
Dr. V Mareeswari, Dr. K Kumar,
Prof and Head, Principal,
Dept. of CSE, AMCEC
AMCEC

Mini Project Guide Mini Project Coordinator Ms. Snigdha Kesh,


Ms. Kavya Shivanand
Assistant Professor, Kandgal,
Dept. of CSE, Assistant Professor
AMCEC Dept. of CSE,
AMCEC
External Viva

i
External Name Signature with Date
1.
2.

ii
DECLERATION
We the undersigned students of 5th semester Department of Computer Science and
Engineering, AMC Engineering College, declare that our project work entitled Crop
Recommendation and Soil Enhance- ment System Using Machine Learning is a bonafide
work of ours. Our project is neither a copy nor by means a modification of any other
engineering project. We also declare that this project was not entitled for submission to
any other university in the past and shall remain the only submission made and will not
be submitted by us to any other university in the future.

NAME ROLL NO SIGNATURE

Pavan A E(14)

Prasanna P E(15)

Siddarth kote E(20)

iii
iv
ACKNOWLEDGMENTS
We have a great pleasure in expressing our deep sense of gratitude to founder Chairman
Dr. K.R. Paramahamsa and Executive Vice President Mr. Rahul Kalluri for having
provided us with a great infrastructure and well-furnished labs for successful completion
of our mini project.

We express our special thanks and gratitude to our Academic Advisor Dr. Nagaraja R for
providing us with all the necessary advice for successful completion of our mini project.

We express our sincere thanks and gratitude to our Principal Dr. K Kumar for providing
us with all the necessary support successful completion of our mini project.

We would like to extend our special thanks to Dr. V Mareeswari Professor and HOD,
Department of CSE, for her support and encouragement and suggestions given to us in
the course of the mini project.

We are grateful to our guide Ms. Snigdha Kesh, Assistant Professor, Department of CSE,
AMC Engineering College, Bengaluru for her constant motivation and timely help,
encouragement and suggestions.

We would like to extend our special thanks to Mini Project coordinator Ms. Kavya
Shivanand Kandgal, Assistant Professor, Department of CSE, for her support and
encouragement and suggestions given to us in the course of our project work.

Last but not the least, we wish to thank all the teaching and non-teaching staffs of
department of Computer Science and Engineering, for their support, patience and
endurance shown during the preparation of this mini project report.

Pavan.A E(14)
Prasanna.P E(15)
Siddarth Kote
E(20)

v
vi
vii
ABSTRACT
Crop yield prediction in these weather conditions or so called Global Warming is
becoming a big challenge for all the farmers. In the same way, the health of the soil for
good yield plays a very important role. This project focuses on Crop Recommendation
And Enhancement Of The Soil using machine learning. This mini project optimizes
agricultural productivity and sustainability by taking inputs from the users.The user will
give the type of soil and the climate conditions like rainy,tropical or temperate and
according to the input given, the system will design a output for appropriate crop for
that soil type which will give maximum yield in that season and soil. The system will also
give advice on how to enhance the soil for good health and maximum yield for the crop
making it easy for the users like farmers to choose the correct crop for that current
climate condition. Soil enhancement is an important aspect of soil quality,crop yield and
consistent,sustainable growth and health of the crop. Strategies like crop rotation,use of
organic fertilizers and others are used to maintain the soils health for a longer period of
time. The project combines data collection, preprocessing, and predictive analytics with
the goal of maximizing efficiency and sustainability in farming practices. The solution can
be deployed via a user-friend web application, ensuring accessibility for farmers. This
approach not only enhances productivity but also promotes sustainable agricultural
practices by preserving soil.

viii
CONTENTS
CERTIFICATE i

DECLERATION ii

ACKNOWLEDGEMENTS iii

ABSTRACT iv

1 INTRODUCTION 1

1.1 Overview ................................... 1

1.2 Problem Statement .............................. 2

1.3 Objective of the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.4 Scope of the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 SYSTEM REQUIREMENTS 4

2.1 Software and Hardware Tools Used . . . . . . . . . . . . . . . . . . . . . . 4

2.1.1 Hardware Requirements ....................... 4

2.1.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . 4

3 LITERATUER SURVEY 5

3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.2 Summary of Literature Survey ........................ 5

3.3 Drawbacks of Existing System ........................ 5

4 SYSTEM ANALYSIS 7

4.1 Proposed System ............................... 7

4.2 Methodology ................................. 8

5 SYSTEM DESIGN 9

5.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

6 IMPLEMENTATION 12
6.1 System Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

7 RESULTS 14

8 CONCLUSION 16

LISTOFFIGURES
Figure 5.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Figure 5.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Figure 6.1 Python Sample Code ......................... 12

Figure 6.2 HTML sample code . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Figure 7.1 Registration Page ........................... 15


Figure 7.2 Login Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

LISTOFTABLES
2.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
CROP RECOMMENDATION USING ML

CHAPTER1

INTRODUCTION
1.1 Overview
Crop yield prediction in these weather conditions or so-called Global Warming is
becoming a big challenge for all farmers. In the same way, the health of the soil for good
yield plays a very important role. This project focuses on Crop Recommendation And
Enhancement Of The Soil (Using Machine Learning). This mini-project optimizes
agricultural productivity and sustainability by taking inputs from the users. The user will
give the contents of soil(tested soil) like N, P, K, pH and the climate conditions like
humidity and rainfall and according to the input given, the system will design an output
for the appropriate crop for that soil type which will give maximum yield in that season
and soil. It will also recommend a fertilizer for the enhancement for soil’s health.
Agriculture is the backbone of many economies, providing food, raw materials,
and employment to millions of people worldwide. However, the sector faces numerous
challenges, including climate change, soil degradation, and the need for sustainable
practices. As the global population continues to grow, the demand for food increases,
necessitating innovative solutions to enhance agricultural productivity. In this context,
the Crop Recommendation System emerges as a vital tool designed to assist farmers in
making informed decisions regarding crop selection and fertilizer application.
Selecting the right crop to cultivate is crucial for maximizing yield and ensuring
economic viability. Various factors influence crop selection, including soil type, nutrient
availability, climate conditions, and market demand. Traditional farming practices often
rely on experience and intuition, which may not always yield optimal results. Farmers
may struggle to adapt to changing environmental conditions, leading to suboptimal crop
yields and increased costs. Therefore, a systematic approach to crop selection is essential
for improving agricultural outcomes.
The Crop Recommendation System is designed to provide farmers with tailored
recommendations based on their unique environmental inputs. By inputting key
parameters such as nitrogen, phosphorus, potassium, temperature, humidity, pH, and

Dept. of CSE, AMCEC 2024-31 1


CROP RECOMMENDATION USING ML

rainfall, farmers can receive real-time suggestions for suitable crops and fertilizers. The
system employs trained machine learning models that analyze the input data and
generate recommendations, empowering farmers to make informed decisions.

1.2 Problem Statement


The agricultural sector is increasingly challenged by the need to optimize crop
yields while managing limited resources and adapting to changing environmental
conditions. Farmers often struggle with selecting the appropriate crops and fertilizers
due to a lack of access to timely and relevant information, leading to suboptimal
agricultural practices, reduced productivity, and economic losses. This situation is
exacerbated by climate change, soil degradation, and the variability of weather patterns,
which further complicate decisionmaking processes. To address these challenges, the
Crop Recommendation System aims to provide farmers with data-driven insights that
facilitate informed decisions regarding crop selection and fertilizer application based on
specific environmental parameters such as nitrogen, phosphorus, potassium,
temperature, humidity, pH, and rainfall.

1.3 Objective of the Project


The primary objectives of the Crop Recommendation System are to enhance
agricultural productivity by recommending suitable crops tailored to the unique
conditions of each farm, promote sustainable farming practices by optimizing resource
use, and support farmers in adapting to climate variability through timely and accurate
recommendations. Additionally, the system seeks to empower farmers with knowledge
and tools that improve their decision-making capabilities, ultimately leading to increased
yields, reduced costs, and a more resilient agricultural sector. By leveraging machine
learning algorithms and providing a user-friendly interface, the Crop Recommendation
System aims to bridge the gap between traditional farming practices and modern
agricultural technology, fostering a more efficient and sustainable approach to farming.

Dept. of CSE, AMCEC 2024-31 2


CROP RECOMMENDATION USING ML

1.4 Scope of the Project


The scope of the Crop Recommendation System includes developing a solution to
enhance agricultural productivity through data-driven insights. This project involves
collecting and preprocessing agricultural data, such as historical crop yields and soil
nutrient levels, to train machine learning models that provide accurate
recommendations for suitable crops and fertilizers based on specific environmental
parameters. The system will feature a user-friendly web application built with Flask,
allowing farmers to input data and receive real-time recommendations. Additionally, a
feedback mechanism will enable users to improve future predictions, while reporting and
analytics features will help track progress. Future enhancements may include satellite
imagery integration and mobile application development, ensuring the system remains
scalable and adaptable to the evolving needs of the agricultural sector.

Dept. of CSE, AMCEC 2024-31 3


CROP RECOMMENDATION USING ML

CHAPTER2

SYSTEMREQUIREMENTS
2.1 Software and Hardware Tools Used
To successfully implement the framework, specific software and hardware
resources are required for optimal performance and scalability. The following sections
detail specific hardware and software requirements.

2.1.1 Hardware Requirements

The following table outlines the minimum hardware requirements necessary for
the optimal performance of the system. These specifications ensure compatibility and
efficient operation of the software components.

Table 2.1: Hardware Requirements

Hardware Component Purpose

Processor Intel Core i5

Hard Disk 512 GB

RAM 8 GB
2.1.2 Software Requirements

The following table provides a list of software tools required for the development
and execution of the system. Each tool serves a specific purpose to ensure the
functionality and efficiency of the software components.

Table 2.2: Software Requirements

Software Tool Purpose

HTML and CSS To design and style the user interface.

JavaScript To add interactivity and dynamic functionality.

Python To develop the backend logic and algorithms.

Flask To create and manage the web framework.

NumPy To perform numerical computations efficiently.


CHAPTER3

Dept. of CSE, AMCEC 2024-31 4


CROP RECOMMENDATION USING ML

LITERATUERSURVEY
3.1 Introduction
Agriculture is the backbone of many economies worldwide, providing food and
livelihoods for millions of people. However, the increasing global population, climate
change, and soil degradation pose significant challenges to sustainable agriculture. To
address these challenges, precision agriculture has emerged as a promising approach,
leveraging advanced technologies like machine learning (ML) to optimize crop yields,
reduce waste, and promote soil health. This literature survey focuses on the application
of ML in crop recommendation and soil enhancement.

3.2 Summary of Literature Survey


Numerous studies have explored the potential of ML in agriculture, particularly in
crop recommendation and soil enhancement. Some notable approaches include:

• Crop Yield Prediction: Researchers have employed ML algorithms like Random


Forest, Support Vector Machines (SVM), and Artificial Neural Networks (ANN) to
predict crop yields based on factors like weather, soil type, and crop variety
(Kamilaris and Prenafeta-Bold, 2018).

• SoilClassification: MLtechniqueshavebeenusedtoclassifysoiltypesbasedontheir
physical and chemical properties, enabling more accurate soil management
practices (Sheikh et al., 2019).

• Crop Recommendation Systems: Several studies have developed crop


recommendation systems using ML, which suggest the most suitable crops for a
given region based on factors like climate, soil type, and market demand (Kaul et
al., 2017).

• Soil Health Prediction: Researchers have applied ML algorithms to predict soil


health indicators like pH, organic carbon, and nutrient levels, enabling farmers to
take proactive measures to improve soil fertility (Gebrehiwot et al., 2020).

Dept. of CSE, AMCEC 2024-31 5


CROP RECOMMENDATION USING ML

3.3 Drawbacks of Existing System


While ML has shown promising results in crop recommendation and soil
enhancement, several drawbacks and limitations exist:

• Data Quality and Availability: The accuracy of ML models relies heavily on


highquality and diverse datasets, which are often scarce in agriculture.

• ScalabilityandTransferability: ManyMLmodelsaredevelopedforspecificregions or
crops, limiting their scalability and transferability to other contexts.

• Interpretability and Transparency: The complexity of ML models can make it


challenging to interpret and understand their decisions, leading to a lack of trust
among farmers.

• Integration with Existing Systems: ML-based systems often require significant


changes to existing agricultural practices and infrastructure, which can be a barrier
to adoption.

Dept. of CSE, AMCEC 2024-31 6


CROP RECOMMENDATION USING ML

CHAPTER4

SYSTEMANALYSIS
4.1 Proposed System
The proposed Crop Recommendation System, as outlined in the code, is a web-
based application designed to assist farmers in selecting suitable crops and fertilizers
based on specific environmental inputs. The system leverages machine learning models
to provide accurate recommendations, ensuring that farmers can make informed
decisions to enhance agricultural productivity. Below are the key components and
functionalities of the proposed system as derived from the code:

• Web Application Framework: The system is built using Flask, a lightweight web
framework for Python, which facilitates the development of the web application.
This allows for easy routing of requests and rendering of HTML templates.

• User Input Form: The application features a user-friendly form where farmers can
input essential parameters such as Nitrogen, Phosphorus, Potassium, Temperature,
Humidity, pH, and Rainfall. This data is crucial for generating accurate crop and
fertilizer recommendations.

• Data Processing and Validation: Upon submission of the form, the system
processes the input data, ensuring it is validated and formatted correctly for
analysis. This includes converting the input values to the appropriate data types for
further processing.

• MachineLearningModels: Thesystemutilizespre-trainedmachinelearningmodels for


crop and fertilizer prediction. These models are loaded from pickle files, allowing
the application to make predictions based on the user-provided inputs. The models
include:

– Acroppredictionmodelthatdeterminesthebestcropbasedontheenvironmental
features.
– A fertilizer prediction model that recommends the appropriate fertilizer based on
Nitrogen, Phosphorus, and Potassium values.

Dept. of CSE, AMCEC 2024-31 7


CROP RECOMMENDATION USING ML

• Real-Time Recommendations: After processing the input data, the system


generates real-time recommendations for the most suitable crop and fertilizer. The
results are displayed on the same web page, providing immediate feedback to the
user.

• Dynamic User Interface: The user interface is designed to be responsive and


visually appealing, utilizing Bootstrap for styling. This ensures that the application
is accessible on various devices, including desktops and mobile phones.

• Feedback and Results Display: The application includes a section that displays the
recommended crop and fertilizer after the user submits their data. This feature
enhances user engagement and allows farmers to see the results of their inputs
clearly.

• Error Handling: The system incorporates error handling to manage invalid inputs
gracefully. Iftheuserprovidesincorrectdata, theapplicationreturnsanerrormessage,
prompting the user to correct their input.

• Future Enhancements: The proposed system is designed with scalability in mind,


allowing for future enhancements such as the integration of additional machine
learning algorithms, the incorporation of satellite imagery for crop health
monitoring, and the development of a mobile application for broader accessibility.

In summary, the proposed Crop Recommendation System, as defined by the code,


is a comprehensive solution that combines a user-friendly web interface with powerful
machine learning capabilities. By providing farmers with accurate and timely
recommendations based on their specific environmental conditions, the system aims to
improve agricultural practices, enhance productivity, and promote sustainable farming.

4.2 Methodology
The methodology for the Crop Recommendation System follows a systematic
approach that encompasses several key steps to ensure a robust and user-friendly
solution. It begins with data collection, where relevant agricultural data, including
historical crop yields, soil nutrient levels, and climatic conditions, is gathered from

Dept. of CSE, AMCEC 2024-31 8


CROP RECOMMENDATION USING ML

various sources such as agricultural databases and research studies. This data undergoes
preprocessing to clean and prepare it for analysis, which includes handling missing
values, normalizing numerical features, and encoding categorical variables. Relevant
features influencing crop yield and fertilizer requirements are then identified, followed
by the development of predictive models using various machine learning algorithms,
such as decision trees and random forests. These models are trained on the
preprocessed data, and performance is evaluated using metrics like accuracy and
precision, with the best-performing model selected for deployment.

CHAPTER5

SYSTEMDESIGN
The system design of the Crop Recommendation System outlines the architecture,
components, and interactions necessary to deliver a robust and user-friendly application.
Thedesignfocusesonensuringthatthesystemisscalable, efficient, andcapableofproviding
accurate recommendations to farmers based on their specific environmental inputs.
Below are the key elements of the system design:

• Architecture Overview: The Crop Recommendation System follows a client-server


architecture, where the client (user interface) interacts with the server (backend
application) to process requests and deliver recommendations. This separation
allows for better scalability and maintainability.

• Components:

– User Interface (Frontend): Developed using HTML, CSS, and JavaScript, the
user interface is designed to be intuitive and responsive. It allows users to
input their environmental data through a web form and displays the
recommendations clearly. Bootstrap is utilized for styling to ensure a visually
appealing layout that is accessible on various devices.
– Backend Application (Server): Built using Flask, the backend application
handles incoming requests from the user interface, processes the input data,
and interacts with the machine learning models to generate predictions. It
also manages routing, data validation, and error handling.

Dept. of CSE, AMCEC 2024-31 9


CROP RECOMMENDATION USING ML

– Machine Learning Models: The system incorporates pre-trained machine


learning models for crop and fertilizer prediction. These models are loaded
from pickle files and are responsible for analyzing the input data to provide
accurate recommendations based on historical agricultural data.

The system design of the Crop Recommendation System encompasses a well-


structured architecture that integrates a user-friendly interface, a robust backend
application, machine learning models, and a database. This design ensures efficient data
processing, accurate recommendations, and a positive user experience, ultimately
empowering farmers to make informed decisions and enhance agricultural productivity.

5.1 System Architecture


The system architecture is designed with a client-server model, utilizing Flask for
the user interface to facilitate easy interaction. Implementation involves integrating the
machine learning models with the web application, allowing for real-time data
processing and recommendations. Comprehensive testing is conducted to ensure the
system functions correctly, including unit testing, integration testing, and user
acceptance testing. Once testing is complete, the system is deployed on a cloud platform
to ensure accessibility for users. To facilitate user adoption, training materials and
support resources are provided, and a feedback mechanism is incorporated to gather
user experiences and suggestions for improvement.
ThisiterativeprocessensuresthattheCropRecommendationSystemremains relevant and
effective, ultimately empowering farmers with accurate, timely, and actionable insights
to enhance agricultural productivity and promote sustainable practices.

Dept. of CSE, AMCEC 2024-31 10


CROP RECOMMENDATION USING ML

Figure 5.1: System Architecture

5.2 Data Flow Diagram


The data flow in an Airbnb clone begins with user interactions on the client-side
applications, whether on the web or mobile. When a user searches for a property, their
query is sent to the backend via RESTful or GraphQL APIs. The search and filtering service
processes this request, querying the database for matching listings, utilizing caching
mechanisms like Redis for faster responses. Results are sent back to the client application
for display. When a user books a property, the booking request is handled by the booking
service, which checks real-time availability and processes the reservation. Payment
details are securely sent to the payment service, integrated with payment gateways like
Stripe or PayPal, to handle the transaction. The booking confirmation and related
notifications are managed by the notification service, which sends emails, SMS, or push
notifications to both the guest and host. User reviews and ratings are submitted through
the client application and processed by the review service, updating the database and
the user interface in real-time. All these interactions are logged and monitored for
performance and security, ensuring a seamless and secure experience for both guests
and hosts.

Dept. of CSE, AMCEC 2024-31 11


CROP RECOMMENDATION USING ML

Figure 5.2: Data Flow Diagram


CHAPTER6

IMPLEMENTATION
6.1 System Implementation
The implementation of this system involves multiple phases:

• Data Collection: Gather soil and environmental data through sensors (measuring
pH, moisture, and nutrients) and external sources like weather APIs. Historical crop
data and agricultural guidelines are also incorporated.

• DataPreprocessing: Clean, normalize, andpreprocesstherawdatatohandlemissing


values, outliers, and inconsistencies. This ensures that the data is suitable for
machine learning models.

Dept. of CSE, AMCEC 2024-31 12


CROP RECOMMENDATION USING ML

• Model Development: Use supervised learning algorithms for crop


recommendation, where features like soil type, weather conditions, and past crop
yields are used to predict the most suitable crops. For soil enhancement, models
like regression or clustering help identify deficient nutrients and recommend
fertilizers or organic solutions.

Figure 6.1: Python Sample Code

• System Architecture: Develop a backend system with a central database to store


all data. Integrate machine learning models via APIs. A user-friendly interface
allows farmers to input data and receive recommendations.

• User Feedback and Iteration: Collect feedback from users to refine the model.
Implement a feedback loop to improve prediction accuracy and usability over time.
• Deployment: Deploy the system as a web or mobile application, ensuring it is
accessible in rural areas and supports local languages. Incorporate offline
capabilities for areas with limited connectivity.

By combining real-time data, predictive models, and actionable recommendations,


this system empowers farmers to maximize yield while maintaining soil health.

Dept. of CSE, AMCEC 2024-31 13


CROP RECOMMENDATION USING ML

Figure 6.2: HTML sample code


CHAPTER7

RESULTS
The Crop Recommendation and Soil Enhancement System has successfully
delivered comprehensive agricultural guidance through its web-based interface. The
system demonstrates robust performance in processing user inputs related to soil
composition and environmental conditions. Through the user-friendly interface, farmers
can easily input essential parameters including nitrogen, phosphorus, and potassium
content levels, along with environmental factors such as temperature, humidity, pH
value, and rainfall measurements. These inputs are processed in real-time by the
underlying machine learning models to generate actionable recommendations.
The system’s primary output consists of two key recommendations: crop selection
and fertilizer type. For crop recommendations, the system analyzes the complete set of
input parameters to suggest the most suitable crop from a diverse range of 22 options,
including staple crops like rice and maize, cash crops like cotton, and various fruits and
pulses. The fertilizer recommendation component focuses on the NPK values to suggest
the optimal fertilizer type from seven different formulations, including Urea, DAP, and
various NPK ratio combinations such as 14-35-14, 28-28, 17-17-17, 20-20, and 10-26-26.
Performance testing of the system has shown consistently quick response times of
less than two seconds for generating recommendations. The system maintains high

Dept. of CSE, AMCEC 2024-31 14


CROP RECOMMENDATION USING ML

accuracy in its predictions across various input combinations, thanks to the well-trained
machine learning models. The user interface has proven to be highly accessible, featuring
clear input fields with proper validation, responsive design that adapts to different
devices, and an intuitive layout that presents recommendations in an easy-to-read card
format. These results demonstrate that the system effectively achieves its goal of
providing farmers with datadriven recommendations for crop selection and soil
enhancement, ultimately supporting more informed agricultural decision-making.
The implemented system successfully bridges the gap between traditional farming
practices and modern agricultural technology, providing a practical tool that farmers can
use to optimize their crop selection and soil management strategies. The clear
presentation of results and the system’s ability to process complex agricultural data into
straightforward recommendations makes it an effective solution for enhancing
agricultural productivity while promoting sustainable farming practices.

Figure 7.1: Registration Page

Dept. of CSE, AMCEC 2024-31 15


CROP RECOMMENDATION USING ML

Figure 7.2: Login Page


CHAPTER8

CONCLUSION
The Crop Recommendation System represents a significant advancement in the
integration of technology and agriculture, providing farmers with essential tools to make
informed decisions regarding crop selection and fertilizer application. By leveraging
machine learning algorithms and a user-friendly web interface, the system offers real-
time, data-driven recommendations tailored to specific environmental conditions. This
capability not only enhances agricultural productivity but also promotes sustainable
farming practices by optimizing resource use and minimizing waste. Through a systematic
methodology encompassing data collection, preprocessing, model development, and
user engagement, the system has been designed to address the challenges faced by
farmers in an increasingly complex agricultural landscape. The incorporation of feedback
mechanisms ensures continuous improvement, allowing the system to adapt to the
evolving needs of its users and the agricultural sector as a whole. As the world grapples
with issues such as climate change, food security, and resource management, the Crop
Recommendation System stands as a valuable resource for farmers, empowering them to
achieve better yields and more efficient farming practices. Future enhancements, such as
the integration of satellite imagery and mobile accessibility, will further expand the
system’s capabilities, making it an indispensable tool for modern agriculture. Ultimately,
the Crop Recommendation System not only aims to improve individual farming outcomes
but also contributes to the broader goal of fostering a more resilient and sustainable
agricultural ecosystem.

BIBLIOGRAPHY
[1] Gebrehiwot, T., et al. (2020). Soil health prediction using machine learning
algorithms.
Computers and Electronics in Agriculture, 170, 105251.

[2] Kamilaris, A., & Prenafeta-Bold, F. (2018). Deep learning in agriculture: A survey.
Computers and Electronics in Agriculture, 147, 70-90.

Dept. of CSE, AMCEC 2024-31 16


CROP RECOMMENDATION USING ML

[3] Kaul, M., et al. (2017). A crop recommendation system using machine learning.
Journal of Intelligent Information Systems, 51(2), 267-284.

[4] Sheikh, A., etal.(2019).Soilclassificationusingmachinelearningalgorithms.Journal of


Environmental Science and Health, Part B, 54, 1-13.

[5] Kaggle (n.d.). Kaggle. Retrieved from https://www.kaggle.com.

[6] OpenAI (n.d.). ChatGPT. Retrieved from https://chat.openai.com.

[7] GitHub (n.d.). GitHub. Retrieved from https://github.com.

[8] Blackbox (n.d.). Blackbox AI. Retrieved from https://www.blackbox.ai.

[9] Gemini AI (n.d.). Gemini AI. Retrieved from https://www.gemini.ai.

[10] Meta AI (n.d.). Meta AI. Retrieved from https://ai.facebook.com.

Dept. of CSE, AMCEC 2024-31 17

You might also like