A Cognitive IoT Learning Models for Agro Climatic Estimation Aiding Farmers in Decision making
Kategoria artykułu: Article
Data publikacji: 15 cze 2024
Zakres stron: 46 - 59
Otrzymano: 22 lut 2024
Przyjęty: 01 maj 2024
DOI: https://doi.org/10.2478/jsiot-2024-0004
Słowa kluczowe
© 2023 Sujata Patil et al., published by Sciendo
This work is licensed under the Creative Commons Attribution 4.0 International License.
A global concern, climate-induced agricultural systems have a substantial impact on social and economic development while maintaining a stable food supply chain within countries [1]. Changes in climatic patterns have a significant impact on agricultural productivity [2]. It’s clear that the unpredictable climatic fluctuations brought about by global warming have killed off agriculture. unexpected disasters, deadly floods, unexpected rainfall, and intense heat have all increased recently due to the effects of global warming, which has negatively impacted both the nation’s economic growth and the lives of farmers. [3,4,5,6]. Thus, “unreliable pattern behaviour of climate over the longer periods” is the term used to describe climate change.
Persistence forecasting, climatology, sky observation, barometric pressure data, atmospheric models, and ensemble forecasting are some of the conventional techniques used to forecast the weather [8]. Especially when a weather system is stable, persistence forecasting is predicated on the idea that the current weather patterns will persist. The foundation of climatology forecasting is the notion that weather patterns for a particular place on a particular day often don’t change over time. By observing the sky, one can forecast the weather; for example, a rise in cloud cover could indicate impending rain [9]. According to barometric pressure measures, weather changes are associated with fluctuations in air pressure; more substantial weather changes are typically indicated by larger pressure variances.
Applications for machine learning and deep learning models are numerous and include things like meteorological data analysis, numerical weather prediction, and environmental observations [13,14,15]. Managing the size and complexity of massive climate information is made possible by deep learning. Farmers can make well-informed judgements about their agricultural operations when they have access to precise weather forecasts. As a result, farmers must embrace AI-based approaches that take climate unpredictability, change, and adaptation into consideration [13,14,15]. Furthermore, effective resource management in agricultural activities depends on meteorological data. It’s critical to react and adjust to changing climate conditions in a way that maximises crop output.
Achieving the highest prediction performance remains a daunting challenge for academics, despite the fact that machine and deep learning approaches are crucial in forecasting meteorological conditions. The design of the climatic prediction system primarily uses deep learning models to predict the climatic condition for the larger datasets, as machine learning techniques are used for the smaller datasets. A number of deep learning models have already been used to anticipate climate change, including Convolutional Neural Networks (CNN) [16], Recurrent Neural Networks (RNN) [17], and Long Short-Term Memory (LSTM) [18]. For these models to attain the best prediction performance, computational overhead and algorithm complexity continue to be the barrier.
The research proposes the new methodology of integrating the Harris Hawk optimization technique over the Long Short-term memory which can be used for better prediction.
The proposed algorithm is compared with the different existing artificial intelligence networks.
Thorough experiments are executed using 200,000 weather datasets, with performance metrics like accuracy, precision, recall, and F1-score calculated.
This manuscript is organized in the following manner: Section-2 explores the relevant studies by multiple authors. The preliminary views of Long short-term memory, Harris hawk optimization are discussed in Section-3, And outlines the working principle of the suggested architecture. Experimentations, along with an analytical discussion of the results are discussed in Section-4. Lastly, the study concludes with the future development in Section -5.
Tegene et al. (2020) [19] introduce a novel multi-model ensemble technique for projecting climate extremes, which incorporates various extreme indices into the climate model performance weighting framework. They evaluated GCM skill using Taylor diagrams for simulating both wet and dry precipitation events and contrasted their approach with reliability ensemble averaging (REA). Their suggested method outperformed the others, lowering the root mean square error (RMSE) by 54% in dry conditions and 5% in wet ones. However, the study ignores their method’s computational requirements, which could be problematic for large-scale climate projections.
Mansfield et al. (2020)[20] present a machine learning technique that leverages existing climate model simulations to discern patterns between immediate and extended temperature reactions to various climate forcing scenarios. By reducing the costs of scenario calculations, this method could speed up climate change forecasts and help detect early indicators of long-term climate reactions that have been modelled. In order to create more reliable climate response emulators, the study highlights the necessity of extensive data exchange between research organisations. However, it ignores possible biases in the training data that can influence the model’s forecasts.
Rysanek et al. (2021)[21] propose a weighted ensemble approach incorporating supervised learning techniques to estimate the number of days exceeding thermal comfort levels. This ensemble method merges gradient boosting with decision tree algorithms and Bayesian logistic regression. As per their case study, forecasts suggest that the number of days exceeding comfort criteria will quadruple prior to the 2050s under the RCP 8.5 global climate change scenario. Even while this ensemble approach outperforms individual models in terms of accuracy and precision, it ignores how the model functions in various building kinds and climates.
Labe and Barnes (2021) [22] employ an artificial neural network (ANN) framework to forecast the year by training on near-surface temperature maps. Critical regional temperature indicators are visualised using layer-wise relevance propagation (LRP), and trustworthy climatic patterns are extracted from LRP by introducing an uncertainty metric. Their results demonstrate that, especially prior to the early 21st century, the North Atlantic, Southern Ocean, and Southeast Asia are critical regions for the ANN’s projections. Furthermore, the study doesn’t go into great detail about the drawbacks of applying ANNs to the interpretation of complicated climate systems.
Fyfe et al. (2021) [23] utilize an artificial neural network to forecast the onset of temporary decelerations in the pace of global warming by analyzing ocean heat maps. Their study shows that modern data science methods, including machine learning, can be useful for predicting changes in the world’s climate. Areas of ocean heat throughout the Pacific Ocean are identified by their ANN as being essential for accurate forecasting. However, there isn’t a thorough comparison with conventional statistical techniques for climate prediction.
Khan and Verma (2022) [24] employed ensemble modeling techniques to forecast the potential habitat distribution of Olea europaea subsp. cuspidata in both the present and the future climates. Under future warming conditions, their study predicts a significant decline in habitat suitability, with possible shrinkage of 41–42% by 2050 under RCP4.5 and 56–61% by 2070 under RCP8.5. Although the study offers insightful information for conservation initiatives, it skips over the uncertainty surrounding long-term climate projections and how they affect estimates of species distribution.
Jose et al. (2022) [25] evaluate the performance of multi-model ensembles (MMEs) of precipitation and temperature over a tropical river basin in India. Arithmetic mean, Multiple Linear Regression (MLR), Support Vector Machine (SVM), Extra Tree Regressor (ETR), Random Forest (RF), and Long Short-Term Memory (LSTM) are among the many methodologies they compare. According to the study, RF and LSTM consistently perform well for temperature prediction, while LSTM performs noticeably better for precipitation prediction. However, the computational resources needed to apply these cutting-edge machine learning methods to operational climate modelling are not covered.
This section details about the working mechanism of the Long Short-Term Memory, Harris Hawk optimization and its overall architecture.

Overall working Mechanism
The dataset comprises attributes crucial for analyzing agricultural productivity. It includes rainfall, which measures precipitation levels affecting soil moisture; maximum and minimum temperature, critical for crop growth and stress tolerance; and humidity, influencing evaporation and transpiration rates. Crop yields indicate the output per area, while the Year of the Yield provides a temporal dimension for trend analysis. Season captures the growing period, and Crop types identify the variety of crops cultivated. Sun-hours represent solar exposure, essential for photosynthesis. Together, these features enable comprehensive analysis of environmental and agricultural factors influencing crop productivity over time.
The preprocessing, NaN value replacement and string-to-numeric conversion are applied to prepare the dataset for analysis. NaN (Not a Number) values represent missing data, which can affect model performance and analysis. These are replaced using strategies like mean, median, mode imputation, or domain-specific values. For example, missing rainfall values could be filled with the average rainfall of the corresponding season.
Label encoding is a preprocessing technique used to convert categorical data into numerical format for machine learning algorithms that require numeric inputs. For the dataset with attributes like Crop types, Season, and potentially other categorical variables, label encoding assigns a unique integer to each category.
The model that is used is the Long Short-Term Memory (LSTM) network, which is suitable for huge datasets and has the ability to manage memory in a flexible manner. The below figure shows the LSTM network.

LSTM Structure
The suggested hybrid learning model combines an HHO Optimiser with Long Short-Term Memory (LSTM) networks. The input gate (I.G. ), forget gate (F.G. ), cell input (C.I. ), and output gate (O.G.) are the four separate parts that make up LSTM networks. In essence, LSTM networks are neural architectures that are based on memory and maintain information during iterations. Let xt be the input layer output in this case, “ht” be the current hidden state, and “ht−1” be the previous hidden state. “Ct” stands for the cell state, “Gt” for the cell output state, and “Gt-1” for the cell’s previous state. The representation of the gate states is j_t 〖, T〗_f. The LSTM unit updates its memory by combining the previous unit’s output with the current input state, utilizing the output and forget gates. The calculation of Gt and ht is performed using the following equations.
In the suggested model, residual connections play a crucial part in overcoming the vanishing gradient issue, which is subsequently utilised to identify redundant data and save the key characteristics in LSTM networks. The suggested R-LSTM design is depicted in Figure 4. The typical LSTM has an inbuilt residual connection network. The residual connection in this model is made up of two convolutional layers that are followed by the activation function Relu layers (ReLU), residual block, and batch normalisation (BN). The final result is determined by the blocks used in the design of the suggested R-LSTM networks, and the data must be entered into the suggested R-LSTM connection.
Mathematically the output from R-LSTM networks are expressed as
The primary goal of this hybrid approach is computationally efficient algorithm by combining the Harris hawk Optimization Model with R-LSTM networks.
In this segment, we introduce the proposed Harris Hawk optimization (HHO) algorithm. With numerous active and time-varying stages of exploration and exploitation, HHO is a well-liked swarm-based, gradient-free optimisation approach. Since its initial publication in 2019 by the esteemed Journal of Future Generation Computer Systems (FGCS), this algorithm has drawn more and more attention from scholars because of its adaptable structure, excellent performance, and superior output. The HHO method’s primary reasoning is derived from the cooperative nature and “surprise pounce” pursuit techniques of Harris’ hawks.

Shows the all the phases of HHO

Convergence Assesment for the Various Optimization Strategies
In the Harris Hawk Optimization (HHO) algorithm, the exploration phase allows the hawks to search for prey over a wide area, ensuring global search capability and preventing premature convergence. During this phase, hawks adjust their positions based on randomization and exploration mechanisms influenced by Lévy flights. The exploration phase can be mathematically modeled as:
The transition from exploration to exploitation is guided by a parameter called the energy level EEE, which simulates the prey’s energy loss. The energy EEE decreases over iterations and is calculated as:
Where: E0E_0E0: Initial energy of the prey (random in [−1,1][−1,1][−1,1]).,ttt: Current iteration.TTT: Maximum number of iterations.
When |E|≥1|E| \geq 1|E|≥1, hawks engage in exploration. When |E|<1|E| < 1|E|<1, they transition to the exploitation phase. This smooth transition ensures that the algorithm progressively focuses on refining solutions.
In the exploitation phase, the focus is on local search to refine and converge on the optimal solution. The hawks employ strategies like soft besiege, hard besiege, and surprise pounce (with or without escape) based on the prey’s energy and behaviour. They are represented as:
This phase ensures convergence by intensively searching around the prey’s location while maintaining adaptability to dynamic changes in the search space
To show that the proposed model is more effective and has reduced overhead costs, these metrics are assessed in addition to computational overhead. The formulae used to determine the performance measurements are shown in Table 1. The early halting strategy is also used to address the problems of inadequate generalisation and overfitting. When the model’s validation performance stops getting better over time, this method stops the training process.
Performance Metrices
SL.NO | Performance Measures | Expression |
---|---|---|
1 | Accuracy |
|
2 | Recall |
|
3 | Specificity |
|
4 | Precision |
|
5 | F1-Score |
|
The complete model was developed using Python3.19 programming and libraries such as matplotlib, numpy, pandas, Scikit-Learn, seaborn are utilized for evaluating the proposed model. The experimentation was carried out in the PC workstation with i7 CPU, 3.2 GHZ operating frequency, 16GB RAM.
To demonstrate the superior performance of the suggested model, a number of performance metrics are evaluated and directly compared with more sophisticated deep learning models, including accuracy, precision, recall, specificity, and the F1-score.
Four categories are frequently used to evaluate predictions in classification tasks. When both the expected and actual values are positive, this is referred to as the True Positive (TP) category. False Positive (FP) is the second category, in which a positive forecast is made but a negative value is obtained. False Negative (FN) is the third type, in which the actual number is positive while the prediction is negative. The fourth and final category is True Negative (TN), in which the actual value and the prediction are both negative.
The performance metrics of the model at the varied values of drop-outs are presented from tables 2–4. The proposed model shows the most promising performance since it combines the strength of Residual LSTM and gorilla troop optimized learning models.
Evaluation of Various Models for Predicting Crop Yield Productivity with Dropout Rate of 0.2
Algorithm | Performance Metrics(%) | recall | Specificity | F1-score | |
---|---|---|---|---|---|
Accuracy | Precision | ||||
LSTM | 82.5 | 83.5 | 83.4 | 84.1 | 84.2 |
LSTM+PSO | 86.3 | 86.2 | 85.8 | 86.1 | 85.4 |
LSTM+GA | 86.6 | 86.4 | 86.2 | 87.3 | 85.9 |
LSTM+WOA | 88.4 | 87.3 | 86.8 | 87.1 | 86.9 |
LSTM+SSO | 88.5 | 89.1 | 88.8 | 88.4 | 88.5 |
LSTM+SHO | 91.6 | 89.7 | 89.4 | 89.4 | 88.4 |
Benchmarking assessment of the various methodologies in identifying the crop-yield productivity with the drop-out=0.4
Algorithm | Performance Metrics(%) | recall | Specificity | F1-score | |
---|---|---|---|---|---|
Accuracy | Precision | ||||
LSTM | 84.3 | 83.6 | 83.5 | 83.5 | 84 |
LSTM+PSO | 87.6 | 86.3 | 85.9 | 88.3 | 85.4 |
LSTM+GA | 87.5 | 86.5 | 86.3 | 88.3 | 85.9 |
LSTM+WOA | 89.5 | 87.4 | 86.9 | 89.6 | 86.9 |
LSTM+SSO | 89.4 | 89.0 | 88.9 | 89.9 | 88.5 |
LSTM+SHA | 91.0 | 89.8 | 89.5 | 90.8 | 88.4 |
PROPOSED MODEL | 97.3 | 96.9 | 96.7 | 96.9 | 96.5 |
Benchmarking assessment of the various methodologies in identifying the crop-yield productivity with the drop-out=0.6
Algorithm | Performance Metrics(%) | recall | Specificity | F1-score | |
---|---|---|---|---|---|
Accuracy | Precision | ||||
LSTM | 83.5 | 83.6 | 83.5 | 84.0 | 84 |
LSTM+PSO | 88.3 | 86.3 | 85.9 | 86.0 | 85.4 |
LSTM+GA | 88.3 | 86.5 | 86.3 | 87.4 | 85.9 |
LSTM+WOA | 89.6 | 87.4 | 86.9 | 87.2 | 86.9 |
LSTM+SSO | 89.9 | 89.0 | 88.9 | 88.5 | 88.5 |
LSTM+SHO | 90.8 | 89.8 | 89.5 | 89.5 | 88.4 |
PROPOSED MODEL | 97.6 | 96.9 | 96.7 | 96.6 | 96.5 |
To test the performance of the proposed architecture, we have used the different epochs with learning rate of 0.001. It is found that the best results in the tuning process were optimized to 120 epochs, with 0.001 learning rate and output batch size is set to 160.
Training Accuracy Performance using the no of batches =160
Sl.no | No of batches | No of Epochs | Training Accuracy (%) |
---|---|---|---|
01 | 160 | 40 | 96.4% |
02 | 160 | 80 | 97.6% |
03 | 160 | 120 | 98.6% |
04 | 160 | 160 | 98.51% |
05 | 160 | 200 | 98.4% |
06 | 160 | 240 | 98.32% |
07 | 160 | 280 | 98.30% |
Training Accuracy Performance using the no of batches =160
Sl.no | No of batches | No of Epochs | Testing Accuracy (%) |
---|---|---|---|
01 | 160 | 40 | 96.36% |
02 | 160 | 80 | 97.65% |
03 | 160 | 120 | 98.55% |
04 | 160 | 160 | 98.35% |
05 | 160 | 200 | 98.21% |
06 | 160 | 240 | 98.3% |
07 | 160 | 280 | 98.2% |
Validation/Verification Accuracy Performance using the no of batches =160
Sl.no | No of batches | No of Epochs | Validation /Verification Accuracy (%) |
---|---|---|---|
01 | 160 | 40 | 96.34% |
02 | 160 | 80 | 97.6% |
03 | 160 | 120 | 98.55% |
04 | 160 | 160 | 98.35% |
05 | 160 | 200 | 98.21% |
06 | 160 | 240 | 98.3% |
07 | 160 | 280 | 98.2% |
Performance Metrics Evaluation for the Proposed Architecture using Testing Datasets
Sl.no | No of batches | No of Epochs | Precision (%) | Recall(%) | F1-Score |
---|---|---|---|---|---|
01 | 160 | 40 | 96.4% | 96.1% | 96.3% |
02 | 160 | 80 | 96.43% | 96.31% | 96.3% |
03 | 160 | 120 | 97.6% | 97.41% | 97.52% |
04 | 160 | 160 | 97.53% | 97.12% | 97.32% |
05 | 160 | 200 | 96.4% | 96.3% | 96.2% |
06 | 160 | 240 | 96.3% | 96.2% | 96.1% |
07 | 160 | 280 | 96.2% | 96.1% | 96.1% |
Table 9 illustrates the training accuracy achieved by the proposed architecture, reaching 98.6% at 120 epochs, while training accuracy across different epochs ranges from 96.45% to 98.30%. Therefore, the model is optimized at 120 epochs to achieve maximum training accuracy. Tables present the testing and verification accuracy, respectively, with the highest values observed at 98.55% for 120 epochs, confirming that this configuration maximizes performance. Precision, recall, and F1-score for the optimized 120 epochs are 97.5%, 97.4%, and 97.3%, respectively.
Performance Metrics Evaluation for the Proposed Architecture using Verification/Validation Datasets
Sl.no | No of batches | No of Epochs | Precision (%) | Recall(%) | F1-Score |
---|---|---|---|---|---|
01 | 170 | 40 | 96.5% | 96.% | 96.3% |
02 | 170 | 80 | 96.45% | 96.3% | 96.3% |
03 | 170 | 120 | 97.5% | 96.9% | 97.51% |
04 | 170 | 160 | 97.3% | 97.1% | 97.31% |
05 | 170 | 200 | 96.45% | 96.30% | 96.4% |
06 | 170 | 240 | 96.30% | 96.20% | 96.20% |
07 | 170 | 280 | 96.20% | 96.10% | 96.17% |
The suggested model in this paper has demonstrated exceptional performance in forecasting the climate that is appropriate for agricultural crop-yield production, with 97.5% accuracy, 96.6% precision, 96.9% recall, and 97.5% F1-score. The hybrid combination of Harris Hawk optimised structures and residual LSTM that underpins this model’s success highlights how well it predicts crop-yield production climate conditions. The outstanding performance of the suggested model demonstrates its ability to accurately discriminate between positive and negative occurrences. Additionally, precision and recall demonstrate the suggested model’s ability to distinguish between environmental factors like temperature, humidity, and rainfall, which are crucial in determining crop-yield output that can benefit farmers. Hence the proposed model requires more training in the direction of real time environmental datasets which can provide the path of designing the most intelligent decision system. Incorporate public datasets and work with government and NGOs to align recommendations with national agricultural policies and subsidies. This future development will significantly enhance the system’s usability, efficiency, and impact on agricultural productivity.