23
6진단하는 기계 <인공지능 입문> 강의 노트 서울대학교 컴퓨터공학부 & 인지과학/뇌과학 협동과정 http://bi.snu.ac.kr/~btzhang/ Version: 20180409

제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

제6강진단하는기계

<인공지능입문>강의노트

장 병 탁서울대학교컴퓨터공학부&인지과학/뇌과학협동과정http://bi.snu.ac.kr/~btzhang/

Version: 20180409

Page 2: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

목차

탐색과지식 …………………..……..……………………………….………….. 3전문가시스템 ………………….………….….…….…………………………. 4규칙기반전문가시스템 ……………..….…….……………..…….…....   6전방향/역방향추론 ………………………………………………………….. 8불확실성과  확률 ………...……...……….……..………………….………. 10확률그래프모델 ………………………………………………………………. 12베이즈넷 ………………………………....………………….…………….……. 13베이즈넷활용  (데모) ……………………………………………………….. 18Reading  Assignments      ….……………..……..…….….………….….……… 23

2©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University

Page 3: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

탐색과지식

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 3

q 탐색기반문제해결Ø 범용휴리스틱Ø GeneralistØ 약방법(weak  methods)Ø 계산(추론)에의존하는경향Ø 인공지능방법론의기반제공

q 지식기반문제해결Ø 도메인특수휴리스틱Ø SpecialistØ 도메인지식의중요성Ø 기억(지식)에의존하는경향Ø 전문가시스템으로산업적으로성공

제6강

Page 4: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

전문가시스템

4

q 추론엔진(IE)과지식베이스(KB)로구성

q 추론과지식을분리

q 일반적인추론방법제공.도메인에따라지식베이스를교체

q 설명시스템을통해추론결과를설명

제6강

Page 5: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

전문가시스템사례

5

제6강

• Mycin [Shortliffe 1976]

• Prospector  [Duda,  Gaschnig &  Hart  1979,  Campbell,  et  al.  1982]

(.5). a-group-cusstreptococ ; (.75) pos-coag-ccusstaphylocoisinfection thecausing bemight which smears)or cultureson seen an those(orther th organism that theevidence is There :Then

bacterial isinfection theof typeThe 4)and culture, theofstain on theseen not wereOrganisms 3)

and infection,esoft tissuor skin serious of evidence have doespatient The 2)

and ,meningitis is therapy requireswhich infection The 1) : If300 Rule

deposit.copperporphyry afor favorablet environmen regional a 0.7) (5, is

e then thersystem,fault going- thoroughintrusive,-pre a is thereIf

Page 6: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

규칙기반전문가시스템

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 6

제6강

• 은행대출업무:개인에게대출을해줄것인가를결정

sheet.) balanceexcellent an hasapplicant (The BALexpenses.)his/her exceeds income sapplicant' (The INC

rating.)credit good a hasapplicant (TheRATING amount.)loan n thegrater tha

lysufficient is collateral on the appraisal (The APP.)reputation financial good a hasapplicant (The REP

payments.)loan the toable isapplicant (The PYMTry.)satisfacto isloan for the collateral (The COLLAT

approved.) be shouldloan (TheOK

OKREPBAL 5.PYMTINC 4.

REPRATING 3.COLLATAPP 2.

OKREPPYMTCOLLAT 1.

⊃∧⊃

⊃⊃

⊃∧∧

사실규칙

Page 7: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

AND-­‐OR 트리

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 7

q 역방향추론과전방향추론

제6강

Page 8: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

전방향/역방향 추론

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 8

q 전방향추론(Forward  Chaining)Ø 데이터à규칙Ø 상향식추론(bottom-­‐up)Ø 데이터기반추론Ø 결과  예측Ø 주어진데이터에대해다양한결론들을모두도출Ø 비효율적일수도있으나새로운결과  발견가능성있음

q 역방향추론(Backward  Chaining)Ø 규칙à데이터Ø 하향식추론(top-­‐down)Ø 가설기반추론Ø 원인  진단Ø 가설과관련되는규칙만을사용하여효율적으로추론Ø 추론이효율적이나새로운결과  발견가능성적음

제6강

Page 9: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

불확실성과확률

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 9

q 논리,불확실성,확률

제6강

((BAT_OK), (MOVES),(LIFTABLE),(GUAGE))

Joint Probability

(True, True, True, True) 0.5686

(True, True, True, False) 0.0299

(True, True, False, True) 0.0135

(True, True, False, False) 0.0007

… …

Page 10: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

확률적추론

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 10

제6강

Page 11: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

확률법칙

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 11

q 확률Ø 확률변수 X:확률  실험의  결과를  실수에  대응시키는  함수Ø 실험,사건 X,실험결과값 x

예:동전을  세번  던지는  실험에서:  X  =  동전  앞면의  수  (0,  1,  2,  3  가능)  Ø 확률값 P(X =  x)Ø 주변확률분포 P(X)Ø 결합확률분포 P(X1,  X2,  …,  Xn)Ø 조건확률분포 P(X1|X2)

q 확률법칙Ø 합법칙 𝑃 𝑋 = ∑ 𝑃(𝑋,𝑌))Ø 곱법칙 𝑃 𝑋,𝑌 = 𝑃 𝑋 𝑌 𝑃 𝑌 = 𝑃 𝑌 𝑋 𝑃 𝑋

Ø 베이즈법칙 𝑃 𝑋|𝑌 = + 𝑌 𝑋 +(,)+())

,        𝑃 𝑌|𝑋 = + 𝑋 𝑌 +())+(,)

제6강

Page 12: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

확률그래프모델

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 12

q 확률적규칙기반시스템è확률그래프모델q 확률적독립관계를이용하여실세계를컴팩트하게표현하는방법

제6강

)()|()|(),|()(),,,,(

EPADPBCPEABPAPEDCBAP

=

1( ) ( | )

==∏

n

i ii

p p xx pa

Page 13: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

베이즈넷:확률적추론

X1 X2

X3

(0.2,  0.8) (0.6,  0.4)

true 1 (0.2,0.8)true 2 (0.5,0.5)false 1 (0.23,0.77)false 2 (0.53,0.47)

-Introdu

ction

제6강

Page 14: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

Example  contd.베이즈넷예1제6강

Page 15: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

베이즈넷예2

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 15

q 방향성비순환그래프구조망 (DAG  =  directed  acyclic  graph)

제6강

Page 16: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

A Bayesian NetworkThe “ICU alarm” network• 37 binary random variables• 509 parameters instead of

PCWP CO

HRBP

HREKG HRSAT

ERRCAUTERHRHISTORY

CATECHOL

SAO2 EXPCO2

ARTCO2

VENTALV

VENTLUNG VENITUBE

DISCONNECT

MINVOLSET

VENTMACHKINKEDTUBEINTUBATIONPULMEMBOLUS

PAP SHUNT

ANAPHYLAXIS

MINOVL

PVSAT

FIO2PRESS

INSUFFANESTHTPR

LVFAILURE

ERRBLOWOUTPUTSTROEVOLUMELVEDVOLUME

HYPOVOLEMIA

CVP

BP

베이즈넷예3제6강

Page 17: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,
Page 18: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

Example

TrainStrike

MartinLate

NormanLate

ProjectDelay

OfficeDirty

BossAngry

BossFailure-­‐in-­‐Love

MartinOversleep

NormanOversleep

Use a DAG to model the causality.

Page 19: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

ExampleTrainStrike

MartinLate

NormanLate

ProjectDelay

OfficeDirty

BossAngry

BossFailure-­‐in-­‐Love

MartinOversleep

NormanOversleep

Attach prior probabilities to all root nodesNorman

oversleep Probability

T 0.2

F 0.8

TrainStrike Probability

T 0.1

F 0.9

Martinoversleep Probability

T 0.01

F 0.99

Bossfailure-in-love Probability

T 0.01

F 0.99

Page 20: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

ExampleTrainStrike

MartinLate

NormanLate

ProjectDelay

OfficeDirty

BossAngry

BossFailure-­‐in-­‐Love

MartinOversleep

NormanOversleep

Attach prior probabilities to non-root nodes

Normanuntidy

Norman oversleep

T F

Normanuntidy

T 0.6 0.2

F 0.4 0.8

Train strikeT FMartin oversleep

T F T F

Martin Late

T 0.95 0.8 0.7 0.05F 0.05 0.2 0.3 0.95

Each column is summed to 1.

Page 21: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

ExampleTrainStrike

MartinLate

NormanLate

ProjectDelay

OfficeDirty

BossAngry

BossFailure-­‐in-­‐Love

MartinOversleep

NormanOversleep

Normanuntidy

Each column is summed to 1.Boss Failure-in-loveT F

Project DelayT F T F

Office DirtyT F T F T F T F

Boss Angry

very 0.98 0.85 0.6 0.5 0.3 0.2 0 0.01mid 0.02 0.15 0.3 0.25 0.5 0.5 0.2 0.02little 0 0 0.1 0.25 0.2 0.3 0.7 0.07no 0 0 0 0 0 0 0.1 0.9

Attach prior probabilities to non-root nodes

Page 22: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

Inference

Page 23: 제6강 진단하는 기계 › Courses › IntroAI › slides › chap6.pdf · 2018-04-09 · 전문가 시스템 사례 5 제6강 • Mycin[Shortliffe1976] • ProspectorB[Duda,

Reading   (Watching)  Assignments

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 23

• Rule-­‐Based  Systems,  MIT  Video  Lecture,  2015.  • Q:  이비디오강의(연습)에서는무슨추론문제를다루고있는가?

P0-­‐P5의규칙집합(rules,  knowledge)은무엇인가?주어진사실(assertions,  facts)은무엇인가?어떤추론즉질문에대한답이가능한가?결론에도달하기위한전방향추론(forward  chaining)과역방향추론(backward  chaining)방법을설명하시오.

제6강