Generic Timeseries Anomaly Detection
Introduction
AI-based anomaly detection system using a simple synthetic waveform dataset. Unlike classification models, the autoencoder is trained only on normal data and learns to reconstruct normal patterns. At inference, the reconstruction error between the input and output is compared against a threshold - a high error indicates an anomaly.
Dataset and Model Details
Dataset
TI has created a synthetic waveform dataset based on a combined sinusoidal pattern. The normal signal follows y = 1.2 sin(2pift) + 0.8 cos(2pift) with a base frequency of 1.0 Hz.
Parameter |
Value |
|---|---|
Sensor |
Signal readings |
Sampling Rate |
100 Hz |
Channels |
1 (Signal magnitude) |
Samples per File |
5,000 samples |
Total Files |
92 files (60 Normal, 32 Anomaly) |
The dataset is divided into two classes:
Normal: Standard sinusoidal pattern
Anomaly: Includes four types of deviations - faster frequency, slower frequency, higher amplitude, and lower amplitude
Important: For anomaly detection, the model is trained only on normal data. Anomaly samples are used exclusively for testing.
Model Architecture
Autoencoder model AD_17k with ~ 17,000 parameters. The encoder compresses the input signal into a compact representation, and the decoder reconstructs the signal.
Inference run on Cortex M33 CPU
Input Features
The model takes 4D input (N,C,H,W):
N (1): batch size which is restricted to 1
C (1): channels which is 1 for signal
H (100): samples of timeseries signal which is 100 in this example
W (1): width of samples is restricted to 1 for timeseries applications
Output Classes
Reconstructed signal of the same shape as the input (1, 1, 100, 1). The reconstruction error (MSE between input and output) is then compared against a threshold to determine if anomaly is detected.
Feature Extraction Configuration
For this anomaly detection task, the raw signal with downsampling and simple windowing approach produces the best results. The autoencoder learns to reconstruct the temporal shape of the raw waveform, so preserving the original signal structure is critical.
Key parameters
FE_NUM_FRAME_CONCAT : 1 i.e. no frame concatenation
RECONSTRUCTION_ERROR_THRESHOLD: Threshold for anomaly decision