MiniProject-Report (9)
MiniProject-Report (9)
Submitted by:
Pavan A
Prasanna P
Siddharth Kote
Under the Guidance of:
Ms. kavya
Assistant Professor, Dept. of CSE
CERTIFICATE
Certified that the mini project report entitled Crop Recommendation and Soil
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
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.
Pavan A E(14)
Prasanna P E(15)
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
2 SYSTEM REQUIREMENTS 4
3 LITERATUER SURVEY 5
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 SYSTEM ANALYSIS 7
5 SYSTEM DESIGN 9
6 IMPLEMENTATION 12
6.1 System Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7 RESULTS 14
8 CONCLUSION 16
LISTOFFIGURES
Figure 5.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 10
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
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.
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.
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.
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.
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.
• SoilClassification: MLtechniqueshavebeenusedtoclassifysoiltypesbasedontheir
physical and chemical properties, enabling more accurate soil management
practices (Sheikh et al., 2019).
• ScalabilityandTransferability: ManyMLmodelsaredevelopedforspecificregions or
crops, limiting their scalability and transferability to other contexts.
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.
– Acroppredictionmodelthatdeterminesthebestcropbasedontheenvironmental
features.
– A fertilizer prediction model that recommends the appropriate fertilizer based on
Nitrogen, Phosphorus, and Potassium values.
• 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.
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
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:
• 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.
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.
• 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.
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
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.
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.
[3] Kaul, M., et al. (2017). A crop recommendation system using machine learning.
Journal of Intelligent Information Systems, 51(2), 267-284.