Time Series Anomaly Detection via LSTM Autoencoders: A Predictive Analytics Framework
摘要
The goal of this project is to detect anomalies in financial market data using an LSTM Autoencoder model created with TensorFlow Keras API. The dataset is made up of daily index values from multiple decades and is divided into two sets: training (80%) and testing (20%). The LSTM Autoencoder is a form of RNN that uses an encoder–decoder architecture to replicate input sequences and identify common patterns in data. Anomalies are discovered by calculating the reconstruction error, which is the difference between the original and rebuilt sequence. A threshold derived from the training error distribution indicates significant deviations from normal data. A threshold derived from the training error distribution identifies large departures from normal data. Data points with reconstruction errors that exceed this threshold are classified as anomalies. The capacity of the model to distinguish between normal and anomalous data items is evaluated using precision, recall, and F1-score. Visualizing training and validation loss, as well as highlighting anomalies, reveals unexpected behavior.