GPU-accelerated industrial anomaly detection

IIT Bhilai M.Tech research combining MSCRED, ConvLSTM, time-series anomaly detection, CUDA programming, im2col/GEMM and a custom PyTorch extension.

Institution
IIT Bhilai
Research
Industrial time series
Acceleration
CUDA · im2col · GEMM
Result
12.68× encoder speed-up

Research problem

Industrial plants generate large volumes of multivariate sensor data. The thesis explored anomaly detection for a bar and rod mill, including HMD flickering, looper behaviour, overshoot, undershoot and cobble-related patterns. The analysis covered approximately 1,860 PLC signals.

The work combined domain-specific signal analysis with a multivariate deep-learning framework. Univariate procedures used operational periods, moving averages, lags and percentage deviation; multivariate detection used reconstruction error from an MSCRED-style architecture.

MSCRED framework

MSCRED models correlations among signals through signature matrices at multiple temporal scales. A convolutional encoder extracts spatial relationships, ConvLSTM layers model temporal behaviour and a decoder reconstructs the expected signal-correlation structure. Large reconstruction errors indicate anomalous behaviour.

SignalsMultivariate industrial time series.
Signature matricesMulti-scale inter-signal correlations.
CNN encoderSpatial feature extraction.
ConvLSTMTemporal dependencies.
DecoderReconstruction-based anomaly score.

Performance bottleneck

Training and inference involved repeated convolution operations across the encoder, ConvLSTM and decoder. I profiled this path and investigated a GPU implementation rather than treating the framework as a black box.

CUDA, im2col and GEMM

Conv2D was transformed into a matrix-multiplication problem using lowering/im2col. Each local convolution window is expanded into a row or column of a larger matrix, allowing the core computation to be expressed as GEMM.

I implemented CUDA-based parallel matrix multiplication and compared two GPU paths:

  • A global-memory implementation.
  • A tiled implementation using GPU shared memory to reduce repeated high-latency global-memory access.

The GPU path was integrated through a custom PyTorch extension, allowing model components to invoke the accelerated computation from the Python training workflow.

Benchmark results

The reported benchmark used 36,000 data points, 30 features, batch size 128 and 32 threads on an NVIDIA RTX A6000 GPU.

ComponentCPUGPU: global memoryGPU: shared memory
Encoder300 s27.492 s23.664 s
ConvLSTM1,200 s909.208 s847.260 s
Total execution2,700 s1,594 s1,481 s
F1 score0.9300.9360.941
  • 12.68× faster encoder execution than the CPU implementation.
  • 1.82× faster total execution, approximately a 45.1% runtime reduction.
  • Comparable predictive quality, with F1 remaining around 0.93–0.94.

Limitations and publication scope

The raw industrial dataset and plant-specific details should not be published without explicit authorisation. A public implementation should use synthetic or anonymised signals while preserving the architecture, CUDA kernels, benchmark methodology and lessons learned.

What I learned

  • Framework-level optimisation requires understanding both model architecture and hardware memory behaviour.
  • im2col improves compatibility with GEMM but increases intermediate memory; tile size and data movement matter.
  • A strong benchmark separates computational speed-up from predictive quality.
  • Custom extensions are most useful when they preserve a clean model-level interface.