Federated Energy Anomaly Detection for Critical Infrastructure

Privacy-aware cyberattack detection for smart-grid time series

Enrique Tomás Martínez Beltrán

Updated: 7 min read
Federated Energy Anomaly Detection for Critical Infrastructure
In this article

Critical infrastructure operators need anomaly detection, but they also need privacy and operational control. In energy systems, raw telemetry may expose substations, load profiles, operational routines and sensitive fault patterns. Federated energy anomaly detection is a way to collaborate without pooling everything: monitoring nodes train on local time series and share model updates or distilled signals, and the result is credible only when it is evaluated with temporal splits, episode-level metrics and alerts that report drift and peer disagreement.

Why energy systems are different

Smart-grid telemetry is temporal, heterogeneous and context-dependent. The same signal can be normal in one operational state and suspicious in another.

That means detection models need context:

  • threat level,
  • asset criticality,
  • seasonality,
  • model drift,
  • local operating constraints.

Decentralized learning pattern

Each monitoring node can train on local time-series data and share model updates or distilled signals with peers. The goal is to detect cyberattacks and anomalies while preserving control over sensitive industrial data.

This is not just a privacy feature. It is also an availability and resilience feature: the system should keep learning even when a central service is unavailable.

Trustworthy alerts

The alert should explain why a signal matters and whether the model is operating in a familiar regime. If drift is high, the alert should say so. If peers disagree, that disagreement is part of the evidence.

Trustworthy anomaly detection is not only about raising alerts. It is about making alerts useful enough to support mitigation.

For critical infrastructure, alert evidence must remain constrained and auditable: affected asset, anomaly window, peer agreement, drift level, safety constraints and approved operational context.

Prevent temporal leakage in evaluation

A time-series detector can appear excellent when training contains fragments almost identical to the test set. Split periods, facilities and events first, then construct windows. Fit normalization and feature selection on training data only. Reserve a future period for regime changes, without recalibrating the threshold using its labels.

As a design example, a consumption increase during a shift change should be compared with that operating regime. An isolated signal deviation does not establish a cyberattack. Distinguish physical anomalies, sensor failures, authorized maintenance and confirmed incidents in the labels.

Metrics an operator can interpret

Point-wise accuracy can hide repeated alerts about a single event. Report detected episodes, delay from onset, false alerts per operating day and alert duration. Explain any adjustment that counts an entire event as detected after a single positive point: this changes the interpretation of the result substantially.

TemporalFED studies industrial time series using federated learning, including temporal preprocessing, performance and resources. It is a related methodological reference; its chemical industrial scenario is not direct validation on an electricity grid. Transferring the approach to energy requires data and constraints from the target domain.

Update without learning the attack as normal

A model that continuously learns from a prolonged intrusion may eventually treat it as normal. Keep a queue of examples awaiting review, compare against a stable model and retain the ability to withdraw an update. Operational response can align with NIST SP 800-61 Rev. 3, without implying that the framework validates the detector.

The DFL monitoring and mitigation lifecycle connects these measurements to alert management.

A worked example: points versus episodes

The numbers below are a hypothetical illustration, not results from any study. They show why the metric choice in the previous sections changes conclusions.

Assume a 30-day test period sampled every minute (43,200 points) containing 4 attack episodes of 2 hours each, so 480 points are labelled as attack. Two detectors are compared.

  • Detector A flags almost every point of episodes 1 and 2 (240 true points) and misses episodes 3 and 4. It also raises 20 separate false alerts totalling 60 points.
  • Detector B flags only the first 10 points of each of the 4 episodes (40 true points) and raises 3 false alerts totalling 10 points.
MetricDetector ADetector B
Point-wise recall0.500.08
Point-wise precision0.800.80
Point-wise recall with point adjustment0.501.00
Episodes detected2 of 44 of 4
False alerts per operating day0.670.10

On point-wise recall, A looks six times better. From an operator's perspective, B is the more useful detector: it catches every episode near its onset and raises far fewer false alerts. Point adjustment, which counts an entire episode as detected after one positive point, swings the comparison the other way and makes B look perfect, hiding that it stops alerting after ten minutes. Reporting episodes, onset delay and false alerts per day alongside point-wise scores makes these differences visible instead of leaving them to the choice of metric.

Choosing a collaboration architecture

Federated learning is one option among several, and the honest comparison includes the alternatives. The table summarizes general trade-offs for energy operators.

OptionDoes raw telemetry leave the site?Central dependencyMain risk to evaluate
Local-only detectorNoNone, but no collaborationMissing attack patterns observed only elsewhere
Centralized poolingYesCentral data platformPrivacy, regulatory and concentration exposure
Server-based FLNo, model updates onlyAggregation serverServer availability and leakage from updates
Semi-decentralized FLNoAggregation delegated to a participantCoordination when the aggregating node fails
Decentralized FLNoNo central aggregatorResults that depend on topology and on peer agreement

The local-only detector is the baseline that every federated configuration must beat on held-out periods and facilities. If collaboration does not improve episode detection or false alerts over that baseline, its added exposure and complexity are not justified.

TemporalFED compared these paradigms on Fedstellar in a chemical gas industrial environment. There, DFL and semi-decentralized FL with a fully connected topology achieved the best anomaly detection, and the configuration without feature engineering used less bandwidth, CPU and RAM. For an electricity grid, those findings are a hypothesis to test with domain data, not a conclusion. The privacy side of the same decision (protected units, budgets and secure aggregation) is developed for gateways in privacy-preserving IoT security with DFL.

Key takeaway

In critical infrastructure, federated anomaly detection should prioritize useful, bounded evidence over broad data sharing. The alert must be explainable, auditable and aligned with operational constraints so operators can decide whether to investigate, mitigate or keep observing.

Open research question

How can federated energy systems distinguish true cyber anomalies from local operational changes when raw telemetry cannot be pooled centrally?

Frequently asked questions

What is federated anomaly detection?

Federated anomaly detection trains a shared detector across several sites, such as substations or plants, while each site keeps its raw telemetry local. Sites exchange model updates or distilled signals, either through a server or directly between peers in decentralized federated learning. The aim is to learn from anomalies seen across the federation without building a central data pool.

Can federated learning detect cyberattacks on smart grids?

Federated learning can train detectors that flag anomalous time-series behavior, and related work has studied cyberattack detection on industrial time series with DFL. Whether it detects attacks on a specific grid depends on labelled episodes from that domain and on separating attacks from faults, maintenance and operational changes. Without that separation, a detector flags anomalies, not attacks.

Is decentralized federated learning better than server-based federated learning for critical infrastructure?

DFL removes the aggregation server as a single point of failure, which matters when monitoring must continue during an outage. It also makes results depend on topology and requires a way to handle peers that disagree. Which option is better should be decided by comparing both against a local-only baseline on the same temporal splits. How shared context and peer disagreement can inform operators is discussed in situational awareness for cyberdefense with DFL.

What is point adjustment in time-series anomaly detection?

Point adjustment is an evaluation convention that marks every point of an anomaly episode as detected if the model flags at least one point inside it. It can turn a detector that fires once per episode into one with perfect recall, as the worked example shows. If it is used, report it explicitly and give episode-level metrics as well. More notes on detection and evaluation are collected in the AI for cyberdefense topic hub.

Estimated text reading time: 7 minutes. Equations, code and references may take longer.

Industrial Cybersecurity · Critical Infrastructure · Decentralized Federated Learning · Trustworthy AI

Related Research