Most unsupervised anomaly detectors for sensor streams follow the same recipe. A model predicts or reconstructs each sensor channel, the leftover error (the "residual") is summed into a score, and an alarm fires when the score crosses a threshold. That summation is where much of the fragility comes from. Background noise on every channel adds into the score, and so does slow sensor drift. A single malfunctioning sensor can dominate the total. Thresholds tuned offline then either flood operators with false alarms or miss real events. We propose to change what gets summed. Before scoring, we treat each channel's residual as "sparse anomaly plus dense noise" and recover only the anomaly part. The recovery uses a wavelet transform, a multi-scale decomposition in which spikes, steps, and bursts occupy few coefficients while noise spreads over all of them. It also uses a smooth shrinkage function whose threshold and shape are chosen per channel, per scale, and per window by an unbiased estimate of error that needs no clean data and no labels.
Put simply, the anomaly score should be the energy of a label-free, risk-optimal estimate of the anomaly component, not the raw residual. Noise and drift are then suppressed channel by channel before the channels are combined, and the final alarm threshold is set on a quantity whose nominal behaviour stays stable when sensors degrade.
Core Claim
Stein's Unbiased Risk Estimate (SURE) scores any denoiser by two terms: how far its output sits from the noisy input, and how strongly the output reacts to small input changes (the divergence). It estimates mean squared error from noisy data alone. It has been used to pick thresholds on the fly for every incoming vector. BEACHES does this for soft thresholding of wireless channel vectors, with an $O(B\log B)$ sort-and-scan search running on an FPGA. It has also been extended to shrinkage families with a shape parameter under unknown noise level: Adaptive Shrinkage of Singular Values tunes a soft-to-hard continuum over singular values with a generalized SURE. Separately, "hybrid" shrinkage operators have been designed that are continuous, smooth, and approach the identity for large inputs. Examples are Improved Wavelet Threshold for Image De-noising and the weighting function of De-noising Algorithm of Modified Thresholding Function Based On the Best Basis of Wavelet Packet. These avoid both the ringing of hard thresholding and the constant shrinkage bias of soft thresholding, but their shape parameters are set by hand. None of this work concerns anomaly detection. The residual-filtering use we propose appears nowhere in the file (gap 2 of its summary).
A reviewer should object here. Shrinking a single coefficient changes its size but not its rank order, so shrinkage by itself cannot improve a pointwise detector. The benefit we claim comes from aggregation. The score sums reconstructed anomaly energy across scales, over a short window, and across channels. In that sum, zeroing thousands of pure-noise coefficients keeps dense noise and drift from accumulating. Per-channel risk-optimal thresholds weight channels by their estimated noise level. Removing the constant bias of soft shrinkage stops scale-dependent thresholds from arbitrarily reweighting the scales against each other. The testable claim is the following. Under the noise, drift, and faulty-sensor stress tests of Benchmarking IoT Time-Series AD with Event-Level Augmentations, a simple reconstruction model with this scoring front-end should lose much less detection quality than the same model with raw-residual scoring. It should also lose less than the model with the dynamic Gaussian scoring (Gauss-D) that An Evaluation of Anomaly Detection and Diagnosis in Multivariate Time Series found to matter more than architecture.
Research Program
The pipeline has four parts. The base detector is the univariate autoencoder (a per-channel model that learns to reconstruct normal windows) that Garg et al. found strong. Its per-channel residual over a sliding window is decomposed with an orthonormal Haar wavelet transform. Cycle spinning, which averages over time shifts, removes dependence on where the window starts.
Each wavelet coefficient $x$ at scale $j$ is shrunk by a smooth two-parameter operator. Our leading candidate is $\eta(x;\lambda,\gamma)=x\,(1-e^{-(|x|/\lambda)^{\gamma}})$, where $\lambda$ sets the threshold and $\gamma$ sets how sharply the operator moves from killing a coefficient to keeping it. The operator is differentiable everywhere, tends to the identity for $|x|\gg\lambda$, and approaches hard thresholding as $\gamma\to\infty$. The operator of Zhang et al. is a second candidate with the same properties. Because the transform is orthonormal and the operator acts coefficient by coefficient, SURE for scale $j$ with $n_j$ coefficients and noise level $\sigma_j$ has a closed form:
$$\mathrm{SURE}_j(\lambda,\gamma)=\sum_{i=1}^{n_j}\Big[(\eta(x_i)-x_i)^2+2\sigma_j^2\,\eta'(x_i)\Big]-n_j\sigma_j^2 .$$
The smoothness of $\eta$ is what makes the term $\eta'$ an ordinary derivative. With hard thresholding it would involve point masses. For each small grid of $\gamma$ values, $\lambda$ is found with a sort-and-scan search in the style of BEACHES, so the per-window cost stays at $O(n_j\log n_j)$.
The noise level $\sigma_j$ is unknown and drifts. We compare three ways to set it. The first is the classical median-absolute-deviation estimate on the finest scale. The second jointly minimizes a generalized SURE, as in Josse and Sardy. The third is an expected-zero-divergence constraint in the style of UNSURE, whose multiplier converges to a conservative noise estimate. UNSURE reports gains when the noise level is misspecified.
Standard SURE thresholds are known to be too low when the signal is extremely sparse, and anomalies are very sparse. Following the node-dependent rule in A wavelet based noise reduction algorithm for speech signal corrupted by coloured noise, we therefore fall back to the universal threshold whenever a sparsity test says a scale contains essentially no signal.
The score is the energy of the inverse-transformed anomaly estimate, summed over channels. The per-channel noise estimates are logged as a by-product. A channel whose estimated noise jumps relative to its own history is flagged, and its contribution is capped. This gives an automatic version of the faulty-sensor ("toxic sensor") masking that the IoT benchmark found by hand. Finally, the alarm threshold comes from a Generalized Pareto fit to the upper tail of nominal scores at a target false-alarm rate, as in the extreme-value procedure of A Feature‐Based Procedure for Detecting Technical Outliers in Water‐Quality Data From In Situ Sensors. The tail is refit on a rolling window.
Baselines
The naive reference point is the same univariate autoencoder scored by raw residual error with a static threshold. The static threshold is set on validation data at the same target false-alarm rate. It measures how much any adaptive scoring buys.
The strongest existing method on the question we ask is the same autoencoder with Gauss-D scoring from Garg et al. Gauss-D adapts a Gaussian mean and variance to local test-time behaviour. That paper found this combination achieved the best average rank across seven datasets, beating graph and recurrent architectures. Its individual F1 tables are truncated in our file, so there is no reported result found on Lacuna for Gauss-D's numeric scores. We will rerun it ourselves.
For heavier architectures under stress, the reference numbers come from the IoT benchmark. There, GBAD's F1 on SWaT drops from 0.804 to 0.677 under additive noise, and MTAD-GAT's drops from 0.762 to 0.756. On the turbogenerator data, manually masking one toxic sensor raised GBAD from 0.38 to 0.58. TFCL reports 92.50% F1 on SWaT and 92.44% on WADI. The file indicates these are point-adjusted figures, which Towards Unbiased Evaluation of Time-series Anomaly Detector shows can be inflated above 0.75 even for random scores. We therefore cite them only as context and do not treat them as targets.
Fairness requires several controls. All methods share the base model where applicable, the same training splits, the same augmentation seeds, and the same tail-fitting threshold stage. Each method gets an equal hyperparameter budget of 50 configurations, and every method is tuned on validation data without labels from the test period.
Two ablations isolate the key ingredient. The first keeps the full SURE machinery but replaces the hybrid operator with soft thresholding, which is essentially BEACHES applied to residuals. The second keeps the hybrid operator but fixes $(\lambda,\gamma)$ globally from validation data. A further ablation removes the wavelet transform and shrinks the residual pointwise. That tests the aggregation argument directly, since pointwise shrinkage should give no gain.
We count the method as beating Gauss-D if its mean composite F-score ($Fc_1$) and balanced point-adjusted F1 ($F1_{BA}$) under the drift and noise augmentations exceed Gauss-D's by more than the seed-to-seed spread. Clean-data performance must be no worse, and the nominal false-alarm rate must stay within a factor of two of target where Gauss-D's does not.
Why not just…?
Why not just use Gauss-D dynamic scoring, which already adapts to local variance? This is the real threat. Gauss-D rescales the whole residual by one local variance. It cannot separate a sparse event from dense noise within a window, and it has no mechanism to notice that one channel's noise has exploded. Whether that matters in practice is exactly what the head-to-head under the IoT benchmark's noise, drift, and faulty-sensor augmentations tests. If Gauss-D matches our method there, the conclusion is that per-scale shrinkage adds nothing beyond variance normalization. We would report that as the finding.
Why not just apply standard wavelet denoising with a median-absolute-deviation noise estimate and the universal threshold? This classical keep-or-kill rule is cheap and already sparsity-aware. The denoising literature reports that fixed soft and hard rules underperform smooth operators by roughly 1 to 6 dB. Examples are 22.64 and 23.21 dB versus 26.46 dB PSNR in Zhang et al., and 23.06 and 27.70 versus 28.86 SNR on Heavysine in Chen et al. Those are reconstruction metrics, though, not detection metrics. Our fixed-parameter and soft-SURE ablations include this baseline explicitly. If it ties with our method on $Fc_1$, the risk-tuning is unnecessary.
Why not just put a rolling tail fit or $\mu+k\sigma$ rule directly on the raw score? Tail fits assume the nominal score distribution is stationary. The IoT benchmark shows drift breaks density-based models, with F1 falling from about 0.75 to about 0.57. We keep the tail fit as the final stage of every method. The comparison between raw-score and shrunk-score inputs to the same tail fit therefore isolates whether the front-end stabilizes the nominal tail.
Proposed Experiments
We use SWaT, WADI, SMD, SKAB, and TEP, each with the additive-noise, linear-drift, and log-drift augmentations of the IoT benchmark. We also use its turbogenerator data for the faulty-sensor test, and the expert-labelled Sandy Creek and Pioneer River water-quality streams. The river streams contain the spikes, drops, and level shifts that wavelets represent sparsely. On the river data the reference is Talagala et al.'s optimized precision of 0.8329 and 0.8845. Detection quality is reported as $Fc_1$ and $F1_{BA}$, never raw point-adjusted F1, together with false alarms per nominal day.
Three checks are decisive. First, on nominal-only streams with injected drift, the achieved false-alarm rate should stay near target for our method and drift away for raw-residual scoring. Second, the hybrid-versus-soft ablation should favour the hybrid operator specifically on level-shift events, where soft shrinkage's constant bias most distorts cross-scale energy. If it does not, the operator choice is cosmetic and we drop that claim. Third, on the turbogenerator data, the per-channel noise flag should single out the channel found by manual zero-channel probing. It should also recover a measurable share of the 0.38 to 0.58 gain with no manual intervention.
We will also report per-window runtime to confirm that the per-window parameter search stays in the millisecond range needed for streaming.
References
- Beamspace Channel Estimation for Massive MIMO mmWave Systems: Algorithm and VLSI Design
- Adaptive shrinkage of singular values
- Improved Wavelet Threshold for Image De-noising
- De-noising Algorithm of Modified Thresholding Function Based On the Best Basis of Wavelet Packet
- Benchmarking IoT Time-Series AD with Event-Level Augmentations
- An Evaluation of Anomaly Detection and Diagnosis in Multivariate Time Series
- UNSURE: Unknown Noise level Stein's Unbiased Risk Estimator
- A wavelet based noise reduction algorithm for speech signal corrupted by coloured noise
- A Feature‐Based Procedure for Detecting Technical Outliers in Water‐Quality Data From In Situ Sensors
- A time–frequency contrastive learning model for anomaly detection in multivariate time series
- Towards Unbiased Evaluation of Time-series Anomaly Detector