Skip to content

Wavelet LSTM

LSTM network for sequential pattern recognition on wavelet features.

Performance

Metric Value Rank
ROC AUC 0.5249 21st
F1 Score 0.0000 Failed
Accuracy 0.6634 17th
Recall 0.0000 Failed
Train Time 161s Medium

Model Failed

This model predicted all zeros — it learned to always predict "no break" regardless of input.

Architecture

flowchart TD
    A["🌊 Wavelet Features"] --> B["📊 Sequence<br/>(10 timesteps)"]

    B --> C["🔄 LSTM Layer 1<br/>64 units, return_sequences=True"]
    C --> C1["Dropout(0.3) + BatchNorm"]

    C1 --> D["🔄 LSTM Layer 2<br/>32 units, return_sequences=True"]
    D --> D1["Dropout(0.3) + BatchNorm"]

    D1 --> E["🔄 LSTM Layer 3<br/>16 units, return_sequences=False"]
    E --> E1["Dropout(0.2)"]

    E1 --> F["🧠 Dense(8, relu)"]
    F --> F1["Dropout(0.2)"]

    F1 --> G["📈 Dense(1, sigmoid)"]

    style A fill:#e1f5fe
    style C fill:#fff3e0
    style D fill:#fff3e0
    style E fill:#fff3e0
    style G fill:#e8f5e9

LSTM Cell Equations

\[ \begin{align} f_t &= \sigma(W_f \cdot [h_{t-1}, x_t] + b_f) \\ i_t &= \sigma(W_i \cdot [h_{t-1}, x_t] + b_i) \\ \tilde{C}_t &= \tanh(W_C \cdot [h_{t-1}, x_t] + b_C) \\ C_t &= f_t \odot C_{t-1} + i_t \odot \tilde{C}_t \\ o_t &= \sigma(W_o \cdot [h_{t-1}, x_t] + b_o) \\ h_t &= o_t \odot \tanh(C_t) \end{align} \]

Why It Failed

1. Univariate Features Insufficient

LSTMs are designed to capture temporal dependencies across multiple correlated variables. With only wavelet coefficients from a single series, there's not enough signal.

2. Class Imbalance

With ~70% of samples being "no break", the model learned to predict the majority class to minimize loss.

3. Long-term Dependency Limitations

Despite being designed for long sequences, LSTMs fail to memorize long sequential information effectively for this task.

What Would Help

  • Add exogenous variables: Related assets, macroeconomic indicators
  • Class-weighted loss: Penalize false negatives more heavily
  • Different architecture: Attention mechanisms, TCN

Usage

cd wavelet_lstm
python main.py --mode train --data-dir /path/to/data --model-path ./model.pt

Near Random Performance

This model achieved near-random AUC (~0.50) and is included for research comparison purposes.