Stock Trend Prediction: A Semantic Segmentation Approach

Shima Nabiee,Nader Bagherzadeh
2023-03-09
Abstract:Market financial forecasting is a trending area in deep learning. Deep learning models are capable of tackling the classic challenges in stock market data, such as its extremely complicated dynamics as well as long-term temporal correlation. To capture the temporal relationship among these time series, recurrent neural networks are employed. However, it is difficult for recurrent models to learn to keep track of long-term information. Convolutional Neural Networks have been utilized to better capture the dynamics and extract features for both short- and long-term forecasting. However, semantic segmentation and its well-designed fully convolutional networks have never been studied for time-series dense classification. We present a novel approach to predict long-term daily stock price change trends with fully 2D-convolutional encoder-decoders. We generate input frames with daily prices for a time-frame of T days. The aim is to predict future trends by pixel-wise classification of the current price frame. We propose a hierarchical CNN structure to encode multiple price frames to multiscale latent representation in parallel using Atrous Spatial Pyramid Pooling blocks and take that temporal coarse feature stacks into account in the decoding stages. Our hierarchical structure of CNNs makes it capable of capturing both long and short-term temporal relationships effectively. The effect of increasing the input time horizon via incrementing parallel encoders has been studied with interesting and substantial changes in the output segmentation masks. We achieve overall accuracy and AUC of %78.18 and 0.88 for joint trend prediction over the next 20 days, surpassing other semantic segmentation approaches. We compared our proposed model with several deep models specifically designed for technical analysis and found that for different output horizons, our proposed models outperformed other models.
Statistical Finance,Computer Vision and Pattern Recognition,Machine Learning
What problem does this paper attempt to address?
The paper aims to address the problem of stock price trend prediction, particularly by leveraging deep learning techniques to improve the accuracy of both long-term and short-term trend predictions. The authors propose a novel approach that applies semantic segmentation techniques to time series data to predict changes in stock price trends. Specifically, the main contributions of the paper include: 1. **Proposing a 2D price matrix**: A 2D matrix is formed by the daily opening price, highest price, lowest price, and closing price, simulating the input style of an image for the semantic segmentation task. The final segmentation mask corresponds to the price trends over the next T days. 2. **Designing a fully convolutional encoder-decoder network**: This network can effectively extract and integrate short-term and long-term patterns. By using Atrous Spatial Pyramid Pooling (ASPP) blocks, the network can extract patterns at different receptive fields and obtain deep coarse-grained feature stacks from multiple consecutive price frames through multi-level downsampling. After fusing the extracted features, these deep coarse-grained feature maps are upsampled to generate a complete segmentation map, which is used to predict the price change direction for the next T days. 3. **Experimental validation**: Through the study of different input time ranges, it was found that as the input time range increases, the overall results improve, and the most accurate prediction date gradually moves to the middle of the output time range. Additionally, compared to previous recursive and feedforward models, the proposed network shows significant advantages in trend prediction performance evaluation and semantic segmentation evaluation. In summary, this paper proposes a novel semantic segmentation-based method to predict stock price trends and demonstrates its effectiveness through experiments. This method not only improves prediction accuracy but also showcases the advantages of using convolutional neural networks in handling time series data.