0% found this document useful (0 votes)
16 views67 pages

Spyros

Uploaded by

amirrezafeyzi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views67 pages

Spyros

Uploaded by

amirrezafeyzi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

AI4OPT Seminar Series

GeorgiaTech, Fall 2022

Machine Learning for Power Systems:


Is it time to trust it?
Spyros Chatzivasileiadis
Associate Professor
Head of Section Power Systems

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 1


Department of Wind and
Energy Systems
Working for a sustainable future

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 2


DTU Wind and Energy Systems
at a Glance
378
employees

98
PhD students
#1
in wind publication
citations worldwide
280
industry partners

70%
funding that involves
industry

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 3


Department of Wind and Energy Systems
Working for a sustainable future

~100 people working on power systems

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis


Electric Power Systems
PWR Section: 28+3 members; 20 nationalities

AC/DC Wind Power Lab

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 5


PWR:
PWR:Advanced
AdvancedMethods
Methods and Toolsfor
and Tools forPower
PowerSystem
System Security
Security and Control
and Control
Methods Going Beyond the Advanced Tools Applications
State-of-the-art
1. World-Record in Fast Real- 1. RTDS infrastructure and
1. Trustworthy AI for Power
Systems
time Security Assessment of Hardware-in-the-Loop
Electric Power Systems
2. Quantum Computing 2. Demonstration in
2. Open-Source Models of the Bornholm
3. Cyber Physical Systems Nordic and European Systems
3. System-stability and
4.Energy Data Spaces 3. Digitalization tools for e.g. operation including the
grid black start Bornholm and North Sea
5. Stability, Optimization, and Energy Islands
Control of Zero-Inertia 4.Digital Twins for Power
Systems Systems

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 6


This work would not have been possible without the hard work
of several people! Many thanks to…

Andreas Rahul Sam Lejla Spyros


Venzke Elea Prat Ilgiz
Nellikkath Chevalier Halilbasic Chatzivasileiadis
Murzakhanov

And to our collaborators:


Dan Molzahn, GeorgiaTech
Steven Low, Caltech
Guannan Qu, Caltech (now at CMU)
Florian Georgios Jochen Brynjar
Thams Misyris Stiasny Sævarsson Panagiotis Papadopoulos, Robert
Hamilton, Tabia Ahmad, Univ. Strathclyde
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 7
Machine learning: Why shall we apply it in power systems?

1. Extremely fast  can assess 100x-1’000x more of critical scenarios


• computation within only a few milliseconds (100x – 1000x faster than conventional methods)
– Predict fast and act faster  drastically increase power system resilience

2. Can handle very complex systems and infer from incomplete data
• Excellent potential to create accurate surrogate models
– Accelerate simulations; and offer good approximations of previously intractable systems

But: Would an Operator ever trust AI in the Control Room?

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 8


This talk: Two Challenges and One Opportunity
• Challenge #1: Machine Learning is extremely dependent on high-quality data.

• Challenge #2: Has the Neural Network been trained to generalize well? Can we
trust it?

• Opportunity: “AI for Optimization”. Use trustworthy Machine Learning to capture


(=approximate well) previously intractable constraints and embed them in any
optimization problem
– Example1: Instead of running 10,000 scenarios to determine the critical clearing
time of a converter-based system, run a single optimization.

Abbreviations I will use:


• ML: Machine Learning
• NN: Neural Network 1G. S. Misyris, J. Stiasny, S. Chatzivasileiadis, Capturing Power System Dynamics by Physics-Informed
Neural Networks and Optimization. IEEE Conference on Decision and Control (CDC), 2021 . [ .pdf ]

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 9


Facts Consequence
1. All data are not the same
For a NN that assesses if a system is stable,
training data close to the stability boundary Statistical sampling is not enough
contain much more information than
Challenge #1: training data far away from it.
ML extremely
dependent on
high-quality data

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 10


Facts Consequence
1. All data are not the same
For a NN that assesses if a system is stable,
training data close to the stability boundary Statistical sampling is not enough
contain much more information than
Challenge #1: training data far away from it.
ML extremely
dependent on
high-quality data 2. Training data must follow the same 1. For power systems: We have so many
statistical properties as real data physical models. Add them!
Do we have enough historical data about
2. We cannot trust “Neural Network
e.g. outages? Is this possible?
Accuracy” as a performance metric

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 11


Facts Consequence
1. All data are not the same
For a NN that assesses if a system is stable,
training data close to the stability boundary Statistical sampling is not enough
contain much more information than
Challenge #1: training data far away from it.
ML extremely
dependent on
high-quality data 2. Training data must follow the same 1. For power systems: We have so many
statistical properties as real data physical models. Add them!
Do we have enough historical data about
2. We cannot trust “Neural Network
e.g. outages? Is this possible?
Accuracy” as a performance metric

Challenge #2: 3. NN training is an extremely complex


Has NN been trained optimization procedure Can we trust it?
to generalize well? Prone to overfitting/underfitting

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 12


Facts Consequence
Solution
1. All data are not the same
For a NN that assesses if a system is stable,
training data close to the stability boundary Statistical sampling is not enough
contain much more information than
Challenge #1: training data far away from it.
ML extremely
dependent on
high-quality data 2. Training data must follow the same 1. For power systems: We have so many
statistical properties as real data physical models. Add them!
Do we have enough historical data about
2. We cannot trust “Neural Network
e.g. outages? Is this possible?
Accuracy” as a performance metric

Challenge #2: 3. NN training is an extremely complex


Has NN been trained optimization procedure Can we trust it?
to generalize well? Prone to overfitting/underfitting

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 13


Facts Consequence
Solution
1. All data are not the same
For a NN that assesses if a system is stable,
training data close to the stability boundary Statistical sampling is not enough
contain much more information than
Challenge #1: training data far away from it.
ML extremely
dependent on
high-quality data 2. Training data must follow the same 1. For power systems: We have so many
statistical properties as real data physical models. Add them!
Do we have enough historical data about
2. We cannot trust “Neural Network
e.g. outages? Is this possible?
Accuracy” as a performance metric

Challenge #2: 3. NN training is an extremely complex


Has NN been trained optimization procedure Can we trust it?
to generalize well? Prone to overfitting/underfitting

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 14


Facts Consequence
Solution
1. All data are not the same
For a NN that assesses if a system is stable,
training data close to the stability boundary Statistical sampling is not enough
contain much more information than
Challenge #1: training data far away from it.
ML extremely
dependent on
high-quality data 2. Training data must follow the same 1. For power systems: We have so many
statistical properties as real data physical models. Add them!
Do we have enough historical data about
2. We cannot trust “Neural Network
e.g. outages? Is this possible?
Accuracy” as a performance metric

Challenge #2: 3. NN training is an extremely complex


Has NN been trained optimization procedure Can we trust it?
to generalize well? Prone to overfitting/underfitting

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 15


Closing the Loop: A Framework for Trustworthy
Machine Learning in Power Systems

J. Stiasny, S. Chevalier, R. Nellikkath, B. Sævarsson, S. Chatzivasileiadis. Closing the Loop: A Framework for Trustworthy
Machine Learning in Power Systems. Accepted to 2022 iREP Symposium - Bulk Power System Dynamics and Control - XI
(iREP). Banff, Canada. July 2022. [ paper | code ]

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 16


Closing the Loop: Trustworthy ML for Power Systems
Conventional Neural Network Training for Power System Applications

Satisfied?
Training Train Neural Ready to deploy in
Database Network yes a real application
no

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 17


Closing the Loop: Trustworthy ML for Power Systems

Satisfied?
Training Train Neural
Database Network yes
no

“Sampling beyond
Statistics”
Focus on High-
Information Content
Regions: Separating
hyperplanes and
Directed Walks

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 18


Closing the Loop: Trustworthy ML for Power Systems

Train Neural Satisfied?


Training Network
Database with/without yes
Physics-Informed no

“Sampling beyond
Statistics”
Focus on High-
Information Content
Regions: Separating
hyperplanes and
Directed Walks

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 19


Closing the Loop: Trustworthy ML for Power Systems

Train Neural Satisfied?


Training Network
Database with/without yes
Physics-Informed no

“Sampling beyond
Statistics”
Enrich Database:
NN-Informed
Sampling

“Sampling beyond
Statistics”
Focus on High-
Information Content
Regions: Separating
hyperplanes and
Directed Walks

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 20


Closing the Loop: Trustworthy ML for Power Systems
Trustworthy AI

Train Neural Satisfied? NN Verification/ Final NN with


Training Network
Worst-case Performance
Database with/without yes
no Guarantees Guarantees
Physics-Informed

“Sampling beyond
Statistics”
Enrich Database:
NN-Informed
Sampling

“Sampling beyond
Statistics”
Focus on High-
Information Content
Regions: Separating
hyperplanes and
Directed Walks

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 21


Closing the Loop: Trustworthy ML for Power Systems
Trustworthy AI

Train Neural Satisfied? Satisfied?


NN Verification/ Final NN with
Training Network
Worst-case Performance
Database with/without yes yes
no Guarantees no Guarantees
Physics-Informed

“Sampling beyond
Statistics”
Enrich Database:
NN-Informed
Sampling
“Sampling beyond
“Sampling beyond Statistics”
Statistics” Enrich Database:
Focus on High- Verification-
Information Content Informed Sampling
Regions: Separating
hyperplanes and
Directed Walks

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 22


Sampling beyond Statistics:
Separating Hyperplanes and Directed Walks
• Historical data are often insufficient
• Need to generate our own data

• Here: generate data for N-1


security+small-signal stability
– Assessing the stability of 100’000s of
operating points is an extremely demanding
task
– Immense search space
– How can I do it efficiently?

F. Thams, A. Venzke, R. Eriksson, and S. Chatzivasileiadis, ”Efficient


database generation for data-driven security assessment of power
systems”. ”. IEEE Trans. Power Systems, vol. 35, no. 1, pp. 30-41, Jan.
2020. https://www.arxiv.org/abs/1806.0107.pdf

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 23


Sampling beyond Statistics:
Separating Hyperplanes and Directed Walks
• Historical data are often insufficient Proposed approach:
• Need to generate our own data • Can accommodate numerous
definitions of power system security (e.g.
• Here: generate data for N-1 N-1, N-k, small-signal stability, voltage
security+small-signal stability stability, transient stability, or a
combination of them)
– Assessing the stability of 100’000s of
operating points is an extremely demanding
task • 10-20 times faster than existing state-of-
– Immense search space the-art approaches
– How can I do it efficiently?
• Generated Databases for IEEE 14-bus
F. Thams, A. Venzke, R. Eriksson, and S. Chatzivasileiadis, ”Efficient and NESTA 162-bus system available!
database generation for data-driven security assessment of power http://www.chatziva.com/downloads.html#databases
systems”. ”. IEEE Trans. Power Systems, vol. 35, no. 1, pp. 30-41, Jan.
2020. https://www.arxiv.org/abs/1806.0107.pdf

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 24


Sampling beyond Statistics:
Efficient Database Generation
Unstable regions
• The goal
– Focus on the boundary between
stability and instability
– We call it: “high information content”
region

• How?
1. Using convex relaxations
Stable region High information
2. And “Directed Walks” content
Real data for the IEEE 14-bus system
N-1 security and small-signal stability
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 25
Convex relaxations
to discard infeasible
regions

Non-convex
stable region

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 26


Convex relaxations
convex to discard infeasible
relaxation
regions
• Certificate: if point infeasible for
semidefinite relaxation 
Non-convex infeasible for the original problem
stable region

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 27


Convex relaxations
convex to discard infeasible
relaxation
regions
• Certificate: if point infeasible for
semidefinite relaxation 
Non-convex infeasible for the original problem
stable region
• If infeasible point: find minimum
radius to feasibility

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 28


Convex relaxations
convex to discard infeasible
relaxation
regions

• Certificate: if point infeasible for


semidefinite relaxation 
Non-convex
infeasible for the original problem
stable region
• If infeasible point: find minimum
radius to feasibility

• Discard all points on one side of


the hyperplane

• A. Venzke, D.K. Molzahn, S. Chatzivasileiadis,


Efficient Creation of Datasets for Data-Driven
Power System Applications. PSCC 2020.
https://arxiv.org/pdf/1910.01794.pdf

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 29


Directed Walks

• “Directed walks”: steepest-


descent based algorithm to
explore the remaining search
space, focusing on the area
around the security boundary

1. Variable step-size
2. Parallel computation
3. Full N-1 contingency check

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 30


Results

Points close to the security boundary


(within distance γ)
IEEE 14-bus NESTA 162-bus

Brute Force 100% of points in 556.0 min intractable

Importance Sampling 100% of points in 37.0 min 901 points in 35.7 hours

Proposed Method 100% of points in 3.8 min 183’295 points in 37.1 hours

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 31


NN-Informed Sampling
• Ideally: enrich the database with points near the
stability boundary during NN training
– But: impossible to know a priori which are these
points

• What do we do?

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 32


NN-Informed Sampling
• Ideally: enrich the database with points near the
stability boundary
– But: impossible to know a priori which are these
points

• What do we do?
1. Sample 1’000’000 random points and have
the NN assess them
• Extremely fast  NN will take some minutes
to assess all of them

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 33


NN-Informed Sampling
• Ideally: enrich the database with points near the
stability boundary
– But: impossible to know a priori which are these
points

• What do we do?
1. Sample 1’000’000 random points and have
the NN assess them
• Extremely fast  NN will take some minutes
to assess all of them

2. From the NN assessment: identify the region


close to the stability boundary

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 34


NN-Informed Sampling
• Ideally: enrich the database with points near the
stability boundary
– But: impossible to know a priori which are these
points

• What do we do?
1. Sample 1’000’000 random points and have
the NN assess them
• Extremely fast  NN will take some minutes
to assess all of them

2. From the NN assessment: identify the region


close to the stability boundary

3. Sample 200 points in this region, compute the


ground truth (=run N-1 and small signal
stability), and enrich the database
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 35
Sampling beyond statistics:
Better results with less data Mean squared error (test set loss)

• Larger datasets achieve


lower error
– 64 : ~2x more data than 54
– 74 : ~4x more data than 54

• The directed walks and the


NN-informed resampling
achieve the same
performance with half the
datapoints

Note: Actual performance of DW and NI


depends on the case study. But the trend
remains the same across all our experiments Number of datapoints
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 36
Sampling beyond statistics:
Better results with less data Mean squared error (test set loss)
• Larger datasets achieve
lower error
– 64 : ~2x more data than 54
– 74 : ~4x more data than 54

• The directed walks and the


NN-informed resampling
achieve the same
performance with half the
datapoints

• Physics-Informed Neural
Networks can achieve
similar results
Note: Actual performance of DW, NI, and PINNs
depends on the case study. But the trend Number of datapoints
remains the same across all our experiments
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 37
Physics-Informed Neural
Networks for Power Systems
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 38
𝑦𝑦𝑖𝑖 : actual/correct value
Neural Networks: An advanced 𝑦𝑦�𝑖𝑖 : estimated value
form of non-linear regression
Loss function: Estimate best 𝑤𝑤1 , 𝑤𝑤2
𝑦𝑦 𝑦𝑦�𝑖𝑖 = 𝑤𝑤1 + 𝑤𝑤2 𝑥𝑥𝑖𝑖 to fit the training data

min 𝑦𝑦𝑖𝑖 − 𝑦𝑦�𝑖𝑖


𝑤𝑤1 ,𝑤𝑤2
s.t.
𝑦𝑦�𝑖𝑖 = 𝑤𝑤1 + 𝑤𝑤2 𝑥𝑥𝑖𝑖 ∀𝑖𝑖

𝑥𝑥
Traditional training of neural networks
required no information about the
underlying physical model. Just data!

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 39


Physics Informed Neural Networks

• Automatic differentiation: derivatives of the neural network output with


respect to the input can be computed during the training procedure

• A differential-algebraic model of a physical system can be included in the


neural network training*

• Neural networks can now exploit knowledge of the actual physical system

• Machine learning platforms (e.g. Tensorflow) enable these capabilities

*M. Raissi, P. Perdikaris, and G. Karniadakis, Physics-Informed neural networks: A deep learning framework for solving forward and
inverse problems involving nonlinear partial differential equations", Journal of Computational Physics, vol.378, pp. 686-707, 2019

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 40


Physics-Informed Neural Networks for Power Systems
“Original”
Loss function

G. S. Misyris, A. Venzke, S. Chatzivasileiadis, Physics-Informed Neural


Networks for Power Systems. Presented at the Best Paper Session of
IEEE PES GM 2020. https://arxiv.org/pdf/1911.03737.pdf

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 41


Physics-Informed Neural Networks for Power Systems
“Original” “Physics-Informed”
Loss function term

Swing equation

G. S. Misyris, A. Venzke, S. Chatzivasileiadis, Physics-Informed Neural


Networks for Power Systems. Presented at the Best Paper Session of
IEEE PES GM 2020. https://arxiv.org/pdf/1911.03737.pdf

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 42


Physics-Informed Neural Networks for Power Systems
• Physics-Informed Neural Networks (PINN) could
potentially replace solvers for systems of
differential-algebraic equations in the long-term
– Probable power system application:
Extremely fast screening of critical
contingencies

• In our example: PINN 87 times faster than ODE


solver

• Can directly estimate the rotor angle at any time


instant
Code is available on GitHub: https://github.com/jbesty
G. S. Misyris, A. Venzke, S. Chatzivasileiadis, Physics-Informed Neural Networks for Power Systems. Presented at the
Best Paper Session of IEEE PES GM 2020. https://arxiv.org/pdf/1911.03737.pdf

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 43


Computation time:
Classical numerical solvers vs. Physics-Informed NNs

RK45 #1
RK45 #2 Classic solvers
RK45 #3
PINN #1
PINN #2 PINNs
PINN #3

• Physics-Informed Neural Networks can


determine the outputs more than 100x faster
than classical numerical solvers
– The further we look in time, e.g. what is the
frequency at t=1s, the larger the
computational advantage is
0.01s 0.1s 1s
J. Stiasny, G. S. Misyris, S. Chatzivasileiadis, Transient Stability Analysis with
Physics-Informed Neural Networks. https://arxiv.org/abs/2106.13638 [ code ]

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 44


Closing the Loop: Trustworthy ML for Power Systems
Trustworthy AI

Train Neural Satisfied? NN Verification/ Final NN with


Training Network
Worst-case Performance
Database with/without yes
no Guarantees Guarantees
Physics-Informed

“Sampling beyond
Statistics”
Enrich Database:
NN-Informed
Sampling

“Sampling beyond
Statistics”
High-Information
Content: Separating
hyperplanes and
Directed Walks

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 45


Neural Network Verification
for classification NNs in Power Systems

A. Venzke, S. Chatzivasileiadis. Verification of Neural Network Behaviour: Formal Guarantees for Power System Applications.
In IEEE Transactions on Smart Grid, vol. 12, no. 1, pp. 383-397, Jan. 2021, https://arxiv.org/pdf/1910.01624.pdf

V. Tjeng, K. Y. Xiao, and R. Tedrake, “Evaluating robustness of neural networks with mixed integer
programming,” in International Conference on Learning Representations (ICLR 2019), 2019
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 46
Neural Network Verification: HOW?

1. Exact transformation: Convert the neural network to a set of linear equations with
binaries
• The Neural Network can be included in a mixed-integer linear program

2. Formulate an optimization problem (MILP) and solve it  certificate for NN behavior

3. Assess if the neural network output complies with the ground truth

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 47


From Neural Networks to
Mixed-Integer Linear Programming
Non-linear Linear weights
activation
• Most usual activation function: ReLU
functions
𝑤𝑤24 • ReLU: Rectifier Linear Unit
𝑢𝑢2 𝑢𝑢4

output
𝑢𝑢𝑖𝑖𝑖𝑖 𝑢𝑢𝑜𝑜𝑜𝑜𝑜𝑜

𝑢𝑢3 𝑢𝑢5
𝑤𝑤35
input

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 48


From Neural Networks to
Mixed-Integer Linear Programming

1. But ReLU can be transformed to a piecewise


linear function with binaries

output
If input<0 , set
binary =0  use
linear function #1
input

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 49


From Neural Networks to
Mixed-Integer Linear Programming

1. But ReLU can be transformed to a piecewise


linear function with binaries

output
If input<0 , set If input>0 , set
binary =0  use binary =1  use
linear function #1 linear function #2
input

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 50


From Neural Networks to
Mixed-Integer Linear Programming

1. But ReLU can be transformed to a piecewise


linear function with binaries

output y 2. I can encode all operations of a Neural Network


to a system of linear equations with continuous
If binary =0, If binary =1, and binary variables
y=0 y=x

input x
3. I can integrate all information encoded in a
neural network inside an optimization
program

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 51


Certify the output for a continuous range of inputs

1. We assume a given input xref with


classification “safe”

A. Venzke, S. Chatzivasileiadis. Verification of Neural Network Behaviour: Formal Guarantees for Power
System Applications. IEEE Transactions on Smart Grid, Jan. 2021. https://arxiv.org/pdf/1910.01624.pdf
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 52
Certify the output for a continuous range of inputs

1. We assume a given input xref with


classification “safe”

2. Solve optimization problem: Does


classification change for any input
within distance ε from xref?

3. If not, then I can certify that my neural


network will classify the whole
continuous region as “safe”

4. I can repeat this for other regions and


different classifications
A. Venzke, S. Chatzivasileiadis. Verification of Neural Network Behaviour: Formal Guarantees for Power
System Applications. IEEE Transactions on Smart Grid, Jan. 2021. https://arxiv.org/pdf/1910.01624.pdf
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 53
Provable Worst-case Guarantees
Venzke, G. Qu, S. Low, S. Chatzivasileiadis, Learning Optimal Power Flow: Worst-case Guarantees for Neural
Networks. Best Student Paper Award at IEEE SmartGridComm 2020. https://arxiv.org/pdf/2006.11029.pdf
R. Nellikkath, S. Chatzivasileiadis, Physics-Informed Neural Networks for Minimising Worst-Case Violations in DC
Optimal Power Flow. In IEEE SmartGridComm 2021, Aachen, Germany, October 2021.
R. Nellikkath, S. Chatzivasileiadis. Physics-Informed Neural Networks for AC Optimal Power Flow. 2021.
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 54
Neural Networks for Optimal Power Flow

Optimal Power Flow


Several recent approaches in literature apply
Minimize Total Generation Cost Neural Networks to estimate the optimal
Subject to: point
• Demonstrate up to 100x speedup
Total supply = Total load demand • But no performance guarantees  Does
Transmission line limits the Neural Network decision lead to any
violations?
Generator limits

We have developed methods that can for the


first time determine these worst-case
violations (of any Neural Network to an OPF)
• Key point: Convert NN to a MILP

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 55


Worst violation over the Our algorithm: provable
whole training dataset worst-case guarantee over
(training+test set) the whole input domain

Maximum violation of
generator limits

Maximum violation of
line limits

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 56


Worst violation over the Our algorithm: provable
whole training dataset worst-case guarantee over
(training+test set) the whole input domain

Maximum violation of
generator limits

Maximum violation of
line limits

Over the whole input domain


violations can be much larger
(here ~7x) compared to what
has been estimated empirically
on the dataset
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 57
Worst violation over the New algorithm: provable
whole training dataset worst-case guarantee over
(training+test set) the whole input domain

Maximum violation of
generator limits

Maximum violation of
line limits

We can now provide guarantees


that no NN output will violate
the line limits over the whole
input domain

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 58


The opportunity
“AI for Optimization”

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 59


The opportunity: 1-slide summary

1. Take any non- 2. Train a NN to 3. Convert NN to a MILP 4. Solve any problem


convex region approximate it (remember NN
verification?)

RELUs as activ. functions


Example1: Instead of running
e.g. 10’000 simulations to
Intersection of all determine the critical clearing
security/stability criteria: time for a set of disturbances,
Non-linear and non- run a single optimization:
convex security region
max fault clearing time
MILP s.t. system=safe
1Misyris, Stiasny, Chatzivasileiadis, CDC, 2021

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 60


An Example
• North Sea Wind Power Hub

• Wind Hub Operators offer energy and


primary frequency control and primary
voltage control
– Can determine both P and Q, and
– Kp,f and Kv (freq. droop and voltage droop)

• What are the permissible combinations of


P,Q, Kp,f , and Kv that satisfy:
– Small-signal Stability (e.g. ζ>3%), for all
– N-1 contingencies
J. Stiasny, S. Chevalier, R. Nellikkath, B. Sævarsson, S. Chatzivasileiadis. Closing
the Loop: A Framework for Trustworthy Machine Learning in Power Systems.
Problem extremely difficult to solve: infinite Accepted to 2022 iREP Symposium - Bulk Power System Dynamics and
Control - XI (iREP). Banff, Canada. 2022. [ paper | code ]
combinations
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 61
Opportunity: Convert Verified Neural Network
to an Optimization Problem
Optimization Problem #1
∗ ∗
For given operating point (𝑃𝑃𝑟𝑟𝑟𝑟𝑟𝑟 , 𝑄𝑄𝑟𝑟𝑟𝑟𝑟𝑟 ), what is the
maximum range of frequency and voltage control
parameters (𝐾𝐾𝑝𝑝 ,𝑓𝑓 and 𝐾𝐾𝑣𝑣 ) that ensures small-
signal stability for all N-1 contingencies?

MILP

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 62


Opportunity: Convert Verified Neural Network
to an Optimization Problem
Optimization Problem #2
For given frequency and voltage control, what is
the maximum permissible range of active and
reactive power (𝑃𝑃 and 𝑄𝑄) that ensures small-
signal stability for all N-1 contingencies?

MILP

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 63


Wrap-up
“Data-centric AI movement”
1. Sampling beyond statistics can yield high quality (Andrew Ng, Stanford, and others)

training databases with smaller amounts of data


“Small [data] is the new big”
2. Physics-informed neural networks exploit the (IEEE Spectrum, Apr. 2022)

underlying physics in the training procedure.


Exploit the prior knowledge
3. Neural network verification builds the missing
trust; necessary in safety-critical systems.

4. From 1000s of simulations to a single


optimization: Neural Networks can capture
previously intractable constraints and embed
them in any optimization problem

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 64


What did I not talk about
Exploring a wide range of research directions
1. Accelerating MILPs: using Decision Trees to estimate the active set and drastically reduce the
number of binary variables [ https://arxiv.org/pdf/2010.06344.pdf , IEEE Trans. Power Systems]

2. Contracting Neural-Newton Solver: Derive convergence guarantees for Neural Networks that can
replace conventional Newton solvers [https://arxiv.org/pdf/2106.02543.pdf , L4DC 2022]

3. Interpretable Machine Learning: Direct association of the SHAP Values with the Power Transfer
Distribution Factors (PTDFs) [ https://arxiv.org/pdf/2209.05793.pdf , submitted ]

4. Input Convex NNs for convex approximations of non-convex optimization problems


[ https://arxiv.org/pdf/2209.08645.pdf , submitted ]

5. Physics-Informed Neural Networks for Fast Dynamic Security Assessment


[https://arxiv.org/pdf/2106.13638.pdf, code: https://github.com/jbesty/PINNs_transient_stability_analysis ]

6. Neural Network Training with by-design worst-case guarantees [soon on ArXiV]

and others…
13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 65
Interested in a postdoc or PhD?
• Come work with us!
• Wide range of topics around ML and beyond:
– Trustworthy Machine Learning, Physics-Informed
Neural Networks, capturing intractrable constraints
with NNs, and more!
– Working with real datasets, and industry
collaboration
– Opportunities for open academic research and/or
toolbox development for practical applications

• Open positions online!

• Contact: [email protected]

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 66


Thank you!

Spyros Chatzivasileiadis
Assoc. Prof, Head of Section
Article without any equations 
www.chatziva.com S. Chatzivasileiadis, A. Venzke, J. Stiasny and
G. Misyris, "Machine Learning in Power
[email protected] Systems: Is It Time to Trust It?," in IEEE
Power and Energy Magazine, vol. 20, no. 3,
• A. Venzke, S. Chatzivasileiadis. Verification of Neural Network Behaviour: Formal Guarantees for pp. 32-41, May-June 2022 [ .pdf ]
Power System Applications. Accepted at IEEE Trans. on Smartgrid. 2020.
https://arxiv.org/pdf/1910.01624.pdf
• A. Venzke, G. Qu, S. Low, S. Chatzivasileiadis, Learning Optimal Power Flow: Worst-case Guarantees
for Neural Networks. Best Student Paper Award at IEEE SmartGridComm 2020.[ .pdf | slides |
video ]
All publications available at:
• G. S. Misyris, A. Venzke, S. Chatzivasileiadis, Physics-Informed Neural Networks for Power Systems.
Presented at the Best Paper Session of IEEE PES GM 2020. https://arxiv.org/pdf/1911.03737.pdf
www.chatziva.com/publications.html
• R. Nellikkath, S. Chatzivasileiadis, Physics-Informed Neural Networks for AC Optimal Power Flow
https://arxiv.org/abs/2110.02672 [ code ] Some code available at:
• J. Stiasny, G. S. Misyris, S. Chatzivasileiadis, Transient Stability Analysis with Physics-Informed Neural www.chatziva.com/downloads.html
Networks. https://arxiv.org/abs/2106.13638 [ code ]
• J. Stiasny, S. Chevalier, R. Nellikkath, B. Sævarsson, S. Chatzivasileiadis. Closing the Loop: A
Framework for Trustworthy Machine Learning in Power Systems. Accepted to 2022 iREP Symposium
- Bulk Power System Dynamics and Control - XI (iREP). Banff, Canada. 2022. [ paper | code ]

13 October 2022 DTU Wind and Energy Systems – Spyros Chatzivasileiadis 67

You might also like