Channel and Spatial Attention CNN: Predicting Price Trends from Images

36 Pages Posted: 2 Aug 2022

See all articles by Ruixun Zhang

Ruixun Zhang

Peking University; MIT Laboratory for Financial Engineering

Guanglian Lin

Nankai University

Chaoyi Zhao

Peking University

Date Written: July 27, 2022

Abstract

Deep learning has been successfully applied for predicting asset prices using financial time series data. However, image-based deep learning models excel at extracting spatial information from images and their potential in financial applications has not been fully explored. Here we propose a new model---channel and spatial attention convolutional neural network (CS-ACNN)---for price trend prediction that takes arbitrary images constructed from financial time series data as input. The model incorporates attention mechanisms between convolutional layers to focus on specific areas of each image that are the most relevant for price trends. CS-ACNN outperforms benchmarks on exchange-traded funds (ETF) data in terms of both model classification metrics and investment profitability, achieving out-of-sample Sharpe ratios ranging from 1.57 to 3.03 after accounting for transaction costs. In addition, we confirm that the images constructed based on our methodology lead to better performance when compared to models based on traditional time series data. Finally, the model learns visual patterns that are consistent with traditional technical analysis, providing an economic rationale for learned patterns and allowing investors to interpret the model.

Keywords: Price trend prediction, Convolutional neural network (CNN), Attention, Image, Interpretability

JEL Classification: G12, G17, C45, C53

Suggested Citation

Zhang, Ruixun and Lin, Guanglian and Zhao, Chaoyi, Channel and Spatial Attention CNN: Predicting Price Trends from Images (July 27, 2022). Available at SSRN: https://ssrn.com/abstract=4173579 or http://dx.doi.org/10.2139/ssrn.4173579

Ruixun Zhang (Contact Author)

Peking University ( email )

5 Yiheyuan Road
Beijing, Beijing 100871
China

HOME PAGE: http://www.math.pku.edu.cn/teachers/ZhangRuixun%20/index.html

MIT Laboratory for Financial Engineering

77 Massachusetts Ave. E62-663
Cambridge, MA 02142
United States

Guanglian Lin

Nankai University ( email )

Balitai, 94 weijing Rd
Tianjin, Tianjin 300071

Chaoyi Zhao

Peking University ( email )

No. 5 Yiheyuan Road
Beijing
China

HOME PAGE: http://zhaochaoyi.github.io/

Do you have a job opening that you would like to promote on SSRN?

Paper statistics

Downloads
61
Abstract Views
186
rank
487,488
PlumX Metrics