Professional Documents
Culture Documents
Soil Analysis and Crop Fertility Predict
Soil Analysis and Crop Fertility Predict
Abstract: Soil is a cr itical par t of successful agr icultur e and is the sour ce of the nutr ients that w e use to gr ow cr ops.
Ther e ar e differ ent types of soil and ther e ar e differ ent pr oper ties of each soil. On these differ en t pr oper ties, sever al
types of cr ops gr ow . We need to know the pr oper ties and char acter istics of var ious soil types to under stand w hich
cr ops sow in cer tain soil types. Machine Lear ning allow s the user to feed a computer algor ithm on an immense
amount of data and have the computer analyze, make data-dr iven r ecommendations and decisions based to analyze
the input data. Machine Lear ning techniques ar e used to model this pr ocess. Machine Lear ning has come into the
pictur e w ith the big data technologies and high-per for mance computing that cr eate new oppor tunities for data-
intensive science in the multi -disciplinar y agr i-technology domain. In this paper , w e have pr oposed a model that can
find w hether the soil is fer tile or not, Sow ing cr op seed on fer tile soil, and at last pr edicting the cr op yield on
differ ent soil featur es. Accor ding to pr ediction, it can be suggested and r ecommended w hich cr ops gr ow mor e.
Var ious Machine Lear ning algor ithms such as Suppor t Vector Machine (SVM), Random For est, Naive Bayes, Linear
Regr ession, Multilayer per ceptr on (MLP), and ANN ar e used for soil classification and cr op yield. Test r esults show
that the pr oposed ANN method follow s a deep lear ning ar chitectur e w hich means it has sever al layer s for input and
output ar e connected to achieve better accur acy than numer ous existing methods.
Keywords: Fer tility, Cr op Yield Pr ediction, Soil, Chemical Featur es, ANN, Machine Lear ning.
I. INTRODUCTION
Agr icultur e is the technique of cultivating the soil, gr ow ing cr ops, and r aising livestock. It builds the pr epar ation of
plant and animal pr oducts for people to use and their distr ibution to mar kets. Agr icultur e gives most of the nation’s
food and fabr ics. Agr icultur e plays a ver y impor tant r ole in the global economy. The w or ld population is incr easing at
a ver y fast r ate and w ith an incr ease in population, the need for food is also incr easing. Tr adition al methods used by
far mer s ar e not sufficient enough to ser ve the huge demand and so they have to hamper the soil by using har mful
pesticides in an intensified manner . This affects the agr icultur e pr actice a lot and in the end, the land r emains bar r en
w ith no fer tility.
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -41
International Journal of Innovative Research in Advanced Engineering ( IJIRAE) ISSN: 2349-2163
Issue 03, Volume 8 ( March 2021) https:/ / www.ijirae.com/ archives
Machine Lear ning in agr icultur e is used to impr ove the pr oduct quality of the cr ops in the agr icultu r e sector .
Machine Lear ning is the scientific field w hich gives the machine the ability to lear n w ithout being inter vention of
human being. The main aim of this r esear ch is to design the cr op yield pr ediction and soil fer tility analysis model by
machine lear ning super vised and deep neur al netw or k model. The r eal -time data of soil and cr op ar e collected fr om
the differ ent online r epositor y (Pr ivate). To assessed the model these datasets ar e used and computed the r esult. The
datasets ar e divided into tw o categor y tr aining dataset and testing dataset to build the model. Then differ ent
Machine lear ning algor ithms ar e applied to classify the soil w hether the soil is fer tile or not by using soil micr o-
nutr ients and chemical featur es. The cr op yield, cr op sow ing is also analyzed using this ML technique. The algor ithm
assessed involves SVM, ar tificial neur al netw or k (ANN), decision tr ee, Naive Bayes, and linear r egr ession w hich all
ar e available in the machine lear ning model.
Her e among all the classification SVM has given the highest accur acy in Soil Classification. Pr amudyana Agus, Noor
Akhmad, and Teghu Bhar ata [2] used sever al machine lear ning algor ithms, such as neur al netw or ks, decision tr ees,
naive Bayes, and SVM. The algor ithm used to automate soil type classification w ith satisfactor y accu r acy (> 70%).
Mahesh Gauda Patil and Indir a R. Umanji [ 3] w or ked on cr op pr otection in or ganic agr icultur e. They used deep
lear ning models that w er e developed, based on specific Convolutional neur al netw or k ar chitectur es. The r esear ch is
developed for checking the var ious cr op diseases to help the far mer . Ashw ini Rao, Janhavi U, Abhishek Gow da NS and
Manjunath [4] descr ibes an appr oach for classifying and gr ading the soil samples using differ ent sci entific featur es.
Differ ent algor ithms ar e used to extr act differ ent featur es of soil like color , textur e, etc com mer cial imaging libr ar ies
w ith Digital Signal Pr ocessing (DSP) boar ds ar e implemented for r eal -time oper ations. It involves both image
pr ocessing and patter n r ecognition techniques.
Sini Anna Alex and Anita Kanavalli [5] in this paper , pr ecision agr icultur e is implemented for var ious cr op yield
pr ediction using a convolutional neur al netw or k algor ithm. Her e author 's focus is on optimizing the significant
par ameter s such as r ainfall, temper atur e, and fer tilizer r ate to obtain the P-values for testing the cr op. Sikha Pr akash,
Animesh Shar ma, and Sitansu Shekhar [6] intr oduced machine lear ning techniques for the pr ediction of soil moistur e
in advance. They used differ ent ML algor ithms viz multiple linear r egr ession, suppor t vector r egr ession, and
r ecur r ent neur al netw or ks for the pr ediction of soil. These techniques w er e applied to their differ ent databases
collected fr om differ ent online r epositor ies. Their per for mance of the pr ediction is evaluated based on mean squar ed
er r or (MSE) and coefficient of deter mination (R^ 2). The compar ison r esult show s that multiple r egr ession is
Super ior pr oviding MSE and R^ 2 of 0.14 and 0.975. Jay Gholap et al. [7] used soil datasets fr om thr ee r egions (Khed,
Bhor , and Velhe) of the Pune distr ict, India.
Dataset has a total of 1988 instances w ith 9 attr ibutes. They focus on applying var ious algor ithms such as Naive
Bayes, JRip, J48 (w hich is an open-sour ce Java implementation of the C4.5 decision tr ee algor ithm) for the
classification task. Madhavi Gudavalli and Vidyasr ee [8] descr ibes cluster ing techniques. This paper r epr esents a
study on differ ent cluster ing techniques that ar e incor por ated on the seed data sets to enhance the cluster ing
appr oach based on the var ious par ameter like ar ea, per imeter , compactness, length, a w idth of the ker nel
asymmetr ic coefficient, and length of the ker nel gr oove.
Methodology:-
A. Dataset: - Ther e ar e thr ee differ ent datasets ar e used for the pr ediction of the model.
i) Soil Dataset
ii) Crop Dataset
iii) Yield Dataset
i) Soil Dataset: It consists of 15 attr ibutes like PH, EC, OC, OM, N, P, K, Zn, Fe, Cu, Mn, Sand, Silt, Clay, CaCo3, and CEC.
Fr om this all attr ibutes w e classified and analyzed by applying ML model w hether the Soil is fer tile or not.
ii) Cr op Dataset: It consists of 4 attr ibutes like temper atur e, humidity, PH, r ainfall. Cr op Pr ediction is per for med by
using a differ ent algor ithm.
iii) Yield Dataset: It consists of 6 attr ibutes ar e Nitr ogen (N), Phosphor ous (P), Potassium (K), Or ganic Car e (Og), PH,
temp. Yield Pr ediction is per for med on these differ ent attr ibutes using an ML algor ithm.
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -42
International Journal of Innovative Research in Advanced Engineering ( IJIRAE) ISSN: 2349-2163
Issue 03, Volume 8 ( March 2021) https:/ / www.ijirae.com/ archives
B. Method and Experimentation: - Datasets ar e collected fr om differ ent r esour ces then classified the data and
gr oup into tw o sets: -
i) Tr aining Dataset,
ii) Testing Dataset
a) Implementation using ML algorithm : Differ ent Super vised algor ithm and compar ed the r esult and accur acy
w ith the models.
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -43
International Journal of Innovative Research in Advanced Engineering ( IJIRAE) ISSN: 2349-2163
Issue 03, Volume 8 ( March 2021) https:/ / www.ijirae.com/ archives
The accuracy of all methods proposed in this paper (SVM, neural networ k, decision tree, naive bayes, Random forest,
Ar tificial Neural Networ k, Regression model) is better than previous exper iment by SK AL Zaminur and Kaushik (KNN,
Bagged Trees and Gaussian ker nel based Suppor t Vector Machines(SVM)). In this paper, we have applied over
sampling method to improve synthetic data and re-sampled the data. Impor ted imblear n package for Random Over
Sampler, w ith this all the our algor ithms achieve comparative accuracy, but random forest shows bett er accuracy than
other method used here. As table 2.1 shows below the classification accuracy.
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -46
International Journal of Innovative Research in Advanced Engineering ( IJIRAE) ISSN: 2349-2163
Issue 03, Volume 8 ( March 2021) https:/ / www.ijirae.com/ archives
Table: 3. Show regression metr ics: For yield prediction model w ith MAE,MSE and R^ 2.
Model Mean Absolute Error Mean Squared Error R^2 ( R square)
Linear Regression 389.679 199735.585 0.034
Random Forest 59.387 15819.658 0.916
Adaptive Boost 382.250 193993.485 0.007
Bagging Regressor 65.975 20883.361 0.893
Gradient Boosting 312.074 138409.677 0.281
Neural Networ k 391.545 209409.226 0.086
SVM 388.463 191805.504 0.035
TABLE 3. Regression Metr ics
Here in the table 2.2 show metr ics result that Random Forest has better accuracy compared w ith Linear Regression,
Ada Boost, Bagging Tree, Gradient Boosting, Neural Networ k and SVM.
b) Implementation using ANN : Applied Ar tificial Neural Networ k using Keras Librar y.
Steps: There are 6 step are present
Step 1: Load Data
We use the Numpy librar y to load our dataset and use Keras librar y to define our model. Indian Soil fer tility dataset we
loaded to test the model. It descr ibes soil chemicals features w ith output value whether the soil is fertile or not. It is a
categor ical classification problem (1 or 0), we conver ted output value fer tile as 0 and not fer tile as 1. The entire input
var iable that descr ibes soil features is numer ical. It easy to use input var iables w ith a neural networ k that expect
numer ical input and conver t categor ical output value in binar y (0 or 1).
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -47
International Journal of Innovative Research in Advanced Engineering ( IJIRAE) ISSN: 2349-2163
Issue 03, Volume 8 ( March 2021) https:/ / www.ijirae.com/ archives
We used the rectified linear unit (RELU) activation function on the fir st two layer s and the softmax function in the
output layer. To achieve better per for mance Relu activation function is used. We used a softmax on t he output layer to
ensure our networ k output is between 0 and 1 as Yes and No.
The model has 16 var iable rows of data(the input_dim=16 ar gument)
The fir st hidden layer has 100 nodes and uses the relu activation function.
The second hidden layer has 30 nodes and uses the relu activation function.
The output layer has tw o nodes and uses the softmax activation function.
It required CPU or GPU for per for ming the execution of large models.
Step 5: Evaluate
Now we have trained our neural networ k on the entire dataset and we can evaluate the per for mance of the networ k
on the same dataset. We also trained and tested the dataset for training and evaluation of our model. Evaluated the
model on training and test dataset using evaluate() function on the model and passed the input and output. This has
generated a prediction for each input and output paired and collected scores, including the average loss and any
metr ics which has configured, such as accuracy. This evaluate() function retur ns a list w ith two values. The fir st w ill be
the loss of the model on the dataset and the second w ill be the accuracy of the model on the dataset . We are only
interested in repor ting the accuracy, so we ignored the loss value.
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -48
International Journal of Innovative Research in Advanced Engineering ( IJIRAE) ISSN: 2349-2163
Issue 03, Volume 8 ( March 2021) https:/ / www.ijirae.com/ archives
CONCLUSION:
A model is proposed for predicting the soil fertility and crop yield w ith types of the crop can grow on fer tile soil. The
research has done on soil datasets and crop datasets of the Indian region. The model has been tested by using a
different machine lear ning algor ithm. Multi -Layer Perceptron and Random Forest Classifier show good accuracy
among all the classifier s but ANN has given the highest accuracy in soil fer tility prediction, crop prediction, and crop
yield prediction. ANN w or ks on input dimensions that are fed and input is provided. Input nodes are connected to the
fir st layer and the cor responding sum of product is per for med by adding the bias and weight ter ms. This output is
then passed through a filter and passed as an input to the second hidden layer and the sequence goes till one gets the
output. The Model has to predict either 1 or 0 the sigmoid function filter is placed in the last hidden layer. The output is
then compared against the actual value and the feedback mechanism is involved and the weights are updated. This
process is done until all the weights are set and finally produce the minimal value of the difference of predicted and
actual values. This completes one Epoch. Multiple epochs are r un until the accuracy reaches the optimal value. Thus
the accuracy and F1 score would be really high for a model developed from Keras. In the future, providing fer tilizer
usage for crop production is our goal and also data from another region w ill be added to make this model more reliable
and efficient usage.
REFERENCES
1. SK AL Zaminur Rahman, Kaushik Chandra Mitra and S.M Mohidul Islam, “Soil Classification using Machin e
Lear ning Methods and Crop Suggestion Based on Soil Ser ies”, 2018 IEEE, 21 st Inter national Conference of
Computer and Infor mation Technology (ICCIT), pp.978-1-5386-9242-4/ 18
2. Pramudyana Agus Har lianto, Teguh Bharata Adji and Noor Akhmad Setiawan, “Compar ison of Machine Lear n ing
Algor ithm for Soil Type Classification”, 2017 3 rd Inter national Conference on Science and Technology-
Computer (ICST).
3. Maheshgouda Patil, Indira R. Umar ji, “Identification of Crop Diseases using Deep Lear ning”, Inter nat ional Jour nal of
Research in Engineer ing,Science and Management, Vol-2,Issues-6,June-2019, ISSN: 2581-5792
4. Ashw ini Rao, Janhavi U, Abhishek Gowda NS, Manjunatha and Mr s.Rafega Beham A, “Machine Lear ning in Soil
Classification and Crop Detection”, IJSRD- Inter national Jour nal for Scientific Research and Development, Vol-4,
Issue 01, 2016, ISSN: 2321-0613
5. Sini Anna Alex and Anita Kanavalli, “Intelligent Computational Techniques for Crops Yield Prediction and Fer til izer
Management over Big Data Environment”, Inter national Jour nal of Innovative Technology and Explor ing
Engineer ing (IJITEE), Vol-8, Issue-12, October 2019, ISSN: 2278-3075
6. Shikha Prakash, Animesh Shar ma and Sitanshu Shekhar Sahu, “Soil Moisture prediction using Machine Lear ning”,
2018 IEEE, 2 nd Inter national Conference on Inventive Communication and Computational Technologies(ICICCT)
7. Jay Gholap, Anurag Ingole, Jayesh Gohil, Shailesh Gargade and Vahida Attar, “Soil Data Analysis Using Classification
Techniques and Soil Attr ibute Prediction”, ar Xiv prepr int ar Xiv:1206.1557.
8. Dr Madhavi Gudavalli, Vidyasree P and S Viswanadha Raju, “Cluster ing Analysis for Appropr iate Crop Prediction
using Hierarchical, Fuzzy C-Means, K-Means and Model based Techniques”, Vol-4, Issue 11, November - 2017,
Scientific Jour nal of Impact Factor (SJIF): 4.72, ISSN (p): 2348-6406
9. Neural Networ k Algor ithm, https:/ / w w w.investopedia.com/ ter ms/ n/ neuralnetwor k.asp
10.Suppor t Vector Machine (SVM) Algor ithm, https:/ / w w w.analyticsvidhya.com/ blog/ 2017/ 09/ under staing-suppor t-
vector -machine-example-code/
____________________________________________________________________________________________________________________________________
IJIRAE:: © 2014-21, AM Publications, India - All Rights Reser ved Page -49