100% found this document useful (1 vote)
96 views10 pages

Weather Prediction Based On LSTM Model Implemented AWS Machine Learning Platform

Climate change has affected the weather forecast on a regular basis compared to reality. Meanwhile, weather forecast plays an important role in daily life and especially it affects developed countries in agricultural fields around the world. When we apply information technology software, we can assess the general weather condition of a given city, and with the help of recent modern scientific methods for more accurate analysis and prediction of weather based on those collected weather data.
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
100% found this document useful (1 vote)
96 views10 pages

Weather Prediction Based On LSTM Model Implemented AWS Machine Learning Platform

Climate change has affected the weather forecast on a regular basis compared to reality. Meanwhile, weather forecast plays an important role in daily life and especially it affects developed countries in agricultural fields around the world. When we apply information technology software, we can assess the general weather condition of a given city, and with the help of recent modern scientific methods for more accurate analysis and prediction of weather based on those collected weather data.
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
You are on page 1/ 10

8 V May 2020

http://doi.org/10.22214/ijraset.2020.5046
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

Weather prediction based on LSTM model implemented


AWS Machine Learning Platform
D. T. Hoang1, Pr. L. Yang2, L. D. P Cuong3, Dr. P. D. Trung4, Dr. N. H. Tu5, L. V. Truong6, T. T Hien7, V. T Nha8
1, 2, 3, 6, 7
College of Computer Science and Electronic Engineering, Hunan University, Changsha 410082, China
3, 4
Yersin University, Da Lat, Vietnam
5
Faculty of Information and Technology, Hanoi University of Industry, Ha Noi, Vietnam
6, 7
Faculty of Electric - Electronic Engineering, Nam Dinh University of Technology Education, Nam Dinh, Vietnam
8
Faculty of Computer Science and Engineering, ThuyLoi University – Ho Chi Minh Campus, Ho Chi Minh, Vietnam
Abstract: Climate change has affected the weather forecast on a regular basis compared to reality. Meanwhile, weather forecast
plays an important role in daily life and especially it affects developed countries in agricultural fields around the world. When
we apply information technology software, we can assess the general weather condition of a given city, and with the help of
recent modern scientific methods for more accurate analysis and prediction of weather based on those collected weather data
for a period of a week earlier or longer for future weather forecasts. Therefore, in this study, machine learning model was
applied and it was allowed to study methods and feature engineering from data pre-processing, so through this, we find an
unpredictable model of climatic conditions, a prognostic model is also monitored. For this work, various weather parameters
were collected from the national climate data center through available software applications, with the application of the Long
Short-Term Memory (LSTM) model is an artificial recurrent neural network (RNN) were trained for different combinations
that are implemented on AWS machine learning platform. In the process of predicting weather conditions with today's modern
technology, neural networks are practiced using different combinations of weather parameters such as temperature,
precipitation, humidity, wind speed, and pressure. After training the LSTM model with these parameters, in addition to the
results of the plot of model accuracy for the training and validation sets and performance evaluation metrics to test the model,
this study also concluded the results of the weather condition by 2 values (good or bad).
Keywords: Weather prediction, neural network, LSTM, recurrent neural network, AWS Sagemaker
I. INTRODUCTION
We seems that the weather plays a big role in all activities of human life with many purposes to survive on this earth by earning a
living in many different fields such as agriculture, industry, education, and so on. Since then, we have a better life and all our
products are made to achieve the desired quality with the support of good weather. But the reality is not exactly as we monitor the
weather forecasts collected through the available weather forecast application which has greatly affected our lives and lost a lot of
their possessions due to weather conditions we cannot predict the future a long time to have a backup plan.
Artificial neural network (ANN) or neural networks are computation algorithms. Artificial neural network (ANN) is an effective
technique to construct a computerized system that is capable of processing non-linear weather conditions inside a specific domain,
and make predictions [1]. ANN has a large number of connected processing units that work together to process information. It
applied neural network for regression of continuous target attributes. It has three layers as: Input layer, Hidden layer and Output
layers [2]. The ANN nature is based on developing a mathematical model capable of recognizing complex patterns on the same
line as the active neuron [3]. Basically, ANN was the system that receives the input, processed the data and then gave output with
respect to input. Neural networks were multilayered with one input layer, most hidden layers and one output layer. Meanwhile, the
weather, it was a data-intensive type, we saw the data set is non-linear and therefore we predetermined the exact weather
conditions with the option of applying ANN. Based on our research, many neural networks are designed. Among these various
neural networks, the transitional neural network was used for both the purpose of predicting climatic conditions or forecasts of
stocks, etc. [4].

Fig.1: Basic ANN architecture

©IJRASET: All Rights are Reserved 283


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

The above figure shows the architecture of an artificial neural network consisting of three layers. As mentioned earlier, the primary
layer has input neurons, the second layer has hidden neurons and the third layer has output neurons. In addition, SNN (Supervised
Neural Networks) are trained to deliver important outputs to training inputs. It was trained by providing it appropriate input and
output samples [1].
Through those reasons, in this our research, we introduce a new AutoML technology based on Cloud platform that is a trend to
develop and assist researchers in the field of artificial intelligence in the training of the model or giving data of metrics result for
model evaluation quickly. Machine learning researchers have mostly used Google’s Cloud AutoML [5] versus Amazon Web
Services (AWS) [6] deploys both models and algorithms directly on Amazon Sagemaker [7]. Both AWS and Google provide
following machine learning services, the training custom models with our own data: Jupyter notebook, a hosted model training and
Hyper-parameter optimization service, to which training jobs can be submitted remotely; a model repository and scalable model
hosting service for inference; built-in algorithms to train our models with just data. Moreover, they are supported LSTM (Long
Short-Term Memory) technique always work well in series time data science. Table 1 shows a comparison of some Cloud machine
learning services and it shows that AWS’s Amazon Sagemaker has a few advantages over Google’s Cloud AutoML [8].

Fig. 2: The Cloud machine learning services comparison


II. RELATED WORK AND LITERATURE SURVEY
Researchers are adopting various machine learning methods, including machine learning and the recently supported Cloud
AutoML (Google or Amazon) technology [8-9], which has been trying to predict weather condition with best results.
The current survey assesses a number of machine learning models to predict weather condition from real-time data is recorded for
a while ago by the available weather data application. The techniques have been used until now such as: logistic regression,
support vector machines, neural network and random forests. The performance of all the models tested is evaluated using several
metrics, including Accuracy, Recall, F1 score, AUC score (Area under the Curve).
These metrics, derived from the model’s exhibited number of true positives (TP), true negatives (TN), false positives (FP) and
false negatives (FN), include Accuracy (Eq.1), Recall (Eq.2), F1 (Eq.3) and AUC stands for “Area under the ROC curve” that is
measures the entire-dimensional are underneath the entire ROC curve from (0.0) to (1.1).
TP + TN
Accuracy = (1)
TP + TN + FP + FN
TP
Recall = (2)
TP + FN
2TP
F1 = (3)
2TP + FP + FN
In this section, the author presents the review of previous studies in weather prediction. This paper reviewed more details by
different researchers with achieved their results below Table 1 [1].

©IJRASET: All Rights are Reserved 284


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

Table 1: The result revised according to the studies


Accura
Reference Used Applied Method Achieved Prediction cy Limitations
(%)
No value results of
evaluation metrics and
features engineering.
Statistical data, the
Asynchronous data
Pushpa Mohan et al classification like Rainfall, crop yield and cost of crop in
- collection by each
[10] Support Vector Machine Mysore region, Karnataka, India.
individual application,
(SVM), neural networks.
prediction in a small area
and only shows general
steps.
Rainfall. Value result of evaluation
metrics.
ANN, Decision tree
Gave a performance comparison
algorithms, build a
P.Shivaranjani et al between C4.5 and Naïve Bayes Build a complex model
classifier tree, the data 88.2
[11] algorithm (showed that C4.5 was with C5 decision tree.
mining tool is WEKA,
better than Naïve Bayes with accuracy
feature extraction.
88.2%). Especially, features
engineering for dataset.
No value results of
evaluation metrics and
features engineering.
Frequent Pattern Growth
Amruta A. Taksande Rainfall, calculate MAE, MSE and SD Only calculate MAE,
Algorithm, Decision
et al[12] and A. with >90% accuracy 90% MSE and SD belong to
Tree, metrics of
Dhore et al[13] Predicted prediction with temperature. metrics of statistics and
statistics.
gave rainfall status result
and predicted prediction
with temperature.
No value results of
evaluation metrics and
Weather prediction with temperature features engineering.
S. Santhosh Baboo et ANN, neural networks, Proposed model result compared with Complex proposed model
al [14] and S.S. De et Back propagation neural practical temperature prediction. with BPNN. Only
-
al [15] and B. Musala network (BPN), real Evaluation of performance of model temperature prediction to
Reddy et al [16] time dataset. by RMSE (Root Mean Square Error) evaluate weather
value. condition and showed
performance of ANN by
RMSE value.
General Weather with maximum
ANN, SVM and MLP
temperature at a location. Performance No value results of
(with BPN algorithm)
SaktayaSuksri [17] of SVM is better than MLP with back - evaluation metrics and
model comparison,
propagation algorithm by evaluation features engineering.
dataset pre-processing.
of MSE performance measure.
ANN, LSTM - Long General Weather. LSTM model gave
No value results of
A. Subashini et al. Short–Term Memory substantial results with high accuracy.
- evaluation metrics and
[1] (traditional RNN), real The history weather dataset for a long
features engineering
time dataset time by available application

©IJRASET: All Rights are Reserved 285


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

Through a more detailed comparison of previous researchers with recent years of 2020, showed that as: many models were applied
to predict weather condition with some parameters as: Sunrise, Sunset, Chance, Humidity, Wind, Pressure, so on, such as ANN,
neural networks, SVM, BPN, and used a WEKA tool was one of the tools in data mining. Since then, they has achieved the desired
results achieved for predicting weather conditions for this time, specifically, prediction of general weather or weather forecasts
with temperature and rainfall, made comparisons of the prediction models (C4.5 and Naïve Bayes , SVM & MLP), and valuation
of performance of models by MSE, RMSE, MAE and SD performance measure. However, there were many limitations such as:
No value results of evaluation metrics which only calculated MSE and SD values belong to metrics of statistics, features
engineering, used complex model and algorithm as C5 decision tree or BPN and proposed BPNN. Besides, evaluation of
performance of models with accuracy ranges was 88.2 – 90% or even, perhaps, most previous authors have not shown a specific
value so far.
III. RECURRENT NEURAL NETWORK AND LSTM
Amazon SageMaker [18] is a fully managed service that enables to make quickly and easily integrate machine learning based
models into our applications. Machine learning with Amazon Sagemaker describes typical machine learning processes and
general ways to accomplish those tasks. Therefore, we preprocess example data in a Jupyter notebook on our notebook instance.
We use our notebook to fetch our dataset, explore it, and prepare it for model training.
Neural network finds great application in data mining used in fields. For example: prediction of economics, stock, finance and
weather, so on. Typically, neural network includes Input layer, Hidden layer, Output layer.
1) Input Layer: Operation of the input unit represents raw information can provided to the network
2) Hidden Layer: Determine the operation of each hidden unit. The operation of the input unit and the weights on the
connection between the input unit and the hidden unit.
3) Output Layer: The outcome of the output unit depends on the operation of the hidden unit and the weight between the output
unit and the hidden unit.
Sequence prediction problems come in many form and are best described by the types of inputs and outputs supported. Our
sequence prediction problem is Many-to-One which is a sequence of multiple steps as input mapped to class or quantity
prediction. Otherwise, Many-to-Many problem is often referred to as sequence-to-sequence, or seq2seq for short, this will
research in future.
This research applied a recurrent neural system (RNN) is a class of ANN where connections between units form a coordinated
chart along a sequence. This allows it to display dynamic behavior time to arrange a time.
This is not possible for the relay neural network, and the recurrent neural network can use its memory from the internal memory
to process a sequence of inputs. RNN can recall important things about the information they get, this allows them to extremely
predict what is coming.
This is the highlight behind why they are the preferred technique for sequential data such as time series, weather, and more
because they are thoughtfully evolving in its sequence and context, compared to other similar technologies. In recurrent neural
network, the data goes through a loop.
When it decides on a decision, it considers the current input and further what it has received from the information it has received
earlier. But, so far, then RNN were traditionally difficult to train.
Current, Long Short–Term Memory (LSTM) [19] networks are an extension of recurrent neural network and perhaps the most
successful RNN because it overcomes the problems of training a recurrent network and in turn has been use on a wide range of
applications [20, 21], which basically expand their memory.
Along these lines it is appropriate to gain from obligatory encounters with long circumstances in the middle. The unit of the
LSTM network is the unit that supports the surface of the recurrent neural network, then, commonly called the LSTM network.
The LSTM allows recurrent neural networks to recall given information over a long period of time.
This is because recurrent neural networks contain their data in memory similar to the memory of a computer in the context that
LSTM can read, write and erase data from its memory. In a recurrent neural network have three gates so far, such as: input,
hidden and gate of output.

©IJRASET: All Rights are Reserved 286


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

Fig.3: Diagram illustrates the typical workflow for creating a machine learning model
IV. PROPOSED METHOD
In this paper, we propose a new technology, Amazon Sagemaker that predicts the weather recently, it is a machine learning
service that has just appeared recently and found its rare context concerned machine learning articles. So, we chose this method to
make evaluation of RNN machine learning model based on LSTM algorithm.
Also, we use weather forecasting model which is the recurrent neural network with LSTM algorithm essentially, fit an LSTM for
a multivariate time series forecasting [22] and collect data that is weather parameters, like temperature, humidity, pressure, wind
speed, so on. These are considered as neurons of input to recurrent neural network. Weather forecasting is done by collecting
information related daily weather in regards to the previous and the present condition of the weather and utilizing this information
to train LSTM model. The proposed technology for weather prediction with the novels of recurrent neural network is given below
Fig.4.

Applying LSTM model


Collect Weather Data by an Data Pre-Processing implemented on
Available Application
AWS platform

Forecasted Weather Result


Evaluation Process Training of Model
Output by Evaluation Metrics

Training
Dataset

Fig.4: The diagram of proposed method

©IJRASET: All Rights are Reserved 287


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

V. EXPERIMENTAL RESULT
To experiment the proposed model, the historical weather dataset has taken from available application for 4 months from
December 2020 to March 2020. The dataset contain many weather attributes like Sunrise, Sunset, Chance, Humidity, Wind,
Pressure, Visibility, and UV, so on. These attributes are the given information to the neural network and trained using LSTM
model. From then, our research results have achieved the following highlights, such as:
A. Supervised dataset for Training using the LSTM model shown below. Fig.5
B. Also, we shown the LSTM model layers in the training process shown below. Fig.6
C. Plot training and validation accuracy values of the model, it shown below. Fig.7
D. Finally, the evaluation metrics highlights indicated that the LSTM model has improved results compared to the majority of
previous models increasing the ratio of metrics (Accuracy, Recall, F1 and AUC score). The evaluation result shown below.
Fig.8
E. Furthermore, the process of saving and loading models automatically in the future when updating data streams by the
specified format. This shown below. Fig.9

Fig.5: Supervised dataset for Training using the LSTM model

Fig.6: The LSTM model Layer

Fig.7: Plot training and validation accuracy values of the model

©IJRASET: All Rights are Reserved 288


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

Fig.8: The best evaluation metrics result of the two sets

Fig.9: The process of saving and loading models automatically


VI. CONCLUSION
Sagemaker configures tuning job quickly thanks to its Tuning Hyperparamter built-in function. Moreover, it also provides Python
SDK to manually develop by developers. The LSTM model implemented in Amazon Sagemaker, after there is a trained model, it
can be deployed as an endpoint API which can be use easily by many machines and systems. So, we can do it quickly and easily
without much effort in the future. Machine learning algorithm uses supervised weather data, in fact, shown more accurate weather
or climate forecasts than conventional prediction, since then, proving that review long time period, our model shows better than
other complete models. In this research work, a proposed technology for forecasting weather system is implemented using
recurrent neural network with LSTM technique implemented AWS platform. In this model, the data is trained using LSTM
method. From experimental results, they were observed that LSTM neural network gives substantial results with high accuracy
among the other weather forecasting techniques. Future work may explore ways to expand the proposal here to allow weather
stations to be added or deleted over time. Another possible research approach is to explore ways to take advantage of a dataset in
which different values have different predictive variables.

©IJRASET: All Rights are Reserved 289


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 8 Issue V May 2020- Available at www.ijraset.com

REFERENCES
[1] A. Subashini, S. M. Thamarai and Dr. T. Meyyappan: “Advanced Weather Forecasting Prediction using Deep Learning”, International Journal for Research
in Applied Science & Engineering Technology, Volume 7, Issue 8, Aug 2019
[2] D. F. Specht: “A general regression neural network”, IEEE transactions on neural networks, Volume 2 (6), 1991
[3] A. Niaei et al: “The use of ANN and the mathematical model for prediction of the main product yields in the thermal cracking of naphtha”, Petroleum
science and technology, Volume 25 (8), 2007
[4] Cloud AutoML. Available from: https://cloud.google.com/automl/
[5] AWS. Available from: https://aws.amazon.com/vi/
[6] Amazon Sagemaker. Available from: https://aws.amazon.com/vi/sagemaker/
[7] M. Kumar: “An Incorporation of Artificial Intelligence Capabilities in Cloud Computing”, International Journal of Engineering and Computer Science,
Volume 5, Issue 11, Nov 2016
[8] L. Faes et al: “Automated deep learning design for medical image classification by health-care professionals with no coding experience: a feasibility study”,
The Lancet Digital Health”, Volume 1(5), 2019
[9] E. Bisong: “Google AutoML: Cloud Vision”, Building Machine Learning and Deep Learning Models on Google Cloud Platform, 2019
[10] Pushpa Mohan and Dr. KiranKumariPatil: “Survey on Crop and Weather Forecasting based on Agriculture related Statistical Data”, International Journal of
Innovative Research in Computer and Communication Engineering, Volume 5, Issue 2, 2017
[11] F. Sheikh et al.: “Analysis of data mining techniques for weather prediction”. Indian Journal of Science and Technology, Volume 9 (38), 2016
[12] Amruta A. Taksande and P. S. Mohod: “Applications of Data Mining in Weather Forecasting Using Frequent Pattern Growth Algorithm”, International
Journal of Science and Research, Volume 4, Issue 6, 2015
[13] A. Dhore et al.: “Weather prediction using the data mining techniques”, International Research Journal of Engineering and Technology, Volume 4, Issue 5,
2017
[14] S. S. Baboo and I. Kadar Shereef: “An efficient weather forecasting system using artificial neural network”, International Journal of Environmental Science
and Development, Volume 4 (5), Oct 2010
[15] S.S. De and A. Debnath: Artificial neural network based prediction of maximum and minimum temperature in the summer monsoon months over India”,
Applied Physics Research, Volume 1(2), 2009
[16] C. J. Devi et al.: “ANN Approach for Weather Prediction using Back Propagation”, International Journal of Engineering Trends and Technology, Volume 3
Issue 1, 2012
[17] Y. Radhika and M. Shashi: “Atmospheric Temperature Prediction using Support Vector Machines”, International Journal of Computer Theory and
Engineering, Volume 1 (1), Apr 2009
[18] AWS: Amazon Sage Maker- Developer Guide. Amazon Web Services, 2020
[19] Schmidhuber, J. and S. Hochreiter: “Long short-term memory”. Neural Computation, Volume 9 (8), 1997
[20] X. H. Le et al: “Application of Long Short-Term Memory Neural Network for Flood Forecasting” , Water, May 2019
[21] Li, Y. and H. Cao: “Prediction for tourism flow based on LSTM neural network”, Procedia Computer Science, Volume 129, 2018
[22] Karim, F., et al.: “Multivariate LSTM-FCNs for time series classification”. Neural Networks, Volume 116, 2019

©IJRASET: All Rights are Reserved 290

You might also like