9 Intelligent Crop Recommendation System Using Machine Learning
9 Intelligent Crop Recommendation System Using Machine Learning
Abstract- Agriculture plays a vital role in the socio- dependent on this income then it's very difficult to
economic fabric of India. Failure of farmers to decide survive.
on the best-suited crop for the land using
traditional and non-scientific methods is a serious Both availability and accessibility of correct and
issue for a country where approximately 58 percent up to date information hinder potential researchers
of the population is involved in farming. Sometimes from working on developing country case studies.
farmers were failed to choose the right crops based on With resources in our reach, a system has been
the soil conditions, sowing season, and geographical
proposed to address this problem by providing
location. This results in suicide, quitting the agriculture
field, moving towards urban areas for livelihood. To predictive insights on crop sustainability and
overcome this issue, this research work has proposed a recommendations based on machine learning models
system to assist the farmers in crop selection by trained considering essential environmental and
considering all the factors like sowing season, soil, and economic parameters.
geographical location. Furthermore, precision
agriculture is being implemented with a modern In the proposed system the environmental
agricultural technology and it is evolving in developing parameters such as rainfall, temperature, and
countries that concentrates on site-specific crop geographical location in terms of the state along with
management. soil characteristics such as soil type, pH value, and
nutrients concentration are being considered to
Keywords- Agriculture, Crop Recommendation,
Machine Learning
recommend a suitable crop to the user. In addition to
this, if the right crop is selected by the farmer then
I. INTRODUCTION they will get the prediction about the yield also. The
Agriculture is one of the major sources of objective is to, 1. Build a robust model to give a
livelihood for about 58% of our nation's population correct and accurate prediction of crop sustainability
[14] [15]. As per the 2016-17, Economic survey the in a given state for the particular soil type and climatic
average monthly income of a farmer in 17 states is conditions. 2. Provide recommendation of the best
Rs.1700/- which results in farmer suicides, diversion suitable crops in the area so that the farmer does not
of agricultural land for non-agricultural purpose. incur any loss3. Provide profit analysis of various
Besides, 48% of farmers don't want their next crops based on the previous year's data.
generation to take care of their agriculture instead
want to settle down in urban areas. The reason The proposed system is implemented using
behind this is that the farmers often take wrong machine learning which is one of the applications of
decision about the crop selection [9] for example Artificial Intelligence that allows the systems to learn
selecting a crop that won't give much yield for the and evolve automatically without explicitly
particular soil, planting in the wrong season, and so programmed by a programmer. Followed by that, the
on. The farmer might have purchased the land from accuracy of the program will be improved without
others so without previous experience the decision human intervention. Many researchers are researching
might have been taken. Wrong crop selection will this field to assist the farmers in the selection
always result in less yield. If the family is fully discussed as follows, to choose a suitable crop with its
various factors like physical, environmental, and
843
Authorized licensed use limited to: East Carolina University. Downloaded on June 20,2021 at 06:26:56 UTC from IEEE Xplore. Restrictions apply.
economic factors were taken into consideration. A. DATA ANALYSIS
Artificial Neural Network is taken into consideration This is an attempt to find the presence of any
to choose the crop with the high yield rate [1], before relationships between the various attributes present in
cultivation, the crops were ranked based on Decision the dataset.
Tree Learning-ID3 (Iterative Dichotomiser 3) and K- Acquisition of Training Dataset:
Nearest Neighbors Regression algorithms [9]. Crop Various datasets from government website [16]
features were analysed based on the random forest and Kaggle [17] are fed into the system. Datasets
algorithm and BigML [10]. Machine learning include i) Yield Dataset: This dataset contains yield
algorithms were implemented to prevent the impacts for 16 major crops grown across all the states in kg
from the water stress in plants and have given a set of per hectare. A yield of 0 indicates that the crop is not
decision rules used in plant’s state prediction [11]. cultivated in the respective state. ii) Cost of
Machine learning techniques were used to predict the Cultivation dataset: This data set provides the cost of
cultivation for each crop in Rs. per hectare. iii) Modal
cost of crops and smart systems were used to provide
real-time suggestions [5]. In this work [8], a survey price of crops: This dataset gives the average market
prices for those crops over a period of two months. iv)
has been made on several applications of machine
Standard price of crops: This dataset gives the current
learning algorithms in agricultural production
market price of the crops in Rs per hectare. v) Soil
systems. Further AI-enabled systems were used to
nutrient content dataset: This dataset has five columns
provide recommendations concerning crop
with the attributes in the order-State, Nitrogen
management. Deep learning techniques can be used to
content, Phosphorous content, Potassium content, and
yield better in crop cultivation [12] [19]. In this paper
average ph. vi) Rainfall Temperature dataset: This
[2] real-time monthly weather is taken into
dataset contains crops, max, and min rainfall, max and
consideration to design an efficient yield forecasting
min temperature, max and min rainfall, and ph values.
mechanism. A non-parametric statistical model along
Profit analysis is performed using the cost of
with nonparametric regression methods was being
cultivation, market price, standard price, and yield
used to implement the above-said forecasting
dataset. This is being performed as a first step to know
mechanism.
how much impact profit can have on crop prediction.
The farmers are being assisted towards crop The profit is calculated for each crop grown in the
selection based on soil characteristics, particular state and assigns a -1 value for the states with 0 or no
geographical location, sowing season, and production of the given crop.
environmental factors, by combining machine
learning and data mining techniques [3]. The B DATA PREPROCESSING
regression technique is used to analyse soil dataset This step includes replacing the null and 0 values
[4]. In this paper [6], five different algorithms were for yield by -1 so that it does not affect the overall
used to suggest the crops for the underlying soil prediction. Further, the data-set has to be encoded so
series. They are as follows, Support Vector Machine, that it could be fed into the neural network. Data pre-
Bagged Tree, Adaboost, Naive Bayes, and Artificial processing is an important step as it helps in cleaning
Neural Network. Further, the ensemble method is the data and making it suitable for use in machine
included to provide more accurate results. In another learning algorithms. Most of the focus in pre-
work [7], Precision agriculture is being discussed processing is to remove any outliers or erroneous data,
which suggests the right crops based on site-specific as well as handling any missing values. The values in
parameters, the precision agriculture is also used to the dataset are in string format. To pass the input to
detect pests in the coconut tress using drone [18]. The the neural network, this should be converted into
proposed recommendation system has used an integer values. Further to reduce the amount of data
ensemble model with a majority voting technique going into the linear regression model the crops are
using CHAID, K-Nearest Neighbour, Naïve Bayes, being filtered based on the required nutrients and
and Random tree as learners. nutrients present in the soil. If the nutrient content of
the soil is below that required by the crops, then the
II. PROPOSED MECHANISM respective crop will be discarded, in this, the training
In our proposed research, both environmental and time has been reduced a lot.
soil parameters are taken into account carefully. The C TRAINING MODEL AND CROP
reason behind this is a particular type of soil will RECOMMENDATION
support a crop whereas the weather conditions won't After the pre-processing step, the data-set is used
support that, such that the yield will suffer. The to train different machine learning models like neural
overall working of the proposed system is depicted in network and linear regression to attain accuracy as
Fig. 1. high as possible.
844
Authorized licensed use limited to: East Carolina University. Downloaded on June 20,2021 at 06:26:56 UTC from IEEE Xplore. Restrictions apply.
Fig 1: Crop Recommendation System
LINEAR REGRESSION
Linear regression fits a straight-line between
rainfall, temperature, pH, and production which
would return a y-pred value for each crop.
In the end, the crops are sorted based on the y-
orvalue returned by the linear regression model
using quick sort giving the crop with the best score
first in the list.
NEURAL NETWORK
Our implementation of the neural network
is facilitated with the help of the Keras module. A
sequential model is implemented with 3 input layers
and 15 output layers which gives the sustainability
of each 15 crops given the input in terms of state,
month, and soil.
III RESULTS AND PERFORMANCE ANALYSIS
The proposed system is implemented along
with two algorithms namely, Linear regression and
Neural network using Pandas, Numpy, Tensorflow,
Keras and Sickitlearn libraries, tools, and Python as
the programming language. Whereas both the
algorithms are based on supervised learning. The
results are analysed and are being compared with
crop recommendation using K Nearest Neighbour,
K Nearest Neighbour with K Nearest Neighbour Fig. 2: Profit on crops per state
with cross validation, Decision Tree, Naive Bayes
and Support Vector Machine [13] in terms of B CROP RECOMMENDER
accuracy. The Crop recommendation model enlists the crops
The overall system is divided into three in an order where the first crop will have the highest
modules: productivity followed by the remaining in the list as
i) Profit analysis depicted in Fig.4. Regression model output and input
ii) Crop recommender to the predictor is depicted in Fig. 3 and Fig.5.
iii) Crop Sustainability predictor C CROP SUSTAINABILITY PREDICTOR
A PROFIT ANALYSIS The prediction value of sustainability for each crop
As shown in Fig.2 after the analysis we get has been observed given the three inputs. Hence from
the profit data for each crop grown in all the states. these values, one can get a clear idea of which crop
This provides a clear insight on which crop to be will give better yield and is depicted in Fig. 6. The
selected. accuracy of proposed system and various machine
learning algorithms in terms of crop prediction is given
845
Authorized licensed use limited to: East Carolina University. Downloaded on June 20,2021 at 06:26:56 UTC from IEEE Xplore. Restrictions apply.
in table 1 and the comparison is depicted in Fig. 7 respectively.
846
Authorized licensed use limited to: East Carolina University. Downloaded on June 20,2021 at 06:26:56 UTC from IEEE Xplore. Restrictions apply.
Fig.6: Crop Sustainability prediction values
T ABLE 1: CROP RECOMMENDAT ION ACCURACY to incorporate a web interface as well as a mobile
app to provide the recommendations of crop
S.No Algorithms Accuracy
cultivation to the farmers can be accessed by
1 Decision Tree 81%
2 K Nearest Neighbour 85% millions of farmers across the country.
K Nearest Neighbour
3 88% V REFERENCES
with cross validation
[1] R. Kumar, M. P. Singh, P. Kumar, and J. P. Singh, "Crop
4 Linear Regression Model 88.26% Selection Method to maximize crop yield rate using machine
5 Naive Bayes 82% learning technique", 2015 International Conference on Smart
6 Neural Network 89.88% T echnologies and Management for Computing, Communication,
Controls, Energy, and Materials (ICST M), Chennai, 2015, pp.
7 Support Vector Machine 78%
138-145, DOI: 10.1109/ICST M.2015.7225403.
[2] H. Lee and A. Moon, "Development of yield prediction
IV CONCLUSION system based on real-time agricultural meteorological
The proposed system helps the farmers to information”, 16th International Conference on Advanced
Communication T echnology, Pyeongchang, 2014, pp. 1292 -
choose the right crop by providing insights that 1295, DOI: 10.1109/ICACT .2014.6779168.
ordinary farmers don't keep track of thereby [3] T .R. Lekhaa, “Efficient Crop Yield and Pesticide Prediction
for Improving Agricultural Economy using Data Mining
decreasing the chances of crop failure and T echniques”, International Journal of Modern T rends in
increasing productivity. It also prevents them from Engineering and Science (IJMTES), Volume 03, Issue10, 2016.
[4] Jay Gholap, Anurag Ingole, Jayesh Gohil, Shailesh Gargade
incurring losses. In the future, it has been planned and Vahida Attar, “Soil Data Analysis Using Classification
847
Authorized licensed use limited to: East Carolina University. Downloaded on June 20,2021 at 06:26:56 UTC from IEEE Xplore. Restrictions apply.
T echniques and Soil Attribute Prediction”, International Journal
of ComputerScience Issues, Volume 9, Issue 3,2012.
[5] S. R. Rajeswari, ParthKhunteta, Subham Kumar, Amrit Raj
Singh, Vaibhav Pandey, "Smart Farming Prediction using
Machine Learning", International Journal of Innovative
T echnology and Exploring Engineering, 2019, Volume-08, Issue-
07.
[6] Z. Doshi, S. Nadkarni, R. Agrawal, and N. Shah,
"AgroConsultant: Intelligent Crop Recommendation System
Using Machine Learning Algorithms”, Fourth International
Conference on Computing Communication Control and
Automation (ICCUBEA), Pune,India, 2018, pp. 1 -6, DOI:
10.1109/ICCUBEA.2018.8697349.
[7] S. Pudumalar, E. Ramanujam, R. H. Rajashree, C. Kavya, T .
Kiruthika and J. Nisha, "Crop recommendation system for
precision agriculture," Eighth International Conference on
Advanced Computing (ICoAC), 2017, pp. 32 -36, DOI:
10.1109/ICoAC.2017.7951740.
[8] Konstantinos G. Liakos, Patrizia Busato, Dimitrios Moshou,
Simon Pearson and Dionysis Bochtis, “Machine Learning in
Agriculture: A Review”, Article on sensors, 2018, pp 1 -29,
doi:10.3390/s18082674.
[9] M. T . Shakoor, K. Rahman, S. N. Rayta and A. Chakrabarty,
"Agricultural production output prediction using Supervised
Machine Learning techniques”, 1st International Conference on
Next Generation Computing Applications (NextComp),
Mauritius, 2017, pp. 182-187, DOI:
10.1109/NEXT COMP.2017.8016196.
[10] Marion Olubunmi Adebiyi, Roseline Oluwaseun Ogundokun
and Aneoghena Amarachi Abokhai, "Machine Learning-Based
Predictive Farmland Optimization and Crop Monitoring System",
open-access article distributed Volume 2020, pp 1-12,
https://doi.org/10.1155/2020/9428281
[11] Dimitriadis Savvas and Christos Goumopoulos. “Applying
machine learning to extract new knowledge in precision
agriculture applications”, 2008 Panhellenic Conference on
Informatics, IEEE, (2008), pp:100-104.
[12] N. Kussul, M. Lavreniuk, S. Skakun, and A. Shelestov,
"Deep Learning Classification of Land Cover and Crop T ypes
Using Remote Sensing Data”, IEEE Geoscience and Remote
Sensing Letters, vol. 14, no. 5, pp. 778-782, May 2017, DOI:
10.1109/LGRS.2017.2681128.
[13] Kevin T om T homas, Varsha S, Merin Mary Saji, Lisha
Varghese, Er. Jinu T homas, “Crop Prediction Using Machine
Learning”, International Journal of Future Generation
Communication and Networking Vol. 13, No. 3, (2020), pp.
1896–1901.
[14] www.india.gov.in/topics/agriculture
[15] www.ibef.org/industry/agriculture-india.aspx
[16] https://data.gov.in/g
[17] https://www.kaggle.com/notebook
[18] Chandy, Abraham. "Pest Infestation Identification in
Coconut T rees Using Deep Learning." Journal of Artificial
Intelligence 1, no. 01 (2019): 10-18.
[19] Vijayakumar, T ., and Mr R. Vinothkanna. "Mellowness
detection of dragon fruit using deep learning strategy." Journal of
Innovative Image Processing (JIIP) 2, no. 01 (2020): 35 -43.
848
Authorized licensed use limited to: East Carolina University. Downloaded on June 20,2021 at 06:26:56 UTC from IEEE Xplore. Restrictions apply.