Paper commentary
Unsupervised Deep Anomaly Detection for Multi-Sensor Time-Series Signals
- Problem Unsupervised anomaly detection on multi-sensor time series has to capture spatial and temporal dependence while noisy training samples are mixed in with normal ones.
- Method CAE-M couples a deep convolutional autoencoder with an MMD penalty and a memory network of an attention-based BiLSTM and an autoregressive predictor, trained end to end under one compound objective.
- Results Reached a mean F1 of 0.9639 on PAMAP2, and a mean F1 of 0.8616 across eight held-out PAMAP2 subjects.

Fig. 1 : The overview of the proposed CAE-M model.
Original paper · CC BY 4.0 · Yuxin Zhang, Yiqiang Chen, Jindong Wang, Zhiwen Pan · Unsupervised Deep Anomaly Detection for Multi-Sensor Time-Series Signals · Original paper figure · Extracted the figure area from page 4 of the original PDF.Why unsupervised detection on multi-sensor series is hard
Multi-sensor systems in health care and activity recognition produce multivariate time series, so a detector has to follow how the sensors relate across space as well as how each signal changes over time. Anomalies are rare and labelling them is costly, so the study works in the unsupervised setting, where the labels are unseen during training.
Classical tools such as PCA, k-means, OCSVM and autoencoders cannot capture spatial and temporal dependence together, which makes them a poor fit for multivariate signals. Reconstruction-based models assume that anomalous inputs reconstruct worse than normal ones, but a flexible model can also reconstruct abnormal inputs well, which removes that separation.
Noise mixed into the training data makes it harder to separate noisy, normal and abnormal samples, and few earlier methods tackle this together with spatial-temporal modelling. Two-stage pipelines that reduce dimensionality and then predict are trained separately, so each stage can settle in a local optimum without the other's correction.
How CAE-M combines reconstruction and prediction
CAE-M has two subnetworks: a characterization network that compresses each multi-sensor input and reconstructs it, and a memory network that predicts the next feature vector from earlier ones. Both parts are optimized together under one compound objective, so the prediction error also shapes the representation during training. Figure 1 gives the overview of the model, and the chain of states it draws matches the split into these two subnetworks.
The MMD penalty replaces the memory module or the Gaussian mixture model that earlier work used to reduce the effect of noise, and it pulls the distribution of the latent codes toward a target distribution. The authors argue that a latent space regularized this way keeps the autoencoder from fitting noisy and abnormal training samples too closely.
The memory network has a non-linear branch and a linear branch, because non-linear recurrent networks are more expressive, while autoregressive models still give good short-term forecasts. The linear branch is kept in parallel so that the model can use both kinds of predictor on the same features.
Convolutional autoencoder and the MMD penalty
Each sample stacks N signals of length T into a matrix x, and the encoder maps it through convolution and max-pooling layers to a latent code z_f. The decoder uses transposed convolutions to map z_f back to a reconstruction x′ of the same shape as x. The reconstruction error z_r is the squared l2 distance between x and x′, and it is the mean squared error term of the objective.
The MMD term compares the set of latent codes in a batch with samples from a Gaussian target distribution, using a Gaussian kernel over all pairs. Because the number of latent vectors in a batch equals batch size times time steps, the MMD is computed over that whole set at each iteration.
The encoder uses five convolution layers with 32, 64, 64, 32 and 1 kernels of size 4 × 4, max-pooling of size 2 × 2, and ReLU after the convolutions. Pooling and transposed convolutions in this stack are what move between the narrow code and the wide reconstruction.
Attention-based BiLSTM and autoregressive predictor
The memory network takes features z_h that concatenate the latent code and the reconstruction error, and tries to predict z_h from z_1 to z_{h-1}. The BiLSTM runs the sequence in both directions, and each direction has input, forget and output gates together with a cell state that holds the memory.
The two directional outputs are merged. The text says the merge uses summation, although the merged output equation is written as a concatenation, and this article follows the text. A temporal attention layer scores each time step, normalizes the scores with a softmax, and takes a weighted sum of the merged outputs as the non-linear prediction Y_h.
The autoregressive branch forms its prediction from a constant term and a weighted sum of the past values, and it is implemented with a dense layer. The prediction loss adds the squared Frobenius distances of the BiLSTM prediction and the autoregressive prediction, each measured against the true z_h, summed over a batch subsample. The non-linear branch is a BiLSTM with 512 units, attention over h minus 1 steps, dropout of 0.2 and a fully connected layer with 1000 linear units, while the linear branch is a fully connected layer with 1000 linear units.
Joint objective and anomaly threshold
The compound objective adds the reconstruction MSE, the MMD term, the BiLSTM prediction error weighted by λ2, and the autoregressive prediction error weighted by λ3. The paper sets λ1 = e-04, λ2 = 0.5 and λ3 = 0.5 and points to Section 4.8.1 for how these values were chosen.
Training all parts in one pass is intended to avoid the local optima reached when feature extraction and prediction are trained in separate stages. Training uses batches, with Adam as the optimizer and a batch size of 32 in Keras.
After training, the threshold is computed from the training losses as their mean plus a term built from their standard deviation. Training and validation sets contain only normal samples, so the threshold describes normal behaviour, and a test sample whose loss exceeds it is labelled abnormal.
Datasets, baselines and evaluation protocol
Three datasets are used: PAMAP2, the CAP Sleep Database and a private Mental Fatigue Dataset. PAMAP2 has 1,140,000 instances, 27 dimensions and 18 classes, the CAP Sleep Database has 921,700,000 instances, 21 dimensions and 8 classes, and the Mental Fatigue Dataset has 1,458,648 instances, 4 dimensions and 2 classes.
For CAP, healthy subjects are normal and patients with sleep-disordered breathing are anomalous, and for the Mental Fatigue Dataset fatigue samples are anomalous and make up a fifth of the total.
The baselines are KPCA, ABOD, OCSVM, HMM, CNN-LSTM, LSTM-AE, ConvLSTM-COMPOSITE, UODA and MSCRED, and ConvLSTM-AE is ConvLSTM-COMPOSITE without its forecasting decoder. The traditional baselines use hand-crafted features, with 324 features for PAMAP2, 91 for CAP and 23 for the Mental Fatigue Dataset.
Mean precision, mean recall and F1 score are the metrics, averaged over the normal and abnormal classes, because accuracy is a poor choice when the classes are strongly imbalanced. Normal samples are split 5 : 1 : 4 into training, validation and test sets, and anomalous samples appear only in the test set. The CAE-M hyperparameters, such as the time window, neuron counts, learning rate and activation, are selected with Hyperopt, and the time step h is 5 or 10.
Comparison across three datasets
The authors attribute the weaker results of LSTM-AE, MSCRED and ConvLSTM-AE to noisy data, which lets abnormal inputs be reconstructed well. CNN-LSTM has the lowest F1 score on PAMAP2, at 0.5968, which the authors link to the need for extra constraints in prediction-based detection.
The strongest baseline on CAP is OCSVM with a mean F1 of 0.9263, and the authors attribute the good showing of OCSVM and HMM to dimensionality reduction. The discussion gives 36 dimensions for PAMAP2, while Table 1 lists 27, and the dimension-reduction comparison refers to that count.
MSCRED was run on CAP with batch size 1 from its open-source code, and its loss did not converge during training, so its CAP result reflects unconverged training.
The authors note that fatigue labels are hard to assign by hand, so the data may hold noise or misclassified patterns, and they say UODA, MSCRED and ConvLSTM handle such training noise better.
The authors report a Wilcoxon signed rank test p-value of 0.0077 for CAE-M against the other methods, and the text describes it as an average p-value over the baselines.
Per-stage detection on the CAP Sleep Database
The fine-grained analysis splits CAP detection by WAKE, S1 to S4 and REM, and compares four traditional methods with three deep methods. CAE-M's stage-level mean F1 is 0.9961 for WAKE, 0.9954 for S1, 0.9950 for S2, 0.9063 for S3, 0.9895 for S4 and 0.9813 for REM.
ConvLSTM-COMP's stage-level mean F1 is 0.9830 for WAKE, 0.9864 for S1, 0.9188 for S2, 0.9217 for S3, 0.9023 for S4 and 0.9810 for REM. On S3, CAE-M's mean F1 of 0.9063 is below both ConvLSTM-COMP's 0.9217 and OCSVM's 0.9605.
The authors describe ABOD as unstable across stages, with a highest F1 of 0.92 on WAKE and a lowest of 0.59 on REM. The authors describe the architecture as the most robust across the same experiment settings, a description that holds for most stages but not for S3.
Leave-one-subject-out results on PAMAP2
Leave One Subject Out holds out one of the eight PAMAP2 subjects as the test set, which checks generalization to a person the model has not seen. The authors motivate the protocol by the concern that a model trained with the same subject in both sets can learn that subject's idiosyncratic patterns.
CAE-M's best, worst and mean F1 over the eight subjects are 0.9433, 0.8009 and 0.8616. ConvLSTM-COMP's mean F1 is 0.8493, UODA's is 0.7984 and ABOD's is 0.7706, with UODA's worst at 0.5938 and ABOD's worst at 0.6093. The authors note that UODA and ConvLSTM-COMPOSITE perform well on some subjects but drop to 0.59 and 0.70 on others.
On subject 1 with repeated measurements, mean F1 is 0.8770 ±0.012 for CAE-M, 0.8488 ±0.019 for ConvLSTM-COMP, 0.7782 ±0.031 for UODA and 0.6090 ±0.000 for ABOD.
What each component contributes
Five variants remove one part each: w/o Pre drops both predictors, w/o Rec+MMD drops the reconstruction error and MMD, w/o ATTENTION drops attention, w/o AR drops the autoregressive branch and w/o MMD drops the MMD term. Figure 2(b) shows the ablation study in the same figure as the LOSO evaluation.
On PAMAP2, the full model reaches a mean F1 of 0.9639, against 0.8063 without prediction, 0.5563 without reconstruction and MMD, 0.9213 without attention, 0.8872 without AR and 0.9493 without MMD. Removing reconstruction error and MMD gives the largest drop on PAMAP2, and removing AR lowers mean F1 from 0.9639 to 0.8872 in this comparison.
On CAP, the full model reaches 0.9961 mean F1, against 0.9506 without AR, 0.9271 without attention, 0.9253 without MMD, 0.8199 without prediction and 0.8303 without reconstruction and MMD. On the Mental Fatigue Dataset, the full model reaches 0.9960, against 0.9047 without AR, 0.9578 without attention, 0.9347 without MMD, 0.6050 without prediction and 0.6930 without reconstruction and MMD.
In every dataset column of Table 6, each removal gives a lower mean F1 than the full model, so these results support keeping each component under this metric and these three datasets. The authors describe attention and MMD as giving large gains on all datasets, and the same table shows that removing either one lowers the score.
Behaviour under noisy training data
The authors inject Gaussian noise with mean 0 and standard deviation 0.3 into a random selection of training samples, with noisy ratios from 1% to 30%. Only three methods are compared on PAMAP2: UODA, ConvLSTM-COMPOSITE and CAE-M.
As the noise increases, all three methods lose performance, and the authors report that CAE-M's F1, precision and recall show little decline. The authors describe CAE-M as still ahead of the other two methods across these noise levels.
Limitations
The experiments cover three datasets, and one of them is private, with the Mental Fatigue Dataset drawn from six healthy young subjects. The subject-independent leave-one-subject-out check is run only on PAMAP2, with eight subjects.
The noise study covers PAMAP2 and three methods only. On CAP's S3 stage, CAE-M is below ConvLSTM-COMP and OCSVM, so the robustness claim across stages does not hold for every stage.
The MSCRED result on CAP comes from unconverged training with batch size 1, so that comparison is not a converged one. The text does not state how many repetitions the ± values on subject 1 are based on. The parameter sensitivity analysis is introduced in Section 4.8.1, and this article does not report its results.
Paper info
- Authors
- Yuxin Zhang, Yiqiang Chen, Jindong Wang, Zhiwen Pan
- Venue
- arXiv · Preprint
- First published
- 2021-7-27
- Added
- 2026-11-6
- Updated
- 2021-8-2
- Version
- v2
- arXiv
- 2107.12626
- Category
- cs.AI · cs.LG · eess.SP
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Nowadays, multi-sensor technologies are applied in many fields, e.g., Health Care (HC), Human Activity Recognition (HAR), and Industrial Control System (ICS). These sensors can generate a substantial amount of multivariate time-series data. Unsupervised anomaly detection on multi-sensor time-series data has been proven critical in machine learning researches. The key challenge is to discover generalized normal patterns by capturing spatial-temporal correlation in multi-sensor data. Beyond this challenge, the noisy data is often intertwined with the training data, which is likely to mislead the model by making it hard to distinguish between the normal, abnormal, and noisy data. Few of previous researches can jointly address these two challenges. In this paper, we propose a novel deep learning-based anomaly detection algorithm called Deep Convolutional Autoencoding Memory network (CAE-M). We first build a Deep Convolutional Autoencoder to characterize spatial dependence of multi-sensor data with a Maximum Mean Discrepancy (MMD) to better distinguish between the noisy, normal, and abnormal data. Then, we construct a Memory Network consisting of linear (Autoregressive Model) and non-linear predictions (Bidirectional LSTM with Attention) to capture temporal dependence from time-series data. Finally, CAE-M jointly optimizes these two subnetworks. We empirically compare the proposed approach with several state-of-the-art anomaly detection methods on HAR and HC datasets. Experimental results demonstrate that our proposed model outperforms these existing methods.
Quote from the paper
Yuxin Zhang, Yiqiang Chen, Jindong Wang, Zhiwen Pan (2021). Unsupervised Deep Anomaly Detection for Multi-Sensor Time-Series Signals. arXiv:2107.12626v2. https://arxiv.org/abs/2107.12626v2
BibTeX
@misc{zhang2021unsupervised,
title = {{Unsupervised Deep Anomaly Detection for Multi-Sensor Time-Series Signals}},
author = {Yuxin Zhang and Yiqiang Chen and Jindong Wang and Zhiwen Pan},
year = {2021},
eprint = {2107.12626},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2107.12626v2}
}