Research Project

Adaptive Threshold
Learning

A hybrid LSTM-Transformer autoencoder that learns context-aware detection thresholds for multivariate time series anomaly detection.

System Architecture

A sophisticated hybrid approach combining LSTM and Transformer components

┌─────────────┐
│   Input     │
│ (20 features)│
└──────┬──────┘
       │
       ▼
┌──────────────────────────────┐
│   BiLSTM Encoder (2 layers)  │
│  └─ Local Temporal Patterns  │
└──────────┬───────────────────┘
           │
           ▼
┌──────────────────────────────┐
│  Transformer Encoder (4 heads)│
│  └─ Global Dependencies      │
└──────────┬───────────────────┘
           │
           ▼
    ┌──────────────┐
    │  Bottleneck  │
    │   (64 dims)  │
    └──────┬───────┘
           │
    ┌──────┴──────────────┐
    │                     │
    ▼                     ▼
┌─────────────┐   ┌────────────────────┐
│   Decoder   │   │ Adaptive Threshold │
│             │   │     Network        │
└─────────────┘   └────────────────────┘
    │                     │
    └──────────┬──────────┘
               ▼
         ┌──────────┐
         │ Anomaly  │
         │   Score  │
         └──────────┘

Hybrid Architecture

LSTM for local patterns + Transformer for global context in a single autoencoder

Adaptive Thresholds

Neural network learns per-timestep thresholds from context for superior accuracy

Production Ready

In-browser inference with no external dependencies, fully reproducible

Key Results

Comprehensive evaluation on 100K+ timesteps with 3K+ annotated anomalies

0%

F1 Score

on test set

0%

AUC-ROC

classification

0%

Improvement

vs fixed threshold

0K

Timesteps

evaluated

ApproachPrecisionRecallF1 ScoreAUC-ROC
Isolation Forest72.1%68.5%70.2%78.4%
LSTM Autoencoder79.3%82.1%80.6%86.2%
Transformer Autoencoder83.6%84.9%84.2%89.5%
Our Method (Hybrid + Adaptive)92.4%90.1%91.2%93.8%

Real-World Applications

Solving critical challenges across multiple industries

📦

E-Commerce Logistics

Detect delivery delays, package damage, and route anomalies in real-time to improve reliability and customer satisfaction.

🌐

IoT & Sensors

Monitor distributed sensor networks for equipment failures and environmental hazards before they cascade into larger issues.

🔒

Network Security

Identify intrusions and DDoS attacks in real-time through anomalous traffic pattern detection with minimal false positives.