A Systematic Approach for Crop Prediction using Deep Learning

DOI : 10.17577/IJERTV11IS110155

Download Full-Text PDF Cite this Publication

Text Only Version

A Systematic Approach for Crop Prediction using Deep Learning

        1. mini 1 , V. Purushothama Raju 2

          1,2 Dept. of CSE, Shri Vishnu Engineering College for Women, Bhimavaram

          Abstract:- More than half of all households in our nation rely on agriculture, making it the most significant industry. Agriculture accounts for a significant portion of a nation's GDP. The land is utilised for agriculture on more than half of it. We can satisfy the demanding demands and accelerate agriculture by using new techniques and methodologies. Our study's goal is to find a solution to the issue of crop losses brought on by natural factors while also helping farmers. Crop price fluctuations have an impact on the GDP of the nation. We can get precise findings for crop price predictions by using deep learning methodology to various datasets. Our goal is to put greater emphasis on agriculture. Crops are mostly grown by farmers. As the price drops after the harvest, farmers suffer severe losses. Before planting a certain crop, crop price estimate and appraisal are performed to help farmers make educated decisions. The loss may be minimised and the risk of price variations managed via crop price forecasting. In this study, we predict crop prices by utilising the LSTM approach to analyse historical data.

          Keywords : Agriculture , Deep Learning , Price Prediction , RNN, LSTM

          1. INTRODUCTION

            Various economies depend on agriculture. In many areas, agriculture provides the main source of livelihood. There are many ways to increase and improve agricultural productivity, quality and income. Crop price estimation can also be done using deep learning. An important agricultural dilemma is determining the price of a crop to maximize profits. Every farmer is interested in how much money he will get for his harvested crop. A farmer's previous experience with a particular crop can be used to predict price. As a result, this study provides a way to predict agricultural prices.

            Indian farmers often follow specific crop cycles or ancient practices to produce their crops. People are facing these difficulties due to their lack of knowledge about financial conditions. To reduce this risk it is essential to select crops that give reasonable yields when grown. While the majority of farmers stick to traditional cropping plans, it is important to grow crops according to market or economic conditions. Our thorough investigation and assessment of different crop recommendation systems, crop price forecasting systems, etc. served as the foundation for the execution of this project. Understanding the numerous elements that affect agricultural practises and pricing is the main goal of this study.


            Farmers may utilise a support-decision-making model to assist them forecast prices, claim Aman Vohra et al. [1]. The idea incorporates a website where farmers must log in to their accounts using credentials that may be as easy to remember as their name and cell phone number. S. [2] used a brand-new prediction model based on a hybrid association rule-based decision tree algorithm (HADT). This research analyses agricultural data to examine the applications and workings of big data and data mining. For a cost estimate methodology based on data mining decision tree techniques, see Jioly Quinn et al. [3]. To anticipate vegetable prices based on the aforementioned two models, linear and nonlinear combination models are created using the linear programming technique and the BP method of neural networks. Rohit et al[4] .'s application of decision tree regression, a crucial machine learning regression technique for managing agricultural output, produced accurate crop price predictions. The aforementioned industries' supply chain strategies might be planned with the aid of these projections.

            With a view to solving the problem faced by farmers, Pandit Samuel et al examined different data mining techniques on different datasets. [5]. This paper proposes a crop price forecasting system using data analysis techniques. The technology uses machine learning algorithms to estimate the price of a crop based on several variables, including the amount of cultivated and cultivated land. A farmer can use this to get an insight into the price of his future crop. To help farmers choose the best timing between desired planting time and area, Sadiq A. Mulla et al. [6] presented a developed method. The framework provides useful information to the farmer by predicting the production and price of the selected crop. The decision tree is created using a small number of spring and fall crops and provides excellent reliability. The SVR model, developed by Wang Shengwei et al. [7], which aims to estimate the wholesale price of agricultural commodities. The research topic was identified as fruit. This article contains statistics of major crops grown in China over a 15-year period based on daily, monthly and annual data. Mean square root was suggested by Gangasagar HL et al. [8] as a linear regression neural network approach to estimate errors during agricultural price forecasting. The objective of this paper is to forecast crop prices for the next cycle. This paper presents a methodology for component cost estimation using information analysis techniques. The aim of Vishal Kasa et al. [9] Estimation of vegetable costs using differences in crude oil prices. The article discusses data mining techniques that help predict crop

            prices, including K-means, K-nearest neighbors (KNN), artificial neural networks (ANN) and support vector machines (SVM). They researched the city of Coimbatore, taking the price of tomatoes as an example, and used MATLAB to generate the result.

          3. PROPOSED SYSTEM

The main components of the proposed system are crop forecasting, price forecasting and optimization. Each component uses different algorithms and techniques, namely long-term memory (LSTM) and linear programming techniques to estimate and optimize raw data sets.

LSTM: This is a RNN used in the field of deep learning. It has a series of gates in-order to take inputs and give accurate outputs. By using this method the accuracy can be improved in making predictions.

Fig-1 : LSTM Cell

  • Input Gate: It determines which of the input values should be used to change the memory. The sigmoid function determines whether to allow 0 or 1 values through. And the tanh function assigns weight to the data provided, determining their importance on a scale of -1 to 1.

  • Forget Gate: It finds the details that should be removed from the block. It is decided by a sigmoid function. For each number in the cell state Ct-1, it looks at the preceding state (ht-1) and the content input (Xt) and produces a number between 0 (omit this) and 1 (keep this).

  • Output Gate: The blocks input and memory are used to determine the output. The sigmoid function determines whether to allow 0 or 1 values through. And the tanh function determines which values are allowed to pass through 0,

1. And the tanh function assigns weight to the values provided, determining their relevance on a scale of -1 to 1 and multiplying it with the sigmoid output.

Linear Programming: It is the simplest optimization technique. This technique is mainly used in making decisions like, can we harvest more than one crop in a particular land (in Acres) based on the some parameters. It also finds the best crop based on the market demand.


User Location

Crop Prediction


Price Prediction

Prediced Crop & Price

If Yes No



Optimization Inputs Optimization

Display profitable crop Combination

Close the application

Fig-2: Workflow of the System

Figure 2 depicts the system process. The system informs the user's location. An existing trained model is scanned using the location provided in the prediction component and predicts the appropriate crops for the region selected by the user. Crop price is also checked using forecasting model and expected price is determined. If the user wants to improve the desired crops for a more profitable combination then he can go to the optimization component. The following illustration shows the main components of this system:

Crop Prediction: Crop prediction is nothing but predicting of crop which is suitable in particular land. So we consider various factors such as temperature, humidity, soil pH value and availability of water that can be entered manually or taken from the data sets for the prediction. Taking into consideration all the external parameters, suitable crop will be predicted and it will be further sent to the prediction of the crop price.

Price Prediction: Price prediction is done using LSTM model. The previous crop prices from the dataset and the current price of the crop are taken as the inputs. As this method is based on time series, we can predict the prices atleast for 5-6 months. So LSTM is the best selection for price prediction and accuracy is also higher.

Optimization: It uses a linear programming model with input parameters such as expected crop list, crop suitability, area in hectares and number of crops the user wants to grow. This gives an accuracy of 89.66% for predicting the available data set. Use this method only when necessary.

4. Results

The findings of our study is to make sure that the harvesting crop will not meet any kind of losses. The suggested method and approach may help farmers to harvest a better crop taking into consideration external parameters. The proposed method helps in getting 89.66% of accuracy in the output. The below shows different types crops for which the prediction and optimization can be done using time series.

Fig-3: Index Page

As we know that different crops grows in different seasons in various climatic conditions based on the nature of the soil. To harvest a crop which is suitable for the soil and also the crop which can meet the market demands the below fig-4 shows the crops whose prices are increased and fig-5 shows the crops whose prices are decreased. So by this the farmer can select a suitable crop.

Fig-4 : Crops whose prices are increased

Fig-5 : Crops whose prices are decreased

The below fig-6 shows the prime locations , Export and Brief Forecast of Coconut Crop. The fig-7 shows the next year price forecast and fig-8 shows the previous year forecast. So by this analysis the farmers may get to know that whether he can harvest the coconut crop based on these forecasts. We can also know the details of various crops like Sugarcane , Wheat , Paddy , Ragi , Barley , etc.,

Fig-6 : Forecast of Coconut

Fig-7 : Price forecast of Coconut using Time Series

Fig-8 : Previous year prices of Coconut


The purpose of this research is to make farmers select effective crop based on the market demand for cultivation. It suggests them to harvest a crop based on the land soil , climate and other pH values in a particular region so that no farmer have to face any losses. We used a method, LSTM which uses previous data sets and compares with the input data based on time series which results in previous and next year price forecast of the selected crop and present market price of the selected crop. It also shows the crop type and to which states the crop will be exported. Another technique, Linear Programming is used for optimizing raw datasets. Using efficient machine learning as well as deep learning algorithms and technologies the results are displayed on a web browser having an overall user-friendly interface to the users. As a result, this research guides farmers to overcome their hardships and predict the future of their harvested crop.


[1] Aman Vohra, Nitin Pandey, S.K. Khatri, Decision Making Support System for Prediction of Prices in Agricultural Commodity, IEEE Xplore , Apr. 2019.

[2] S. Rajeswari, K. Suthendran, Developing an Agricultural Product Price Prediction Model using HADT Algorithm, IJEAT, vol. 9., Dec. 2019.

[3] Lu Ye, Xiaoli Qin, Yuping Li, Yanqun Liu and Weihong Liang, Vegetables Price Forecasting in Hainan Province Based on Linear and Nonlinear Combination Model, IEEE Xplore , Aug. 2016.

[4] Rohith R, Vishnu R, Kishore A, Deeban Chakkarawarthi, Crop Price Prediction and Forecasting System using Supervised Machine Learning Algorithms, IJARCCE., Vol. 9., No. 3., Mar. 2020.

[5] Pandit Samuel, B.Sahithi , T.Saheli , D.Ramanika , N.Anil Kumar, Crop Price Prediction System using Machine learning Algorithms, Quest Journals, vol. 6., No. 1, Apr. 2020.

[6] Sadiq A Mulla, Dr.S.A.Quadri, Crop-yield and Price Forecasting using Machine Learning, ResearchGate., Vol. 12., No. 8., Aug. 2020.

[7] Wang Shengwei, Li Yanni, Zhuang Jiayu, and Liu Jiajia, Wang Shengwei, Li Yanni, Zhuang Jiayu, and Liu Jiajia, Agricultural price fluctuation model based on SVR, IEEE Xplore., Mar. 2018.

[8] Gangasagar HL, Jovin Dsouza, Bhagyashree B Yargal, Arun Kumar SV, Anuradha Badage, Crop Price Prediction Using Machine Learning Algorithms, IJIRSET , Vol. 9., No. 10., Oct. 2020.

[9] Vishal Kasa, Karan Mahajan, Shweta Dhautre, Suresh Kapare, Crop Selection Based on Economic Factors: A Review, IRJET, vol. 8., No. 5., May 2021.