Professional Documents
Culture Documents
G. Jaswanth - 20BQ1A0555
This is to certify that the Community Service Project report titled Crop Recommendation
System is being submitted by A. Naga Sai Ajay Kumar, Ch. Pavan Sai Ganesh, G. Jaswanth, B.
Dheeraj Kumar bearing 20BQ1A0501, 20BQ1A0537, 20BQ1A0555, 20BQ1A0521 in IV B.
Tech II semester Computer Science & Engineering is a record bonafide work carried out by me.
The results embodied in this report have not been submitted to any other University for the award
of any degree.
Mr. V. Koteswara Rao Mr. P.R. Krishna Prasad Dr. V. Rama Chandran
We A. Naga Sai Ajay Kumar, Ch. Pavan Sai Ganesh, G. Jaswanth, B. Dheeraj Kumar hereby
declare that the Project Report entitled “CROP RECOMMENDATION SYSTEM” was done
Technology is submitted in partial fulfilment of the requirements for the award of a degree in
DATE :
PLACE :
1.
2.
3.
4.
ACKNOWLEDGEMENT
With deep sense of gratitude, I acknowledgment the guidance, help & active cooperation rendered
by the following people whose guidance had submitted the effort, which led to the successful
completion of this project.
I express my profound gratitude to Chairman Sri Vasireddy Vidya Sagar of the college for
providing me the opportunity to do the project work.
I would also like to extend my gratitude to Dr. Y Mallikarjuna Reddy, Principal, for providing
me with all the facility that was required.
I would also like to extend my gratitude to Dr. V Ramachandran, Head of the department of
Computer Science & Engineering (CSE) for providing me with all the facility that was required.
I would like to thank to Mr. P. R. Krishna Prasad, project guide in charge who gave me this
opportunity to undergo industrial in this organization.
Our utmost thanks to all the NSS Coordinator and Faculty members and Non-Teaching Staff of
the Department of Computer science & Engineering for their support throughout our project work.
Our Family Members and Friends receive our deepest gratitude and love for their support
throughout our academic year.
(Autonomous)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Institute Vision
To impart quality education through exploration and experimentation and
generate socially conscious engineers, embedding ethics and values, for the
advancement in science and technology.
Institute Mission
Department Vision
Department Mission
• To equip the graduates with the knowledge and skills required to enable
them to be industry ready.
• To train socially responsible, disciplined engineers who work with good
leadership skills and can contribute for nation building.
• To make our graduates proficient in cutting edge technologies through
student centric teaching-learning process and empower them to
contribute significantly to the software industry
• To shape the department into a centre of academic and research
excellence
Index
1. Overview of CSP
2. Problem Statement
4. Performed Activities
i Approaches
7. Implementation
8. Output Screens/Screenshots
10. Conclusion
11. References
Overview of Community Service Project
Date of Submission :
Overview of Community Service Project
A community service project is an initiative undertaken by individuals or groups to address a
specific need or issue within a community. These projects are typically aimed at improving the
well-being, quality of life, or circumstances of community members. Community service projects
can take various forms and may involve activities such as:
Volunteer Work: Engaging in hands-on activities such as cleaning up parks, serving meals at
homeless shelters, tutoring students, or providing companionship to elderly residents.
Fundraising: Organizing events or campaigns to raise funds for local charities, schools, or other
community organizations that support important causes.
Awareness Campaigns: Creating and promoting initiatives to raise awareness about social,
environmental, or health issues within the community, such as mental health awareness
campaigns or recycling drives.
Environmental Initiatives: Undertaking projects to protect and improve the environment, such as
planting trees, cleaning up litter, or promoting recycling and conservation efforts.
Community Development Projects: Working on projects that aim to enhance the infrastructure or
facilities within the community, such as building playgrounds, renovating community centers, or
improving access to clean water.
Support Services: Providing support services to vulnerable populations within the community,
such as organizing food drives, offering free healthcare clinics, or assisting with disaster relief
efforts.
Learning Outcomes
• Positive impact on students’ academic learning in view of the classroom to field and vice
versa experience
• Improves students’ ability to apply what they have learned in “the real world”
• Positive impact on academic outcomes such as demonstrated complexity of
understanding, problem analysis, problem-solving, critical thinking, and cognitive
development
• Improved ability to understand complexity and ambiguity
Personal Outcomes
• Greater sense of personal efficacy, personal identity, compassion, spiritual growth, and
moral development
• Greater interpersonal development, particularly the ability to work well with others, and
build leadership and communication skills
Social Outcomes
• Connections with professionals and community members for learning and career
opportunities
• Greater academic learning, leadership skills, and personal efficacy can lead to greater
opportunity Relationship with the Institution
• Stronger relationships with faculty
• Greater satisfaction with college
Problem Statement
In agricultural practices, making informed decisions regarding crop selection is crucial for
maximizing yield and profitability. However, farmers often face challenges in determining the
most suitable crops to cultivate based on various factors such as soil type, climate conditions,
and market demand. To address this issue, a Crop Recommendation System is proposed,
leveraging Flask along with decision tree classifier and random forest classifier algorithms. The
system aims to provide personalized crop recommendations to farmers, helping them optimize
their agricultural activities and achieve better harvests.
The primary objective of the Crop Recommendation System is to offer tailored crop suggestions
to farmers based on their specific soil characteristics, and prevailing weather conditions. By
utilizing Flask, an efficient web framework, the system will be deployed as a user-friendly web
application accessible to farmers via internet. Through an intuitive user interface, farmers can
input relevant information such as their climate conditions, soil type and preferences, enabling
the system to generate personalized crop recommendations promptly.
To develop accurate crop recommendations, the system will employ machine learning
algorithms, including decision tree classifier and random forest classifier. These algorithms will
analyze historical agricultural data, climate patterns, soil properties, and crop attributes to
generate predictive models. The decision tree classifier will help in understanding the
relationship between various factors and crop suitability, while the random forest classifier will
enhance the accuracy and robustness of predictions by aggregating multiple decision trees. By
integrating these algorithms within the Flask framework, the Crop Recommendation System
aims to deliver reliable, data-driven recommendations to farmers, empowering them to make
informed decisions and improve their agricultural outcomes.
Furthermore, the Crop Recommendation System will continually evolve and improve its
recommendations over time by leveraging feedback from farmers and incorporating real-time data
updates. By allowing farmers to provide feedback on the suggested crops' performance and their
actual harvest yields, the system can refine its algorithms and enhance the accuracy of future
recommendations. Additionally, the integration of real-time weather data and market trends will
enable the system to adapt recommendations dynamically, helping farmers respond to changing
environmental conditions and market demands promptly.
In addition to aiding individual farmers, the Crop Recommendation System can also contribute
to broader agricultural research and policy initiatives. By aggregating anonymized data collected
from farmers who use the system, researchers and policymakers can gain insights into regional
agricultural trends, soil health, climate resilience, and crop diversification strategies. This
aggregated data can inform decision- making processes related to agricultural policies, resource
allocation, and climate adaptation measures, ultimately contributing to the sustainability and
resilience of agricultural systems worldwide. Thus, the Crop Recommendation System not only
benefits individual farmers but also serves as a valuable tool for advancing agricultural science
and promoting sustainable farming practices on a larger scale.
Constraints and Policies
1. Data Privacy and Security: The project must adhere to strict data privacy regulations to
ensure that farmers' sensitive information, including location, soil data, and crop preferences, is
protected from unauthorized access or misuse. Implementing robust encryption methods and
access controls is essential to safeguarding the confidentiality of user data.
4. Accuracy and Reliability: The system must strive for high accuracy and reliability in its
crop recommendations to earn farmers' trust and confidence. This requires rigorous testing and
validation of the machine learning algorithms used, as well as ongoing monitoring and refinement
based on feedback from users and real-world performance data.
5. Transparency: The project should maintain transparency in its operations, providing clear
explanations of how crop recommendations are generated and the factors influencing them.
Farmers should have visibility into the data sources, algorithms, and decision-making processes
underlying the recommendations to foster trust and accountability.
7. Collaboration and Stakeholder Engagement: The project should engage with relevant
stakeholders, including farmers, agricultural experts, policymakers, and local communities, to
ensure that recommendations are contextually relevant and aligned with stakeholders' needs and
priorities.
Collaboration with research institutions, extension services, and agricultural cooperatives can
enhance the project's impact and effectiveness.
Performed Activities
Focus Group Discussions: Organizing focus group discussions with small groups of
community members or stakeholders to facilitate dialogue, explore opinions, and generate
ideas for improvement or expansion of the project.
Observation: Engaging in direct observation of project activities and interactions within the
community to gather qualitative data on participation levels, community engagement, and the
overall implementation of the project.
Outcome Measurement Tools: Using standardized tools and indicators to measure specific
project outcomes and impacts, such as changes in knowledge, behavior, or quality of life among
project beneficiaries.
Social Media Monitoring: Monitoring social media platforms and online forums to gather
feedback, track engagement, and assess the reach and visibility of the project within the
community and beyond.
Case Studies: Conducting in-depth case studies of individual beneficiaries or success stories
to capture personal experiences, challenges overcome, and the tangible impact of the project
on their lives.
By utilizing a combination of these data collection methods, community service projects can
gather comprehensive and meaningful data to inform decision-making, improve project
outcomes, and demonstrate accountability to stakeholders.
Adapted Method for the current project:
For the crop recommendation system project, surveys and questionnaires were employed as
primary methods to collect essential data for analysis. These surveys focused on gathering
information regarding key factors influencing crop selection and agricultural practices.
Parameters such as nitrogen, potassium, and phosphorus levels in the soil were measured to
assess soil fertility and nutrient availability, crucial for determining suitable crop
recommendations.
The survey methodology involved administering structured questionnaires to farmers within the
target communities. These questionnaires were designed to elicit detailed information about
farmers' current crop preferences, cultivation practices, and challenges faced in their agricultural
activities. Farmers were asked to provide insights into the types of crops they have traditionally
grown, their experiences with different soil conditions, and their observations regarding crop
performance under varying weather patterns. Through these questionnaires, a rich dataset was
compiled, allowing for thorough analysis and pattern recognition to inform the development of
the crop recommendation system.
Analysis of the survey data revealed correlations and patterns between soil nutrient levels,
weather conditions, crop types, and farmers' preferences. For instance, areas with higher
nitrogen content in the soil might be more conducive to certain nitrogen-loving crops like maize
or soybeans. Similarly, regions experiencing specific weather patterns, such as consistent
rainfall or prolonged dry spells, may favor the cultivation of drought-resistant crops like
sorghum or millet. By examining these relationships, the project team gained valuable insights
into the complex interactions between environmental variables and crop suitability, laying the
groundwork for building accurate predictive models within the crop recommendation system.
Overall, the utilization of surveys and questionnaires proved instrumental in gathering empirical
data and farmer perspectives necessary for developing an effective crop recommendation
system. By systematically collecting information on soil properties, weather conditions, crop
preferences, and agricultural practices, the project team was able to tailor recommendations that
align with the specific needs and contexts of the target communities. Moving forward, the
insights gleaned from these surveys will serve as foundational inputs for refining algorithms,
validating models, and ultimately delivering personalized crop recommendations to farmers,
thereby enhancing agricultural productivity and livelihoods.
Sample Copy of Data Collection:
Implementation
1. Dataset Acquisition:
import pandas as pd
df = pd.read_csv('Crop_recommendation.csv')
df.sample(n=5)
Next we need to know if there are any relationships between data fields.
There is no need for pre-preprocessing all values are numeric.
app.py file :-
app = Flask(__name__)
CORS(app)
@app.route('/')
def home():
return render_template('homepage.html')
@app.route('/crop_pred', methods=['POST'])
def disease():
if request.method == 'POST':
data = request.form.to_dict()
form_values = [float(data[key]) for key in data]
form_values = [form_values]
result = predict_type(form_values)
print(result)
return jsonify({"result": result})
if __name__ == '__main__':
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
app.run(debug=True, port=5000)
Recommender.py file ;-
import joblib
rf = joblib.load('RandomForest.pkl')
def predict_type(arr):
res = rf.predict(arr)
print(res)
return res[0]
Test Results
Accuracy using DecisionTree:
In conclusion, our project on the crop recommendation system utilizing Random Forest
classifiers with a remarkable accuracy of 99% signifies a significant milestone in leveraging
data-driven approaches for agricultural decision-making. With the inclusion of crucial soil
and environmental parameters such as N, P, K, temperature, humidity, pH, and rainfall, the
model demonstrates its robustness in generating precise crop recommendations.
Such high accuracy implies that the model can confidently predict suitable crops based on the
provided input parameters. Farmers and agricultural stakeholders can rely on these predictions
to optimize crop selection, thereby enhancing yield potential, resource efficiency, and overall
farm profitability.
The success of this project underscores the potential of machine learning techniques in
addressing complex agricultural challenges and empowering farmers with actionable insights.
Moving forward, continuous monitoring and validation of the model's performance, along
with updates to accommodate evolving agricultural practices and environmental conditions,
will be essential for its sustained effectiveness.
References
1. Crop recommendation using Machine Learning. April 2020, Dr.D Kavitha
2. CROP RECOMMENDATION SYSTEM USING MACHINE LEARNING
ALGORITHM. April 2022 By LAKSHMAN KUMAR SERU
6. Marie ionnotti (2020), ‘Outdoors & Gardning’, The Spruce Web Site
7. Rohith Gandhi (2018), ‘Support Vector Machine — Introduction to Machine Learning Algorithms’,
Toward Data Science Web Site
8. C. Brouwer and M. Heibloem, Irrigation Water Management: Irrigation Water Needs, manual 6
Reading, ITALY: Food and Agriculture Organization of the United Nations, 1987. [Online] Available:
http://www.fao.org/3/s2022e/s2022e07.htm#TopOfPage.
10. Department of Agriculture Sri Lanka (2015), ‘Crop Suitability Recommendation for Grama Niladhari
Divisions in Sri Lanka’, Natural Resources Management Center, Peradeniya.