Abstract
Deep learning models, particularly Convolutional Neural Networks (CNNs), have demonstrated significant potential in identifying complex financial candlestick patterns. However, their "black-box" nature often hinders trust among traders. This paper presents an explainable framework that utilizes Gramian Angular Summation Fields (GASF) to encode price data into images and applies a "Local Search" adversarial attack to identify critical features. The results show that the model aligns with human technical analysis by focusing on specific price bars essential for pattern recognition.
Introduction
Technical analysis relies heavily on visual patterns like the "Morning Star" or "Hammer" to forecast market reversals and trends. While CNNs excel at image recognition, applying them to 1D financial time-series data requires transformation. More importantly, for these models to be actionable in high-stakes trading, they must be interpretable. This research addresses the lack of transparency in financial CNNs by proving that the model's decisions are based on the same logical criteria used by human experts.
Methodology
GASF Encoding
To bridge the gap between 1D price data and 2D convolutional layers, the authors employ Gramian Angular Summation Fields (GASF). This method transforms time-series data (Open, High, Low, Close) into a polar coordinate system to calculate temporal correlations. The resulting matrix preserves temporal dependency, with the main diagonal directly representing the original time series.
CNN Architecture
The framework utilizes a modified LeNet architecture, consisting of two convolutional layers followed by a fully connected layer. This setup is optimized to classify the GASF-encoded images into eight distinct candlestick patterns.
Local Search Adversarial Attack
The core of the paper's explainability lies in the "Local Search" attack. Instead of traditional heatmaps, the authors systematically perturb pixels along the GASF matrix's diagonal. Since these pixels correspond to specific price bars, a successful "attack" (one that changes the model's classification) identifies that specific bar as a critical feature for the model's decision-making process.
Experimental Setup
The study utilized EUR/USD 1-minute price data from 2010 to 2018. The dataset was split into a training set (2010–2016) and a testing set (2016–2018). The model was trained to recognize eight major patterns, with 1,500 samples per pattern and an additional 3,000 samples for non-matching sequences (Label 0).
Results and Discussion
The GASF-CNN model achieved a high classification accuracy of 90.0%. Beyond accuracy, the Local Search Attack revealed significant insights into the model's "reasoning."
- Human-AI Alignment: For complex patterns like the "Morning Star," the model was most sensitive to the final three bars and the preceding trend. This confirms that the CNN effectively "reads" the chart similarly to a human technician.
- Feature Sensitivity: The attack success rate averaged 64.36%, indicating that most classifications were tied to specific, identifiable price bars. Patterns like the "Inverted Hammer" showed high sensitivity (87.9%), whereas "Bullish Engulfing" was more robust to single-bar perturbations.
Conclusion and Future Work
This research demonstrates that CNNs can be both accurate and interpretable in financial contexts. By showing that the model focuses on logically relevant price bars, the authors provide a pathway for building trader trust in automated systems. Future work should expand the pattern library beyond eight types and investigate the model's consistency across different timeframes (e.g., daily or weekly charts) where market noise varies.
Summary updated