FINAL REPORT Project
FINAL REPORT Project
Project report of
Final Year, Semester-IV
By
CERTIFICATE OF COMPLETION
1
This is to certify that the dissertation entitled “___________” carried out
by_____________, student of MASTER OF COMPUTER APPLICATION [2022-
2023], of MUKESH PATEL SCHOOL OF TECHNOLOGY MANAGEMENT &
ENGINEERING, MUMBAI, is hereby accepted and approved as a credible work.
Submitted in the partial fulfillment for the requirement of degree of MCA from NMIMS
(DEEMED-TO-BE UNIVERSITY),MUMBAI, It’s a bona –fide record of the work done
by him/her under my supervision during his/her stay as a project trainee at Company
Name From _______ to __________. The system has been implemented and running
successfully. We do not have any objection on the content of the report.
2
Shri Vile Parle Kelavani Mandal’s
CROPYFY
Submitted by
Dhrumil Oza
has successfully completed the project report required for the partial fulfillment of
Master of Computer Application(MCA) Degree as per the norms prescribed by
NMIMS during the IV Semester of the academic year 2023-2024. The project report
has been assessed and found to be satisfactory.
_______________ ________________
_______________ ________________
_______________________
DEAN
3
DECLARATION
I/We, ________ , hereby declare that the project work entitled “Project Name” is an
authenticated work carried out by me at Company Name Under the guidance of
Company Mentor Name for the partial fulfillment of the award of the degree of
MASTER OF COMPUTER APPLICATION and this work has not been submitted
for similar purpose anywhere else except to Mukesh Patel School of Technology
Management & Engineering, Mumbai, affiliated to NMIMS (DEEMED-TO-BE
UNIVIERSITY),MUMBAI.
Date:
Place: Sign &
Name of Students
4
INDEX OF CONTENT
1 Introduction to Project
4.1 Project Profile
4.2 Introduction to system
4.3 Scope and Applicability of the Project
6 Testing
9.1 Test Cases
9.2 Validation
7 Key Learnings from Internship
8 Challenges During Internship
9 Conclusion and Future Expansion
10 References and Bibliography
Appendix.
Project Profile
5
Project Title : CROPYFY
CHAPTER 1 : Introduction
1.1 Background:
6
development provides assistance to the crop producers with the help
of various agricultural resources. As a result, it provides high
productivity with low consumption of resources. Despite the
overwhelming size of the agricultural sector, yields per hectare of
crops in India are generally low compared to international standards.
There are several factors that affect agriculture. Some of them are soil,
climate and land relief. Soil is a critical part of successful agriculture
and is the original source of the nutrients that we use to grow crops.
The nutrients move from the soil into plants that we eat like tomatoes.
Nutrients are also a part of the food animals (like cows) eat. In the end,
we benefit from healthy soil. The healthiest soils produce the healthiest
and most abundant food supplies .Farmers must use certain practices
to make sure they are taking good care of the soil. Following best
practices for crop production is essential, but prior to that, the selection
of right crop suitable for the fertile land must be ensured to make the
best use of the practices followed. Hence the System focuses on the
crop selection as it directly contributes to the crop production rate.
1.2 Objectives:
• Design a recommendation system for accurate crop selection based on
several parameters and help them make an informed decision before
cultivation.
The major parameters considered here are: Crop name, Nitrogen,
Phosphorus,
Potassium Values (NPK Values), Temperature, Rainfall, pH value of the
Soil
7
1.3.1 Purpose:
• The purpose is to build a simple web application for Farmers wherein
they have to submit the Soil Nutrients and based on that data, best crop
will be recommended for them.
• A forum for people to interact with each other and develop an online
community to discuss topics related to farming.
• The important purpose is to suggest a way to fertilize the soil and to
improve the crop productivity.
1.3.2 Scope:
• There will be a Home Page for the web application where there will be
all the information related to farming and there will be two Hyperlinks.
The first one will be a simple form wherein they have to input soil
details and the best crop will be recommended to them.
• The second link will again ask for the soil details and also the crop
which the farmer wants to cultivate and based on his soil requirements
they will be suggested the best methods to fertilize their soil.
• A forum will be provided for the people to interact with each other and
develop an online community wherein they can discuss topics related
to farming.
• We can develop a complete product that will help the speech and
hearing impaired people to interpret their language with this automatic
system and help them become self-reliable and thereby reduce the
communication gap
1.3.3 Applicability:
• The application will be taking input from the users about the soil data
such as the NPK values and the soil pH level and the Rainfall in mm,
and the best crop suitable for growing will be displayed.
8
• Not only it recommends the best crop but will also suggest how to
improve the fertility of the soil.
9
Data analytics is important because it helps businesses optimize their
performances.
A company can also use data analytics to make better business decisions and help
analyze customer trends and satisfaction, which can lead to new—and better—
products and services.
Resurging interest in machine learning is due to the same factors that have
made data mining and Bayesian analysis more popular than ever. Things like
growing volumes and varieties of available data, computational processing that
is cheaper and more powerful, and affordable data storage.
All of these things mean it's possible to quickly and automatically produce
models that can analyze bigger, more complex data and deliver faster, more
accurate results – even on a very large scale. And by building precise models,
an organization has a better chance of identifying profitable opportunities – or
avoiding unknown risks.
10
form validation, upload handling, various open authentication technologies and
several common framework related tools.
11
Why Bootstrap?
• Time-saving
With Bootstrap, you get to use pre-made design themes and templates as
your starting point. It allows modification of its code to make the
framework suit your project’s needs.
• Easy to Use
Bootstrap is very simple to use – the setup process doesn’t take too long
and is relatively easy, even for beginners.
• Customizable
With Bootstrap’s design template, you can add your own twist to its CSS
file. You can also combine it with the existing code and make them
complement each other’s functions.
• Cross-browser Compatible
12
• Maintain Consistency
Bootstrap eliminates the use of libraries that always differ from one
developer to the other. Thus, you get to maintain the stability of your
project elements no matter who is tackling them.
• Open Source
• Fertilizer Suggestion
13
The first problem is, Which crop to grow?
The solution to this problem can be easily calculated by the NPK values.
Each crop has an NPK value associated with you, the main concern over
here would be to apply this data on a NPK table, but this application will
help us by providing a simple user interface where we will be allowed to
enter these details and we can get a simplified form of which crop will be
a better option for us.
• To predict the best crop the user will be required to fill the soil details,
that is the NPK values.
• The Fertilizer suggestion page will also require the NPK data as well
as the Crop name, which the user is willing to grow and based on this
data, then the user will be suggested the best way to fertilize the soil.
• For the third Machine learning model, the user will be asked for an
image of the crop for the disease prediction.
14
Following Non-Functional Requirements will be there:
INCREMENTAL MODEL
GANTT CHART
15
Chapter 4: System Design
The user is expected to put in the soil details that is the NPK
values based on which the best crop will be predicted which could
easily get cultivated based on the soil nutrients.
In this module again the user will be asked for the soil details,
that is the NPK values again and the application will also ask
for which crop does the user wants to cultivate, based on it, the
application will calculate on which nutrients the soil is lacking
16
and then best methods will be suggested to improve the crop
production
SEQUENCE :
ACTIVITY DIAGRAM
17
CLASS DIAGRAM
18
SAMPLE DATA FILE :
19
CODE :
def weather_fetch(city_name):
"""
Fetch and returns the temperature and humidity of a city
:params: city_name
:return: temperature, humidity
"""
20
api_key = config.weather_api_key
base_url = "http://api.openweathermap.org/data/2.5/weather?"
if x["cod"] != "404":
y = x["main"]
@ app.route('/crop-predict', methods=['POST'])
def crop_prediction():
title = 'Cropify - Crop Recommendation'
if request.method == 'POST':
N = int(request.form['nitrogen'])
P = int(request.form['phosphorous'])
K = int(request.form['pottasium'])
ph = float(request.form['ph'])
rainfall = float(request.form['rainfall'])
# state = request.form.get("stt")
city = request.form.get("city")
if weather_fetch(city) != None:
temperature, humidity = weather_fetch(city)
data = np.array([[N, P, K, temperature, humidity, ph,
rainfall]])
my_prediction = crop_recommendation_model.predict(data)
final_prediction = my_prediction[0]
return render_template('crop-result.html',
prediction=final_prediction, title=title)
else:
21
return render_template('try_again.html', title=title)
➢ FERTILIZER SUGGESTION :
@ app.route('/fertilizer-predict', methods=['POST'])
def fert_recommend():
title = 'Cropify - Fertilizer Suggestion'
crop_name = str(request.form['cropname'])
N = int(request.form['nitrogen'])
P = int(request.form['phosphorous'])
K = int(request.form['pottasium'])
# ph = float(request.form['ph'])
df = pd.read_csv('Data/fertilizer.csv')
nr = df[df['Crop'] == crop_name]['N'].iloc[0]
pr = df[df['Crop'] == crop_name]['P'].iloc[0]
kr = df[df['Crop'] == crop_name]['K'].iloc[0]
n = nr - N
p = pr - P
k = kr - K
temp = {abs(n): "N", abs(p): "P", abs(k): "K"}
max_value = temp[max(temp.keys())]
if max_value == "N":
if n < 0:
key = 'NHigh'
else:
key = "Nlow"
elif max_value == "P":
if p < 0:
key = 'PHigh'
else:
key = "Plow"
else:
if k < 0:
key = 'KHigh'
else:
key = "Klow"
response = Markup(str(fertilizer_dic[key]))
22
return render_template('fertilizer-result.html',
recommendation=response, title=title)
ScreenShots :
23
24
25