Industrial Time-Series Anomaly Detection Project

BOSCH Predictive Maintenance

Detecting anomalies in wire-cutting torque time-series data using distance-based clustering, Dynamic Time Warping, FastDTW, and reconstruction-based deep learning with VAE-LSTM.

Context

BOSCH Wire Cutting

Data Type

Torque Time Series

Task

Anomaly Detection

Models

DTW / FastDTW / VAE-LSTM

Project Overview

This project focused on predictive maintenance for a wire-cutting process in an industrial manufacturing setting. The main goal was to analyze torque measurements over time and identify unusual cutting behavior that may indicate failures or maintenance needs.

The project compared multiple unsupervised anomaly detection approaches for time-series data, including distance-based clustering with Dynamic Time Warping and reconstruction-based anomaly detection with a VAE-LSTM model.

Industrial Motivation

Wire cutting is an essential manufacturing process where quality and precision directly affect the reliability of final components. By monitoring the torque signal during the cutting process, abnormal behavior can be detected before it becomes a larger production or quality issue.

Main objective: detect anomalies and support predictive maintenance in the wire-cutting process using torque/time measurements.

Wire-Cutting Process

The cutter process includes a stator after wire cutting, a wire-cutting station, and a cutting knife. During the process, torque values are recorded over time to capture the mechanical behavior of the cut.

Each cutting cycle contains two rotations. Each rotation lasts approximately 1.5 seconds for a full 360° rotation. The first 360° rotation receives special attention because it corresponds to the main cutting process.

Dataset

The data were collected from the wire-cutting process, stored in a database, and exported in JSON format. The key measured variable was torque, recorded at high frequency with timestamps.

  • Source format: JSON files exported from the industrial data system.
  • Main signal: torque during the cutting process.
  • Sampling interval: one measurement every 0.004 seconds.
  • Cycle structure: two 360° rotations per cutting process.
  • Relevant columns: relative time, angle, part ID, test ID, torque, start/stop time, date, and index by part ID.

Data Preparation

The raw JSON files were consolidated into a single dataframe to make the data easier to analyze, visualize, and model. Unique identifiers were added so that angle and torque values belonging to the same timestamp could be handled separately and reshaped for efficient analysis.

The cleaned dataframe was saved in Parquet format to improve storage efficiency and enable faster loading for large-scale time-series analysis.

Methods

The project explored both distance-based and reconstruction-based anomaly detection methods. This was useful because industrial time-series anomalies can appear either as shape differences between cutting cycles or as high reconstruction errors in a learned sequence model.

Method Group Method Purpose
Distance-Based Time Series K-Means with DTW Cluster torque curves based on temporal shape similarity.
Distance-Based Time Series K-Means with FastDTW Reduce the computational cost of DTW-based similarity comparison.
Reconstruction-Based VAE-LSTM Learn normal sequence structure and detect anomalies by reconstruction error.
Exploratory K-Means, DBSCAN, GMM, Autoencoder Initial experiments to compare clustering and representation learning approaches.

DTW and FastDTW Clustering

Dynamic Time Warping was used because it compares time-series curves based on their shape, even when patterns are shifted or stretched in time. This is useful for torque signals, where the exact timing may vary between cycles while the overall shape remains meaningful.

  • DTW: provided more robust shape-based clustering but was computationally expensive.
  • FastDTW: improved runtime and scalability but did not fully match the clustering quality achieved with DTW.
  • Cluster interpretation: some clusters showed visible anomaly patterns, while others had only minor differences.

VAE-LSTM Reconstruction Model

The VAE-LSTM model was used as a reconstruction-based anomaly detector. The model learns to reconstruct normal torque sequences. If a sequence has a high reconstruction error, it is treated as potentially anomalous.

Architecture

  • Encoder: LSTM layer followed by dense layers for z_mean and z_log_var.
  • Latent space: sampling function adds Gaussian noise to create stochastic latent variables.
  • Decoder: RepeatVector, LSTM layer, and TimeDistributed dense output.
  • Loss: reconstruction loss plus KL divergence loss.

Results

The VAE-LSTM model detected anomalies using reconstruction error. A 98th percentile threshold was used to identify high-error sequences as anomalous. This approach produced a compact set of anomaly candidates for inspection.

40,475 training sequences used for the VAE-LSTM experiment.
4,498 test sequences evaluated for anomaly detection.
90 anomalies detected using the 98th percentile threshold.

VAE-LSTM Threshold

The anomaly detection threshold was set to approximately 0.02536 based on the 98th percentile of reconstruction errors. Sequences above this threshold were flagged as anomalies.

Interpretation

Distance-based clustering helped group similar torque curves and highlight unusual curve shapes. The VAE-LSTM reconstruction approach was useful for detecting deviations from learned normal behavior, especially where anomalies appear as reconstruction-error spikes.

The results suggest that reconstruction-based anomaly detection is a strong direction for predictive maintenance, while DTW-based clustering remains valuable for understanding shape-based groups and visually inspecting abnormal cutting patterns.

Limitations and Future Work

The main limitation is that anomaly detection was mostly unsupervised, meaning detected anomalies still need expert validation. Another limitation is that the project identified anomalous sequences but did not yet localize the exact time window inside each sequence where the anomaly occurs.

  • Future work should localize the exact anomalous window within each torque curve.
  • Forecasting methods could be added to predict when maintenance may be required.
  • More labelled failure cases would allow supervised evaluation.
  • Domain expert feedback would improve anomaly interpretation.

Outcome

This project strengthened my experience with industrial time-series data, predictive maintenance, anomaly detection, sequence modelling, and data preparation for large-scale sensor datasets. It also showed the value of combining classical time-series distance methods with deep learning reconstruction models.

Predictive Maintenance Time Series Anomaly Detection DTW FastDTW VAE-LSTM Industrial Data Torque Signals BOSCH