Smart Grids & AI Tasks
- 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
| Task | What it is |
|---|---|
| Load forecasting | Predicting 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 assessment | The 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 detection | Identify abnormal conditions for safety & reliability. Types of fault: physical device, communication, software/hardware-level. |
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.
⭐ 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.
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!)
⭐ 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
| Category | Description | Example |
|---|---|---|
| Non-deferrable | Cannot be shifted or scheduled | Refrigerator, TV, alarm system |
| Deferrable | Can be scheduled/shifted based on energy requirements; once ON they can NOT be halted; shifting may impact discomfort. Preferable in off-peak times | Washing machine, dishwasher |
| Controllable | Can operate at different power levels (may depend on environment temperature); changing power level may impact discomfort | Air 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.
- "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 element | In energy management |
|---|---|
| Agent | The energy management system |
| Environment | Observations: energy consumption (appliance level), other sensors, time, weather, user activities, user's comfort level |
| Actions | Energy-saving strategies: switch off low-priority appliances, change power level (controllable), defer appliance usage (deferrable) |
| Reward | Computed 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.
⭐ The Load Disaggregation Problem (Q8)
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
| Type | Behavior | Examples | Difficulty |
|---|---|---|---|
| 1 · On-Off (single-state) | Only two operation states | Table lamp, toaster | Easiest to detect |
| 2 · Multi-state | >2 states with known transitions, repeated pattern | Electric fan, washing machine | Moderate |
| 3 · Continuously variable (infinite-state) | Consumption keeps changing, not fixed | Laptop, electric drill | Most challenging |
| 4 · Permanent consumer | Always active, ~constant power | Refrigerator, TV receiver | — |
The "classic" pipeline
- 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.
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.
Privacy Aspects
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.
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.
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.