75
Introduction to Bayesian Networks A Tutorial for the 66th MORS Symposium 23 - 25 June 1998 Naval Postgraduate School Monterey, California Dennis M. Buede Joseph A. Tatman Terry A. Bresnick

Basen Network

Embed Size (px)

DESCRIPTION

share any thing increse ur knowledge

Citation preview

Page 1: Basen Network

Introduction to Bayesian Networks

A Tutorial for the 66th MORS Symposium

23 - 25 June 1998Naval Postgraduate School

Monterey, California

Dennis M. Buede Joseph A. TatmanTerry A. Bresnick

Page 2: Basen Network

Overview

• Day 1– Motivating Examples– Basic Constructs and Operations

• Day 2– Propagation Algorithms– Example Application

• Day 3– Learning– Continuous Variables– Software

Page 3: Basen Network

Day One Outline

• Introduction

• Example from Medical Diagnostics

• Key Events in Development

• Definition

• Bayes Theorem and Influence Diagrams

• Applications

Page 4: Basen Network

Why the Excitement?• What are they?

– Bayesian nets are a network-based framework for representing and analyzing models involving uncertainty

• What are they used for?– Intelligent decision aids, data fusion, 3-E feature recognition, intelligent

diagnostic aids, automated free text understanding, data mining• Where did they come from?

– Cross fertilization of ideas between the artificial intelligence, decision analysis, and statistic communities

• Why the sudden interest?– Development of propagation algorithms followed by availability of easy to

use commercial software – Growing number of creative applications

• How are they different from other knowledge representation and probabilistic analysis tools?– Different from other knowledge-based systems tools because uncertainty

is handled in mathematically rigorous yet efficient and simple way– Different from other probabilistic analysis tools because of network

representation of problems, use of Bayesian statistics, and the synergy between these

Page 5: Basen Network

Example from Medical Diagnostics

• Network represents a knowledge structure that models the relationship between medical difficulties, their causes and effects, patient information and diagnostic tests

Visit to Asia

Tuberculosis

Tuberculosisor Cancer

XRay Result Dyspnea

BronchitisLung Cancer

Smoking

Patient Information

Medical Difficulties

Diagnostic Tests

Page 6: Basen Network

Example from Medical Diagnostics

• Relationship knowledge is modeled by deterministic functions, logic and conditional probability distributions

Patient Information

Diagnostic Tests

Visit to Asia

Tuberculosis

Tuberculosisor Cancer

XRay Result Dyspnea

BronchitisLung Cancer

SmokingTuber

Present

Present

Absent

Absent

Lung Can

Present

Absent

Present

Absent

Tub or Can

True

True

True

False

Medical DifficultiesTub or Can

True

True

False

False

Bronchitis

Present

Absent

Present

Absent

Present

0.90

0.70

0.80

0.10

Absent

0.l0

0.30

0.20

0.90

Dyspnea

Page 7: Basen Network

Example from Medical Diagnostics

• Propagation algorithm processes relationship information to provide an unconditional or marginal probability distribution for each node

• The unconditional or marginal probability distribution is frequently called the belief function of that node

TuberculosisPresentAbsent

1.0499.0

XRay ResultAbnormalNormal

11.089.0

Tuberculosis or CancerTrueFalse

6.4893.5

Lung CancerPresentAbsent

5.5094.5

DyspneaPresentAbsent

43.656.4

BronchitisPresentAbsent

45.055.0

Visit To AsiaVisitNo Visit

1.0099.0

SmokingSmokerNonSmoker

50.050.0

Page 8: Basen Network

Example from Medical Diagnostics

• As a finding is entered, the propagation algorithm updates the beliefs attached to each relevant node in the network

• Interviewing the patient produces the information that “Visit to Asia” is “Visit”• This finding propagates through the network and the belief functions of several nodes are updated

TuberculosisPresentAbsent

5.0095.0

XRay ResultAbnormalNormal

14.585.5

Tuberculosis or CancerTrueFalse

10.289.8

Lung CancerPresentAbsent

5.5094.5

DyspneaPresentAbsent

45.055.0

BronchitisPresentAbsent

45.055.0

Visit To AsiaVisitNo Visit

100 0

SmokingSmokerNonSmoker

50.050.0

Page 9: Basen Network

TuberculosisPresentAbsent

5.0095.0

XRay ResultAbnormalNormal

18.581.5

Tuberculosis or CancerTrueFalse

14.585.5

Lung CancerPresentAbsent

10.090.0

DyspneaPresentAbsent

56.443.6

BronchitisPresentAbsent

60.040.0

Visit To AsiaVisitNo Visit

100 0

SmokingSmokerNonSmoker

100 0

Example from Medical Diagnostics

• Further interviewing of the patient produces the finding “Smoking” is “Smoker”

• This information propagates through the network

Page 10: Basen Network

TuberculosisPresentAbsent

0.1299.9

XRay ResultAbnormalNormal

0 100

Tuberculosis or CancerTrueFalse

0.3699.6

Lung CancerPresentAbsent

0.2599.8

DyspneaPresentAbsent

52.147.9

BronchitisPresentAbsent

60.040.0

Visit To AsiaVisitNo Visit

100 0

SmokingSmokerNonSmoker

100 0

Example from Medical Diagnostics

• Finished with interviewing the patient, the physician begins the examination• The physician now moves to specific diagnostic tests such as an X-Ray, which results in a “Normal”

finding which propagates through the network• Note that the information from this finding propagates backward and forward through the arcs

Page 11: Basen Network

TuberculosisPresentAbsent

0.1999.8

XRay ResultAbnormalNormal

0 100

Tuberculosis or CancerTrueFalse

0.5699.4

Lung CancerPresentAbsent

0.3999.6

DyspneaPresentAbsent

100 0

BronchitisPresentAbsent

92.27.84

Visit To AsiaVisitNo Visit

100 0

SmokingSmokerNonSmoker

100 0

Example from Medical Diagnostics

• The physician also determines that the patient is having difficulty breathing, the finding “Present” is entered for “Dyspnea” and is propagated through the network

• The doctor might now conclude that the patient has bronchitis and does not have tuberculosis or lung cancer

Page 12: Basen Network

Applications• Industrial

• Processor Fault Diagnosis - by Intel

• Auxiliary Turbine Diagnosis - GEMS by GE

• Diagnosis of space shuttle propulsion systems - VISTA by NASA/Rockwell

• Situation assessment for nuclear power plant - NRC

• Military

• Automatic Target Recognition - MITRE

• Autonomous control of unmanned underwater vehicle - Lockheed Martin

• Assessment of Intent

• Medical Diagnosis• Internal Medicine• Pathology diagnosis -

Intellipath by Chapman & Hall

• Breast Cancer Manager with Intellipath

• Commercial• Financial Market Analysis• Information Retrieval• Software troubleshooting and

advice - Windows 95 & Office 97

• Pregnancy and Child Care - Microsoft

• Software debugging - American Airlines’ SABRE online reservation system

Page 13: Basen Network

Definition of a Bayesian Network• Factored joint probability distribution as a directed graph:

• structure for representing knowledge about uncertain variables

• computational architecture for computing the impact of evidence on beliefs

• Knowledge structure:• variables are depicted as nodes• arcs represent probabilistic dependence between

variables• conditional probabilities encode the strength of the

dependencies• Computational architecture:

• computes posterior probabilities given evidence about selected nodes

• exploits probabilistic independence for efficient computation

Page 14: Basen Network

Sample Factored Joint DistributionX1

X3X2

X5

X4X6

p(x1, x2, x3, x4, x5, x6) = p(x6 | x5) p(x5 | x3, x2) p(x4 | x2, x1) p(x3 | x1) p(x2 | x1) p(x1)

Page 15: Basen Network

Bayes Rule

• Based on definition of conditional probability

• p(Ai|E) is posterior probability given evidence E

• p(Ai) is the prior probability

• P(E|Ai) is the likelihood of the evidence given Ai

• p(E) is the preposterior probability of the evidence

iii

iiiii

))p(AA|p(E

))p(AA|p(E

p(E)

))p(AA|p(EE)|p(A

p(B)

A)p(A)|p(B

p(B)

B)p(A,B)|p(A

A1

A2 A3 A4

A5A6

E

Page 16: Basen Network

Arc Reversal - Bayes Rule

X1

X3

X2X1

X3

X2

X1

X3

X2 X1

X3

X2

p(x1, x2, x3) = p(x3 | x1) p(x2 | x1) p(x1) p(x1, x2, x3) = p(x3 | x2, x1) p(x2) p( x1)

p(x1, x2, x3) = p(x3 | x1) p(x2 , x1)

= p(x3 | x1) p(x1 | x2) p( x2)

p(x1, x2, x3) = p(x3, x2 | x1) p( x1)

= p(x2 | x3, x1) p(x3 | x1) p( x1)

is equivalent to is equivalent to

Page 17: Basen Network

Inference Using Bayes TheoremTuber-culosis

LungCancer

Tuberculosisor Cancer

Dyspnea

BronchitisLung

Cancer

Tuberculosisor Cancer

Dyspnea

Bronchitis

LungCancer

Tuberculosisor Cancer

Dyspnea

LungCancer

Dyspnea

LungCancer

Dyspnea

The general probabilistic inference problem is to find the probability of an event given a set of evidenceThis can be done in Bayesian nets with sequential applications of Bayes Theorem

Page 18: Basen Network

Why Not this Straightforward Approach?

• Entire network must be considered to determine next node to remove

• Impact of evidence available only for single node, impact on eliminated nodes is unavailable

• Spurious dependencies between variables normally perceived to be independent are created and calculated

• Algorithm is inherently sequential, unsupervised parallelism appears to hold most promise for building viable models of human reasoning

• In 1986 Judea Pearl published an innovative algorithm for performing inference in Bayesian nets that overcomes these difficulties - TOMMORROW!!!!

Page 19: Basen Network

Overview

• Day 1– Motivating Examples– Basic Constructs and Operations

• Day 2– Propagation Algorithms– Example Application

• Day 3– Learning– Continuous Variables– Software

Page 20: Basen Network

Introduction to Bayesian Networks

A Tutorial for the 66th MORS Symposium

23 - 25 June 1998Naval Postgraduate School

Monterey, California

Dennis M. Buede Joseph A. TatmanTerry A. Bresnick

Page 21: Basen Network

Overview

• Day 1– Motivating Examples– Basic Constructs and Operations

• Day 2– Propagation Algorithms– Example Application

• Day 3– Learning– Continuous Variables– Software

Page 22: Basen Network

Overview of Bayesian Network Algorithms

• Singly vs. multiply connected graphs

• Pearl’s algorithm

• Categorization of other algorithms

– Exact

– Simulation

Page 23: Basen Network

Propagation Algorithm Objective

• The algorithm’s purpose is “… fusing and propagating the impact of new evidence and beliefs through Bayesian networks so that each proposition eventually will be assigned a certainty measure consistent with the axioms of probability theory.” (Pearl, 1988, p 143)

Data

Data

Page 24: Basen Network

Singly Connected Networks(or Polytrees)

Definition : A directed acyclic graph (DAG) in which only one semipath (sequence of connected nodes ignoring direction of the arcs) exists between any two nodes.

Do notsatisfy

definition

Polytreestructuresatisfiesdefinition

Multiple parents and/or

multiple children

Page 25: Basen Network

Bel (x) = p(x|e), the posterior (a vector of dimension m)

f(x) g(x) = the term by term product (congruent multiplication) of two vectors, each of dimension m

f(x) g(x) = the inner (or dot) product of two vectors, or the matrix multiplication of a vector and a matrix

= a normalizing constant, used to normalize a vector so that its elements sum to 1.0

NotationX = a random variable (a vector of dimension m); x = a possible value of Xe = evidence (or data), a vector of dimension mMy|x = p(y|x), the likelihood matrix or conditional probability distribution

p(y1|x1) p(y2|x1) . . . p(yn|x1) p(y1|x2) p(y2|x2) . . . p(yn|x2)

. . . . . . . . .

p(y1|xm) p(y2|xm) . . . p(yn|xm)

y

=

x

Page 26: Basen Network

Bi-Directional Propagation in a Chain

e+

e-

X

Y

Z

(e+)

(x)

(y)

(y)

(z)

(e-)

Each node transmits a pi message to itschildren and a lambda message to its parents.

Bel(Y) = p(y|e+, e-) = (y)T (y)

where

(y) = p(y|e+), prior evidence; a row vector(y) = p(e-|y), diagnostic or likelihood evidence; a column vector

(y) = x p(y|x, e+) p(x| e+) = x p(y|x) (x) = (x) My|x

(y) = z p(e-|y, z) p(z| y) = z p(e-|z) p(z| y) = z (z) p(z| y) = Mz|y (z)

Page 27: Basen Network

An Example: Simple Chain

p(Paris) = 0.9p(Med.) = 0.1

M TO|SM =

M AA|TO =

ParisMed.

ChalonsDijon

NorthCentralSouth

Strategic

Mission

Tactical Objective

Avenue ofApproach

.8 .2

.1 .9[ ]

.5 .4 .1

.1 .3 .6[ ]

Ch DiPaMe

No Ce SoChDi

Page 28: Basen Network

Sample Chain - Setup(1) Set all lambdas to be a vector of 1’s; Bel(SM) = (SM) (SM)

(SM) Bel(SM) (SM)Paris 0.9 0.9 1.0Med. 0.1 0.1 1.0

(2) (TO) = (SM) MTO|SM; Bel(TO) = (TO) (TO)

(TO) Bel(TO) (TO)Chalons 0.73 0.73 1.0Dijon 0.27 0.27 1.0

(3) (AA) = (TO) MAA|TO; Bel(AA) = (AA) (AA)

(AA) Bel(AA) (AA)North 0.39 0.40 1.0Central 0.35 0.36 1.0South 0.24 0.24 1.0

Strategic

Mission

Tactical Objective

Avenue ofApproach

MAA|TO =MTO|SM =.8 .2.1 .9[ ] .5 .4 .1

.1 .3 .6[ ]

Page 29: Basen Network

Sample Chain - 1st Propagation

t

TRT

0

5( ) . 1 .6

t = 0(lR) = .8 .2

t = 1(SM) = (IR)

(SM) Bel(SM) (SM)Paris 0.8 0.8 1.0Med. 0.2 0.2 1.0

(TO) Bel(TO) (TO)Chalons 0.73 0.73 1.0Dijon 0.27 0.27 1.0

(AA) Bel(AA) (AA)North 0.39 0.3 0.5Central 0.35 0.5 1.0South 0.24 0.2 0.6

t = 1(AA) = (TR)

Intel.Rpt.

TroopRpt.

Strategic

Mission

Tactical Objective

Avenue ofApproach

Page 30: Basen Network

Sample Chain - 2nd Propagation

t

TRT

0

5( ) . 1 .6

t = 0

(lR) = .8 .2 (SM) Bel(SM) (SM)Paris 0.8 0.8 1.0Med. 0.2 0.2 1.0

t = 2(TO) = (SM) MTO|SM

(TO) Bel(TO) (TO)Chalons 0.66 0.66 0.71Dijon 0.34 0.34 0.71

t = 2(TO) = MAA|TO (SM)

(AA) Bel(AA) (AA)North 0.39 0.3 0.5Central 0.35 0.5 1.0South 0.24 0.2 0.6

Intel.Rpt.

TroopRpt.

Strategic

Mission

Tactical Objective

Avenue ofApproach

Page 31: Basen Network

Sample Chain - 3rd Propagation

(SM) Bel(SM) (SM)Paris 0.8 0.8 0.71Med. 0.2 0.2 0.71

t = 3(SM) = MTO|SM(TO)

(TO) Bel(TO) (TO)Chalons 0.66 0.66 0.71Dijon 0.34 0.34 0.71

t = 3(AA) = (TO) MAA|TO

(AA) Bel(AA) (AA)North 0.36 0.25 0.5Central 0.37 0.52 1.0South 0.27 0.23 0.6

Intel.Rpt.

TroopRpt.

Strategic

Mission

Tactical Objective

Avenue ofApproach

Page 32: Basen Network

Internal Structure of a Single Node Processor

Processor for Node X

Message toParent U

Message fromParent U

MX|U MX|U

k k(X)BEL =

Message toChildren of X

Message fromChildren of X

BEL(X)1(X)

BEL(X)N(X)... ...

(X)(X)

X(U)

1(X) N(X)

X(U)

N(X)1(X)

Page 33: Basen Network

PropagationExample

• The example above requires five time periods to reach equilibrium after the introduction of data (Pearl, 1988, p 174)

“The impact of each new piece of evidence is viewed as a perturbation that propagates through

the network via message-passing betweenneighboring variables . . .” (Pearl, 1988, p 143`

Data

Data

Page 34: Basen Network

Categorization of Other Algorithms

• Exact algorithms

• on original directed graph (only singly connected, e.g., Pearl)

• on related undirected graph

• Lauritzen & Spiegelhalter

• Jensen

• Symbolic Probabilistic Inference

• on a different but related directed graph

• using conditioning

• using node reductions

•Simulation algorithms• Backward sampling

• Stochastic simulation• Forward sampling

• Logic sampling• Likelihood weighting• (With and without

importance sampling)• (With and without

Markov blanket scoring)

Page 35: Basen Network

Decision Making in Nuclear Power Plant Operations

• “Decision making in nuclear power plant operations is characterized by:– Time pressure– Dynamically evolving scenarios– High expertise levels on the part of the operators

MonitorEnvironment

StartAssessment

?

PropagateEvidence

Situation AwarenessUpdated SituationBelief Distribution

Assess SituationAction Required

?

ProjectEvents

Choose Action

If Situation = Si

Then Procedure = Pi

Situation Assessment (SA)Decision Making

1) Monitor the environment2) Determine the need for situation assessment3) Propagate event cues4) Project Events5) Assess Situation6) Make Decision

Page 36: Basen Network

Model of Situation Assessment andHuman Decision Making

• The Bayesian net situation assessment model provides:– Knowledge of the structural relationship among situations, events, and event cues– Means of integrating the situations and events to form a holistic view of their meaning– Mechanism for projecting future events

Steam GeneratorTube Rupture

Loss of CoolantAccident

Loss of SecondaryCoolant

Other

Emergency

Steam LineRadiation

PressurizerPressure

Steam Gen-erator Level

Steam LineRadiation Alarm

PressurizerIndicator

Steam GeneratorIndicator

Situations

Events

SensorOutputs

Page 37: Basen Network

Situation Assessment Bayesian NetInitial Conditions Given Emergency

Emergency

TrueFalse

100 0

LOSC

TrueFalse

17.083.0

LOCA

TrueFalse

17.083.0

Other

TrueFalse

22.078.0

SGTR

TrueFalse

44.056.0

PRZ_Pressure

Rapidly DecSlowly DecConst or Inc

56.63.5039.9

SL_Radiation

TrueFalse

71.328.7

SG_Level

IncreasingNon Increasing

62.737.3

SLR_Alarm

TrueFalse

70.929.1

PRZ_Indicator

Rapidly DecSlowly DecConst or Inc

39.730.130.1

SG_Indicator

IncreasingNon Increasing

60.139.9

Page 38: Basen Network

Situation Assessment Bayesian NetSteam Line Radiation Alarm Goes High

Emergency

TrueFalse

100 0

LOSC

TrueFalse

17.083.0

LOCA

TrueFalse

17.083.0

Other

TrueFalse

26.074.0

SGTR

TrueFalse

55.444.6

PRZ_Pressure

Rapidly DecSlowly DecConst or Inc

64.43.6032.0

SL_Radiation

TrueFalse

99.60.41

SG_Level

IncreasingNon Increasing

71.428.6

SLR_Alarm

TrueFalse

100 0

PRZ_Indicator

Rapidly DecSlowly DecConst or Inc

43.628.228.2

SG_Indicator

IncreasingNon Increasing

67.132.9

Page 39: Basen Network

Emergency

TrueFalse

100 0

LOSC

TrueFalse

17.083.0

LOCA

TrueFalse

17.083.0

Other

TrueFalse

12.387.7

SGTR

TrueFalse

16.383.7

PRZ_Pressure

Rapidly DecSlowly DecConst or Inc

37.63.2659.1

SL_Radiation

TrueFalse

2.4597.6

SG_Level

IncreasingNon Increasing

41.558.5

SLR_Alarm

TrueFalse

0 100

PRZ_Indicator

Rapidly DecSlowly DecConst or Inc

30.134.934.9

SG_Indicator

IncreasingNon Increasing

43.256.8

Situation Assessment Bayesian NetSteam Line Radiation Alarm Goes Low

Page 40: Basen Network

Simulation of SGTR ScenarioEvent TimelineTime Event Cues Actions

6:30:00 Steam generator tube rupture occurs

6:30:14 Radiation alarm Operator observes that the radioactivityalarm for “A” steam line is on

6:30:21 Low pressure alarm

6:30:34 Pressurizer level and pressure aredecreasing rapidly

Charging FCV full open

6:30:44 Pressurizer pressure and level are stilldecreasing

Letdown isolation

6:30:54 Decrease in over-temperature-deltatemperature limit

10% decrease in turbine load

6:32:34 Decreasing pressurizer pressure andlevel cannot be stopped fromdecreasing . . . Emergency

Manual trip

6:32:41 Automatic SI actuated

6:32:44 Reactor is tripped EP-0 Procedure starts

6:33:44 Very low pressure of FW is present FW is isolated

6:37:04 Pressurizer pressure less than 2350 psig PORVs are closed

6:37:24 Radiation alarm, pressure decrease andSG level increase in loop “A”

SGTR is identified and isolated

Page 41: Basen Network

Simulation of SGTR ScenarioConvergence of Situation Disparity

• Situation Disparity is defined as follows:– SD(t) = | Bel (S(t)) - Bel(S’(t)) |– S represents the actual situation– S’ represents the perceived situation

0

0.2

0.4

0.6

0.8

1

6:29 6:30 6:31 6:31 6:32 6:33 6:34 6:35 6:36 6:37

Page 42: Basen Network

Overview

• Day 1– Motivating Examples– Basic Constructs and Operations

• Day 2– Propagation Algorithms– Example Application

• Day 3– Learning– Continuous Variables– Software

Page 43: Basen Network

Introduction to Bayesian Networks

A Tutorial for the 66th MORS Symposium

23 - 25 June 1998Naval Postgraduate School

Monterey, California

Dennis M. Buede, [email protected] Joseph A. Tatman, [email protected]

Terry A. Bresnick, [email protected]

http://www.gmu.edu - Depts (Info Tech & Eng) - Sys. Eng. - Buede

Page 44: Basen Network

Overview

• Day 1– Motivating Examples– Basic Constructs and Operations

• Day 2– Propagation Algorithms– Example Application

• Day 3– Learning– Continuous Variables– Software

Page 45: Basen Network

Building BN Structures

BayesianNetwork

BayesianNetwork

BayesianNetwork

ProblemDomain

ProblemDomain

ProblemDomain

ExpertKnowledge

ExpertKnowledge

TrainingData

TrainingData

ProbabilityElicitor

LearningAlgorithm

LearningAlgorithm

Page 46: Basen Network

Learning Probabilities from Data

• Exploit conjugate distributions

– Prior and posterior distributions in same family

– Given a pre-defined functional form of the likelihood

• For probability distributions of a variable defined between 0 and 1, and associated with a discrete sample space for the likelihood

– Beta distribution for 2 likelihood states (e.g., head on a coin toss)

– Multivariate Dirichlet distribution for 3+ states in likelihood space

Page 47: Basen Network

Beta Distribution

1)n(nm/n)m(1

variance

nm

mean

x)(1xm)(n(m)

(n)n)m,|(xp 1mn1m

Beta

-1

0

1

2

3

4

0 0.5 1 1.5

x

p(x

|m,n

)

m=1, n=2 m=2, n=4 m=10, n=20

Page 48: Basen Network

Multivariate Dirichlet Distribution

1)m(m

)m/m(1mstate i theof variance

m

mstate i theofmean

...xxx)(m)...(m)(m

)m()m,...,m,m|(xp

N

1ii

N

1ii

N

1iiii

th

N

1ii

ith

1m1-m1m

N21

N

1ii

N21DirichletN21

Page 49: Basen Network

Updating with Dirichlet• Choose prior with m1 = m2 = … = mN = 1

– Assumes no knowledge

– Assumes all states equally likely: .33, .33, .33

– Data changes posterior most quickly

– Setting mi = 101 for all i would slow effect of data down

• Compute number of records in database in each state

• For 3 state case:

– 99 records in first state, 49 in second, 99 in third

– Posterior values of m’s: 100, 50, 100

– Posterior probabilities equal means: .4, .2, .4

– For mi equal 101, posterior probabilities would be: .36, .27, .36

Page 50: Basen Network

Learning BN Structure from Data• Entropy Methods

– Earliest method

– Formulated for trees and polytrees

• Conditional Independence (CI)

– Define conditional independencies for each node (Markov boundaries)

– Infer dependencies within Markov boundary

• Score Metrics

– Most implemented method

– Define a quality metric to maximize

– Use greedy search to determine the next best arc to add

– Stop when metric does not increase by adding an arc

• Simulated Annealing & Genetic Algorithms

– Advancements over greedy search for score metrics

Page 51: Basen Network

Sample Score Metrics

• Bayesian score: p(network structure | database)

• Information criterion: log p(database | network structure and parameter set)

– Favors complete networks

– Commonly add a penalty term on the number of arcs

• Minimum description length: equivalent to the information criterion with a penalty function

– Derived using coding theory

Page 52: Basen Network

Features for Adding Knowledge to Learning Structure

• Define Total Order of Nodes

• Define Partial Order of Nodes by Pairs

• Define “Cause & Effect” Relations

Page 53: Basen Network

Demonstration of Bayesian Network Power Constructor

• Generate a random sample of cases using the original “true” network

– 1000 cases

– 10,000 cases

• Use sample cases to learn structure (arc locations and directions) with a CI algorithm in Bayesian Power Constructor

• Use same sample cases to learn probabilities for learned structure with priors set to uniform distributions

• Compare “learned” network to “true” network

Page 54: Basen Network

Enemy Intent

StrategicMissionWeather

TacticalObjective

Enemy’sIntelligence

onFriendlyForces

Avenue ofApproach

DeceptionPlan

Trafficabilityof S. AA

Trafficabilityof C. AA

Trafficabilityof N. AA

Troops @NAI 1

Troops @NAI 2

AA - Avenue of ApproachNAI - Named Area of Interest

IntelligenceReports

Observationson Troop

Movements

WeatherForecast

&FeasibilityAnalysis

Page 55: Basen Network

Original Network

Weather

ClearRainy

70.030.0

Traf_S_AA

GoodBad

81.518.5

Troops_at_NAI_2_N

TrueFalse

40.060.0

Enemy_Intel_on_Friendly_...

GoodPoor

30.070.0

Strategic_Mission

ParisMediteranean

80.020.0

Tactical_Objective

ChalonsDijon

75.025.0

Ave_of_Approach

NorthCentralSouth

37.336.725.9

Deception_Plan

Northern Dec...Southern De...

44.955.1

Troops_at_NAI_1_S

TrueFalse

34.665.4

Traf_N_AA

GoodBad

70.229.8

Traf_C_AA

GoodBad

75.524.5

Page 56: Basen Network

Weather

ClearRainy

68.431.6

Traf_S_AA

GoodBad

79.920.1

Troops_at_NAI_2_N

TrueFalse

39.960.1

Enemy_Intel_on_Friendly_...

GoodPoor

29.470.6

Strategic_Mission

ParisMediteranean

78.521.5

Tactical_Objective

ChalonsDijon

72.827.2

Ave_of_Approach

NorthCentralSouth

37.234.828.0

Deception_Plan

Northern Dec...Southern De...

47.452.6

Troops_at_NAI_1_S

TrueFalse

37.562.5

Traf_N_AA

GoodBad

68.231.8

Traf_C_AA

GoodBad

73.726.3

Learned Network with 1000 Cases

Missing Arcs: 2Added Arcs: 0Arcs Misdirected: 5Arcs Unspecified: 3

Missing Arcs: 2Added Arcs: 0Arcs Misdirected: 5Arcs Unspecified: 3

Page 57: Basen Network

Learned Network with 10,000 Cases

Weather

ClearRainy

70.030.0

Traf_S_AA

GoodBad

81.118.9

Troops_at_NAI_2_N

TrueFalse

40.859.2

Enemy_Intel_on_Friendly_...

GoodPoor

30.369.7

Strategic_Mission

ParisMediteranean

80.519.5

Tactical_Objective

ChalonsDijon

75.124.9

Deception_Plan

Northern Dec...Southern De...

45.055.0

Traf_C_AA

GoodBad

75.724.3

Ave_of_Approach

NorthCentralSouth

38.135.826.2

Troops_at_NAI_1_S

TrueFalse

35.065.0

Traf_N_AA

GoodBad

70.429.6

Missing Arcs: 1Added Arcs: 1Arcs Misdirected: 4

Page 58: Basen Network

Comparison of Learned Networks with Truth

p(AoA) Truth 1 K 10 K

Prior .37, .37, .26 .37, .35, .28 .38, .36, .26

“Clear” .41, .37, .22 .38, .36, .26 .41, .36, .23

“Rainy” .30, .36, .34 .35, .32, .33 .30, .36, .34

“NAI 1 True” .15, .13, .71 .17, .12, .71 .16, .12, .71

“Rain, NAI 1True”

.10, .11, .79 .15, .10, .75 .11, .11, .78

“Rain, NAI 1 &2 True”

.56, .02, .43 .59, .05, .36 .56, .03, .40

Page 59: Basen Network

Summary of Comparison• Reasonable accuracy can be obtained with a relatively small

sample

– Prior probabilities (before data) look better than posterior probabilities (after data) for small samples

• More data improves results, but may not guarantee learning the same network

• Using partial order expertise can improve the structure of the learned network

• Comparison did not have any nodes with low probability outcomes

– Learning algorithms requires 200-400 samples per outcome

– In some cases, even 10,000 data points will not be enough

Page 60: Basen Network

Continuous Variables Example

• Data from three sensors can be fused to gain information on relevant variables

Page 61: Basen Network

Continuous Variables Example

Entering values for the three discrete random variables shifts the sensor mean values

Page 62: Basen Network

Continuous Variables Example

• A defective filter has a strong impact on the light penetrability and metal emissions sensors

Page 63: Basen Network

Continuous Variables Example

• What can we learn about the three state variables given sensor outputs?

Page 64: Basen Network

Continuous Variables Example

• A light penetrability reading that is 3 sigma low is a strong indicator of a defective filter

Page 65: Basen Network

Software

• Many software packages available

– See Russell Almond’s Home Page

• Netica

– www.norsys.com

– Very easy to use

– Implements learning of probabilities

– Will soon implement learning of network structure

• Hugin

– www.hugin.dk

– Good user interface

– Implements continuous variables

Page 66: Basen Network

Basic References

• Pearl, J. (1988). Probabilistic Reasoning in Intelligent Systems. San Mateo, CA: Morgan Kauffman.

• Oliver, R.M. and Smith, J.Q. (eds.) (1990). Influence Diagrams, Belief Nets, and Decision Analysis, Chichester, Wiley.

• Neapolitan, R.E. (1990). Probabilistic Reasoning in Expert Systems, New York: Wiley.

• Schum, D.A. (1994). The Evidential Foundations of Probabilistic Reasoning, New York: Wiley.

• Jensen, F.V. (1996). An Introduction to Bayesian Networks, New York: Springer.

Page 67: Basen Network

Algorithm References

• Chang, K.C. and Fung, R. (1995). Symbolic Probabilistic Inference with Both Discrete and Continuous Variables, IEEE SMC, 25(6), 910-916.

• Cooper, G.F. (1990) The computational complexity of probabilistic inference using Bayesian belief networks. Artificial Intelligence, 42, 393-405,

• Jensen, F.V, Lauritzen, S.L., and Olesen, K.G. (1990). Bayesian Updating in Causal Probabilistic Networks by Local Computations. Computational Statistics Quarterly, 269-282.

• Lauritzen, S.L. and Spiegelhalter, D.J. (1988). Local computations with probabilities on graphical structures and their application to expert systems. J. Royal Statistical Society B, 50(2), 157-224.

• Pearl, J. (1988). Probabilistic Reasoning in Intelligent Systems. San Mateo, CA: Morgan Kauffman.

• Shachter, R. (1988). Probabilistic Inference and Influence Diagrams. Operations Research, 36(July-August), 589-605.

• Suermondt, H.J. and Cooper, G.F. (1990). Probabilistic inference in multiply connected belief networks using loop cutsets. International Journal of Approximate Reasoning, 4, 283-306.

Page 68: Basen Network

Backup

Page 69: Basen Network

The Propagation Algorithm• As each piece of evidence is introduced, it generates:

– A set of “” messages that propagate through the network in the direction of the arcs

– A set of “” messages that propagate through the network against the direction of the arcs

• As each node receives a “” or “” message:– The node updates its own “” or “” and sends it out onto the network– The node uses its updated “” or “” to update its BEL function

TBEL(t)

(t) (t)

UBEL(t)

(t) (t)

XBEL(t)

(t) (t)

YBEL(t)

(t) (t)

ZBEL(t)

(t) (t)

Mu|t Mx|uMy|x Mz|y

Page 70: Basen Network

Key Events in Development of Bayesian Nets

• 1763 Bayes Theorem presented by Rev Thomas Bayes (posthumously) in the Philosophical Transactions of the Royal Society of London

• 19xx Decision trees used to represent decision theory problems• 19xx Decision analysis originates and uses decision trees to model real world

decision problems for computer solution• 1976 Influence diagrams presented in SRI technical report for DARPA as technique for

improving efficiency of analyzing large decision trees• 1980s Several software packages are developed in the academic environment for

the direct solution of influence diagrams• 1986? Holding of first Uncertainty in Artificial Intelligence Conference

motivated by problems in handling uncertainty effectively in rule-based expert systems• 1986 “Fusion, Propagation, and Structuring in Belief Networks” by Judea Pearl

appears in the journal Artificial Intelligence• 1986,1988 Seminal papers on solving decision problems and performing probabilistic

inference with influence diagrams by Ross Shachter• 1988 Seminal text on belief networks by Judea Pearl, Probabilistic Reasoning in

Intelligent Systems: Networks of Plausible Inference• 199x Efficient algorithm• 199x Bayesian nets used in several industrial applications• 199x First commercially available Bayesian net analysis software available

Page 71: Basen Network

TuberculosisPresentAbsent

7.2892.7

XRay ResultAbnormalNormal

24.675.4

Tuberculosis or CancerTrueFalse

21.178.9

Lung CancerPresentAbsent

14.685.4

DyspneaPresentAbsent

100 0

BronchitisPresentAbsent

86.713.3

Visit To AsiaVisitNo Visit

100 0

SmokingSmokerNonSmoker

100 0

Example from Medical Diagnostics

• Finished with interviewing the patient, the physician begins the examination• The physician determines that the patient is having difficulty breathing, the finding “Dyspnea” is

“Present” is entered and propagated through the network• Note that the information from this finding propagates backward through the arcs

Page 72: Basen Network

TuberculosisPresentAbsent

0.1999.8

XRay ResultAbnormalNormal

0 100

Tuberculosis or CancerTrueFalse

0.5699.4

Lung CancerPresentAbsent

0.3999.6

DyspneaPresentAbsent

100 0

BronchitisPresentAbsent

92.27.84

Visit To AsiaVisitNo Visit

100 0

SmokingSmokerNonSmoker

100 0

Example from Medical Diagnostics

• The physician now moves to specific diagnostic tests such as an X-Ray, which results in a “Normal” finding which propagates through the network

• The doctor might now conclude that the evidence strongly indicates the patient has bronchitis and does not have tuberculosis or lung cancer

Page 73: Basen Network

Tuberculosis

XRay Result

Tuberculosisor Cancer

Lung Cancer

Dyspnea

Bronchitis

Page 74: Basen Network

Inference Using Bayes Theorem

• The general probabilistic inference problem is to find the probability of an event given a set of evidence

• This can be done in Bayesian nets with sequential applications of Bayes Theorem

Tuber-culosis

LungCancer

Smoker

Tuberculosisor Cancer

Tuber-culosis

LungCancer

Smoker

Tuberculosisor Cancer

LungCancer

Smoker

Tuberculosisor Cancer

LungCancer

Smoker

Tuberculosisor Cancer

Smoker

Tuberculosisor Cancer

Smoker

Page 75: Basen Network

Sample Chain - Setup

(1) Set all lambdas to be a vector of 1’s; Bel(SM) = (SM) (SM)

(SM) Bel(SM) (SM)Paris 0.9 0.9 1.0Med. 0.1 0.1 1.0

(2) (TO) = (SM) MTO|SM; Bel(TO) = (TO) (TO)

(TO) Bel(TO) (TO)Chalons 0.73 0.73 1.0Dijon 0.27 0.27 1.0

(3) (AA) = (TO) MAA|TO; Bel(AA) = (AA) (AA)

(AA) Bel(AA) (AA)North 0.39 0.73 1.0Central 0.35 0.27 1.0South 0.24 0.24 1.0

Strategic

Mission

Tactical Objective

Avenue ofApproach

.9.1

.2.8

.6.3.1

.1.4.5MAA|TO =MTO|SM =