medical cyber-physical systems · 2019-12-03 · medical cyber-physical systems electrophysiology...

42
Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur Behl Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 1 Many thanks to: Zhihao Jiang, Houssam Abbas, and Rahul Mangharam, For help with preparing this module.

Upload: others

Post on 20-Jun-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Medical Cyber-Physical Systems

Electrophysiology basics

Lecture 10

Pr inc ip les of Model ing for Cyber-Phys ica l Systems

Instructor: Madhur Behl

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 1

Many thanks to:Zhihao Jiang,Houssam Abbas, andRahul Mangharam,

For help with preparing this module.

Page 2: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Why explore cardiac modeling?

Cardiac disease is the leading cause of death in the USAround the world, 17.5 million people die of Cardiovascular Diseases (CVD) yearly

That’s an estimated 31% of all deaths

More than 75% of CVD deaths occur in low income and middle income countries

Implanted devices are a leading method of treating some CVDs

2Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 3: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Why study cardiac devices?

These devices are life-critical à must function correctly

Are constrained in their energy consumption à must be low-power

Are implanted in the body à very special design considerations (e.g., materials used, must be ex-plantable…)

Are regulated by the FDA à must follow certain best practices, but also have some inertia

These are life-critical embedded systems

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 3

Page 4: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Its shocking! Cardiac devices can have bugs

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 4

Page 5: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 5

Page 6: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Implantable Cardiac Devices Recalls

• Over 600,000 cardiac medical devices recalled from 1990-2000

– 40% of which were due to software issues

• 2008-12: 15% of all the medical device recalls due to software

Implantable Pacemaker Implantable Cardioverter-Defibrillator (ICD)Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 6

Page 7: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

The consequences of incorrect algorithms and implementations

Filmed and shared with patient’s consent

7Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 8: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

8

Closed-Loop Evaluation

Scenario 1

Scenario 2

Scenario 3

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 9: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Need a model of the heart which can capture the physiological conditions of the heart and respond to pacemaker outputs.

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 9

Model/implement the pacemaker

Check if pacemaker is ‘safe’ for different heart conditions

Page 10: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Let our heart (model) catch the bugs before your heart does

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 10

Page 11: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

This Module

Will be challenging:

◦ New domain (electrophysiology)

◦ New tools (Simulink and UPPAAL)

◦ New theory (timed automata)

◦ New concepts (model checking)

Simulink

UPPAAL

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 11

Page 12: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

How do we go about understanding the heart?

Understand the electrical system as a circuit?Understand the cellular activity? Understand the molecular activity?What does one heart tell us about other hearts?What does a healthy heart tell us about an unhealthy heart?What is a healthy heart?

What is the purpose of our enquiry?

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 12

Page 13: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Need to understand the domain.

Speak the same language as the domain experts.

Remember….modeling choices and ‘usefulness’ depend on the problem at hand.

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 13

Page 14: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Electrophysiology of the heart

aka ..talking like a cardiologist without attending med schoolPrinciples of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 14

Page 15: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

First, let’s examine the human heart

Principles of Modeling for CPS – Fall 2018 15

Page 16: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Circulatory system and heart function

16

Vein: towards the heart.Artery: away from the heart

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 17: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Electrical generation and propagation

Right atrium

Right ventricle

Left atrium

Right ventricle

Sino-atrial (SA) node

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 17

Page 18: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Bradycardia: bradus (slow) + kardia (heart)

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 18

Page 19: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Two leads in heart chambers

19

Implantable Pacemaker

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 20: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Two leads are placed in the right atrium and right ventricleMonitors the local electrical activities of the heart and deliver therapy according to the timing information

Madhur Behl [email protected]

Implantable Pacemaker

Principles of Modeling for CPS – Fall 2018 20

Page 21: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

21

Implantable Pacemaker

A

V

AS

VS

Pacemaker

Pace

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 22: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Sinoatrial Node“Automaticity”

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 22

RA

RV

LA

LV

+Depolarization-

Bachmann’s bundle

Atrioventricular Node[delay bw Atria & ventricles]

Bundle of His L posterior fascicle

L anteriorfascicle

R bundle

L bundlePurkinje fibers

Page 23: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 23

Page 24: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Pacemaker cells (naturally pace the atria and ventricles)and

Cardiac myocytes cells (“squeezing” the heart)

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 24

Page 25: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Pacemaker cells – “Automaticity”

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 25

1) Sino-Atrial (SA) node

2) Atrioventricular (AV) node

3) Bundle of His / Purkinje fibers

Page 26: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Pacemaker cells

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 26

mV

(+123) Ca2+

(+67) Na+

(-92) K+ -60

Na+

time

threshold

Na+Ca2+

“Voltage-gated”

-40Na+

K+

+10

-60

Dep

olar

izat

ion

Repo

lari

zatio

n

1 beat

Page 27: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Race to keep pace !

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 27

mV

SA AV BoH

threshold

“Normal Sinus Rhythm”

Page 28: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Race to keep pace !

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 28

Heart Rate (beats/min) 1 beat (sec)SA 60-90 0.66 secAV 40-60 1 sec

BoH 20-30 2 sec

0.66 sec

1 sec

2 sec

Page 29: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Race to keep pace !

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 29

0.66 sec

1 sec

2 sec

Page 30: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Race to keep pace !

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 30

SA AV BoH2cm 1cm

How does SA node control the heart beat ?“Normal Sinus Rhythm”

?

Can this signal arrive before 1 sec ?

0.5 m/sec 2 m/sec

Conduction velocity is very fast !

0.04 sec

0.66 sec0.7 sec+0.1 sec

0.005 sec0.805 sec

0.66 sec

1 sec

2 sec

Page 31: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Race to keep pace !

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 31

• SA node – Plan A• AV node – Plan B• BoH – Plan C

0.66 sec

1 sec

2 sec

Page 32: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Pacemaker cells (naturally pace the atria and ventricles)and

Cardiac myocytes cells (“squeezing” the heart)

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 32

Page 33: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Cardiac Myocytes – How does the heart squeeze

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 33

mV

time

(+123) Ca2+

(+67) Na+

(-92) K+

K+

-90

Na+

Ca2+

Neighboring cell depolarizes

K+

Na+

-70

+20+5

K+

Ca2+-90

Page 34: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Action Potential - TissueThe elementary signal of the heart

It affects the conduction velocity and signal passage of the tissue.

Closely related to most cardiac diseases.

Madhur Behl [email protected]

APD: Action Potential Duration Functional syncytium

Principles of Modeling for CPS – Fall 2018 34

Page 35: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Cellular Level - Action potentialIons refill

Divided into Effective Refractory Period(ERP) and Relative Refractory Period(RRP) for activation with certain strength

Block Interval during ERP, abnormal new action potential during RRP

Madhur Behl [email protected]

Refractory

ERP RRP

Principles of Modeling for CPS – Fall 2018 35

Page 36: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Refractory

Time

V out

Rest ERP RRP Rest

Refractory

TimeV out

Rest ERP RRP Rest

node

pathnode

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 36

Page 37: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Treating bradycardiaWe want to detect when the atria or the ventricles miss a beat, and pace the chambers when that happens

Start small and simple:◦ We know that usually, the atria contract together, and the ventricles contract together à sense only in right

atrium and ventricles◦ Usually, depolarization is synchronous with contraction à measure the electrical activity as a proxy for the

mechanical activity◦ Usually, depolarization in part of the atrium (or ventricle) is

propagated to the rest of that chamber à measure only inone location of the chamber

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 37

Page 38: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Two leads are placed in the right atrium and right ventricleMonitors the local electrical activities of the heart and deliver therapy according to the timing information

Madhur Behl [email protected]

Implantable Pacemaker

Principles of Modeling for CPS – Fall 2018 38

Page 39: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 39

Page 40: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Timing info for local activation

40

Implantable Pacemaker

A

V

AS

VS

Pacemaker

Pace

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected]

Page 41: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

• Simulink and State-flow tutorials have been posted on the course website. • Not graded. No submission required.

• One week to brush up on Simulink/Stateflow.• Go through the tutorials before the Simulink/Stateflow model walkthrough lecture next week

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 41

Page 42: Medical Cyber-Physical Systems · 2019-12-03 · Medical Cyber-Physical Systems Electrophysiology basics Lecture 10 Principles of Modeling for Cyber-Physical Systems Instructor: Madhur

Next Lecture:

• Pacemaker operation and heart conditions•Model checking vs Model testing• Heart modeling using timed automata

Principles of Modeling for CPS – Fall 2018 Madhur Behl [email protected] 42