Professional Documents
Culture Documents
DEPARTMENTOFCOMPUTERSCIENCEANDENGINEERING
Phase-1ProjectReport
On
Submitted by:
Bhoomika Anand(1SK18CS010)
Durgalakshmi M(1SK18CS015)
Tejashri S J (1SK18CS044)
Tejaswini K(1SK18CS045)
GovernmentSriKrishnarajendraSilverJubileeTechnologicalInstitute
Agro System Development
K R Circle, Bangalore-560001.
GovernmentSriKrishnarajendraSilverJubileeTechnologicalInstitute
KRCircle,Bangalore–560001
(AffiliatedtoVisvesvarayaTechnologicalUniversity,Belgaum)
DEPARTMENTOFCOMPUTERSCIENCEANDENGINEERING
CERTIFICATE:
2.
2
Agro System Development
ACKNOWLEDGEMENT
A unique opportunity like this come very rarely. It is indeed a pleasure for us to
work onthis project. The satisfaction that accompanies the successful completion
of this phase-1 project is incomplete without the mention of the people whose
guidance has made it possible for us tocompletethisproject.
WearegratefultoourinstitutionGovt.SriKrishnarajendraSilverJubileeTechnologi
cal Institute with its ideals and inspiration for providing us with facilities that
hasmade thisphase-1 projectsuccessful.
3
Agro System Development
ABSTRACT
In general, agriculture is the backbone of India and also plays an important role in
Indian economy by providing a certain percentage of domestic product to ensure
the food security. But now-a-days, food production and prediction is getting
depleted due to unnatural climatic changes, which will adversely affect the
economy of farmers by getting a poor yield and also help the farmers to remain
less familiar in forecasting the future crops. This project helps the beginner farmer
in such a way to guide them for sowing the reasonable crops by deploying machine
learning, one of the advanced technologies in crop prediction.Supervised learning
algorithm puts forth in the way to achieve it. The data of the crops are collected
here, with the appropriate parameters like temperature, humidity and moisture
content, which helps the crops to achieve a successful growth. In addition to this,
an user-interface will be developed. The users are encouraged to enter parameters
like temperature and NPK values, based on this input information the suitable crop
will be detected by the system.
4
Agro System Development
TABLE OF CONTENTS
Topic Page.no
1. Introduction 6
2. Problem Statement 7
3. Objectives 8
4. Methodology 9-10
5. Literature Survey 11-17
6. System Requirements and specification 18-21
6.1 Functional Requirement 18-20
6.2 Non Functional Requirement 20-21
7. System Architecture 22-24
8. Use case diagram 25-26
9. Sequence diagram 27
10.Context Diagram 28
11.Activity Diagram 29
12.Class Diagram 30-31
13.Data flow diagram 31-33
5
Agro System Development
1. INTRODUCTION
6
Agro System Development
2. PROBLEM STATEMENT
In general, agriculture is the backbone of India and also plays an important role
inIndian economy by providing a certain percentage of domestic product to ensure
the foodsecurity. Selection of crop is an important issue for agriculture planning. It
depends on variousparameters such as product rate, market prize and government
policies. Many researchersstudied prediction of yield, rates of crop, prediction of
weather, soil classification and cropclassification for agriculture planning using
statistics method or machine learning techniques.If there's more than one options to
plant a crop at a time using limited land resource thenselection of crop is a
puzzle.However, regrettable is the yield per hectare of crops in comparison to
internationalstandards. This is one of the possible causes for a higher suicide rate
among marginal farmersin India. However, rainfall is uncertain in India it is
complicated to predictthe rainfallaccurately. It is challenging to forecast the rainfall
for both summer and rainy season. We haveseen many cases in which farmers
facing problems due toheavy rainfall, flood and also due todrought, they are not
able to get the expectedoutcome.
7
Agro System Development
3.OBJECTIVES
This project aims at predicting the crop yield at a particular weather condition and
therebyrecommending suitable crops for that field. It involves the following steps.
● Collect the weather data, crop yield data, soil type data and the rainfall data and
mergethese datasets in a structured form and clean the data. Data Cleaning is done
to removeinaccurate, incomplete and unreasonable data that increases the quality
of the data andhence the overall productivity.
● Perform Exploratory Data Analysis (EDA) that helps in analyzing the complete
datasetand summarizing the main characteristics. It is used to discover patterns,
spot anomaliesand to get graphical representations of various attributes. Most
importantly, it tells us theimportance of each attribute, the dependence of each
attribute on the class attribute andother crucial information.
● Divide the analyzed crop data into training and testing sets and train the model
using thetraining data to predict the crop yield for given inputs.
8
Agro System Development
4.METHODOLOGY
This will be done by collecting information like Soil type, climate, place etc. by the
farmers using a mobile application. Application will be developed using Android
Studio platform. The datasets for respective phases will be collected and Suitable
crop, climate and method will be predicted based on the algorithm which has the
highest accuracy among the tested algorithms like Naïve Bayes, Random-forest,
Artificial Neural Network, Support Vector Machine, K-Nearest Neighbors
and Decision tree.
SVM algorithm is to create the best line or decision boundary that can segregate n-
dimensional space into classes so that we can easily put the new data point in the
correct category in thefuture. This best decision boundary is called a hyperplane.
SVM chooses the extremepoints/vectors that help in creating the hyperplane.
The KNN algorithm aim is to locate all of the closest neighbors around a new
unknown datapoint in order to figure out what class it belongs to. It’s a distance-
based approach.
9
Agro System Development
Naïve Bayes Classifier is one of the simple and most effective Classification
algorithms whichhelps in building the fast machine learning models that can make
quick predictions. It predicts on the basis of the probability of an object.
Collection of dataset
Pre-processing
Feature Reduction
Prediction
Training Testing data Model
data 70% 30%
Graphs and
Result
10
Agro System Development
5.LITERATURE SURVEY
11
Agro System Development
Literature survey describes about the existing work on the given project. It
dealswith the problem associated with the existing system and also gives user a
clearknowledge on how to deal with the existing problems and how to provide
solutiontothe existing problems.
12
Agro System Development
It predicts the yieldof almost all kindsof crops that are planted in India. They
predicted the yield of thecrop in which year he or shewants to, by the usage of
simple parameters like State,district, season and area. The paper usesregression
techniques like Kernel Ridge, Lasso and ENet algorithms to predict the yield.
Theoutput has been shown in a web application, but they failed in building an
application wherethe farmers can use it as app and converting the whole system in
their regional language.
13
Agro System Development
05.In the paper "Crop Selection Method to Maximize Crop Yield Rate
usingMachine learningtechniques" Rakesh Kumar, M.P. Singh, Prabhat Kumar,
J.P. Singh proposed a method namedCrop Selection Method to solve Crop
selection problem, and maximize net yield rate of cropover season. This paper
takes crop, their sowing time, plantation days and predicted yield ratefor the season
as input and finds a sequence of crops whose production per day are maximumover
season. The algorithms used in this paper are ANN, SVM, KNN, Decision tree
learning,Random Forest, Gradient Boosted Decision tree, Regularized Greedy
Forest. Here the userinterface is not built to take inputs from the users. We will
implement this in our project.
forfarmers. By which farmer canmake their own decisions like which season which
crop shouldsow so that they can get better profit.
07.In this paper titled “Rianfall Prediction using Machine Learning and Deep
Learning”,CMAK ZeelanBasha ,Nagulla Bhavana , Ponduru Bhavya , Sowmya V,
predicts the rainfallusing regression techniques such as Artificial Neural-
Network(ANN),Support-Vector-Machines(SVM),ARIMA(auto-regression
integrated moving average),Deep Learningtechniques such as Multilayer
Perceptron and Auto-Encoders. This paper provides a study ofdifferent types of
methodologies used to forecast and predict rainfall and issues that could befound
when applying different approaches to forecasting rainfall.
08.In this paper titled “Rainfall Prediction based on 100 years of Meteorological
Data”,SandeepKumarMohapatra, Anamika Upadhyay,Channabasava Gola,
predicts the rainfall onthe data collected for wet day frequency, precipitation and
rainfall for the years ranging from1901-2002 of Bangalore, India. This paper uses
the techniques like weather prediction, Datamining, Linear Regression to predict
the rainfall. This paper used fixed sampling of the inputdata set and another
method for K-fold cross validation techniques.
15
Agro System Development
11.The paper titled “Machine Learning convergence for weather based crop
selection”,SonalJain, Dharavath Ramesh, proposed a crop selection method to
maximize crop yield based onweather and soil parameters. It also suggests the
proper sowing time for suitable crops usingseasonal weather forecasting. Machine
learning algorithms such as Recurrent neural networkis used for weather
prediction, and Random-forest classification algorithmisused to selectsuitable
crops. The result of proposed weather forecasting technique is compared
withconventional Artificial neural network. This classification model is trained by
considering theweather and soil parameters of agro-climatic zones of only
Telangana state. The datasetcontains January 2014 to September 2019 data of
crops.
16
Agro System Development
the existing models utilized Neural networks, random forests, KNN regression
techniques for CYP and a variety of ML techniques were also used for best
prediction. From the studies most of the common algorithms used were CNN,
LSTM, DNN algorithms but still improvement was still required further in CYP.
The present research shows several existing models that consider elements such as
temperature, weather condition, performing models for the effective crop yield
prediction.
17
Agro System Development
FUNCTIONAL REQUIREMENTS:
18
Agro System Development
requirements. They help clearly define the expected system service and behavior.
Errors caught in the Functional requirement gathering stage are the cheapest to
fix.
Basic requirements:
Data collection: The dataset used in this project is the data collected from
reliablewebsites and merged to achieve the desired data set.
Dataset splitting: A dataset used for machine learning should be partitioned into
twosubsets — training and test sets. We split the dataset into two with a split ratio
of 80%i.e., in 100 records 80 records were a part of the training set and remaining
20 recordswere a part of the test set.
Model training: After a data scientist has preprocessed the collected data and
splitit intotrain and test can proceed with a model training. This process
19
Agro System Development
Model evaluation and testing: The goal of this step is to develop the simplest
modelable to formulate a target value fast and well enough. A data scientist can
achieve thisgoal through model tuning. That‘s the optimization of model
parameters to achieve analgorithm‘s best performance.
NON-FUNCTIONAL REQUIREMENTS:
20
Agro System Development
The nonfunctional requirements ensure the software system follows legal and
compliancerules.
They ensure the reliability, availability, and performance of the software system.
They ensure good user experience and ease of operating the software.
HARDWARE REQUIREMENTS:
System: intel i5
RAM: 8 GB
SOFTWARE REQUIREMENTS:
21
Agro System Development
7.SYSTEM ARCHITECTURE
Architecture diagrams can help system designers and developers visualize the
high-level, overall structure of their system or application for the purpose of
ensuring the system meets their users' needs. They can also be used to describe
patterns that are used throughout the design. It's somewhat like a blueprint that can
be used as a guide for the convenience of discussing, improving, and following
among a team.
Data Mining
Regression Algorithm
Bayesian 75%
Month Year
Bayesian Model
Rainfall in cm^3
22
Agro System Development
Fig shows the system architecture of rainfall prediction. The first step is data
mining. Here we extract the useful information from the dataset for testing and
training. Missing values can be handled by deleting the rows of columns having
null values. And null values can be replaced by appropriate values using fillna
method. And after feature reduction data is divided into training data and testing
data.
Regression algorithm:
User data collection-In the next step we collect required data from user for
predicting rainfall. Here for user interface we are using Tkinter a GUI(Graphical
User Interface) toolkit.
23
Agro System Development
Data Mining
Classification Algorithm
Predicted Rainfall
N P K PH
Class Model
Crop Predicted
Technologies can be
used
The first step is data mining it is same as explained in the rainfall prediction
model.
Next we are using classification algorithms. As we identity the category of a
given dataset.
24
Agro System Development
In the next step we will collect inputs from the user. And the predicted
rainfall is given as one of the inputs.
Classification models:
In the next step the collected inputs will be given to classification model. Here we
considered Logistic regression, Decision tree and Random forest algorithm. In
these algorithms we will choose the best algorithm with good accuracy score and
thus crop will be predicted. Further the predicted crop is used to identify the
suitable methods or technologies that can be used for growing the particular crop.
25
Agro System Development
User Data
Load Dataset
Read Data
Data Mining
Apply Algorithm
SYSTE
Predicts Crop
Identify suitable
Technologies &
Methods
USER Result
The figure represents the actor and their functional requirements provided by
thesystem.The functionalities provided by the system are represented in ovals.
Thearrows represent the dependencies and visibility of the functionalities.The user
have to provide input data and get predicted crop, required technologies as output.
26
Agro System Development
9.SEQUENCE DIAGRAM
Month ,State
Month, Year Responded prediction
N, P, K, PH of Rainfall
N, P, K, PH
Recommended
Crop
Responded
Identified
prediction of
Technology &
Crop
Method
27
Agro System Development
In the first step the user will provide input data such as month,state, NPK
values and ph.Tothe system by the interface. Then the interface will provide
these inputs to trained models.
The inputs moth and state will be given to rainfall prediction model this
model will provide the predicted rainfall as input to crop prediction model.
And the crop prediction model will get other inputs by the interface.
After collecting the inputs model will predict the crop. By that crop the
method and technology will be identified.Then both will be given as output
for the user through the interface.
10.CONTEXT DIAGRAM
Inputs
(N, P, K, PH)
AGRO
USER SYSTEM
Predicted
Crop &
Identified
Method/
Technology
28
Agro System Development
Context diagram contains only one process node that generalizes the
function of the entire system in relationship with external entities.
Here we have provided the overview of our project. That is the user will
provide the inputs like NPK values ph, year and month to the system and the
system will provide the predicted crop and identified method to the user.
11.ACTIVITY DIAGRAM
29
Agro System Development
SYSTEM STARTS
PROVIDE INPUT
SUCCESS
YES
IDENTIFY METHOD /
TECHNOLOGY
OUTPUT RESULT
In the Activity diagram when the system has started, the user will be provided a
user interface to provide inputs after collecting the inputs will be provided to
prediction models if the prediction is successful then using the predicted crop the
method and technology will be identified and that will be provided as output. If
30
Agro System Development
any error has occurred during the prediction the control will be redirected to user
interface.
12.CLASS DIAGRAM
In user we have variables to store the input values that will be given by the user.
And the user will call the predict() function through user interface.
And in the system, we use read dataset method for loading the dataset. Train model
() for training the rainfall and crop prediction models
Predict rainfall () and predict crop() methods for predicting rainfall and croy
respectively..
And user and system are interrelated user provide input the system and the system
will provide the output.
31
Agro System Development
SYSTEM
Dataset : .csv
Read dataset()
Train model()
Predict Rainfall()
Predict crop()
13.DATA-FLOW DIAGRAM
LEVEL 0:
Here we provide inputs to the crop prediction model and the model will predict the
crop and identifies the suitable technology and method.
LEVEL 1:
32
Agro System Development
The data set will be loaded and that will be preprocessed after preprocessing the
data will be selected and reduced. After reduction data will be provided to ML
algorithm for training the model.
33
Agro System Development
LEVEL 2:
User input will be provided to the trained modelfirstly the rainfall prediction model
then the predicted rainfall and other inputs will be provided to crop prediction. We
get the predicted crop as the final output.
LEVEL-2
2.2
RAINFALL PREDICT
MODEL
2.3
CROP PREDICTION
MODEL
PREDICTED CROP
34