DOI QR코드

DOI QR Code

A Stock Price Prediction Based on Recurrent Convolution Neural Network with Weighted Loss Function

가중치 손실 함수를 가지는 순환 컨볼루션 신경망 기반 주가 예측

  • 김현진 (단국대학교 전자전기공학부) ;
  • 정연승 (단국대학교 경영학부)
  • Received : 2018.08.02
  • Accepted : 2018.10.01
  • Published : 2019.03.31

Abstract

This paper proposes the stock price prediction based on the artificial intelligence, where the model with recurrent convolution neural network (RCNN) layers is adopted. In the motivation of this prediction, long short-term memory model (LSTM)-based neural network can make the output of the time series prediction. On the other hand, the convolution neural network provides the data filtering, averaging, and augmentation. By combining the advantages mentioned above, the proposed technique predicts the estimated stock price of next day. In addition, in order to emphasize the recent time series, a custom weighted loss function is adopted. Moreover, stock data related to the stock price index are adopted to consider the market trends. In the experiments, the proposed stock price prediction reduces the test error by 3.19%, which is over other techniques by about 19%.

본 논문에서는 RCNN (recurrent convolution neural network) 계층 모델을 채택한 인공 지능에 기반을 둔 주가 예측을 제안한다. LSTM (long-term memory model) 기반 신경망은 시계열 데이터의 예측에 사용된다. 다른 한편, 컨볼루션 신경망은 데이터 필터링, 평균화 및 데이터 확장을 제공한다. 제안된 주가 예측에서는 위에서 언급 한 장점들을 RCNN 모델에서 결합하여 적용함으로써 다음날의 주가 종가를 예측한다. 그리고 최근의 시계열의 데이터를 강조하기 위해 커스텀 가중치 손실 함수가 채택되었다. 또한 시장의 상황을 반영하기 위해 주가 인덱스에 관련된 데이터를 입력으로 포함하였다. 제안된 주가 예측 방식은 실제 주가를 대상으로 한 실험에서 3.19%로 테스트 오차를 줄였으며, 다른 방법보다 약 19%의 성능 향상을 거둘 수 있었다.

Keywords

JBCRJM_2019_v8n3_123_f0001.png 이미지

Fig. 1. Basic Structure of RNN

JBCRJM_2019_v8n3_123_f0002.png 이미지

Fig. 2. Structure of LSTM Cell

JBCRJM_2019_v8n3_123_f0003.png 이미지

Fig. 3. Example Using Convolution Layers

JBCRJM_2019_v8n3_123_f0004.png 이미지

Fig. 4. Structure of RCNN in Proposed Method

JBCRJM_2019_v8n3_123_f0005.png 이미지

Fig. 5. Averaging Errors According to Epoch

JBCRJM_2019_v8n3_123_f0006.png 이미지

Fig. 6. Averaging Errors Compared to Other RCNN Approaches

Table 1. Experimental Environments

JBCRJM_2019_v8n3_123_t0001.png 이미지

Table 2. Performance Comparisons

JBCRJM_2019_v8n3_123_t0002.png 이미지

Table 3. Comparison in Terms of Training Time

JBCRJM_2019_v8n3_123_t0003.png 이미지

References

  1. S. Russell and P. Norvig, "Artificial Intelligence: A Modern Approach," 3th ed., New York: Prentice Hall, 2009.
  2. Yu Jin Oh and Yu Seop Kim, "Artificial intelligence : A two-Phase hybrid stock price forecasting model: cointegration tests and artificial neural networks," The KIPS Transactions: Part B, Vol.14, No.7, pp.531-540, 2007.
  3. Rafal Jozefowicz, Wojciech Zaremba, and Ilya Sutskever, "An empirical exploration of recurrent network architectures," in Proceedings of the 32nd International Conference on Machine Learning, pp.2342-2350, 2015.
  4. Hun Kim., Lecture of Machine Learning and Deep Learning [Internet], https://hunkim.github.io/ml/.
  5. Convolution network [Internet], https://deeplearning4j.org.
  6. Israt Jahan and Sayeed Sajal, Stock Price Prediction using Recurrent Neural Network (RNN) Algorithm on Time-Series Data [internet], https://www.micsymposium.org.
  7. Dong-Ha Shin, Kwang-Ho Choi, and Chang-Bok Kim, "Deep learning model for prediction rate improvement of stock price Using RNN and LSTM," Journal of KIIT, Vol.15, No.10, pp.9-16, 2017.
  8. Qun Zhuge, Lingyu Xu, and Gaowei Zhang, "LSTM Neural Network with Emotional Analysis for Prediction of Stock Price," Engineering Letters, Vol.25, No.2, 2017.
  9. Baoguang Shi, Xiang Bai, and Cong Yao, "An end-to-end trainable neural network for image-based sequence recognition and its application to scene text recognition," IEEE Transactions on Pattern Analysis and Machine Intelligence, Vo.39, No.11, pp.2298-2304, 2017. https://doi.org/10.1109/TPAMI.2016.2646371
  10. Jaeho Chang and Jechang Jeong, "Topic mining using time axis weighting," in Proceedings of the Korea Data mining Society Spring Conference, 2012.
  11. Yahoo finance [Internet], https://in.finance.yahoo.com/.
  12. Tensorflow [Internet], https://www.tensorflow.org.
  13. Pandas [Internet], https://pandas.pydata.org/.
  14. Anaconda [Internet], https://www.anaconda.com/download.
  15. Predict Stock Prices Using RNN [Internet], https://lilianweng.github.io/lil-log/2017/07/08/predict-stock-prices-using-RNN-part-1.html.