Ensemble Deep Learning Algorithm for Forecasting of Rice Crop Yield based on Soil Nutrition Levels

Agriculture is critical to the development of a growing country like India. For the vast majority of the population, agriculture is their primary source of income. Crop yield estimates that are accurate and timely can give crucial information for determining agriculture policy and making investments. Crop yield forecasting and prediction will boost agricultural productivity, while crop rotation will improve soil fertility. When farmers are unaware of the soil nutrition and composition, crop yields are reduced to a minimum. To address these concerns, the proposed methodology creates an ensemble deep learning system for predicting rice crop production based on soil nutrition levels. Soil nutrients and crop production statistics are taken as the input for the proposed method. The soil nutrients dataset contains different nutrients level in the soil. Crop production statistics are the amount of crop yield in a particular area. Normalization and mean of the attribute techniques are used as pre-processing approaches to fill the missing values in the input dataset. The suggested process utilizes a stacking-based ensemble deep learning strategy termed Model Agnostic Meta-Learning (MAML) for classification. MAML receives output from three different classifiers, including Deep Neural Network (DNN), Deep Belief Network (DBN) and Support Vector Machine (SVM). Then the MAML produce the final output as how much amount of rice crop is predicted in the particular soil. The proposed method provides better accuracy of 89.5%. Thus the designed model predicted the crop yield prediction in an effective manner.


Introduction
Agriculture is critical to every economy's survival.It is the backbone of the country's economic structure.Choosing a crop to grow is one of the most difficult decisions that farmers must make.Crop selection is influenced by temperature, soil type, market pricing, and other variables [1].Farmers and planters can use yield projections to make financial and administrative decisions.Agricultural supervision, particularly crop production monitoring, is critical for measuring a region's food security.
In the food production process, crop output prediction is crucial.Policymakers rely on accurate estimates to make timely import and export decisions to improve national food security.Farmers can also utilize yield prediction to aid in decision-making.Crops get the majority of their macro and micronutrients from the soil.The quantity and quality of food produced may be limited due to a lack of key nutrients or soil availability [2].Important nutrient deficiency or soil unavailability may decrease the quantity and quality of food produced.Rice requires sixteen nutrient, including N, P and K as major macronutrients, Mg, Ca and S as secondly macronutrients, and Zn, Fe, Mn, Cu, B, Mo and Cl as macronutrients.Phosphorus (P), Nitrogen (N), Sulphur (S), and Potassium (K) are the most important nutrients for plants.Crop production forecasting, on the other hand, is extremely difficult because of several complex factors [3].Weather, soil quality, landscapes, insect infestations, water quality and availability, genotype, harvest activity planning, and other elements all influence crop output [4].Due to the intricacies of the interplay between the plant growth process and external influences such as weather and soil variability, crop forecasting in the current growing season is difficult.As a result, a number of independent factors have an impact on the final product.When forecasting yield, any interactions between components or groups of yieldforming elements should be considered [5].
Crop production prediction used to be done by experienced farmers back in the day.Due to rapidly changing climates and conditions, farmers have recently been forced to grow an expanding range of crops.Farmers still lack sufficient knowledge about new crops and are unaware of environmental elements that influence agricultural productivity.Farmers have a tremendous challenge in maintaining high-quality agricultural production while dealing with limited resources and environmental conditions [6].Two of the most widely used yield prediction methods today are physical simulation models and statistical machine learning models.Crop yield is evaluated by utilizing physical crop models based on the physiological properties of crops to describe the underlying crop and environmental processes, such as crop growth, nutrient cycling, soil-plant dynamics, and water balance [7].
People must have knowledge about the kind of crops that can be cultivated in a certain place before they can yield.A lack of knowledge regarding which crop is best suited for a certain piece of land leads to financial loss.To avoid this, agricultural regions should be checked for sand quality, and farmers should be instructed on the best crop to grow.Machine learning approaches are developed to reduce the farmer's pressure [8] regarding which crop wants to sow on the land.The decision tree [9], K-Nearest neighbour (KNN), KNN with Cross-Validation, Support Vector Machine (SVM) [10] and Naive Bayes are some machine learning techniques used in monitoring the sand properties.However, it has certain limitations when it comes to forecasting soil qualities.Deep learning is a cutting-edge method of picture processing and data analysis with significant potential [11].The potential for smart agriculture aided by deep learning is very evident given the successful application of deep learning in many fields.More than 40 agricultural research are currently using deep learning technologies [12].These experiments demonstrate that deep learning offers great precision and outperforms currently used conventional image processing technologies.
The proposed method develops a stacking based ensemble learning strategy termed Model Agnostic Meta Learning (MAML) that monitors the soil properties continuously and predicts the nutrients values present in the soil, and also suggests which type of crop is suited for the particular land.The primary idea behind MAML is to use probabilities of classes derived from three separate classifiers to train the classifier without overfitting it.
The primary goal of the proposed work is given below: • To identify the missing values in the given data, the given dataset is initially reprocessed.Normalization and mean of the attribute are used for the preprocessing approach in the proposed method.The rest of the paper contains: chapter 2 represents the literature review that is related to the crop yield prediction.In chapter 3, the proposed approach and design of the proposed part are present.The result and discussion part of the proposed method is present in chapter 4. At last, chapter 5 contains the conclusion part.

Literature review
Various methods are used to overcome the financial losses caused by planting incorrect crops in that.Some approaches are discussed below.
Kamath et al. [13] had suggested a random forest approach that provides a fast inspection of agricultural yield forecast.Crop production forecasting demands a significant quantity of data, making data mining techniques an excellent fit.Data mining is a method for obtaining previously unknown and expected information from massive databases.By aiding in the study of future trends and character, data mining assists businesses in making intelligent decisions.
Malik et al. [14] had suggested a machine learning algorithms to predict fertility and crop yield has been performed.The study was based on data collected by the author for three crops: potato, chilli pepper and tomato.The Decision Trees classifier, the Naive Bayes algorithm, and the K-Nearest Neighbour approach were used to estimate crop yields.
Li et al. [15] had suggested a dynamic yield forecasting system based on the random forest model.The RF model estimated yields for all three crops well, with a correlation coefficient (r) greater than 0.75 and normalized root mean square errors (nRMSE) less than 18.0%.The approach suggested was used to anticipate agricultural yields and better understand how yields respond to changing environmental conditions.
Nazir et al. [16] had suggested a phenology based algorithm and linear regression model.The goal of this study was to quantify rice crop yield at different phonological phases using hyper-temporal satellite-derived vegetation indices computed from time series Sentinel-II images.A variety of vegetation metrics were used to forecast paddy yield.The RMSE and ME statistical approaches were used to validate the expected yield.Rice yield was properly forecasted using PLSR and sequential time-stamped vegetation indications.In this study, the PLS algorithm's accuracy was not compared to artificial neural networks, support vector machines, other geostatistics, or yield forecasting systems.
Iniyan et al. [17] found that the innovative ensemble regression crop prediction model outperformed several supervised machine learning and sophisticated ensemble learning approaches.In terms of projected yield, the sophisticated ensemble regression crop prediction model outperformed several supervised machine learning and advanced ensemble learning approaches.
Jeong et al. [18] suggested an approach for predicting rice yield at a pixel size, a crop model, and a deep learning model for diverse agricultural systems in South and North Korea.To begin, pixel size reference rice yield was calculated using satellite-integrated crop models.To leverage crop models, the deep learning model used pixel scale reference rice yields as target labels.In the future, other crop designs or sophisticated DL approaches could be used to apply the proposed method, which incorporates early crop yield prediction and an analytical method for the RI, to diverse geographies and crops.
Oikonomidis et al. [19] suggested a deep learning model evaluate how well the underlying method works against specific performance metrics.This research looked at the XGBoost machine learning (ML) algorithm, as well as CNN-DNN, CNN-XGBoost, CNN-RNN, and CNN-LSTM.
For the example study, use a public soybean dataset comprising 395 characteristics, like weather, and soil conditions, also 25345 samples.In future, a combination of XGBoost with a deep learning method such as LSTM or RNN may be able to forecast crop yields more accurately using date sequence data.
Nain et al. [20] had suggested the Principle Component Analysis (PCA) address the problem of multicollinearity.The inclusion of PCs obtained from meteorological data as predictor variables improves yield forecast accuracy.Discriminant analysis is a multivariate approach that includes grouping and assigning new items to categories that have already been established.Crop yield can also be forecasted utilizing a discriminant analysis score regressor and a climatic parameter predictor.
Ajithkumar et al. [21] proposed a two-weather-based statistical model in which principle component regression and composite weather variables were used to forecast the yield of two different rice varieties.The interaction effect of meteorological circumstances can be described using both PCR and CVW models.The t-test was used to determine the determines how much amount of rice crop is predicted in the particular models' goodness of fit.The computed value of t was discovered to be less than the t-critical value in both models.As a consequence, the projected yield was found to be close to the actual yield.To compare model performance, the mean absolute percentage error was determined (MAPE).
Kandan et al. [22] had suggested a random forest algorithm to solve agriculture problems by recommending the good crop and its average yield to a farmer by analyzing climatic and agriculture parameters like state, season and rainfall.Crop forecasting is challenging owing to a variety of factors like region, season, rainfall, and so on.As a result, a system is needed to provide farmers with reliable crop recommendations based on meteorological conditions, production zones, and other considerations.
From the aforementioned literature, it is found that numerous techniques are designed to forecast the amount of rice crop yield.The above-mentioned techniques have some limitations like the suggested methods do not compare with existing techniques [16], are not transferrable to various regions [18], have low performance in crop yield prediction [19] and are undesirable in locations where soil fertility is low.To overcome these issues, the proposed develops an ensemble-based deep learning approach termed Model Agnostic Meta Learning (MAML) approach.This MAML classifies the nutrients present in the soil and forecasts the rice crop yield in the particular soil.

Proposed methodology
Agriculture is vital to the survival of any economy.It is the country's economic system's backbone.One of the most difficult issues that farmers face is deciding which crop to grow.The soil type, land type, and macronutrients in the soil are the most important elements impacting crop output.The goal of this work is to forecast the amount of crop output in a specific soil.
Soil nutrients which include micronutrients and macronutrients, and crop production statistics are taken as the input for the proposed method.The input dataset has a large number of missing values, so the given dataset is preprocessed to remove all those missing values present in the dataset.In the suggested approach, the mean of the attribute and normalizing techniques are employed to fill in the missing values.In the suggested technique, an ensemblebased deep learning algorithm is employed for classification.Model Agnostic Meta Learning (MAML) is developed.MAML receives data from three models: Support Vector Machine (SVM), Deep Belief Network (DBN) and Deep Neural Network (DNN).The ensemble classifier classifies the nutrients present in the soil and soil.Figure 1 depicts the proposed approach's architecture.

Normalization
There are several ways to normalize a dataset.In that, Min-Max normalization is the most efficient.The normalization method transforms  to  * that falls within [A, B].The mathematical formula for it is provided in (1).
The data is normalized such that all qualities have the same weight.  Represents minimum value and   represents the maximum value.

Impute missing value with mean
Imputation using mean values, also known as rough imputation, is a quick and simple imputation method that employs the mean value of all the data on the variable to be imputed.Imputation of numerical variables is done using the mean.This rough imputation not only ignores the amount of variance but also the connection between variables, resulting in inaccurate estimations.The rough imputation approach should only be used when just a few missing data are present, and it is not designed for broad usage, and it is given in (2).
Where, ̅ represents the sample mean, the total of each value in the sample is represented by∑ , while the number of values in the population is represented by n.

Support Vector Machine (SVM)
SVM is a linear classifier as well as a binary classification system.Because of its generalization ability, SVM can handle problems with limited samples.The principle of SVM is to use a nonlinear transformation to obtain a linear separator of two data classes of a hyperplane with the maximum width.The separation boundary and the closest data points are separated by this margin.These are known as support vectors, and they are utilized to determine the hyperplane.This modification was performed using kernel functions such as the sigmoid kernel, the linear kernel, radial bias (RBF) kernel and polynomial kernel [23].Figure5 shows the principle of SVM is shown in figure 2.
Let  be the training instances {  ,   },  = 1, . . each instance consists of an input   and a class label  ∈ {−1,1}.Each hyperplane is parameterized by a bias (c), and a weight vector (w) is given in (3).

𝑤. 𝑥 + 𝑐 = 0
(3) The hyperplane function that classifies training and testing data can be expressed as in (4), If dealing with kernel function, the prior function can be given as in (5), Where,   is the input of training instance,   is its corresponding class label, is a bias, the number of training occurrences is symbolized by N and (  , ) is the used kernel function which maps the input vectors into an expanded features space.The coefficients   are attained subject to two constraints expressed in ( 6) and (7).

Deep Belief Network
Deep belief neural networks are a popular method.DBNs have a layer-by-layer layout of limited Boltzmann machines (RBM) [25].Because of the scarcity of labelled data, RBMs and auto-encoders may be trained on fine-tuned on a small piece of labelled data and unlabeled data.To train the DBN data, greedy layer-wise strategies are used, one unit at a time.Furthermore, the approach uses the greedy time to optimize a layer.Following the conclusion of unsupervised training, the supervised training method is a full access layer, and the procedure is known as fine-tune phase.This phase combines two ideas: (a) an initial element that has a strong standardizing impact, and (b) an investigation of input to result in mapping will be aided by an input distribution study.The unsupervised dataset is trained for the pre-training phase using a greedy layer-wise technique.
Figure 4 shows the architecture of the proposed method.

Input unit
Hidden unit

Output unit
Let,  = {    } and  = {    } Where,  is a visible layer element,  denotes a weight matrix, and  denotes a buried layer element.i th visible unit threshold is denoted by   , j th hidden unit threshold is denoted by   .
According to the Bernoulli distribution, the hidden and visible layers are distributed, and the RBM energy equation is as follows: (13), Where,  =   ,   ,   .The energy function presented the energy value for each visible node and hidden layer node valuation individually.The total number of hidden layer nodes is stated as in (14), Where, () denotes a standardized factor.The probability of neurons arising in the visible and hidden unit is expressed as ( 15) and ( 16 [26]. (20) Then in the outer loop, sample a new data batch for updating the meta-objective.
In the proposed approach, the chances acquired from three classifiers, SVM, DNN, and DBN, were utilized as input to MAML.The rice crop quantity is determined by MAML output.This ensemble-based MAML is utilized in the suggested approach for classification and predicts the output as six different classes.This classifier classifies the nutrients present in the soil and determines how much amount of rice crop is predicted in the particular soil.The below algorithm 1 illustrates the pseudocode for the suggested approach.8), ( 9), (10) Output is calculated using Eqn (11) } DBN { RBM energy is calculated using Eqn (13) Overall hidden unit is calculated using Eqn ( 14) Number of neurons in the visible and hidden unit is calculated using Eqn ( 15), ( 16) } #Ensemble Learning { Model Agnostic Meta Learning } End Output: Rice crop yield forecasting

Proposed System
The world's population is rapidly growing, putting strain on agriculture and threatening global food security.Accurate and timely crop production predictions before harvest are critical for food administrative planning and food security, especially in today's constantly changing international situation and global environment.The proposed technique creates a system for forecasting rice crop yields by monitoring the nutrient levels in the soil.The proposed technique use ensemble learning to classify the nutrient levels existing in the soil and forecast the quantity of rice crop production in the soil.The proposed model is performed with the help of python 3.8 with CPU: Intel Core i5, GPU: NVidia GeForce GTX 1650, 16-bit operating system, RAM: 16GB.
Soil nutrients dataset [27] and crop production statistics [28] are taken as the raw data for the proposed method.The soil nutrients dataset contains different nutrients level in the soil.pH, Electrical Conductivity (EC), Iron (Fe), Organic Carbon (OC), Nitrogen (N), Potassium (K), Sulfur (S), Phosphorus (P), Boron (B), Copper (Cu), Manganese (Mn) and Zinc (Zn) are soil parameters.Crop production statistics contain the amount of crop yield in a particular area.Totally

Comparison Analysis:
The proposed method using an ensemble classifier is compared with some existing methods like SVM, DNN, DBN and KNN classifiers.The performance attained using these existing techniques is compared with the proposed ensemble learning approach.Some of the performance metrics used for comparison are False Positive Rate (FPR), accuracy, specificity, recall, F-1 score, False-negative Rate (FNR), precision, False Predictive Value (NPV), Error and Mathew Correlation Coefficient (MCC).The accuracy rate obtained for the proposed approach using an ensemble learning classifier is 89.5%, but in the existing method, the accuracy rate was 82%, 76%, 80% and 75% for DNN, DBN, SVM and KNN classifiers, respectively.This clearly demonstrates that the suggested strategy outperforms the existing alternatives in terms of accuracy.Figure 9 (a) shows the precision metrics of suggested and current techniques.The value of precision in the proposed method using an ensemble learning classifier is 74%.In the existing method, the precision value obtained using DNN, DBN, SVM and KNN classifiers are 53%, 36%, 45% and 36%.This clearly shows that the precision value of the suggested approach is higher than the existing techniques.shows the specificity metrics of proposed and existing approaches.The value of specificity for the proposed method using an ensemble learning classifier is 94%.In the existing method, the precision value obtained using DNN, DBN, SVM and KNN classifiers are 88%, 85%, 87% and 85%.This clearly shows that the specificity value of the suggested approach is higher than the existing techniques.
Figure 10 (b) shows the comparison of F1_Score metrics.The F1_Score value of the proposed approach using an ensemble classifier is 75%.The F1_Score metrics of current methods using DNN, DBN, SVM and KNN classifiers were 50%, 28%, 44% and 35%, respectively.It is seen that the F1_Score value of the suggested approach is high compared to existing approaches.It clearly shows that the suggested approach was superior to existing methods.
Figure 11 (b) shows the False Negative Rate (FNR) of the proposed and existing approaches.The FNR value of the existing method using DNN, DBN, SVM and KNN classifiers are 52%, 77%, 59% and 80%, respectively.But for, the proposed method using an ensemble learning classifier has an FNR value of 25%. Figure 11 (c) shows the False Positive Rate (FPR) of the proposed and existing approaches.The FPR value obtained from the proposed method using an ensemble learning classifier is 6%.But in the existing approach, the FPR values are 11.5%, 15%, 12.5% and 16% for DNN, DBN, SVM and KNN.It clearly shows that the suggested approach produces less FPR value compared to existing approaches.   1 illustrates the performance of suggested and current techniques.The accuracy of the suggested method is 89.5%.The suggested method is compared with the current techniques mentioned in the literature reviews like Random forest, MSER and CNN-DNN.The performance metrics are high when compared to the existing methods.As a result, the suggested method's ensemble classifier was the best choice for forecasting rice crop output based on soil nutrient levels.

Conclusion
In this paper, a stacking based ensemble learning technique termed Model Agnostic Meta Learning (MAML) approach was suggested for forecasting rice crop yield in a particular soil.Soil nutrients and crop production statistics were taken as the input for the proposed method.The input dataset has some missing values, and preprocessing technique was used to remove the missing values.Normalization and mean of the attribute methods were used to preprocess the dataset.The reprocessed data were given as an input for the three different classifiers like SVM, CNN and DBN.The output of these classifiers was given to one Meta-learning technique termed Model Agnostic Meta Learning (MAML) approach.This MAML classifies the input data and predicts the output as six different classes.The amount of rice crop yield, in particular, is the final prediction.The accuracy rate obtained by the proposed method was 89.5%.Comparison graphical representation proves that the proposed method results are significantly better than those of the existing methods.Thus, the suggested method's ensemble classifier was the best alternative for forecasting rice crop output based on soil nutrient levels.

Figure 1 .
Figure 1.Architecture of the proposed method An ensemble-based deep learning algorithm is used in the proposed method for classification purposes.Model Agnostic Meta Learning (MAML) is developed in the proposed work.This Meta classifier receives data from three separate classifiers like Deep Belief Network (DBN), Deep Neural Network (DNN) and Support Vector Machine (SVM).

Algorithm 1 .
Pseudocode for the proposed approach Input: Soil nutrients dataset and crop production statistics vector is analyzed using Eqn(3) Training and testing are analyzed using Eqn (4) } DNN { Network computation is calculated using Eqns (

EAI
Endorsed Transactions on Scalable Information Systems | Volume 10 | Issue 4 | Ensemble Deep Learning Algorithm for Forecasting of Rice Crop Yield based on Soil Nutrition Levels 711227 number of samples were taken as the input for the suggested approach.

Figure 6 .
Figure 6.Confusion matrix for the proposed approach

Figure 7 .
Figure 7. AUC and ROC plot for the proposed method

Figure 7
Figure 7 shows the AUC plot and ROC plot for the proposed method.The AUC (Area Under the Curve) ROC (Receiver Operating Characteristics) curve is utilized to validate or demonstrate the performance of a multi-class classification problem.The degree or amount of separability is represented by the AUC.A great model has an AUC close to one, indicating a high level of separability, whereas a poor model has an AUC close to zero.AUC is close to 1 in the proposed method, so the proposed method has a high-level

Figure 8 Figure 9 .
Figure 8 (b) illustrates the error metrics of proposed and existing approaches.The error value produced by the

Figure 9 Figure 10 .
Figure 9 (b)shows the recall metrics of the suggested and existing approaches.The recall value of the proposed approach using an ensemble classifier is 75%.But the recall value of the existing approach using DNN, DBN, SVM and KNN classifiers are 48%, 23%, 41% and 19%.The proposed method has a high recall value compared to the existing techniques.

Figure 12 .
Figure 12.Comparison of Execution time

•
For classification purposes, Model Agnostic Meta Learning (MAML), an ensemble-based deep learning algorithm, is developed in the proposed work.

Table 1 .
Performance comparison of the proposed and existing techniques