Evaluating data augmentation for financial time series classification

Elizabeth Fons, Paula Dawson, Xiao-Jun Zeng, John A. Keane, Alexandros IosifidisarXiv 2020

Abstract: Data augmentation methods in combination with deep neural networks have been used extensively in computer vision on classification tasks, achieving great success; however, their use in time series classification is still at an early stage. This is even more so in the field of financial prediction, where data tends to be small, noisy and non-stationary. In this paper we evaluate several augmentation methods applied to stocks datasets using two state-of-the-art deep learning models. The results show that several augmentation methods significantly improve financial performance when used in combination with a trading strategy. For a relatively small dataset ($\approx30K$ samples), augmentation methods achieve up to $400\%$ improvement in risk adjusted return performance; for a larger stock dataset ($\approx300K$ samples), results show up to $40\%$ improvement.

Introduction

Deep learning models are notoriously "data-hungry," requiring vast amounts of information to learn complex patterns without overfitting. In fields like computer vision, researchers have access to millions of labeled images. However, in finance, we are constrained by the "arrow of time." For example, ten years of daily stock data yields only about 2,500 samples. This scarcity, combined with the high noise-to-signal ratio and non-stationarity of financial markets, makes training robust deep neural networks exceptionally challenging.

While data augmentation (DA)—the process of creating synthetic training examples from existing ones—is standard practice in image recognition, its application to financial time series is still in its infancy. This study systematically evaluates whether these synthetic sequences help models learn generalizable patterns or if they merely introduce more noise into a chaotic environment.

Methodology

Datasets and Models

The study utilized the S&P 500 dataset, covering daily returns from 1990 to 2018. To investigate how data volume affects the utility of augmentation, two subsets were created:

  1. Full S&P 500: Approximately 255,000 training samples.
  2. 50 Stocks Dataset: A "small" subset of the 50 largest stocks by market cap, totaling approximately 25,500 training samples.

These datasets were tested on two architectures: the standard Long Short-Term Memory (LSTM) network and the Temporal Logistic Neural Bag-of-Features (TLo-NBoF), a newer architecture designed to capture local temporal features.

Data Augmentation Techniques

The authors evaluated eight distinct DA techniques, many adapted from computer vision but tailored for the unique properties of time series data:

  • Magnify: A variation of window slicing where a sub-section of the series is zoomed in or out.
  • Time Warping: Distorting the time intervals between samples using smooth curves to alter the speed of price movements.
  • Jittering: Adding Gaussian noise to the data to simulate market volatility.
  • SPAWNER: A complex method that averages two different patterns to create a new "sub-optimal" sequence.
  • Reverse, Pool, Quantise, and Convolve: Various transformations involving flipping the series, downsampling, rounding values, or smoothing via kernels.
Visual comparison of the eight data augmentation techniques applied to a sample sine wave.

Results and Discussion

Financial vs. Classification Metrics

A key finding of the study was that augmentation methods did not drastically change raw classification accuracy or F1 scores. However, they significantly improved financial performance metrics, specifically the Information Ratio (IR) and Downside Risk-Adjusted Return. This suggests that DA helps models become more "confident" or accurate on the specific samples that drive portfolio performance, even if overall accuracy remains near the 50% mark typical of financial forecasting.

Performance Leaders

"Magnify" and "Time Warping" emerged as the most consistent winners. By slightly altering the magnitude or the timing of price movements, these methods help the model learn the underlying "shape" of a trend rather than memorizing specific price points. Conversely, techniques like "Reverse"—which is highly effective in computer vision—were largely ineffective or detrimental, likely because market dynamics like volatility clustering do not function the same way in reverse.

Impact of Scale

As hypothesized, DA provided the most significant boost to the smaller dataset. Using the TLo-NBoF model with "Magnify" augmentation resulted in a 400% improvement in the Information Ratio compared to the baseline. For the full S&P 500 dataset, the LSTM model still saw a substantial 40% improvement in IR when using "Time Warping" and "Magnify."

Conclusion

Data augmentation is a powerful tool for improving the financial performance of deep learning models in stock classification, particularly when data is scarce. While not all computer vision techniques translate directly to finance, methods that preserve the temporal logic of the market—like Magnify and Time Warping—offer significant advantages. Future work should focus on developing finance-specific augmentation methods and exploring how these techniques interact with high-frequency data and different neural architectures.

Summary updated

BibTeX
@misc{fons2020evaluating,
  author = {Elizabeth Fons and Paula Dawson and Xiao-Jun Zeng and John A. Keane and Alexandros Iosifidis},
  title = {{Evaluating data augmentation for financial time series classification}},
  year = {2020},
  eprint = {2010.15111},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.15111},
}
Figure