Lecture 6 · AI4ST

Smart Energy Management

The most exam-loaded lecture so far: it powers simulation Q8 (load disaggregation, reproduced verbatim) and the entire open-ended Q23 (load forecasting + RL appliance rescheduling).

⏱ ~50 min 📚 7 sections ✅ 9 MCQ + 2 open-ended ⭐ Q8 · Q23
1

Smart Grids & AI Tasks

Definition
A smart grid is an electricity network that can intelligently integrate the actions of all users in a smart city — generators and consumers — to efficiently deliver sustainable, economic and secure electricity supplies.
  • Leverages IT & communication for real-time applications — a two-way exchange of information (vs the one-way traditional grid).
  • Self-healing, adaptive, resilient and sustainable.
  • Traditional → smart: few large plants → many small producers; centralized → decentralized market; top-to-bottom → bidirectional distribution; passive consumer → active participant.

Two types of AI in smart grids

Virtual AI

  • Analyzes smart-grid data to help grid operators or consumers (e.g., recommender systems)

Physical AI

  • Self-aware AI that optimizes and controls grid operations without human intervention

The grid-level AI tasks

TaskWhat it is
Load forecastingPredicting energy consumption — balance supply/demand, predict peaks, plan infrastructure. Granularities: short-term (minutes–hours: real-time control, demand response), mid-term (hours–weeks: load dispatch, maintenance), long-term (years: system planning/expansion).
Stability assessmentThe grid's ability to stay at (or quickly reach) an equilibrium under disturbances; assessed via PMU sensors (magnitude + phase angle of voltage/current). Types: transient (huge perturbation, e.g. lightning), small-signal (continuous small fluctuations), frequency (steady frequency range after upset), voltage (prevent voltage collapse). Crucial for prevention.
Fault detectionIdentify abnormal conditions for safety & reliability. Types of fault: physical device, communication, software/hardware-level.
2

Smart Homes: Meters, Plugs & Strategies

Two ways to monitor consumption

Smart Meter → NILM

  • One device for the whole home's consumption
  • Fundamental for smart grids (bi-directional communication), samples more frequently than traditional meters
  • Non-Intrusive Load Monitoring — but no fine-grained per-appliance info

Smart Plug → ILM

  • Monitors one power plug; data sent to the home IoT gateway (usually WiFi)
  • Intrusive Load Monitoring — fine-grained per-appliance monitoring
  • But more intrusive and costly

Context variables impacting home energy load (⭐ feeds Q23a)

  • Types of appliances being used
  • User's habits — derived via Indoor Localization (Lecture 5) and Human Activity Recognition; personalization is crucial; the profile is also depicted by appliance ON/OFF usage
  • External weather conditions & seasonal variations (e.g., summer A/C), plus time and day

Two energy-conservation strategies (combinable)

User-oriented

  • Recognize residents' habits, choices, waste-energy patterns and improve them (e.g., recommendations + visualization apps)

Appliance-oriented

  • Monitor appliance consumption to automatically schedule them (or guide residents) — e.g., shifting load to off-peak hours

Pipeline: smart-home sensor data → HAR → activities + user profile + weather/time → energy management algorithms → recommendations or automatic intervention.

3

⭐ Load Forecasting in Smart Homes (Q23a)

This is the exact subject of the open-ended Q23a: the role of short-term load forecasting and the relevant context variables.

⭐ Role of short-term load forecasting — Q23a
Predict the future load of the home using historical energy data + context information (user habits, availability of renewable sources, weather forecast). Short-term is the most common granularity: it enables dynamic pricing, reducing peak demand, and better scheduling of appliance usage to save on electricity bills.

The "ingredients"

  • Setting: a smart home with multiple appliances; power measured at regular intervals (minutes, 15 min, hours).
  • Observation horizon: the historical time series available to the model — how much past data is used as input.
  • Forecast horizon: the future time window to predict (minutes → hours → days ahead).
  • Granularity: appliance level, device-category level (HVAC, lighting), or whole-home.
  • Inputs: past consumption (observation horizon) + optional contextual variables (time of day, weather, occupancy patterns).

Two deep approaches

CNN-based

  • 1D conv layers extract features from historical data
  • Context features (hour, month, day-of-week, weekend flag) injected in the fully-connected layers
  • Output: a fixed number of future values (regression)

Seq2Seq-based

  • Encoder: latent representation of past energy data
  • Decoder: learns temporal dependencies by reconstructing the input in reverse (weights recent observations more; optionally also classifies the appliance)
  • Generator: predicts the next m points (ties to Lecture 4!)
ThinkYour whole-home forecaster is accurate at 3 pm but fails badly at 7 pm on rainy winter days. What inputs is it probably missing?
Answer: Context variables. Pure historical consumption can't capture what drives evening winter peaks: time of day / day of week, weather conditions and season (heating, lighting), and occupancy / user habits (everyone home at 7 pm). The lecture's CNN approach injects exactly these (hour, month, day-of-week, weekend flag) in the dense layers; weather forecasts and renewable availability also help.
4

⭐ Appliance Scheduling with RL (Q23b)

Q23b asks exactly this: which appliance categories can be re-scheduled, and how RL-based re-scheduling works.

⭐ Categories of home appliances — Q23b

CategoryDescriptionExample
Non-deferrableCannot be shifted or scheduledRefrigerator, TV, alarm system
DeferrableCan be scheduled/shifted based on energy requirements; once ON they can NOT be halted; shifting may impact discomfort. Preferable in off-peak timesWashing machine, dishwasher
ControllableCan operate at different power levels (may depend on environment temperature); changing power level may impact discomfortAir conditioner, light bulb

Short-term load forecasting tells when energy is cheap; the challenge is understanding whether and when usage can actually be deferred: identify appliances consuming extra energy → predict when usage minimizes cost → schedule while minimizing user's discomfort.

Reinforcement Learning in a nutshell

An agent interacts with an environment that provides numeric reward signals; the goal is learning to take actions that maximize long-term reward.

Q(Sₜ,Aₜ) ← Q(Sₜ,Aₜ) + α[ Rₜ₊₁ + γ·maxₐQ(Sₜ₊₁,a) − Q(Sₜ,Aₜ) ]
  • "Classic" RL (Q-learning): estimate Q(s,a) — the expected reward of action a in state s; pick the action maximizing it; update the estimate after observing the actual reward.
  • Deep RL: a neural network implicitly learns Q(s,a) by maximizing collected reward.
  • Exploration vs exploitation: at the start the agent explores (random actions, no policy yet); later it exploits the learned policy. Balance via ε-greedy: explore with probability ε (high at start, decays over time), exploit with 1−ε.

⭐ RL for energy management — Q23b

RL elementIn energy management
AgentThe energy management system
EnvironmentObservations: energy consumption (appliance level), other sensors, time, weather, user activities, user's comfort level
ActionsEnergy-saving strategies: switch off low-priority appliances, change power level (controllable), defer appliance usage (deferrable)
RewardComputed automatically from the action's impact: positive when good for comfort + consumption, negative otherwise, 0 if no impact. Policy goal: maximize comfort, minimize consumption
  • Estimating comfort in the reward: average Waiting Time Rate (WTR) of appliance operations (users prefer short delays → minimizing WTR increases comfort); environmental conditions (temperature, humidity, air quality); emotion/stress recognition tools.
  • Exploration problem in smart homes: random actions may hurt the user's comfort → pre-train the decision module in a controlled environment, then fine-tune in the target home with transfer learning.
ThinkWhy can't the washing machine simply be paused mid-cycle when energy gets expensive, and what does the RL agent do instead?
Answer: The washing machine is a deferrable appliance: it can be shifted before starting, but once ON it cannot be halted. So the RL agent acts on the start time — deferring the cycle to low-price/off-peak hours — while the reward penalizes excessive waiting (high WTR = discomfort). Power-level modulation is only possible for controllable appliances like the air conditioner.
5

⭐ The Load Disaggregation Problem (Q8)

⭐ Load disaggregation (NILM) — Simulation Q8
With only a single smart meter measuring the whole home (or one plug connected to many appliances): can we understand how each single appliance contributes to the overall energy consumption? This is load disaggregation, a.k.a. Non-Intrusive Load Monitoring (NILM) — and the primary benefit asked in Q8.
P(t) = Σᵢ₌₁ⁿ Pᵢ + e(t)

P(t) = total load at time t · Pᵢ = load of the i-th appliance · e(t) = noise term
Goal: observing only P(t), estimate each Pᵢ

Load patterns: each appliance has a characteristic signature

TypeBehaviorExamplesDifficulty
1 · On-Off (single-state)Only two operation statesTable lamp, toasterEasiest to detect
2 · Multi-state>2 states with known transitions, repeated patternElectric fan, washing machineModerate
3 · Continuously variable (infinite-state)Consumption keeps changing, not fixedLaptop, electric drillMost challenging
4 · Permanent consumerAlways active, ~constant powerRefrigerator, TV receiver

The "classic" pipeline

Aggregated consumption Pre-processing Event detection Feature extraction Load identification
  • Event detection = segmentation by spotting consumption changes attributable to appliance state changes: steady-state changes (variations within a stable state) vs transient changes (specific transitions between states). (Echoes dynamic segmentation from Lecture 3.)
  • Metric — MAE: for each appliance, minimize the mean absolute error between estimated and true consumption. It's a regression problem with multiple outputs.
ThinkSimulation Q8 lists four candidate "primary benefits" of load disaggregation: detecting abnormal situations, scheduling deferrable appliances, understanding per-appliance contributions, predicting habits. Which is THE primary one and why?
Answer: Understanding how each appliance contributes to the overall energy consumption obtained by a smart meter. That is the very definition of the disaggregation problem (estimate each Pᵢ from P(t) alone). The others — anomaly detection, scheduling, habit prediction — are downstream applications that may use the disaggregated signal, not the primary benefit of disaggregation itself.
6

NILM with Deep Learning

Why deep learning became the NILM standard

  • Learns features directly from raw data — removes the event-detection problem.
  • Learns complex load signatures and temporal dependencies between appliances.
  • More robust to noise and scalable.

Architectures

  • Denoising AutoEncoder (DAE): "denoising" = extracting a clean signal from a noisy one. The encoder takes the aggregated consumption window → latent space → the decoder maps it to the power consumption of each appliance. (Same autoencoder machinery as Lecture 3's anomaly detection — different target.)
  • Transformer architectures: 1D conv + positional embedding → transformer layers (Q/K/V scaled dot-product attention) → deconv/linear decoding. (Direct application of Lecture 4!)

Single-appliance vs multi-output models

One network per appliance

  • Simpler learning task (one output)
  • High computational cost — a new model per appliance
  • Poor scalability, no shared learning of common patterns

One multi-output network

  • Estimates power for multiple appliances simultaneously
  • Efficient training/deployment, shared feature extraction
  • Harder optimization (several tasks at once, more data); adding an appliance requires a new output head + fine-tuning

How to train? The labeling challenge

  • NILM is a supervised regression task — the ground truth is each appliance's consumption. But homes differ in number/type of appliances, so generalizing is hard.
  • Submetering: a plug sensor per appliance to collect ground truth — costly and unrealistic (once bought, why remove them?).
  • Manual annotation (turning appliances on/off) — may be prohibitive.
  • Simulation: simulate per-device consumption and aggregate — but meta-information for all devices is hard, and synthetic data may be unrealistic.
  • Transfer learning: adapt labeled source domains to an unlabeled target home, with a domain-adaptation loss learning domain-invariant features. Limits: source/target domains and their data distributions should be similar.
7

Privacy Aspects

The risk
Energy usage data reveals customer habits and behaviors (which appliances are used, and when). Companies may mine behavioral patterns for their advantage (targeted marketing, statistics for third parties), with little user control. Smart meters may also be attacked to manipulate energy costs or steal sensitive information.

Countermeasures

🔐

Encryption schemes

Confidentiality by protecting data; some techniques even allow computation on encrypted data.

🎭

Differential privacy

Introduce noise so a home's data is associated with a group of indistinguishable homes — still useful to the operator, but individual homes can't be inferred.

🛡️

Trusted platforms

Analysis runs in trusted hardware that outsiders cannot access.

Example privacy-preserving strategy

  • Goals: compute a consumer's total consumption over a period (billing) and the regional total at an instant — while avoiding revealing an individual's instantaneous measurements.
  • How: perturb consumption data with Laplacian noise (differential privacy) — the masked daily profile no longer exposes appliance usage events.

Final Quiz — Exam Style

9 MCQs + 2 open-ended. Q1 is the simulation's Q8 verbatim; open-ended Q10 is the simulation's Q23 verbatim.

1
Simulation Q8. Which of the following is a primary benefit of load disaggregation in smart homes?
Aidentifying abnormal situations
Bscheduling of deferrable appliances in low-price energy hours
Cunderstanding how each appliance contributes to the overall energy consumption obtained by a smart meter
Dpredicting the habits of the resident
C — that's the definition of disaggregation: from the aggregated P(t) alone, estimate each appliance's Pᵢ. The others are downstream applications, not the primary benefit.
2
What is the difference between NILM and ILM?
ANILM uses a smart plug per appliance; ILM uses a single smart meter
BNILM uses a single smart meter for the whole home (no per-appliance detail); ILM uses smart plugs for fine-grained but intrusive and costly monitoring
CThey are identical; the names depend on the country
DNILM only works in smart grids; ILM only in traditional grids
B — Non-Intrusive Load Monitoring = one smart meter, whole-home aggregate. Intrusive Load Monitoring = smart plugs per appliance: fine-grained but intrusive and costly.
3
Which statement about deferrable appliances is correct?
AThey can be operated at different power levels, like an air conditioner
BThey can never be scheduled, like a refrigerator
CThey can be paused at any moment during operation
DThey can be shifted/scheduled (preferably off-peak), but once ON they cannot be halted, and shifting may impact comfort
D — e.g. the washing machine. A = controllable; B = non-deferrable. Once a deferrable appliance starts, it can NOT be halted.
4
In RL-based energy management, what does the reward capture?
AThe impact of an action: positive when good for comfort and energy consumption, negative otherwise, 0 if no impact
BOnly the money saved on the electricity bill
CThe number of appliances switched off
DThe accuracy of the load forecast
A — the reward is computed automatically by analyzing the action's impact; the policy optimizes both criteria: maximize comfort and minimize consumption (long-term).
5
How does the ε-greedy strategy balance exploration and exploitation?
AIt always explores with probability 0.5
BIt exploits with probability ε, which grows over time
CIt explores with probability ε (high at the start, decaying over time) and exploits with probability 1−ε
DIt alternates exploration and exploitation every other step
C — exploration probability ε starts high (no policy yet) and decays as learning progresses; exploitation = 1−ε. In smart homes random exploration may hurt comfort → pre-train + transfer learning.
6
Which appliance load pattern is the most challenging to detect in load disaggregation?
AType 1 — On-Off appliances (table lamp, toaster)
BType 3 — Continuously variable / infinite-state appliances (laptop, electric drill)
CType 2 — Multi-state appliances (washing machine)
DType 4 — Permanent consumer appliances (refrigerator)
B — Type 3 consumption is not fixed and keeps changing, with no characteristic repeated pattern. Type 1 (On-Off) is the easiest.
7
Why have deep learning methods become the standard for NILM?
AThey require no training data at all
BThey make smart plugs unnecessary because they measure each socket directly
CThey are guaranteed to be 100% accurate on every appliance
DThey learn features from raw data (removing event detection), learn complex signatures and inter-appliance temporal dependencies, and are more robust to noise
D — exactly the four reasons in the slides. Architectures: denoising autoencoders (aggregate in → per-appliance out) and transformer-based models.
8
What is the main challenge in training load disaggregation models?
ALabeling: per-appliance ground truth is needed, but submetering is costly/unrealistic, manual annotation prohibitive, and synthetic data may be unrealistic
BThe smart meter cannot sample more than once per day
CDeep networks cannot do regression
DThe aggregated signal P(t) is never observable
A — NILM is supervised regression needing per-appliance ground truth; homes differ widely. Mitigations: submetering (initial phase), simulation, and transfer learning with a domain-adaptation loss learning domain-invariant features.
9
How does differential privacy protect smart-meter data?
ABy encrypting the data so no computation is ever possible
BBy deleting all measurements older than one day
CBy adding noise (e.g., Laplacian) so a home's data is associated with a group of indistinguishable homes, while staying useful to the operator
DBy moving all data analysis to the user's smartphone
C — noise makes the individual home indistinguishable within a group; aggregate statistics (billing totals, regional totals) remain usable, but instantaneous individual consumption can't be inferred.
10
⭐ Open-ended · Simulation Q23 (Smart Energy Management)
a) What is the role of short-term load forecasting in smart-home environments? Which additional context variables may be relevant?
b) Which categories of appliances may be re-scheduled based on load forecasting? Briefly summarize how to re-schedule based on reinforcement learning.
Model answer

a) Short-term load forecasting (minutes to hours ahead) predicts the future energy load of the home from historical consumption over an observation horizon. Its role: enabling dynamic pricing, reducing peak demand, and scheduling appliance usage in low-price hours to save on electricity bills (also real-time control and demand response). It can be done at appliance, device-category, or whole-home granularity. Relevant context variables: time of day / day of week (and month/weekend), weather conditions and season (e.g., summer A/C; accurate weather forecasts help), user habits / occupancy patterns (derived via HAR and indoor localization), types of appliances in use, and availability of renewable sources (e.g., rooftop solar).

b) Re-schedulable categories: deferrable appliances (e.g., washing machine, dishwasher) — can be shifted to off-peak hours, but once started they cannot be halted, and shifting may impact comfort; and controllable appliances (e.g., air conditioner) — can be operated at different power levels. Non-deferrable appliances (refrigerator, TV) cannot be re-scheduled. RL-based re-scheduling: the agent is the energy management system; the environment provides observations (appliance-level consumption, time, weather, user activities, comfort level); actions are energy-saving strategies (defer usage, change power level, switch off low-priority appliances); the reward is automatically computed from the action's impact — positive when it improves comfort and reduces consumption, negative otherwise. The agent learns a policy maximizing long-term reward (maximize comfort, minimize consumption), e.g. via Q-learning/deep RL with ε-greedy exploration. Comfort can be estimated via the Waiting Time Rate (users prefer short delays) or environmental conditions; since random exploration could hurt comfort, the agent can be pre-trained in a controlled environment and fine-tuned in the target home via transfer learning.

11
Open-ended · Load Disaggregation (NILM)
a) Define the load disaggregation problem (including the aggregated-load formula) and describe the four appliance load-pattern types.
b) Why is labeling a challenge when training NILM models, and which strategies mitigate it?
Model answer

a) In a home where a single smart meter measures the whole consumption, the total load is P(t) = Σᵢ Pᵢ + e(t) (Pᵢ = load of the i-th appliance, e(t) = noise). Load disaggregation (NILM) means observing only P(t) and estimating each Pᵢ — understanding how each appliance contributes to the overall consumption. It's framed as a supervised regression problem with multiple outputs (metric: MAE per appliance). Load-pattern types: Type 1 On-Off (two states; lamp, toaster — easiest), Type 2 Multi-state (>2 states with known transitions, repeated patterns; fan, washing machine), Type 3 Continuously variable / infinite-state (consumption keeps changing; laptop, drill — most challenging), Type 4 Permanent consumer (always on, ~constant power; refrigerator, TV receiver).

b) NILM needs per-appliance ground truth, but every home has a different number/type of appliances, making generalization hard. Collecting labels is costly: submetering (a plug sensor per appliance) is expensive and unrealistic (why remove the plugs once installed?), manual annotation (turning appliances on/off) may be prohibitive. Mitigations: labeling through simulation (simulate per-device consumption and aggregate it — but meta-information for all device models/modes is hard and synthetic data may be unrealistic) and transfer learning — adapt one or more labeled source domains to the unlabeled target home using a domain-adaptation loss that learns domain-invariant features; its limits are that source and target domains (and their data distributions) must be similar.

0/9
MCQ score 0/9