NTNU's CINDI Cleans Dirty Sensor Data With One Unified AI Model
A new framework unifies anomaly detection and imputation using conditional normalizing flows, cleaning noisy power grid time series without separate detector and imputer models.
ProTakeaways
- CINDI unifies anomaly detection and imputation in one conditional normalizing flow model.
- Iteratively flags low-likelihood windows and autoregressively samples replacements from the flow's mode.
- Hits F1 0.93 and VUS 0.97 on Norwegian grid loss data with 1% training errors.
- Beats interpolation, KnowImp diffusion, and Dynamix baselines up to 13.69% error rates.
- Breaks down past 24% errors, where pretrained models and simple skipping win.
- Code, experiments, and grid loss splits released at github.com/2er0/CINDI.
Cleaning messy sensor data usually means stitching together two models: one to spot the bad points and another to fill them in. Researchers from the Norwegian University of Science and Technology argue that this split is part of the problem, and they have released CINDI, a framework that folds both jobs into a single probabilistic model trained on noisy multivariate time series from a real Norwegian power distribution operator.
Why disjoint pipelines fall short
Grid loss forecasting is a high-stakes downstream task. In markets like the Nord Pool exchange, power distribution operators must report precise loss estimates to determine pricing and manage risk. The catch is that the training data itself is unreliable. Real-world time series data is frequently corrupted by sensor malfunctions, transmission errors, and noise, resulting from equipment malfunctions or data processing issues.
The conventional fix chains an anomaly detector to an imputer, but these methods typically rely on distinct models, limiting their ability to capture the full joint distribution of the data. This fragmentation limits the model's ability to distinguish between genuine system anomalies and mere data errors. That matters when a rare spike could be either a real physical event or a broken sensor, and treating it wrong pollutes whatever forecaster you train next.
One flow, two jobs
CINDI is built on a conditional normalizing flow, a generative model that learns an invertible mapping from data to a simple base distribution (a standard Gaussian) so you can both score how likely any observation is and sample new ones from the learned distribution. The authors use a conditioned RealNVP variant that takes the current observation plus a sliding window of past values as temporal context.

The loop is deceptively simple:
- Train the flow on the current (still-dirty) dataset by minimizing negative log-likelihood.
- Score every window. Define the threshold as the average likelihood plus twice the standard deviation of known expected data points. Points above it get flagged.
- For each flagged segment, walk the flow backwards from the mode of the base distribution to autoregressively generate a replacement, feeding each new value back into the temporal context for the next step.
- Retrain on the updated data and repeat until it converges.
Because a single model handles both scoring and generation, learned structure gets reused instead of being duplicated across a detector-imputer pair. Hyperparameters are picked automatically with CMA-ES, an evolutionary search, against an objective that mixes AUC-ROC, VUS-ROC (a range-aware detection metric), and a self-regressive reconstruction error on known-clean windows.
What the numbers say
The team evaluates on an extended version of the TrønderEnergi grid loss dataset, covering hourly measurements from May 2017 to August 2023, plus a fully synthetic benchmark suite. They construct four training splits with error rates from 0% to 24.19%, then measure downstream anomaly detection on a held-out test set with roughly 52% anomalous points.

At 1.04% error, CINDI with the base encoder hits F1 0.93, VUS 0.97, AUC 0.97, edging out linear, cubic, and spline baselines as well as the diffusion-based KnowImp and the pretrained Dynamix. At 13.69% it stays competitive (F1 0.92, VUS 0.97). But at 24.19% errors the story flips: simple nearest-neighbor interpolation and just skipping the flagged sections outperform the flow, and the pretrained Dynamix holds up better because it never touched the dirty data in the first place.
The honest caveats
The paper is unusually candid about where the method breaks:
- It needs some noise to work. On fully clean synthetic sequences, training the model results in new manifolds that are not useful for detection or imputation. A little imperfection is what anchors the learned density.
- Skipping is a serious baseline. Avoiding imputation altogether for sections with errors can still lead to solid results, and it should not be ignored as a baseline. This holds especially with increased levels of errors in the training data, since too many errors can lead to biased models.
- It denoises, it does not resurrect. The framework cannot reconstruct values when the underlying signal is missing or severely corrupted; heavy error rates degrade every non-pretrained method.
When to reach for it
CINDI is a good fit if you have multivariate sensor data with light-to-moderate corruption (roughly under 15% flagged points), enough natural variability for the flow to learn a useful density, and a downstream task where preserving joint statistical structure matters more than perfect pointwise reconstruction. Utilities, industrial IoT, and any pipeline where the same team owns both cleaning and forecasting are the obvious candidates.
The full training and evaluation code is available in the CINDI GitHub repository, including the model selection loop and baseline implementations used in the paper.