0% found this document useful (0 votes)
32 views8 pages

Random Forest Algorithm Use For Crop Recommendatio

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views8 pages

Random Forest Algorithm Use For Crop Recommendatio

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Journal of Engineering and Technology for Industrial Applications

Manaus, v.9 n.43, p. 34-41. Sept/Oct, 2023


DOI: [Link]
ISSN ONLINE: 2447-0228

RESEARCH ARTICLE OPEN ACCESS

RANDOM FOREST ALGORITHM USE FOR CROP RECOMMENDATION


Pradip Mukundrao Paithane*1
1
Head and Assistant Professor, AIDS department, VPKBIET Baramati, Pune, Maharashtra, India.

1 [Link]

Email: *paithanepradip@[Link]

ARTICLE INFO ABSTRACT


Article History The proposed method seeks to assist Indian pleasant in selecting the optimum crop to
Received: September 27th, 2023 produce based on the characteristics of the soil as well as external factors like temperature
Revised: October 11th, 2023 and rainfall by using an intelligent system called Crop Recommender. The Indian economy
Accepted: October 26th, 2023 is significantly impacted by the agricultural sector. Whether publicly or covertly, the bulk of
Published: October 31th, 2023 Indians are relying on agriculture for their living. As a result, it is undeniable that
agriculture is significant to the country. The majority of Indian farmers believe that they
Keywords: should trust their intuition when deciding on a crop to grow in a particular season or they
Crop Recommender, simply employ the methods they have been doing from the beginning of time. They are
Supervised learning, more at ease just adhering to conventional agricultural practices and standards than truly
Support Vector Machine, appreciating how crop yield is influenced by the present weather and soil conditions. The
Naïve Base Approach, farmer can unintentionally lose money if he makes one bad decision, which would hurt both
Random Forest Algorithm. him and the surrounding agricultural industry. As the agriculture business is the foundation
of the entire lateral system. Using the machine learning algorithm, this problem can be
resolved. A crucial perspective for identifying a practical and workable solution to the crop
production issue is machine learning (ML). Machine learning (ML) may predict a target or
outcome from a set of predictors using supervised learning. A recommendation system is
implemented using decision trees. The major goals of this system are to provide farmers
with recommendations regarding the best crops to sow based on their soil and local rainfall
patterns. We have employed the Random Forest Machine Learning technique to forecast the
crop. Crop prediction is assessing the crop based on historical data from the past that
includes elements like temperature, humidity, ph, and rainfall. It gives us a broad picture of
the best crop that can be raised in light of the current field weather conditions. These
predictions can be made by Random Forest, a machine learning technique. The highest level
of accuracy, up to 90%, will be possible for crop predictions. The random forest algorithm
achieved the accuracy about 99.03%.

Copyright ©2023 by authors and Galileo Institute of Technology and Education of the Amazon (ITEGAM). This work is licensed
under the Creative Commons Attribution International License (CC BY 4.0).

I. INTRODUCTION challenging to choose when and what crops to plant due to


shifting market pricing. The previous ten years. Farmers are
India has a lengthy agricultural history. In terms of farm confused about which crop to plant, when to start, and where to
output, India is currently ranked second worldwide. Nearly half of plant it because the weather is unpredictable. This may also be the
all jobs were in closely related industries to agriculture, such as cause of the farmer suicides. In this circumstance, the pace of
forestry and fishing, and India's agricultural sector is no longer crop output is steadily declining [3]. The problem can be resolved
contributing significantly to GDP [1]. Predicting the best harvest by giving the farmers access to a smart, user-friendly
is agriculture's principal source of income. Numerous factors, recommender system.
including meteorological, geographic, biological, and economic We offer a paradigm in this study that overcomes these
ones, have an impact on crop productivity [2]. Farmers find it difficulties. The recommended technique is unique in that it

Journal homepage: [Link]


Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

teaches farmers how to choose the best crop for their soil system farmers to decide which crop to grow, when to plant it, and where
as well as the weather conditions in that place [4]. It suggests the to begin. Due to changes in seasonal weather patterns and
best lucrative crop for a certain location. Crop selection is based important resources like “soil”, “water”, and “air”, the use of
on economic and environmental aspects, with the goal of reducing various fertilizers is also unclear. Crop yields in this situation are
crop seed loss, efforts to take them, and components given to steadily declining. As a result of study, a ground-breaking system
them such as water and fertilizers. Crop projections are made for crop suggestion that addresses farmers' challenges has been
using a variety of variables such as “rainfall”, “temperature”, developed. The fundamental goal of our suggested approach is to
“area”, “soil type”, and so on. The method aids in determining the aid farmers in maximizing agricultural productivity and choosing
best time to apply fertilizer. The present crop production the most profitable crops suitable for their individual regions [10].
prediction system is hardware-based, costly to maintain, and The most significant promise of block-chain for the
complicated to utilize [5]. agricultural sector is that it will do away with the need for third
parties to guarantee trust in buyer-seller relationships or other
I.1 KEY CONTRIBUTIONS source-destination links. Blockchain technology enables peer-to-
peer transactions, which do away with the need for middlemen.
1) Error rate and accuracy comparisons for crop prediction for Peer-to-peer transactions are made possible by blockchain, which
specific regions using various machine learning approaches. also makes it possible to create "smart contracts" that carry out
2) A simple web application that any user (including farmers) can the terms of any agreement when specific conditions are met.
use to access a user-friendly web application that recommends the When something of value is exchanged, whether it is real
most lucrative crop. commodities, services, or money, the transaction can be
3) A GPS-based location identifier for retrieving rainfall and documented, providing a very long history of the product or
weather data estimates in a specific area. exchange from its origin to its destination. Blockchain technology
could be quite handy in this situation. Putting all data linked to
Weather forecasting has become extremely difficult as a agricultural happenings on a blockchain allows for the creation of
result of global warming and increased pollution. We use our a dependable and transparent system. Farmers also have rapid
traditional ways for crop selection because we have been farming access to information on a variety of areas, such as seed quality,
for so long. We determine which crop to take based solely on our weather and environment, payments, soil moisture, demand, and
assumptions, without employing any sophisticated sale price [11].
methodologies. These conventional systems rely solely on global Stable agricultural growth in India has raised questions.
weather, but because forecasting weather is difficult, the results Using data on paddy yield, area, and production from the years
can be disastrous for farmers. That is why, when making 1970–1971 to 2011–2012, an analysis of 41 years is conducted to
decisions such as which crop to plant, there should be a smart better understand the problem of instability in India's rice
system that will tell us which crop will produce the best results production. The research revealed that while the acreage, output,
depending on our soil as well as weather-based observations such and yield of rice had positive compound annual growth rates over
as temperature, rainfall, and ph. The system will employ an all of India, they had been steadily declining over time. There has
efficient algorithm to make the best decision about the main crop. been an increase in precariousness at the national level in India's
There are also dynamic parameters for soil type and weather regions, production, and rice yield over the past ten years (2000-
conditions [6]. Because of its accuracy, robustness, 01 to 2011-12). The rise in instability may have been caused by a
interpretability, scalability, and ability to manage missing data, decline in the usage of fertilizer, seeds, and other agricultural
the Random Forest algorithm is an excellent foundation for a crop inputs as well as a low ratio of irrigated land to total cropland.
recommendation system. Because of these characteristics, it is a The wholesale price of paddy has fluctuated considerably
popular candidate for machine learning-based crop between states during the reform, from 1990–1991 to 2016–17,
recommendation applications [7].The purpose is to anticipate the whereas the price of paddy harvested on farms has been less
most suited crop(s) to be grown on a specific farm or agricultural erratic. Although there has been a lot of research on agricultural
location given a set of input factors such as soil type, climate sector instability, this paper intends to explicitly look into the
conditions, crop traits, and historical yield data. The Random topic of instability in India's rice output. Over 10% of India's
Forest algorithm is used by the recommendation system to create entire agricultural production value is made up of paddy rice, with
these predictions [8]. The system's primary goal is to provide crop China being the world's top producer and India coming in second.
recommendations based on input factors such as soil type, climate Over 16 states' worth of farmers harvest rice, this is a basic crop
conditions, crop traits, and historical yield data. The system's goal for about 60% of the Indian population [12].
is to recommend the best crop(s) to grow in a certain agricultural A key viewpoint for securing a real-world and practical
region or farm. The system is strongly reliant on the availability solution to the crop yield problem is artificial intelligence (AI).
and accuracy of historical crop production data, soil data, climate By using directed learning, machine learning (ML) may predict
data, and other pertinent aspects. The accuracy and dependability an objective or result from a set of indicators. A good function
of suggestions might be impacted by limited or incomplete data must be created by a group of variables that will map the input
[9]. variable to the intended output in order to get the desired results.
The user enters the region and soil type as input. Machine Crop yield prediction includes predicting a crop's yield based on
learning algorithms can be used to determine the most profitable historical information such as temperature, humidity, pH, rainfall,
crop list or to estimate crop yield for a crop chosen by the user. and the crop's name. It provides information about the best crop
Machine Learning algorithms such as “Support Vector Machine that may be expected to be grown in a field [13]. These
(SVM)”, “Artificial Neural Network (ANN)”, “Random Forest predictions can be made using the machine learning method
(RF)”, “Multivariate Linear Regression (MLR)”, and “K-Nearest Random Forest. The crop prediction will be as precise as feasible.
Neighbor (KNN)” are used to forecast crop productivity. The The ideal crop yield model is found using the random forest
unpredictable nature of the environment makes it difficult for approach by considering the fewest number of models. Predicting

Page 35
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

crop yield is extremely useful in agriculture [14]. The suggested II. METHODOLOGY
approach functions as an informed and sophisticated tool for
farmers, taking into account a number of important elements like For farmers, crop production is a crucial piece of
soil quality, weather forecasts, and yield. The method improves information. Knowing the yield that lowers loss is really helpful.
precision, allowing farmers to maximize crop yield and eventually Farmers with experience used to predict the yield. The way the
boost earnings. The use of accurate data is necessary to achieve suggested system functions is likewise similar. It makes use of the
increased precision. The suggested system analyses all available historical data to predict the future yield. Crop productivity is
data using data mining techniques and delivers accurate harvest significantly impacted by both weather and pesticide use. It is
yield projections. With the aid of this forecast, farmers are better required for the accuracy of the data used to make this prediction.
equipped to understand their unique needs and make wise As a result, the proposed technique anticipates yield and
decisions [15]. minimizes losses.
Given data sets from the chosen region, the suggested
I.2 RESEARCH CONTRIBUTION model forecasts the crop. Integrating ML and agriculture will lead
to significant industry improvements.
1. In this research work, in detail comparison has been carried For forecasting current performance, past performance
out on various machine learning algorithm. data is crucial. Historical data is compiled from a variety of
2. The Random Forest algorithm provides higher result as trustworthy sources, including "[Link]," "[Link]," and
compare to other machine learning approaches "[Link]." Other databases including information
3. The proposed random forest algorithm works on the basis of on states and districts include soil type as an attribute. The
various variable parameters like rainfall, temperature, area, primary data set is combined with the soil type column that was
soil type, and various soil parameters. retrieved. Similar to this, average temperature and rainfall from a
4. The proposed random forest algorithm, predict the crop on the different dataset are added to the main data sets for the specific
basis of parameter used in dataset. place. The data sets have been organized and purified. The null
5. The accuracy of random forest algorithm is about 99.09%, and values are swapped out for the mean values. The attributes of the
which is higher than Decision tree with accuracy 90.00%, category are converted into labels before the algorithms are
Support Vector Machine with accuracy 97.90% and Logistic processed.
Regression with accuracy 95.22%.

Figure 1: System Architecture.


Source: Author, (2023).

Figure 1 depicts the architecture of the created crop data will be transformed into a numerical feature to produce an
recommender system. The main applications of the crop output with a higher yield and greater efficiency.
recommender system are: After that, we only choose the "Random Forest
The first step is to gather all the data (in the form of a Algorithm" from among the available methods because it
dataset) from all the locations. Since we are employing a produces a greater result. The rules generated by our algorithm
supervised machine learning technique, training will follow. are then represented in a figure, and they illustrate how our
Following that, there will be feature extraction, in which the raw system actually operates by selecting and forecasting the crop,
which is our ultimate objective [16].

Page 36
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

II.1 Algorithm: Random Forest 5. Then based on crop data, algorithm will calculate its
final output based on decision tree.
Steps:
6. Choose the prediction result with the most votes as the
1. Choose random samples from a given data or training
final prediction result.
set.
7. Find each decision tree's predictions for the new data
2. Make a decision tree for each piece of training data.
points and assign them to the category that receives the most
3. Then data is trained and tested based on dataset.
votes.
4. After training the data, real time weather data is
fetched into the system.

Figure 2: Working of Random Forest Algorithm.


Source: Author, (2023).

To increase the accuracy of the input dataset, the Random bigger. The strategy enhances the model and adds more diversity
Forest classifier applies a number of decision trees to various by searching for the best characteristics among the random
subsets of the input dataset and averages the results. The core of subset of features while splitting a node.
the trees is ensemble learning, a method for combining several For visualizing through-out the system, there is a login
classifiers to handle challenging problems and improve model system in which user first need to sign-up by his/her credentials
performance. The random tree uses the variation from each (like name, username, mobile number and password). After that
decision tree instead of relying solely on one, and it predicts the the user can login into system and need to click on ‘Get the
outcome based on votes for prediction maturity. Crop’ option.
The random forest algorithm builds a forest out of a
number of decision trees, adding randomness as the trees get

Figure 3: Login Page of System.


Source: Author, (2023).

Page 37
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

Figure 4: Sign Up Page of System.


Source; Author: (2023).

After that a new page will open which asks your location Final output we get based on all of our values is the
and basic elements of your soil (like Nitrogen, Phosphorus and recommended crop that will get maximum yield or suitable for
Potassium value). Then some element like temperature are respective climate.
fetched from real time website, and based upon that model gives
recommendation for the crop. III. RESULTS AND DISCUSSIONS
Result Analysis for Crop Recommendation system vs.
Traditional Approach
Several elements should be taken into account when
comparing the result analysis between a Crop Recommendation
System employing machine learning and a Traditional Approach.
Here are some things to take into account when comparing the
outcomes of the two methods:

III.1 CROP RECOMMENDATION SYSTEM USING


MACHINE LEARNING
Accuracy: Machine learning models can leverage large
amounts of data and complex algorithms to make predictions. The
accuracy of a Crop Recommendation System using machine
Figure 5: Crop Data Filling Form. learning can be evaluated based on how well it predicts suitable
Source: Author, (2023). crops for specific conditions compared to actual crop yields in the
given region.
Personalization: Machine learning models can take into
account individual factors such as soil type, weather patterns,
historical crop yields, and other relevant data points to provide
personalized recommendations. The ability to provide tailored
suggestions based on specific requirements can be a significant
advantage.
Scalability: Machine learning models can handle large
datasets and scale well, making them suitable for analyzing vast
amounts of historical data and incorporating new data points as
they become available. This scalability allows the system to
continually improve its recommendations over time.
Adaptability: Machine learning models can adapt to
changing conditions and learn from new data, enabling them to
adjust recommendations based on evolving factors like climate
change or updated agricultural practices. This adaptability can
Figure 6: Final Output as a Recommended Crop.
lead to more accurate and relevant crop recommendations.
Source: Author, (2023).

Page 38
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

III.2 TRADITIONAL APPROACH


Expert Knowledge: Traditional approaches often rely on
expert knowledge and experience in agriculture. Crop
recommendations are made based on established guidelines, local
knowledge, and expertise in agricultural practices. The accuracy
of recommendations depends on the proficiency and experience
of the experts involved.
Simplified Models: Traditional approaches may use
simplified models or rules of thumb based on historical practices
and observations. These models may not account for as many
variables or adapt as effectively to changing conditions compared
to machine learning models.
Limited Data: Traditional approaches may rely on limited
historical data or general knowledge about crop suitability in
certain regions. They may not be able to leverage the vast amount
of available data that machine learning models can analyze.
Time and Cost: Traditional approaches may require
significant time and resources to gather expert opinions, conduct Figure 8: Comparison using F1_Score Evaluation Parameter.
surveys, or analyze historical data manually. The efficiency and Source: Author, (2023).
cost-effectiveness of traditional approaches may vary depending
on the expertise available.
When analyzing the results, it is essential to compare the
accuracy, efficiency, scalability, and adaptability of both
approaches. Machine learning-based systems can leverage large
datasets, personalize recommendations, and adapt to changing
conditions, potentially leading to more accurate and dynamic crop
recommendations. On the other hand, traditional approaches may
rely on expert knowledge and local expertise but may lack the
scalability and adaptability of machine learning models. The
specific context, available resources, and the accuracy of the
results must be carefully evaluated to determine which approach
is more suitable for a particular crop recommendation system.
In the below figure 7,8,9 and 10 shows the detail
comparison of proposed random forest algorithm with other
machine learning algorithm.

Figure 9: Comparison of Random Forest with State-of-Art


using Precision.
Source: Author, (2023).

Figure 7: Comparison using Time Evaluation Parameter.


Source: Author, (2023).

Figure 10: Comparison of random Forest with State-of-Art


using Recall.
Source: Author, (2023).

Page 39
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

Table 1: Comparison of random forest algorithm using accuracy system offers recommendations that can help optimize
parameter. agricultural practices and maximize yields by utilizing historical
Sr. No Algorithm Accuracy crop yield data and analyzing the correlations between input
1 Random Forest 99.09% features and crop performance. The random forest algorithm's
2 Decision Tree 90.00% accuracy is higher than that of Naïve bias, SVM, Decision Tree,
3 Naïve Bayes 98.99% and Logistic Regression, but its execution time is longer than that
4 Support Vector Machine 97.64% of Decision Tree.
5 Logistic Regression 95.22% In future, to reduce execution time of random forest
Source: Author, (2023). algorithm is next step of this research

Table 2: COMPARISON OF RANDOM FOREST ALGORITHM V. AUTHOR’S CONTRIBUTION


USING ACCURACY PARAMETER. Conceptualization: [Link] Mukundrao Paithane.
Sr. No Algorithm Accuracy Methodology: [Link] Mukundrao Paithane.
1 Random Forest 0.170 Investigation: [Link] Mukundrao Paithane.
2 Decision Tree 0.045 Discussion of results: [Link] Mukundrao Paithane.
3 Naïve Bayes 0.035 Writing – Original Draft: [Link] Mukundrao Paithane.
4 Support Vector Machine 0.075 Writing – Review and Editing: [Link] Mukundrao Paithane.
5 Logistic Regression 0.169 Resources: [Link] Mukundrao Paithane.
Source: Author, (2023). Supervision: [Link] Mukundrao Paithane.
Approval of the final text: [Link] Mukundrao Paithane.

VI. REFERENCES
[1] Shilpa Mangesh Pande, Dr. Prem Kumar Ramesh, Anmol, B.R Aishwarya,
karuna Rohilla, Kumar Shaurya. “Crop recommender system using machine
learning approach”, Proceedings of the Fifth International Conference on
Computing Methodologies and Communication (ICCMC 2021) IEEE Aydin,
O.F., Gokasar, I. and Kalan, O., 2020. Matching algorithm for improving ride-
sharing by incorporating route splits and social factors. PloS one, 15(3),
p.e0229674.

[2] Umamaheswari S, Sreeram S, Kritika N, Prasanth DJ, “BIoT: Blockchain-


based IoT for Agriculture”, 11th International Conference on Advanced
Computing (ICoAC), 2019 Dec 18 (pp. 324-327). IEEE.

[3] Jain A. “Analysis of growth and instability in the area, production, yield, and
price of rice in India”, Journal of Social Change and Development, 2018.

[4] Paithane, Pradip Mukundrao. "Yoga Posture Detection Using Machine


Learning." Artificial Intelligence in Information and Communication
Technologies, Healthcare and Education: A Roadmap Ahead (2022): 27.

[5] Sagar BM, Cauvery NK., “Agriculture Data Analytics in Crop Yield
Estimation: A Critical Review”, Indonesian Journal of Electrical Engineering and
Computer Science, 2018 Dec;12(3):1087-93.

[6] Johnson LK, Bloom JD, Dunning RD, Gunter CC, Boyette MD, Creamer NG,
“Farmer harvest decisions and vegetable loss in primary production. Agricultural
Systems”, 2019 Nov 1;176:102672.
Figure 11: Confusion matrix of random forest algorithm.
Source: Author, (2023). [7] Sriram Rakshith.K, [Link].G, Rajesh M, Sudharshan K S, Vasanth ,S
Harish Kumar N, “A Survey on Crop Prediction using Machine Learning
Approach”, In International Journal for Research in Applied Science &
IV. CONCLUSIONS Engineering Technology (IJRASET), April 2019, pp( 3231-3234).

This research highlighted the limitations of current [8] S. Pavani, Augusta Sophy Beulet P., “Heuristic Prediction of Crop Yield Using
methods and their applicability for crop recommendation. The Machine Learning Technique”, International Journal of Engineering and
Advanced Technology (IJEAT), December 2019, pp(135-138).
proposed approach then connects the farmers with a functional
crop recommender system through a web application. The web [9] Nigam, Aruvansh, Saksham Garg, Archit Agrawal, and Parul Agrawal. "Crop
application gives users a number of options from which to choose yield prediction using machine learning algorithms." In 2019 Fifth International
a crop. Farmers that use the built-in suggestion technology can Conference on Image Information Processing (ICIIP), pp. 125-130. IEEE, 2019.
predict crop output. A user can research possible crops using the [10] Paithane, Pradip Mukundrao, and S. N. Kakarwal. "Automatic Pancreas
built-in recommender system to make better decisions. Machine Segmentation using A Novel Modified Semantic Deep Learning Bottom-Up
learning algorithm (Random Forest) is deployed on the Keggle Approach." International Journal of Intelligent Systems and Applications in
datasets that are provided, together with the rainfall data and real Engineering 10.1 (2022): 98-104.
meteorological data, and its prediction accuracy is evaluated. A [11] Paithane, Pradip M., S. N. Kakarwal, and D. V. Kurmude. "Automatic Seeded
useful technique for giving farmers and stakeholders data-driven Region Growing with Level Set Technique Used for Segmentation of Pancreas."
advice on the best crops for particular environmental conditions is Proceedings of the 12th International Conference on Soft Computing and Pattern
a crop recommendation system employing Random Forest. The Recognition (SoCPaR 2020) 12. Springer International Publishing, 2021.

Page 40
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.

[12] Wagh, Sarita Jibhau, Pradip M. Paithane, and S. N. Patil. "Applications of


Fuzzy Logic in Assessment of Groundwater Quality Index from Jafrabad Taluka
of Marathawada Region of Maharashtra State: A GIS Based Approach."
International Conference on Hybrid Intelligent Systems. Cham: Springer
International Publishing, 2021.

[13] Kakarwal, Sangeeta, and Pradip Paithane. "Automatic pancreas segmentation


using ResNet-18 deep learning approach." System research and information
technologies 2 (2022): 104-116.

[14] Paithane, Pradip, Sarita Jibhau Wagh, and Sangeeta Kakarwal. "Optimization
of route distance using k-NN algorithm for on-demand food delivery." System
research and information technologies 1 (2023): 85-101.

[15] Paithane, Pradip M., and S. N. Kakarwal. "Automatic determination number


of cluster for multi kernel NMKFCM algorithm on image segmentation."
Intelligent Systems Design and Applications: 18th International Conference on
Intelligent Systems Design and Applications (ISDA 2018) held in Vellore, India,
December 6-8, 2018, Volume 2. Springer International Publishing, 2020.

Page 41

You might also like