SlideShare a Scribd company logo
1 of 15
Download to read offline
Anomaly	Detec-on	and	

Change	Detec-on

-	Sparse	Structure	analysis	-
@_X37n	

March	3rd,	2019

	in	Kernel,	Tokyo
問題設定:	異異常箇所同定	(anomaly	localiza-on)
• 変数個別を⾒見見るだけでは検知できない異異常を、変数同⼠士の関係性から⾒見見たい

• 例例:	市街の監視カメラ動画からの異異常検知

(個別に動く⼈人が、異異常事態で何らかの集団的⾏行行動を取るようになる。)





























Real-Time Anomaly Detection and Localization in Crowded Scenes, Sabokrou et al.. 2015 CVPR
問題設定:	異異常箇所同定	(anomaly	localiza-on)
• 正常時のデータを元にして、個々の変数関係を計算

新規データについて、変数の相関異異常度を計算すればいい。



1.	疎構造学習



2.	相関異異常度



(3.	密度⽐比推定)





















グラフの独⽴立性
• 最も単純な近似:

2変数が他の変数の条件付きで独⽴立であるとき、グラフでエッジがない

(pairwise	Markov	graph;	pairwise	Markov	random	field)

• Markov確率場とは

graph	G	=	(V,	E)	上の確率変数族	(Xv)	v	in	V		に関して、次のMarkov性を定義	
• Global	Markov	であるとは、Vの互いに素な部分集合S,	A,	Bについて





• Local	Markov	であるとは、任意のv	in	Vについて











• Pairwise	Markov	であるとは、任意のu,	v	in	V	(uv	not	in	E)	について



XA ⊥⊥ XB |XS
Xv ⊥⊥ XVcl(v) |XN(v)
N(v) = {u ∈ V|uv ∈ E}
cl(v) = {v} ∪ N(v)
Xv ⊥⊥ Xu |XV{v,u}
Grow-Shrinkage	Markov	Network	(GSNN)
• Grow-Shrinkage	Markov	Network	は、

1.)	grow	…	近傍	N(i)	を増やす		2.)	shrink	…	近傍	N(i)	を減らす

2段階の計算を⾏行行う。	
• Local	Markov	条件独⽴立として、近傍	N(i)	を適切に求める。	
• Pairwise	Markov	条件独⽴立の計算(|V|-2に関して指数的)	よりも早い。
Efficient Markov Network Structure Discovery Using Independence Tests, Bloomberg et al., 2009
Boltzmann	分布からのsparse正則化
• Boltzmann	machine	(2値のpairwise	model)	を考え、L1正則化を加えて最適化



• Boltzmann	machine

確率分布関数







対数尤度関数







• Boltzmann	machine	の勾配計算は⼤大変なため、辺のないグラフから⽬目的関数を
⼤大きくする辺を追加する⼿手法が提案されている。

(Su-In	Lee	et	al.	NIPS	2006:	Efficient	Structure	Learning	of	Markov	Networks	using	L1)
p(x) =
1
Z
exp
∑
i<j
Jijxixj +
∑
i
hixi xi ∈ {1, − 1}
1
N
l(J, h) =
∑
i<j
JijED[xixj] +
∑
i
hiED[xi] − logZ(J, h)
l(J, h) + λ∥J∥1
Gaussian	Markov	確率場からのsparse	正則化
• Gaussian	Markov	確率場を考え、L1正則化を加えて最適化

(Graphical	Lasso,	2008,	Fredman)





• Gaussian	Markov	確率場

確率分布関数









• 内点法で解くと、O(|V|6)	の計算時間で解ける	
• もうちょっと賢い⽅方法もあるらしい。

(O.	Banerjee	et	al.,	Model	selec-on	through	sparse	maximum	likelihood	es-ma-on	
Mul-variate	Gaussian	or	Binary	Data,	NIPS	2008)

(O.	Banerjee	et	al.,	Convex	op-miza-on	techniques	for	fieng	sparse	gaussian	
graphical	models,	NIPS	2006)
p(x) =
detΛ
(2π)n
exp
(
−
1
2
(x − μ)T
Λ(x − μ)
)
logdetΛ−tr( ̂ΣΛ) − λ∥Λ∥1
Gaussian	Markov	確率場の性質
• (i,	j)	-	pairwise	Markov	独⽴立であることは、Λij	=	0	と等価である。





proof.





• 次で定義される偏相関係数	r	が	0	でないとき、

xi	と	xj	に直接相関があると呼ぶ









• 直接相関が	0	であり、共分散⾏行行列列∑	の	(i,j)成分が0であるとき、

間接相関があると呼ぶ。



Xi ⊥⊥ Xj |XV{i,j} ⇔ Λij = 0
p(xi, xj |xV{i,j}) ∝ exp
(
1
2
(Λiix2
i + Λijxixj + Λjjxjxj) + Axi + Bxj + C
)
ri,j
≡ −
Λi,j
Λi,iΛj,j
Graphical	Gaussian	Model	(GGM)によるグラフ定義
• 6	変数の場合の例例
伝統的⼿手法
• 素朴な⽅方法:	共分散の逆⾏行行列列計算して、閾値以下を0としてしまう	
• 確率モデルでなくなる。	
• 精度⾏行行列列は正定値でなくなる	
• 直接相関と間接相関を分ける性質がなくなる	
• 閾値の設定が実⽤用上簡単でない

• Λが疎な解となるような事前分布を付し、MAP推定する

>>	Graphical	Lasso	2008	Fredman

• 伝統的⽅方法:	共分散構造選択	(Dempster	1972)	
• 以下の繰り返し	
• (1)	⼩小さい⾏行行列列要素をひとつ	0	にする	
• (2)	その拘束上で確率モデルを推定
ブロック座標降下法によるGraphical	Lasso計算
• ⽬目的関数





これは次と等価	(既出)







• f	の勾配



• 座標降下法:	Λ	のほかを既知として、⼀一つの列列・⾏行行について解く。

—>	疎な精度⾏行行列列を、逆⾏行行列列計算なしに求められる。







とし、L,	Wを既知、																						の制約条件のもとで、

fの勾配	=	0	を計算する。



Λ* = argmaxΛ{ln p(Λ)ΠN
n=1N(x(n)
|0,Λ)}
Λ* = argmaxΛ f(Λ; Σ, ρ)
p(Λ) =
ρ
2
exp(−ρ∥Λ∥1)
f(Λ; Σ, ρ) ≡ ln|Λ|−tr(ΣΛ) − ρ∥Λ∥1
∂f
∂Λ
= Λ−1
− Σ − ρsign(Λ)
˜⇤˜⇤ 1
= I
˜⇤ =
✓
L l
lT
◆
˜⇤ 1
=
✓
W w
wT
◆
˜⌃ =
✓
R s
sT
si,i
◆
• (fの勾配)	=	0





• 拘束条件



• 																							を導⼊入する。





により	β	が求まり、λ,	l,	w,	σ	も以下から計算できる。







• (a)	のβ計算は、次の最適化問題と等しい。	

実務的には、Lasso	の	solver	でこちらを解く。





ブロック座標降下法によるGraphical	Lasso計算
Wl + λw = 0
wl + σλ = 1
W − R − ρsign(L) = 0
w − s − ρsign(l) = 0
σ − si,i − ρsign(λ) = 0
˜⇤ 1 ˜⇤ =
✓
WL + wlT
Wl + w
lT
W + wT
wT
l +
◆
β ≡ W−1
w
l = − λW−1
w = − λβWβ − s − ρsign(β) = 0 (a)
λ =
1
σ − βTWβ
l =
β
σ − βTWβ
w = Wβ σ = si,i + ρ
min
1
2
∥W
1
2 β − b∥2
+ ρ∥β∥1
外れ値解析
• 異異常値を次のように定義







Graphical	Lasso	で求めた精度⾏行行列列Λから計算できる。







• 意味:	各他の変数から期待される予想値に対して、どれだけ期待から外れてい
るかを求めることになる。

















αi ≡ − ln(x′i |x′−i, D)
α(x′) =
1
2
ln
2π
Λi,i
+
1
2Λi,i
∑
Λi,jx′j
異異常解析
• 異異常値を次のように定義







Graphical	Lasso	で求めた精度⾏行行列列Λから計算できる。







• 意味:	正常データ	D	に対して、新たに得たデータD’	がどのように異異常度を持っ
ているかを計測する。

















αi ≡
∫
dx−i p(x−i |D)
∫
dxi p(xi |x−i, D)ln
p(x′i |x′−i, D)
p(x′i |x′−i, D′)
α(x′) =
1
2
ln
Λi,i
Λ′i,i
−
1
2 (
[ΛSΛ]i,i
Λi,i
−
[Λ′SΛ′]i,i
Λ′i,i )
参考資料料
• 潜在的グラフ構造からの異異常検知	(井⼿手剛)

hop://latent-dynamics.net/01/2010_LD_Ide.pdf



• グラフィカルモデル	(機械学習プロフェッショナルシリーズ)	(渡辺	有祐)

• 異異常検知と変化検知	(機械学習プロフェッショナルシリーズ)	(井⼿手剛,	杉⼭山将)

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Anomaly detection and change detection - sparse structure analysis -