← back to projects

EdgeSense

Predictive maintenance that runs entirely on the machine it's watching. Unsupervised anomaly detection, a 0–100 health score, and remaining-useful-life estimation, with no cloud and no labeled failures required.

PyTorch · 1D-CNN · USAD · Edge AI · RUL · Industry 4.0 view on github ↗

Unplanned downtime is expensive, and the usual fixes all run into the same three problems. Cloud monitoring streams sensitive sensor data off-site. Supervised models need labeled failure examples that real factories don’t have. And most off-the-shelf tools only know one failure mode. EdgeSense is my attempt to deal with all three at once.

Anomaly score over time on the metro compressor data
Anomaly score across months of Metro do Porto compressor data — the spikes line up with real air-leak events.

How it works

The core is a USAD-style 1D-CNN autoencoder: a shared encoder and two decoders that play a minimax game during training. It learns what healthy looks like from a couple of weeks of normal sensor data, with no failure labels needed, then flags anything that drifts outside that envelope. A small MLP head on the latent space adds remaining-useful-life regression for components that wear down gradually.

Everything runs locally on an edge device next to the machine. One architecture gives three outputs an operator can actually use:

  1. Anomaly score per window of sensor data.
  2. Health score from 0 to 100% — one number you can read at a glance.
  3. Remaining useful life in cycles, for components that degrade gradually.

Validated on three very different machines

DatasetFailure profileResult
Metro do Porto compressorsSudden air leaksRecall 88%, F1 0.69 (AUC 0.91)
Hydraulic test rigMulti-component faultsAUC up to 1.00
NASA C-MAPSS turbofansGradual degradation (RUL)RMSE ≈ 15 cycles, correlation 0.93

My favorite result isn’t in the table. When I audited the top “false positives” on the metro data, two of them turned out to be real, undocumented air-leak events that were missing from the maintenance log. The model caught failures the humans hadn’t recorded.

USAD-style 1D-CNN autoencoder architecture
The model: a shared 1D-CNN encoder, two decoders trained adversarially, and a small RUL head on the latent space.

The on-site recalibration trick

Training in the lab and deploying in the field never lines up cleanly. EdgeSense uses two weeks of on-site data to recalibrate its alert threshold to the specific machine, which roughly doubled F1 on the metro compressors (0.37 to 0.69) compared to deploying the lab threshold as-is. It’s cheap to do and made a big difference.