Awoke2021 Chapter BitcoinPricePredictionAndAnaly

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/345262720

Bitcoin Price Prediction and Analysis Using Deep Learning Models

Chapter · October 2020


DOI: 10.1007/978-981-15-5397-4_63

CITATIONS READS

10 8,602

4 authors, including:

Temesgen Awoke Muniye Minakhi Rout


KIIT University KIIT University
2 PUBLICATIONS   11 CITATIONS    30 PUBLICATIONS   159 CITATIONS   

SEE PROFILE SEE PROFILE

Suresh Satapathy
Institute of Electrical and Electronics Engineers
301 PUBLICATIONS   3,350 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Power System Control View project

4TH INTERNATIONAL CONFERENCE ON INFORMATION SYSTEM DESIGN AND INTELLIGENT APPLICATIONS (INDIA - 2017) View project

All content following this page was uploaded by Temesgen Awoke Muniye on 04 February 2021.

The user has requested enhancement of the downloaded file.


Bitcoin Price Prediction and Analysis
Using Deep Learning Models

Temesgen Awoke, Minakhi Rout, Lipika Mohanty,


and Suresh Chandra Satapathy

Abstract Cryptocurrencies are a digital way of money in which all transactions


are held electronically. It is a soft currency which doesn’t exist in the form of hard
notes physically. Here, we are emphasizing the difference of fiat currency which
is decentralized that without any third-party intervention all virtual currency users
can get the services. However, getting services of these cryptocurrencies impacts
on international relations and trade, due to its high price volatility. There are several
virtual currencies such as bitcoin, ripple, ethereum, ethereum classic, lite coin, etc. In
our study, we especially focused on a popular cryptocurrency, i.e., bitcoin. From many
types of virtual currencies, bitcoin has a great acceptance by different bodies such as
investors, researchers, traders, and policy-makers. To the best of our knowledge, our
target is to implement the efficient deep learning-based prediction models specifically
long short-term memory (LSTM) and gated recurrent unit (GRU) to handle the price
volatility of bitcoin and to obtain high accuracy. Our study involves comparing these
two time series deep learning techniques and proved the efficacy in forecasting the
price of bitcoin.

1 Introduction

Virtual currencies are a form of cryptocurrency which is an impressive technical


achievement in digital marketing, nevertheless. Virtual currencies live on, and they
couldn’t fully replace fiat or conventional currencies. In the current study, we

T. Awoke · M. Rout (B) · L. Mohanty · S. C. Satapathy


School of Computer Engineering, KIIT Deemed to be University, Bhubaneswar, Odisha, India
e-mail: [email protected]
T. Awoke
e-mail: [email protected]
L. Mohanty
e-mail: [email protected]
S. C. Satapathy
e-mail: [email protected]

© Springer Nature Singapore Pte Ltd. 2021 631


S. C. Satapathy et al. (eds.), Communication Software and Networks, Lecture Notes
in Networks and Systems 134, https://doi.org/10.1007/978-981-15-5397-4_63
632 T. Awoke et al.

are trying to show an interesting new perspective from which view of economics
questions surrounding currency governance, the characteristics of money, political
economy of financial intermediaries, and the nature of currency computation.
Virtual currencies become the most favorable and used for commercial enterprise
transactions all over the world [1, 2]. The popularity is due to its innovative char-
acteristics such as transparency, simplicity, and increasing acceptance through the
world [3]. In the current time, bitcoin is the popular flourishing virtual currency.
Reported to the website https://bitcoin.org, viewed on April 19, 2019, the virtual
currency market value is close to 90 billions of dollars, but it varies from time to
time. Bitcoin is a peer-to-peer cryptocurrency in which all transactions are not regu-
lated or controlled by any third party. Third-party intervention between customers is
impossible. It is highly volatile market price working 24/7. Market capitalization of
bitcoin is increased through time to time. In the current time, more than 71 billions
of dollars publicly traded. Due to its open-source nature, clear, transparent, simple,
and time is saving which leads all virtual currencies in the world.
Bitcoin is a worldwide and most popular cryptocurrency, first introduced in 2008
and exploited as open source in 2009 by a person called Satoshi Nakamoto, but
it became highly popular in 2017. Bitcoin functions as a decentralized moderate
of electronic cash, with transactions proved and transcribed in a public distributed
ledger (blockchain) without any third-party intervention. Transaction blocks consist
of secure shell algorithm which is used to connect each other, and blocks are served
as a non-editable data which is recorded when the transaction is being held. Then any
virtual currency especially bitcoin has been adopted by the people, and the virtual
currency market trend has been growing up.
The popularity of bitcoin is increased within a short period of time. Different
technologies and business companies are joined with bitcoin. As different researchers
assured that after 2015 around 100,000 technology and business companies have
started the bitcoin market. Some of the popular companies which are joined with
bitcoin are Amazon, Microsoft, Overstock, Dell, and others [1]. Many works have
been done to predict time series, as well as BTC value. However, any deep learning
models have not been much used yet to predict the BTC price value. Knowing
the deep learning models become state-of-the-art neural network architecture that
improves prediction accuracy in various domains including time series, we consider
applications of deep learning to predict the BTC price value. In coming sections, we
will explore previous works done on BTC price prediction, discuss deep learning
models to predict the time series, and focus on three main articles which will serve
as foundation of our work.
Primarily, the main challenge of bitcoin exchange rate is its high rate of price
fluctuation. High price volatility implies a certain measure should be taken to predict
the price of bitcoin accurately. Knowing the forecasting activity is necessary to tell
about the future price of bitcoin and build trust as well as acceptance throughout the
world. Influenced by a variety of factors, such as political system, public relations, and
market policy of a country, can determine economical role of bitcoin and international
relation of countries on different market strategies. Lastly, doesn’t have an official
road map: few key challenges and developments coming up for bitcoin prediction
Bitcoin Price Prediction and Analysis Using Deep Learning Models 633

are in consistent, because there is no clear description of the exchange platform on


which the transactions related to buying and selling are not regulated. The objective
of our current study is to forecast the bitcoin price with improved efficiency using
deep learning models and minimizing the risks for investors as well as policy-makers.

2 Related Works

Researches on the prediction of cryptocurrencies using machine learning are not


much enough, especially on deep learning models. According to the research of 2016,
more than 600 papers have been published on this topic. Our literature survey covers
work done on bitcoin (BTC) price prediction using different techniques, the need, and
evaluation of recurrent neural network (RNN) and its system architecture. Dennys
et al. [4] used different attribute selection mechanisms to get the most important
features and applied machine learning methods such as artificial neural network
(ANN), support vector machine (SVM), and recurrent neural network (RNN) as
well as k-means clustering in the bitcoin price prediction. However, one limitation
of this study is only focused on the investors. Policy-makers should be considered as
a major partner of the system because cryptocurrency can change the dynamics of
world economy. Sean McNally et al. [5] used Bayesian optimized recurrent neural
network and LSTM to predict the direction of Bitcoin price in USD. They also
used ARIMA model to compare the deep learning methods. In Atsalakis et al. [6],
this research focuses on computational intelligence method especially hybrid neuro-
fuzzy controller in order to predict the exchange rate of bitcoin. This model used
neuro-fuzzy approach and artificial neural networks. Goodfellow et al. [7] proposed
a deep direct reinforcement learning framework for financial signal representation
and trading. They combined the reinforcement learning (RL), deep learning (DL),
and their current deep neural network (NN) to generate precise prediction results.
They validate the proposed approach using commodity future markets as well as
stock market data. Madan et al. [8] tried to predict the price of bitcoin using machine
learning and investigate the trends of BTC surrounding. They used 25 attributes
relating to bitcoin to forecast the daily price variation. In Lahmiri et al. [9], they
implemented machine learning algorithms to predict the exchange rate of daily price
of high data availability cryptocurrencies such as BTC, ripple, and digital cash.
They applied RNN and GRNN (Generalized Regression Neural Network) to get
the accurate prediction rate of high liquidity cryptocurrencies. Saxena et al. [10]
investigated the minimum accuracy of bitcoin price using LSTM and ARIMA model.
Paresh kumar et al. [11] suggested that bitcoin has a negative impact on market
inflation. It is not predictable; therefore, bank of Indonesia should warn not to invest
on bitcoin. Not only this but also different government authorities including police
should prevent bitcoin marketing in Indonesia, and the objective of this study is
to control the effects of cryptocurrency on the monetary system. Pant et al. [12]
state that socially constructed ideas in a twitter about virtual currency have straight
or sidelong impact over all the market analyses of virtual currencies. This study
634 T. Awoke et al.

focuses on forecasting the fluctuated value of bitcoin by sentiment analysis and


identifying the relationship between positive and negative sentiments. Nivethitha
et al. [13] proposed the future stock price prediction using LSTM machine learning
algorithm. They especially focused on time series prediction because it is a basic for
share price prediction and other financial prediction models. And comparing with that
of existing model ARIMA, LSTM algorithm provides efficient and accurate results.
Roth et al. [14] assured that bitcoin is the new and most popular virtual currencies,
while the security and its volatility rate are debatable. This study makes it functional
for the peer-to-peer transaction of bitcoin through the network and the blockchain
technology. Phaladisailoed et al. [15] used various machine learning algorithms to
predict the bitcoin price more efficiently.

3 Proposed Methodology

The proposed methodology considers two different deep learning-based prediction


models to forecast daily price of bitcoin by identifying and evaluating relevant
features by the model itself. After applying both the models for bitcoin prediction,
we can determine which model is much more accurate for the future fulfillment of
our target and select appropriate parameters to obtain a better performance. In this
work, we have proposed deep learning mechanisms such as LSTM and GRU which
are the latest and efficient techniques for the forecasting of bitcoin price. As bitcoin is
the most popular cryptocurrency, the price volatility issue should be handled within
a short period of time. The process of prediction starting from collecting data till the
forecasting of bitcoin price is depicted in Fig. 1.

3.1 RNN

RNN is a deep neural network characterized as a recurrent connection between the


input and output of its neurons or layers and capable of learning sequences designed
to capture temporal contextual information along time series data. They have recently
gained popularity in deep learning due to their ability to overcome the limitation of
existing neural network architecture where it comes to learn over long sequences.
Two common RNN networks are LSTM and GRU and presented in the subsequent
sections.

3.1.1 LSTM

LSTMs are explicitly designed to avoid the long-term dependency problem. Remem-
bering information for long periods of time is practically their default behavior, not
something they struggle to learn. All recurrent neural networks have the form of
Bitcoin Price Prediction and Analysis Using Deep Learning Models 635

Fig. 1 Block diagram of proposed workflow

a chain of repeating modules of neural network. In standard RNNs, this repeating


module will have a very simple structure, such as a single tan h layer.
The deep learning LSTM neural networks overcome the problems with RNN
related to vanishing gradients, by replacing nodes in the RNN with memory cells and
gating mechanism. In this regard, it is an attractive deep learning neural architecture
mostly on the account of its efficacy in memorizing long- and short-term temporal
information simultaneously, and it can be viewed the same in LSTM architecture
depicted in Fig. 2.

Fig. 2 LSTM architecture


636 T. Awoke et al.

Fig. 3 GRU architecture

3.1.2 GRU

The GRU is the newer generation of recurrent neural networks and is pretty similar
to an LSTM. GRU got rid of the cell state and used the hidden state to transfer
information. It has also only two gates, a reset gate and update gate as shown in
Fig. 3.
Reset Gate: The reset gate is another gate that is used to decide how much past
information to forget.
Update Gate: The update gate acts similar to the forget and input gate of an
LSTM. It decides what information to throw away and what new information to be
added.

4 Simulation Results and Analysis

4.1 Data and Data Set Preparation Method

Data preparation is the process of collecting, combining, organizing, and structuring


data, and then it can be considered as data visualization, analytics, and data mining
with machine learning applications. It is critical to feed accurate data for the problem
we want to solve.
Data set preparation is a crucial step in machine learning. As we mentioned before,
the data preparation impacts the accuracy of the predictions. Therefore, in this section,
we should explain the details of the data sets. We will expose the methods used to
prepare the data in scope of our model. The dataset used for this research consists of
daily price value collected from Kaggle website https://www.kaggle.com.
The overall data collection period is from January 1, 2014 to February 20, 2018.
In this dataset, there are seven attributes such as opening price, high price, low price,
and closing prices and also the market cap of publicly traded outstanding shares.
Bitcoin Price Prediction and Analysis Using Deep Learning Models 637

Table 1 Comparision of
Model Compilation time (ms) Epoch
compilation time required by
both the deep learning-based LSTM 53 100
models GRU 5 100

Fig. 4 a MSE graph obtained using LSTM model b MSE graph obtained using GRU model

4.2 Results and Discussion

The proposed model of LSTM and GRU price prediction of bitcoin was trained,
and the predictions were carried out for popular cryptocurrency. The accuracy of
the proposed LSTM as well as GRU model is investigated by finding the root mean
square error (RMSE) and mean absolute percentage error (MAPE) to determine
which model has better accuracy. We observed from the resultant Table 1 that LSTM
takes greater compilation time than GRU model.
The MSE value obtained for 7 days ahead from both the models is plotted and
shown in Fig. 4, and it is clearly observed that GRU is converging faster and steady
than the LSTM model. From Fig. 5a, b, it is discovered that the variation of actual
price and predicted price is more in LSTM than the GRU.

4.3 Performance Measures

One of the common ways to compare the time series models is to measure their
performance for short- and long-term prediction. To validate the performance of
these two models, we have used MAPE (Mean Absolute Percentage Error) and
RMSE (Root Mean Square Error) as performance measure. These error values are
obtained using LSTM and GRU and listed in Table 2.
638 T. Awoke et al.

Fig. 5 Comparison of actual and predicted bitcoin price during training phase of LSTM (a) and
GRU (b)

Table 2 Comparison of RMSE and MAPE value obtained using LSTM and GRU models
Window size Number of days ahead LSTM GRU
RMSE MAPE RMSE MAPE
1 1 0.092 0.068 0.075 0.065
5 3 0.079 0.057 0.065 0.046
7 5 0.081 0.060 0.087 0.062
12 7 0.045 0.030 0.051 0.035
15 15 0.067 0.048 0.067 0.058

From this study, we found that the GRU-based forecasting model is more appro-
priate in order to forecast time series data of highest price volatility. As we have
observed, from Table 2 and Fig. 6 the prediction accuracy of the LSTM is better at
window size of 12 and days ahead of 7. However, in the rest of window sizes and days
ahead, GRU model is more efficient than that of LSTM models and the comparison
actual and predicted bitcoin price obtained.

5 Conclusion and Future Work

Bitcoin is the most popular decentralized way of virtual currency which has a great
role in the free market economy and avoids the intermediary of another third party
between customers. The main objective of our study is to forecast the bitcoin price
with improved efficiency using deep learning models and minimizing the risks for
the investors as well as policy-makers. We have implemented two deep learning
techniques such as LSTM and GRU as prediction models. The study reveals that the
GRU model is the better mechanism for time series cryptocurrency price prediction
Bitcoin Price Prediction and Analysis Using Deep Learning Models 639

Fig. 6 Actual and predicted bitcoin price in terms of USD obtained using LSTM model

and takes lower compilation time. LSTM and GRU models are more capable of
recognizing long-term dependencies. In this study, we have only compared to basic
deep learning-based models, i.e., LSTM and GRU. However, it needs to investigate
further to enhance the accuracy of the deep learning-based prediction models by
considering different parameters in addition to the previous one. Features such as
political system, public relations, and market policy of a country can affect and
determine the price volatility of cryptocurrency. In our study, we have not considered
other cryptocurrencies such as ripple, ethereum, lite coin, and others. We will enhance
the model by applying on these cryptocurrencies so the model becomes a stable one.
Fuzzification can also be incorporated at the input layer by considering the degree
of participation of each of the features in the prediction.

References

1. Nakamoto S et al. (2008) Bitcoin: a peer-to-peer electronic cash system, 2008. Working Paper
from www.bitcoin.org
2. Urquhart A (2016) The inefficiency of Bitcoin. Elsevier, pp 80–82
3. Jang H, Lee J (2017) An empirical study on modeling and prediction of bitcoin prices with
bayesian neural networks based on blockchain information. 5427—5437
4. Dennys CA, Mallqui RAF (2018) Predicting the direction, maximum, minimum and closing
prices of daily bitcoin exchange rate using machine learning techniques. Int J Soft Comput
(IJSC) 596–606
5. McNally S, Roche J, Caton S (2018) Cryptocurrency forecasting with deep learning chaotic
neural networks. IEEE, pp 339–343
6. Atsalakis GS, Atsalaki IG, Pasiouras, F, Zopounidis C (2019) Bitcoin price forecasting with
neuro-fuzzy techniques. Elsevier, pp 770–780
7. Goodfellow I, Bengio Y, Courville A (2016) Deep learning. MIT press
640 T. Awoke et al.

8. Madan I, Saluja S, Zhao A(2015) Automated bitcoin trading via machine learning algorithms.
1–5. http://cs229.stanford.edu/proj2014/Isaac\%
9. Lahmiri S, Bekiros S (2019) Cryptocurrency forecasting with deep learning chaotic neural
networks. Elsevier, 35–40
10. Saxena A, Sukumar TR (2018) Predicting bitcoin Price using lstm and compare its predictability
with Arima model. Int J Pure Appl Math 2591–2600
11. Paresh Kumar N, Narayan S, Rahman RE, Setiawan I (2019) Bitcoin price growth and
Indonesia’s monetary system. Emerg Mark Rev 38:364–376
12. Pant DR, Neupane P, Poudel A, Pokhrel AK, Lama BK (2018) Recurrent neural network based
bitcoin price prediction by twitter sentiment analysis. IEEE, pp 128–132
13. Nivethitha P, Raharitha P (2019) Future stock price prediction using LSTM machine learning
algorithm. Int Res J Eng Technol (IRJET) 1182–1186
14. Roth N (2015) An architectural assessment of bitcoin: using the systems modeling language.
Procedia Comput Sci 44:527–536
15. Phaladisailoed T, Numnonda T (2018) Machine learning models comparison for bitcoin price
prediction. In: 2018 10th international conference on information technology and electrical
engineering (ICITEE). IEEE, pp 506–511

View publication stats

You might also like