3

I want to try CNN in the task of stock chart pattern recognition. I suspect that feeding a line chart won't work because the image will have a lot of empty pixels.

What time series encoding options are available to get a lossless, dense image?

Alisher
  • 33
  • 1
  • 3

2 Answers2

3

You can encode time series to images using image encoding methods like Recurrence Plots (RP), Gramian Angular Field (GAF), Markov Transition Field (MTF).

See the following article:

Estebsari, A.; Rajabi, R. Single Residential Load Forecasting Using Deep Learning and Image Encoding Techniques. Electronics 2020, 9, 68. https://doi.org/10.3390/electronics9010068

Roozi
  • 131
  • 2
2

1D CNN :

enter image description here

You do not have to convert it into an image for CNN. CNN can work directly on time-series (1D Convolution Network).

More Details :

What is a 1D Convolutional Layer in Deep Learning?

Examples for time-series :

https://towardsdatascience.com/stock-price-prediction-system-using-1d-cnn-with-tensorflow-js-machine-learning-easy-and-fun-fe5323e68ffb

https://jeddy92.github.io/JEddy92.github.io/ts_seq2seq_conv/

https://machinelearningmastery.com/how-to-develop-convolutional-neural-network-models-for-time-series-forecasting/

Image as input to CNN

Image can be fed into CNN like any other image. CNN will learn to ignore all whitespace and tune first few filters as edge-detection filters.

In such models, output variable will be the direction or a band of percentages (say next stock tick will be in a band of 0 - 1% or 0 -1%).

Shamit Verma
  • 2,319
  • 1
  • 10
  • 14