Hiding When Routines Change: Battery Privacy Control Under Non-Stationary Household Demand

A home battery placed between the grid and the appliances can hide what a household is doing. It supplies power when appliances switch on and recharges when they are idle, so the current on the service wire no longer mirrors the kettle, the shower, or the moment someone wakes up. Unlike adding noise to digital meter readings, this defense also holds when an observer clamps a current sensor on the wire. The theory behind it assumes the household's demand is statistically stable over time. Real demand is not. It moves between regimes such as asleep, away, cooking, or heating on, and the mean and variance of the load jump by large factors between them. We argue that under this kind of drift, most of the privacy loss comes from the regime changes and their timing, not from individual appliance spikes. A battery with finite capacity cannot hide a sustained change in average consumption. What it can hide is exactly when that change happened.

The proposal is a battery controller that tracks a probability distribution over the household's hidden regime and deliberately randomizes when regime changes appear on the wire. It is trained against the strongest current disaggregation attacker, one that normalizes each window of the signal by its local mean and variance before analyzing it. The work has three parts: an energy-conservation bound that says which regime information is physically hideable at all, a controller designed around that bound, and an evaluation on the ECO occupancy dataset against adaptive attackers. The central empirical question is whether this beats the obvious fix, which is simply letting the flattening target track a rolling average of demand.

Core Claim

The optimal-policy theory in Information-Theoretic Privacy for Smart Metering Systems with a Rechargeable Battery covers independent, identically distributed (i.i.d.) demand. In that setting the best controller is randomized and memoryless. It keeps the battery charge in a fixed statistical distribution so that the grid draw looks like fresh i.i.d. draws. Its achievable leakage falls as $1/B$ in battery capacity $B$.

That construction has no stationary target once demand drifts. Energy conservation then shows what remains possible. Let $X_t$ be appliance demand and $Y_t$ the grid draw. Because the battery charge stays between $0$ and $B$, for any window of length $T$

$$\Big|\frac{1}{T}\sum_{t=1}^{T}(Y_t - X_t)\Big| \le \frac{B}{T}.$$

Suppose a regime raises mean demand by $\Delta$. If the regime lasts much longer than $B/\Delta$, it must appear in the average grid draw, whatever the controller does. The hideable information is therefore the fine timing of the regime change, which is resolved on the scale of $B/\Delta$, together with within-regime appliance structure.

For occupancy inference, onset times are the sensitive quantity: they reveal when people wake, leave, and return. Our claim is that a controller should spend battery capacity on randomizing the apparent onset of regime changes. It should not spend it on flattening every fluctuation.

We further claim that attackers built for non-stationarity make this sharper. NILMFormer: Non-Intrusive Load Monitoring that Accounts for Non-Stationarity feeds the local window mean and variance to a Transformer as separate tokens and analyzes the normalized shape. Its authors also report a "fridge problem": it is blind to steady, low-variance baselines. Against such an attacker, leakage splits into two channels, the window statistics and the normalized shape. A defense should shape each channel separately.

Research Program

The first part is analytical. We model demand as a hidden semi-Markov regime process, meaning each regime lasts a random amount of time, with i.i.d. appliance draws inside each regime. In this model we characterize, as a function of $B$, the peak charge or discharge power $P_{\max}$, the regime gap $\Delta$, and the regime dwell time, how much uncertainty about onset time a controller can create. We then show that a delayed, randomized transition policy achieves it.

This extends the belief-state argument of Smart Meter Privacy with Renewable Energy and a Finite Capacity Battery. In that work, the controller's current probability distribution over hidden quantities is a sufficient statistic for choosing actions, but that result is for stationary Markov models. Our extension adds the regime to the hidden state, so that stationarity no longer has to be assumed. A key requirement from Ashish J Khisti et al. is that the policy must stay randomized. A deterministic onset delay could be inverted by an attacker who knows the rule.

The second part is the controller. A particle filter maintains the belief over the current regime, its elapsed duration, and the battery charge. We compress the particles into a fixed-length vector using the moment-generating-function encoding of Interaction-Aware Parameter Privacy-Preserving Data Sharing in Coupled Systems via Particle Filter Reinforcement Learning, which paired it with an actor-critic learner for vehicle-platoon privacy. We reuse that method but replace the known car-following dynamics with a learned regime model.

The actor outputs a probability distribution over grid draws. The reward combines three terms, each with a weight:

The third part adds rooftop solar as an exogenous, non-stationary input the controller observes but does not control. Earlier privacy formulations such as Smart Meter Privacy With Renewable Energy and an Energy Storage Device model solar as a stationary Markov chain. Non-intrusive load monitoring under residential solar power influx, by contrast, shows that solar acts on the aggregate signal like a volatile "negative appliance." We test one question: does cloud-driven solar variability supply free timing noise that the controller can exploit, or does it mainly push the battery to full and cost privacy? This part is secondary. It is dropped if the main result fails.

Baselines

The naive reference is the unprotected load, with no battery action. Against it we report attacker accuracy and the fraction of occupancy transitions localized to within one interval.

The main published competitor is the Deep Double Q-Learning privacy-cost unit of Privacy-Cost Management in Smart Meters Using Deep Reinforcement Learning. It penalizes deviation of grid draw from a fixed flat target, plus cost and wear. Its reported result on ECO at 15-minute resolution is that attacker occupancy accuracy drops from over 85% unprotected to under 65% at its maximum-privacy setting. It is the strongest competitor because it is the only learned battery-masking controller in the file evaluated on real occupancy labels. We re-implement it on the same houses, the same splits, the same battery parameters $B$ and $P_{\max}$, and the same number of environment steps and hyperparameter trials as our method. We compare at matched battery throughput and cost.

We add a stronger variant that the original paper did not test: the same controller with a flattening target that tracks a rolling mean of demand. This is the natural non-stationary patch.

On the attack side, we train a NILMFormer-style attacker, including its local statistics tokens and timestamp encoding, on masked traces from each policy. This makes it adaptive to that policy. Beating a baseline means lower balanced occupancy accuracy and lower onset-localization accuracy against this retrained attacker, at equal or lower cost and throughput. For NILMFormer we can cite only its relative gains: 15% lower mean absolute error and a 22% higher matching ratio over BERT4NILM and UNet-NILM. No reported result was found on Lacuna for NILMFormer run against battery-masked load.

Two ablations isolate the key ingredient. The first gives the same actor-critic a recurrent network instead of the explicit regime belief. The second keeps the regime belief but uses an adversary that sees only raw windows, without the decomposed statistics.

Why not just…?

Why not just let the flattening target follow a rolling average? This is the most serious threat. It removes the battery saturation and depletion that a fixed target causes. Our concern is that a target that follows demand transmits the regime onset directly, delayed by the averaging window, and that delay is fixed and therefore partly invertible. The prediction is concrete: at matched cost and throughput, the rolling-target controller should look good against a static classifier but leak onset times to the retrained NILMFormer-style attacker. If it does not, and it matches our controller, then the regime belief adds nothing and we will report that.

Why not just use a recurrent policy trained against an adversary, with no explicit regime model? A recurrent actor might infer the regime implicitly, which would make the particle filter unnecessary engineering. The first ablation tests this directly. We expect the explicit belief to matter most in the regime where onset hiding is feasible but tight, that is, when regimes last close to $B/\Delta$. There the controller must know how far into a regime it is. If the recurrent variant matches it, we keep the simpler design.

Why not just add differential-privacy noise to the reported readings? A current sensor on the service wire bypasses digital noise entirely, as argued in Smart meter privacy with an energy harvesting device and instantaneous power constraints. Digital release also costs heavy distortion: Deep Directed Information-Based Learning for Privacy-Preserving Smart Meter Data Release needs a normalized error of about 0.4 to push attacker accuracy near 50%. We include digital noise only as a reference line, evaluated under the wire-tap threat model.

Why not just re-solve the stationary optimal policy per regime? Switching between per-regime invariant policies of Information-Theoretic Privacy for Smart Metering Systems with a Rechargeable Battery announces each switch at the moment it is detected. We include this plug-in controller on the synthetic regime model, where exact per-regime solutions are computable.

Proposed Experiments

The primary benchmark is the Electricity Consumption and Occupancy (ECO) dataset: 1 Hz measurements from five Swiss houses with occupancy labels, run at 1-minute and 15-minute resolution. Occupancy regimes are taken from the labels. We report results across a sweep of battery capacities.

Appliance-level leakage is measured on UK-DALE and REFIT. We compute disaggregation error and matching ratio of the retrained attacker on masked aggregates, using NILMTK (NILMTK: an open source toolkit for non-intrusive load monitoring) and Torch-NILM (Torch-NILM: An Effective Deep Learning Toolkit for Non-Intrusive Load Monitoring in Pytorch). For the solar part, we overlay traces from the California solar power station data used in the solar-influx NILM study onto ECO and REDD homes.

Metrics are:

  • balanced occupancy accuracy;
  • onset-localization error of the attacker, in minutes;
  • a neural estimate of mutual information between regime onset and grid draw;
  • battery time at empty or full;
  • cost and cycle throughput.

The first decisive check tests the analysis. On the synthetic semi-Markov model, onset-hiding by our controller should hold for regimes shorter than roughly $B/\Delta$ and collapse beyond it, as the conservation bound predicts. The measured crossover should shift in proportion to $B$ as capacity is varied.

The second decisive check is the head-to-head against the rolling-target controller on ECO under the retrained attacker, at matched cost. The proposal succeeds only if onset-localization error is clearly higher and occupancy accuracy clearly lower for our controller.

The third check tests the fridge-problem hypothesis. For both the rolling-target controller and ours, we measure how much of the attacker's accuracy comes from the window-statistic tokens versus the normalized shape. If the decomposed adversary exposes leakage that a raw-window adversary misses, the attacker-aware design is justified. If not, the second ablation's simpler adversary is enough.