SlideShare a Scribd company logo
1 of 54
Download to read offline
머신 러닝(machine learning) 기반
이상 탐지(anomaly detection)
-DataIntelligenceLab-
2023.07.25. 이상명
2
❑ 연구실 소개
❑ 이상 탐지 란
❑ 이상 탐지의 기본 원리
❑ 이상 탐지 알고리즘
❑ 샘플 복잡도
목차
3
❑ DataIntelligenceLab( DILab)
연구실 소개
4
연구실 소개
❑ DataIntelligenceLab( DILab)
5
이상치 탐지란
6
❑ 시계열 데이터
❑ 시간적 순서를 갖는 관측치로 구성됨
❑ 주가 데이터 . 센서 데이터 , …
Input data type
Sliding window
Testbed
8
Sensorexample.
Anomaly Pattern
Noised Data
9
Anomalytype
10
❑ 시계열 이상탐지의 어려움
❑ 이상 유형이 다양함
❑ 라벨링 비용
1. 도메인 지식 필요
2. 정상과 이상의 경계가 불분명
❑ 데이터 불균형
11
Machinelearning
준지도학습
(Semi-supervised Learning)
• 소수의 labeled data를 학습에 이용
이상탐지는 Imbalanced dataset이기 때문에 주로 비지도 학습
12
Imbalanceddatasets
1. Labeling cost
2. Real scenario
Normal data only
비지도학습이 선호됨
13
❑ Statisticalmodel
❑ 이전 시점의 데이터로 미래 시점을 예측해서 예측 값과 관측 값의 불일치 정도를 anomaly score로
정량화
▪ ARIMA(Autoregressive Integrated Moving Average)
▪ STL (Seasonal Trend Decomposition using Loess )
▪ ETS (Exponential Smoothing State Space Model)
▪ VAR (Vector Autoregressive)
❑ Clusteringmodel
❑ Data를 clustering 하고 cluster의 중심으로부터 떨어진 거리를 통해 anomaly score 정량화
• K-means clustering
• One-classSVM
• GMM(gaussian mixture model)
• DBSCAN(density based spatial clustering of applications with noise)
Classical approach
14
❑ Reconstructionbasedapproach
➢ 모델이 복원한 값과 관측값의 차이를 통해 anomaly score 정량화
▪ Autoencoder
❑ Forecastingbasedapproach
➢ 모델이 예측한 값과 관측값의 차이를 통해 anomaly score 정량화
▪ LSTM
❑ Hybridapproach
Deeplearning-basedapproach
15
SVM(supportvectormachine)
Hard margin SVM
Soft margin SVM
Non - linearly
separable
16
➢ 비선형 분류 문제를 풀기 위해 선형 분리가 가능한 고차원 공간(reproducing kernel Hilbert
space, RKHS) 으로 mapping
KernelSVM
17
KernelSVM
18
One-classSVM
19
One-classSVM
20
Supportvectordatadescription (SVDD)
21
➢ Featuremap𝜙(⋅) 를 신경망을 통해 찾기
DeepSVDD
Anomaly score :
Objective :
22
DeepSVDD
23
❑ Autoencoder
Deeplearning-basedapproach
1. 정상 데이터로만 학습
2. Anomaly score = 입력 데이터 – 복원 데이터
3. Anomaly score > threshold : 이상으로 탐지
24
USAD(2020, KDD)
25
❑ AE1 : generator
❑ Phase 1 : reconstruction error 최소화
❑ Phase 2 : 실제 데이터 W와 AE2의 생성 데이터 간의 reconstruction error 최소화
❑ AE2 : discriminator
❑ Phase 1 : reconstruction error 최소화
❑ Phase 2 : 실제 데이터 W와 AE2의 생성 데이터 간의 reconstruction error 최대화
Two – phasetraining
Phase 1 Phase 2
26
Evaluation
27
GNN foranomalydetection
Sensor간의 dependency를 고려
28
GDN (2021,AAAI)
29
VAE –LSTM(2020, IEEE)
30
LSTMbasedVAE – GAN
31
❑ 평가 방법의 한계
❑ F1 : best F1
❑ AUC : 모든 임계 값에 대한 성능의 평균
❑ 이상치의 영향력 고려
❑ 임계 값 문제
❑ Attack data에 대한 정보 없이 임계 값 추정
Limitation
학습 데이터에 따른 제어시스템 이상탐지 AI모델의 영향성 연구
33
❑ Background
❑ Related work
❑ Problem definition
목차
34
❑ 관련 연구 키워드 :Samplecomplexity
Background and related work
Sample complexity : 머신러닝 모델이 성공적으로 학습하기 위해서는 데이터가 얼마나 필요한지
Optimal performance
Optimal Model complexity
Performance
(Generalization Error)
Model complexity Train data size
35
❑ Classical learningtheory의 PAC(Probablyapproximatelycorrect) - learning
❑ 학습 알고리즘이 학습 데이터를 기반으로 새로운 데이터에 대해 어떻게 예측할지 가늠
❑ 학습 알고리즘이 특정 함수를 근사하기 위해서는 “학습데이터가 얼마나 필요한지” Generalization
bound 에 대한 연구
❑ Generalization bound는 주로 다음과 같은 식의 형태를 띰
Background and related work
| train error – test error| ≤ O( Model complexity, Data size, Confidence level )
36
❑ VC(Vapnik-Chervonenkis) - dimension
➢ 대표적이고 고전적인 model complexity 척도
➢ 분류(classification)문제에서 머신러닝 모델이 학습데이터 포인트를 나눌 수 있는 경우의 수와 연관
➢ 머신러닝 모델이 만들 수 있는 가설 함수 공간(𝐻)의 크기를 정량화
Background and related work
➢ 최적의 성능을 위해서는 적절한 model- complexity가 요구된다
37
❑ 하지만, Deep learning model의 경우 여러 이론들(e.g., Universal approximation theorem,
… )이 말해주듯이 model이 만들 수 있는 함수 공간이 매우 크고 함수 표현력이 뛰어남.
❑ 최근 연구동향에서 sample complexity와 관련된 주제의 예시는 다음과 같음
❑ Theoretical analysis
➢ 기존의 learning theory 이외에 정보 이론을 통한 접근법이나 새로운 이론적인 접근법을 통해
학습 곡선 예측과 추정
❑ Active learning
➢ 한정된 자원내에서 성능 향상에 큰 의미를 갖는 데이터에 우선적으로 labelling, annotation
하기 위해 데이터의 가치 판단 및 선별
❑ Transfer learning , Meta learning , few-shot learning
➢ Pre-trained model이 있을 때, 적은 데이터로 효율적으로 목표 성능을 달성하기 위해
Background and related work
고전적인 머신러닝 모델에는 기존의 model complexity가 잘 적용되지만
딥러닝 모델에 대해서는 실제 성능과 이론의 차이가 큼
38
❑ “AMeta-LearningApproachto PredictingPerformanceandDataRequirements“ byAchin Jainetal.
Background and related work
➢ Meta learning에서 어림짐작으로 Data size에 따른 Learning curve 추정 하는 power law와
비교해서 개선된 piecewise power law 를 제안
➢ Learning curve에서 double descent, and saturation를 고려하지 않았다는 한계가 존재
39
❑ "How muchmoredatado i need? estimatingrequirementsfordownstreamtasks.“(Mahmood,
Rafid, etal. ,CVPR, 2022)
Background and related work
➢ 일부 데이터셋에 대해서 반복적인 모델평가를 하고 성능 추정 함수
의 파라미터를 추정
40
❑ "TooLarge; DataReduction forVision-LanguagePre-Training.“(Wang,AlexJinpeng, etal., preprint,
2023)
Background and related work
➢ large-scale Vision-Language Pre-Training (VLP) datasets에 대하여 효과적인 압축방안을 제시
➢ 이미지- 텍스트 데이터의 특성(high redundancy, misalignment )때문에 적절한 선택과
정제(refinement)를 통해 더 적은 데이터수로도 목표 성능을 달성할 수 있음을 보임
➢ Figure1.을 통해서 알 수 있듯이 단순히 data size 뿐 만 아니라 data complexity 역시 sample
complexity 고려에 중요한 요소
ITM : image – text matching
41
❑ “ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs”(Bisla, Devanshet
al.,CVPR,2021)
❑ 학습데이터 수에 따른 딥러닝 모델의 일반화 오류(generalization error)의 함수를 이론적으로 추정
❑ test point ො
𝑥 가 error를 만들어낼 확률을 feature space에서 ො
𝑥 의 nearest neighbor인 x(ො
𝑥) 와의
거리에 비례하는 Φ ො
𝑥 로 정의
Background and related work
Nearest neighbor : train data point
Test data point ො
𝑥
[ Feature space (D dim.)]
“radius” : Empirically 추정
최종적으로 Error 함수를 계산하기
위해서 Empirically 추정
“radius” : Empirically 추정
42
❑ EffectivedimensionalityD를 찾기 위해Featureextractor부분에 Bottleneckstructure를 추가함
❑ Pre-trained model의 성능(accuracy)을 대부분( ≈ 90%) 보존하는 압축을 통해 D를 찾고 D차원의
feature space에서 Φ ො
𝑥 적분을 통해 error 기대값을 계산함
ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs
Pre-trained model Bottleneck
structure
Bottleneck
structure
D = 2
43
❑ 최종적으로Traindata의 분포 𝒇𝒕𝒓𝒂𝒊𝒏 ,Testdata의 분포 𝒇𝒕𝒆𝒔𝒕 를 통해, 다음 적분 식을 계산(by
MonteCarlomethod)함으로써 datasize N에 따른 error의 기대값 𝑬𝒇𝒕𝒆𝒔𝒕
[𝚽]를 추정함
ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs
➢ 최종적으로 D-차원의 적분을 함으로써 데이터 수(N)에 따른 error의 기대 값 함수가 유도됨
44
ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs
Hyperparameter : Empirically 추정
➢ D-차원의 feature space에서
가우시안 분포를 가정함
➢ Maximum likelihood approach를 통해
가우시안의 파라미터(𝜇, 𝛴)를 추정
45
❑ 학습 데이터 복잡도(entropy)와 시계열 이상탐지 AI 모델의 성능 변화의 상관 관계 연구
❑ 데이터 복잡도 : sampling rate에 따른 시계열 데이터의 복잡도를 entropy-based metric을 통해
정량화
❑ Base AI 모델 : “USAD: UnSupervised Anomaly Detection on Multivariate Time Series” by Julien
Audibert et al.
❑ 성능 : F1, AUC , 이상치 점수, 확률 분포 거리 metric(e.g., Jensen-Shannon divergence, Total
variance distance, … )
➢ 각각의 이상 탐지 성능 metric은 한계를 갖고 있기 때문에 여러가지 metric에 대해서
종합적으로 평가
❑ Entropy analysis
❑ 생물학에서 EEG(Electro Encephalo Graphy,뇌파), ECG(electrocardiogram, 심전도)같이 복잡한 시계열
생체신호의 동적 특성을 분석하고 이상상태(질병)를 파악하기 위해 여러가지 entropy-based
metric을 사용함
❑ 마찬가지로, 물리학의 비선형 동역학에서 시계열로부터 시스템의 동적 특성이나 복잡성, 초기 조건의
민감성 등을 entropy를 통해 정량화하고 혼돈계(Chaos system)을 분석함
Problemdefinition
46
❑ 연구를 통한 이점
① 이상탐지 성능 최적화 : Entropy가 높으면 불필요한 정보(noise)에 의해 모델이 과적합 될 수 있고
낮으면 데이터의 중요한 정보를 잃을 수 있기 때문에 적절한 entropy에 따른 최적의 모델 성능을
제시
② 학습 시간, 자원 단축
③ 최적의 모델 성능을 보장하는 entropy를 통해 down sampling rate 가이드라인을 제시할 수 있음
❑ 더 나아가서,
➢ Entropy와 성능의 변화를 이해함으로써 효과적인 윈도우 크기(window size)에 대한 연구,
적절한 데이터 수(time step)에 대한 연구로 이어질 수 있음
➢ 이상 탐지 뿐만 아니라 시계열 도메인의 다른 task에도 유용할 수 있음
Problemdefinition
❑ “Time Series Complexities and Their Relationship to Forecasting Performance”(Ponce-
Flores, Mirna, et al., Entropy, 2020)
❑ Entropy를 통해 정량화된 시계열 데이터의 특성(time series complexity)과 통계 모델(e.g., ARIMA,
ETS, …) 예측 성능과의 PCA를 통한 상관관계 연구
❑ 데이터 수(time step)에 따른 entropy값들과 예측 성능과의 분석
❑ 딥러닝 모델이 아니라 통계 모델이라는 차이점이 존재
47
Comparing method
48
❑ Shannon entropy
➢ Y값의 분포
❑ Spectral entropy
➢ Frequency의 분포
❑ Bubble entropy
➢ Pattern(상승과 하강) 출현에 대한 분포
❑ Phase entropy
➢ Slope angle에 대한 분포
Entropybasedmeasure
➢ Entropy based measure를 통해 시계열 데이터의
예측가능성, 무작위성을 정량화 할 수 있음
❑ 학습데이터의 데이터 수(time step length)를 늘리면서 각각의 센서에 대해 4가지
entropy들을 측정한 결과
49
Dataratio 10%~ 100% (SWaT)
데이터 수(time step length)에 대해서 entropy가 대체로 flat하기 때문에 성능과 상관관계
연구에서 뚜렷한 경향성을 찾기 힘들 수 있음
50
❑ 적절한 Sampling rate미만이라면 신호가 왜곡되기 때문에 모델 성능에 결정적
➢ Noise가 포함 되어있는 sensor 시계열의 경우 sampling rate에 의한 왜곡이 심함
Motivatingexample
51
Motivatingexample
Sine data Noised - Sine data
➢ Frequency의 분포를 계산하는 spectral entropy 의 경우, noise에 민감한 것을 확인할 수 있음
➢ Y값의 분포를 계산하는 shannon entropy의 경우, sampling rate에 민감한 것을 확인할 수 있음
Down sampling rate
52
Motivatingexample
Logistic map :
Bifurcation : 시간이 충분히 흐른 뒤 반복되어 나타나는 점의 개수를 나타냄
Logistic map을 통해 생성되는 시계열 데이터를 통해 선정한 entropy들이 시계열의 복잡성을
표현하는지 확인할 수 있음
53
Motivatingexample
시계열의 일부 복잡한 성질을 선정한 entropy들이 나타냄을 확인할 수 있음
54
❑ 각 센서에 대한 4가지 entropy measure
Down sampling rate 1-500 (SWaT)
1. down sampling rate에 따라 시계열의 특성이 변화함을 확인할 수 있음
2. 단, model complexity와 data complexity의 고려를 위해 fine-tuning을 통한 effective
dimension에서 분석되어야 함

More Related Content

Similar to S.M.Lee, Invited Talk on "Machine Learning-based Anomaly Detection"

Imagination-Augmented Agents for Deep Reinforcement Learning
Imagination-Augmented Agents for Deep Reinforcement LearningImagination-Augmented Agents for Deep Reinforcement Learning
Imagination-Augmented Agents for Deep Reinforcement Learning성재 최
 
2.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-12.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-1Haesun Park
 
빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측
빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측
빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측ABRC_DATA
 
데이터 분석 프로세스
데이터 분석 프로세스데이터 분석 프로세스
데이터 분석 프로세스Lee Seungeun
 
what is deep learning?
what is deep learning? what is deep learning?
what is deep learning? PartPrime
 
Deep Learning for AI (1)
Deep Learning for AI (1)Deep Learning for AI (1)
Deep Learning for AI (1)Dongheon Lee
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks ISang Jun Lee
 
Introduction toDQN
Introduction toDQNIntroduction toDQN
Introduction toDQNCurt Park
 
"From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ..."From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ...LEE HOSEONG
 
Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리SANG WON PARK
 
Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tae Young Lee
 
Azure ml studio_fraud_detection
Azure ml studio_fraud_detectionAzure ml studio_fraud_detection
Azure ml studio_fraud_detectionTIMEGATE
 
Azure ml studio_fraud_detection
Azure ml studio_fraud_detectionAzure ml studio_fraud_detection
Azure ml studio_fraud_detectionSeung-Woo Kang
 
1조_SLRA_최종발표.pptx
1조_SLRA_최종발표.pptx1조_SLRA_최종발표.pptx
1조_SLRA_최종발표.pptxssuserb4f344
 
From maching learning to deep learning episode2
From maching learning to deep learning episode2 From maching learning to deep learning episode2
From maching learning to deep learning episode2 Yongdae Kim
 
2017 빅콘테스트
2017 빅콘테스트2017 빅콘테스트
2017 빅콘테스트Sanghyun Kim
 
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝Haesun Park
 
5일차.map reduce 활용
5일차.map reduce 활용5일차.map reduce 활용
5일차.map reduce 활용주영 송
 

Similar to S.M.Lee, Invited Talk on "Machine Learning-based Anomaly Detection" (20)

Imagination-Augmented Agents for Deep Reinforcement Learning
Imagination-Augmented Agents for Deep Reinforcement LearningImagination-Augmented Agents for Deep Reinforcement Learning
Imagination-Augmented Agents for Deep Reinforcement Learning
 
2.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-12.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-1
 
SLRA
SLRASLRA
SLRA
 
빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측
빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측
빅데이터 윈윈 컨퍼런스-지능형 보험 부당청구탐지와 예측
 
데이터 분석 프로세스
데이터 분석 프로세스데이터 분석 프로세스
데이터 분석 프로세스
 
what is deep learning?
what is deep learning? what is deep learning?
what is deep learning?
 
Deep Learning for AI (1)
Deep Learning for AI (1)Deep Learning for AI (1)
Deep Learning for AI (1)
 
Lecture 4: Neural Networks I
Lecture 4: Neural Networks ILecture 4: Neural Networks I
Lecture 4: Neural Networks I
 
Introduction toDQN
Introduction toDQNIntroduction toDQN
Introduction toDQN
 
"From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ..."From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ...
 
Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리
 
Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)
 
Azure ml studio_fraud_detection
Azure ml studio_fraud_detectionAzure ml studio_fraud_detection
Azure ml studio_fraud_detection
 
Azure ml studio_fraud_detection
Azure ml studio_fraud_detectionAzure ml studio_fraud_detection
Azure ml studio_fraud_detection
 
1조_SLRA_최종발표.pptx
1조_SLRA_최종발표.pptx1조_SLRA_최종발표.pptx
1조_SLRA_최종발표.pptx
 
From maching learning to deep learning episode2
From maching learning to deep learning episode2 From maching learning to deep learning episode2
From maching learning to deep learning episode2
 
2017 빅콘테스트
2017 빅콘테스트2017 빅콘테스트
2017 빅콘테스트
 
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 1장. 한눈에 보는 머신러닝
 
Ml
MlMl
Ml
 
5일차.map reduce 활용
5일차.map reduce 활용5일차.map reduce 활용
5일차.map reduce 활용
 

More from Network Science Lab, The Catholic University of Korea

More from Network Science Lab, The Catholic University of Korea (20)

230727_HB_JointJournalClub.pptx
230727_HB_JointJournalClub.pptx230727_HB_JointJournalClub.pptx
230727_HB_JointJournalClub.pptx
 
230724_Thuy_Labseminar.pptx
230724_Thuy_Labseminar.pptx230724_Thuy_Labseminar.pptx
230724_Thuy_Labseminar.pptx
 
230724-JH-Lab Seminar.pptx
230724-JH-Lab Seminar.pptx230724-JH-Lab Seminar.pptx
230724-JH-Lab Seminar.pptx
 
5강 - 멀티모달 및 모듈화.pptx
5강 - 멀티모달 및 모듈화.pptx5강 - 멀티모달 및 모듈화.pptx
5강 - 멀티모달 및 모듈화.pptx
 
3강 - CNN 및 이미지 모델.pptx
3강 - CNN 및 이미지 모델.pptx3강 - CNN 및 이미지 모델.pptx
3강 - CNN 및 이미지 모델.pptx
 
4강 - RNN 및 시계열 모델.pptx
4강 - RNN 및 시계열 모델.pptx4강 - RNN 및 시계열 모델.pptx
4강 - RNN 및 시계열 모델.pptx
 
2강 - 실험 흐름과 멀티모달 개요.pptx
2강 - 실험 흐름과 멀티모달 개요.pptx2강 - 실험 흐름과 멀티모달 개요.pptx
2강 - 실험 흐름과 멀티모달 개요.pptx
 
1강 - pytorch와 tensor.pptx
1강 - pytorch와 tensor.pptx1강 - pytorch와 tensor.pptx
1강 - pytorch와 tensor.pptx
 
Technical Report on "Lecture Quality Prediction using Graph Neural Networks"
Technical Report on "Lecture Quality Prediction using Graph Neural Networks"Technical Report on "Lecture Quality Prediction using Graph Neural Networks"
Technical Report on "Lecture Quality Prediction using Graph Neural Networks"
 
Presentation for "Lecture Quality Prediction using Graph Neural Networks"
Presentation for "Lecture Quality Prediction using Graph Neural Networks"Presentation for "Lecture Quality Prediction using Graph Neural Networks"
Presentation for "Lecture Quality Prediction using Graph Neural Networks"
 
NS-CUK Seminar: J.H.Lee, Review on "Graph Neural Networks with convolutional ...
NS-CUK Seminar: J.H.Lee, Review on "Graph Neural Networks with convolutional ...NS-CUK Seminar: J.H.Lee, Review on "Graph Neural Networks with convolutional ...
NS-CUK Seminar: J.H.Lee, Review on "Graph Neural Networks with convolutional ...
 
NS-CUK Seminar: V.T.Hoang, Review on "Are More Layers Beneficial to Graph Tra...
NS-CUK Seminar: V.T.Hoang, Review on "Are More Layers Beneficial to Graph Tra...NS-CUK Seminar: V.T.Hoang, Review on "Are More Layers Beneficial to Graph Tra...
NS-CUK Seminar: V.T.Hoang, Review on "Are More Layers Beneficial to Graph Tra...
 
NS-CUK Seminar: S.T.Nguyen Review on "Accurate learning of graph representati...
NS-CUK Seminar: S.T.Nguyen Review on "Accurate learning of graph representati...NS-CUK Seminar: S.T.Nguyen Review on "Accurate learning of graph representati...
NS-CUK Seminar: S.T.Nguyen Review on "Accurate learning of graph representati...
 
Joo-Ho Lee: Topographic-aware wind forecasting system using multi-modal spati...
Joo-Ho Lee: Topographic-aware wind forecasting system using multi-modal spati...Joo-Ho Lee: Topographic-aware wind forecasting system using multi-modal spati...
Joo-Ho Lee: Topographic-aware wind forecasting system using multi-modal spati...
 
Ho-Beom Kim: Detection of Influential Unethical Expressions through Construct...
Ho-Beom Kim: Detection of Influential Unethical Expressions through Construct...Ho-Beom Kim: Detection of Influential Unethical Expressions through Construct...
Ho-Beom Kim: Detection of Influential Unethical Expressions through Construct...
 
NS-CUK Seminar: J.H.Lee, Review on "Hyperbolic graph convolutional neural net...
NS-CUK Seminar: J.H.Lee, Review on "Hyperbolic graph convolutional neural net...NS-CUK Seminar: J.H.Lee, Review on "Hyperbolic graph convolutional neural net...
NS-CUK Seminar: J.H.Lee, Review on "Hyperbolic graph convolutional neural net...
 
Sang_Graphormer.pdf
Sang_Graphormer.pdfSang_Graphormer.pdf
Sang_Graphormer.pdf
 
NS-CUK Seminar: S.T.Nguyen, Review on "Do Transformers Really Perform Bad for...
NS-CUK Seminar: S.T.Nguyen, Review on "Do Transformers Really Perform Bad for...NS-CUK Seminar: S.T.Nguyen, Review on "Do Transformers Really Perform Bad for...
NS-CUK Seminar: S.T.Nguyen, Review on "Do Transformers Really Perform Bad for...
 
NS-CUK Seminar: S.T.Nguyen, Review on "DeeperGCN: All You Need to Train Deepe...
NS-CUK Seminar: S.T.Nguyen, Review on "DeeperGCN: All You Need to Train Deepe...NS-CUK Seminar: S.T.Nguyen, Review on "DeeperGCN: All You Need to Train Deepe...
NS-CUK Seminar: S.T.Nguyen, Review on "DeeperGCN: All You Need to Train Deepe...
 
NS-CUK Seminar: V.T.Hoang, Review on "Everything is Connected: Graph Neural N...
NS-CUK Seminar: V.T.Hoang, Review on "Everything is Connected: Graph Neural N...NS-CUK Seminar: V.T.Hoang, Review on "Everything is Connected: Graph Neural N...
NS-CUK Seminar: V.T.Hoang, Review on "Everything is Connected: Graph Neural N...
 

S.M.Lee, Invited Talk on "Machine Learning-based Anomaly Detection"

  • 1. 머신 러닝(machine learning) 기반 이상 탐지(anomaly detection) -DataIntelligenceLab- 2023.07.25. 이상명
  • 2. 2 ❑ 연구실 소개 ❑ 이상 탐지 란 ❑ 이상 탐지의 기본 원리 ❑ 이상 탐지 알고리즘 ❑ 샘플 복잡도 목차
  • 6. 6 ❑ 시계열 데이터 ❑ 시간적 순서를 갖는 관측치로 구성됨 ❑ 주가 데이터 . 센서 데이터 , … Input data type Sliding window
  • 10. 10 ❑ 시계열 이상탐지의 어려움 ❑ 이상 유형이 다양함 ❑ 라벨링 비용 1. 도메인 지식 필요 2. 정상과 이상의 경계가 불분명 ❑ 데이터 불균형
  • 11. 11 Machinelearning 준지도학습 (Semi-supervised Learning) • 소수의 labeled data를 학습에 이용 이상탐지는 Imbalanced dataset이기 때문에 주로 비지도 학습
  • 12. 12 Imbalanceddatasets 1. Labeling cost 2. Real scenario Normal data only 비지도학습이 선호됨
  • 13. 13 ❑ Statisticalmodel ❑ 이전 시점의 데이터로 미래 시점을 예측해서 예측 값과 관측 값의 불일치 정도를 anomaly score로 정량화 ▪ ARIMA(Autoregressive Integrated Moving Average) ▪ STL (Seasonal Trend Decomposition using Loess ) ▪ ETS (Exponential Smoothing State Space Model) ▪ VAR (Vector Autoregressive) ❑ Clusteringmodel ❑ Data를 clustering 하고 cluster의 중심으로부터 떨어진 거리를 통해 anomaly score 정량화 • K-means clustering • One-classSVM • GMM(gaussian mixture model) • DBSCAN(density based spatial clustering of applications with noise) Classical approach
  • 14. 14 ❑ Reconstructionbasedapproach ➢ 모델이 복원한 값과 관측값의 차이를 통해 anomaly score 정량화 ▪ Autoencoder ❑ Forecastingbasedapproach ➢ 모델이 예측한 값과 관측값의 차이를 통해 anomaly score 정량화 ▪ LSTM ❑ Hybridapproach Deeplearning-basedapproach
  • 15. 15 SVM(supportvectormachine) Hard margin SVM Soft margin SVM Non - linearly separable
  • 16. 16 ➢ 비선형 분류 문제를 풀기 위해 선형 분리가 가능한 고차원 공간(reproducing kernel Hilbert space, RKHS) 으로 mapping KernelSVM
  • 21. 21 ➢ Featuremap𝜙(⋅) 를 신경망을 통해 찾기 DeepSVDD Anomaly score : Objective :
  • 23. 23 ❑ Autoencoder Deeplearning-basedapproach 1. 정상 데이터로만 학습 2. Anomaly score = 입력 데이터 – 복원 데이터 3. Anomaly score > threshold : 이상으로 탐지
  • 25. 25 ❑ AE1 : generator ❑ Phase 1 : reconstruction error 최소화 ❑ Phase 2 : 실제 데이터 W와 AE2의 생성 데이터 간의 reconstruction error 최소화 ❑ AE2 : discriminator ❑ Phase 1 : reconstruction error 최소화 ❑ Phase 2 : 실제 데이터 W와 AE2의 생성 데이터 간의 reconstruction error 최대화 Two – phasetraining Phase 1 Phase 2
  • 31. 31 ❑ 평가 방법의 한계 ❑ F1 : best F1 ❑ AUC : 모든 임계 값에 대한 성능의 평균 ❑ 이상치의 영향력 고려 ❑ 임계 값 문제 ❑ Attack data에 대한 정보 없이 임계 값 추정 Limitation
  • 32. 학습 데이터에 따른 제어시스템 이상탐지 AI모델의 영향성 연구
  • 33. 33 ❑ Background ❑ Related work ❑ Problem definition 목차
  • 34. 34 ❑ 관련 연구 키워드 :Samplecomplexity Background and related work Sample complexity : 머신러닝 모델이 성공적으로 학습하기 위해서는 데이터가 얼마나 필요한지 Optimal performance Optimal Model complexity Performance (Generalization Error) Model complexity Train data size
  • 35. 35 ❑ Classical learningtheory의 PAC(Probablyapproximatelycorrect) - learning ❑ 학습 알고리즘이 학습 데이터를 기반으로 새로운 데이터에 대해 어떻게 예측할지 가늠 ❑ 학습 알고리즘이 특정 함수를 근사하기 위해서는 “학습데이터가 얼마나 필요한지” Generalization bound 에 대한 연구 ❑ Generalization bound는 주로 다음과 같은 식의 형태를 띰 Background and related work | train error – test error| ≤ O( Model complexity, Data size, Confidence level )
  • 36. 36 ❑ VC(Vapnik-Chervonenkis) - dimension ➢ 대표적이고 고전적인 model complexity 척도 ➢ 분류(classification)문제에서 머신러닝 모델이 학습데이터 포인트를 나눌 수 있는 경우의 수와 연관 ➢ 머신러닝 모델이 만들 수 있는 가설 함수 공간(𝐻)의 크기를 정량화 Background and related work ➢ 최적의 성능을 위해서는 적절한 model- complexity가 요구된다
  • 37. 37 ❑ 하지만, Deep learning model의 경우 여러 이론들(e.g., Universal approximation theorem, … )이 말해주듯이 model이 만들 수 있는 함수 공간이 매우 크고 함수 표현력이 뛰어남. ❑ 최근 연구동향에서 sample complexity와 관련된 주제의 예시는 다음과 같음 ❑ Theoretical analysis ➢ 기존의 learning theory 이외에 정보 이론을 통한 접근법이나 새로운 이론적인 접근법을 통해 학습 곡선 예측과 추정 ❑ Active learning ➢ 한정된 자원내에서 성능 향상에 큰 의미를 갖는 데이터에 우선적으로 labelling, annotation 하기 위해 데이터의 가치 판단 및 선별 ❑ Transfer learning , Meta learning , few-shot learning ➢ Pre-trained model이 있을 때, 적은 데이터로 효율적으로 목표 성능을 달성하기 위해 Background and related work 고전적인 머신러닝 모델에는 기존의 model complexity가 잘 적용되지만 딥러닝 모델에 대해서는 실제 성능과 이론의 차이가 큼
  • 38. 38 ❑ “AMeta-LearningApproachto PredictingPerformanceandDataRequirements“ byAchin Jainetal. Background and related work ➢ Meta learning에서 어림짐작으로 Data size에 따른 Learning curve 추정 하는 power law와 비교해서 개선된 piecewise power law 를 제안 ➢ Learning curve에서 double descent, and saturation를 고려하지 않았다는 한계가 존재
  • 39. 39 ❑ "How muchmoredatado i need? estimatingrequirementsfordownstreamtasks.“(Mahmood, Rafid, etal. ,CVPR, 2022) Background and related work ➢ 일부 데이터셋에 대해서 반복적인 모델평가를 하고 성능 추정 함수 의 파라미터를 추정
  • 40. 40 ❑ "TooLarge; DataReduction forVision-LanguagePre-Training.“(Wang,AlexJinpeng, etal., preprint, 2023) Background and related work ➢ large-scale Vision-Language Pre-Training (VLP) datasets에 대하여 효과적인 압축방안을 제시 ➢ 이미지- 텍스트 데이터의 특성(high redundancy, misalignment )때문에 적절한 선택과 정제(refinement)를 통해 더 적은 데이터수로도 목표 성능을 달성할 수 있음을 보임 ➢ Figure1.을 통해서 알 수 있듯이 단순히 data size 뿐 만 아니라 data complexity 역시 sample complexity 고려에 중요한 요소 ITM : image – text matching
  • 41. 41 ❑ “ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs”(Bisla, Devanshet al.,CVPR,2021) ❑ 학습데이터 수에 따른 딥러닝 모델의 일반화 오류(generalization error)의 함수를 이론적으로 추정 ❑ test point ො 𝑥 가 error를 만들어낼 확률을 feature space에서 ො 𝑥 의 nearest neighbor인 x(ො 𝑥) 와의 거리에 비례하는 Φ ො 𝑥 로 정의 Background and related work Nearest neighbor : train data point Test data point ො 𝑥 [ Feature space (D dim.)] “radius” : Empirically 추정 최종적으로 Error 함수를 계산하기 위해서 Empirically 추정 “radius” : Empirically 추정
  • 42. 42 ❑ EffectivedimensionalityD를 찾기 위해Featureextractor부분에 Bottleneckstructure를 추가함 ❑ Pre-trained model의 성능(accuracy)을 대부분( ≈ 90%) 보존하는 압축을 통해 D를 찾고 D차원의 feature space에서 Φ ො 𝑥 적분을 통해 error 기대값을 계산함 ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs Pre-trained model Bottleneck structure Bottleneck structure D = 2
  • 43. 43 ❑ 최종적으로Traindata의 분포 𝒇𝒕𝒓𝒂𝒊𝒏 ,Testdata의 분포 𝒇𝒕𝒆𝒔𝒕 를 통해, 다음 적분 식을 계산(by MonteCarlomethod)함으로써 datasize N에 따른 error의 기대값 𝑬𝒇𝒕𝒆𝒔𝒕 [𝚽]를 추정함 ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs ➢ 최종적으로 D-차원의 적분을 함으로써 데이터 수(N)에 따른 error의 기대 값 함수가 유도됨
  • 44. 44 ATheoretical-EmpiricalApproachto EstimatingSampleComplexityof DNNs Hyperparameter : Empirically 추정 ➢ D-차원의 feature space에서 가우시안 분포를 가정함 ➢ Maximum likelihood approach를 통해 가우시안의 파라미터(𝜇, 𝛴)를 추정
  • 45. 45 ❑ 학습 데이터 복잡도(entropy)와 시계열 이상탐지 AI 모델의 성능 변화의 상관 관계 연구 ❑ 데이터 복잡도 : sampling rate에 따른 시계열 데이터의 복잡도를 entropy-based metric을 통해 정량화 ❑ Base AI 모델 : “USAD: UnSupervised Anomaly Detection on Multivariate Time Series” by Julien Audibert et al. ❑ 성능 : F1, AUC , 이상치 점수, 확률 분포 거리 metric(e.g., Jensen-Shannon divergence, Total variance distance, … ) ➢ 각각의 이상 탐지 성능 metric은 한계를 갖고 있기 때문에 여러가지 metric에 대해서 종합적으로 평가 ❑ Entropy analysis ❑ 생물학에서 EEG(Electro Encephalo Graphy,뇌파), ECG(electrocardiogram, 심전도)같이 복잡한 시계열 생체신호의 동적 특성을 분석하고 이상상태(질병)를 파악하기 위해 여러가지 entropy-based metric을 사용함 ❑ 마찬가지로, 물리학의 비선형 동역학에서 시계열로부터 시스템의 동적 특성이나 복잡성, 초기 조건의 민감성 등을 entropy를 통해 정량화하고 혼돈계(Chaos system)을 분석함 Problemdefinition
  • 46. 46 ❑ 연구를 통한 이점 ① 이상탐지 성능 최적화 : Entropy가 높으면 불필요한 정보(noise)에 의해 모델이 과적합 될 수 있고 낮으면 데이터의 중요한 정보를 잃을 수 있기 때문에 적절한 entropy에 따른 최적의 모델 성능을 제시 ② 학습 시간, 자원 단축 ③ 최적의 모델 성능을 보장하는 entropy를 통해 down sampling rate 가이드라인을 제시할 수 있음 ❑ 더 나아가서, ➢ Entropy와 성능의 변화를 이해함으로써 효과적인 윈도우 크기(window size)에 대한 연구, 적절한 데이터 수(time step)에 대한 연구로 이어질 수 있음 ➢ 이상 탐지 뿐만 아니라 시계열 도메인의 다른 task에도 유용할 수 있음 Problemdefinition
  • 47. ❑ “Time Series Complexities and Their Relationship to Forecasting Performance”(Ponce- Flores, Mirna, et al., Entropy, 2020) ❑ Entropy를 통해 정량화된 시계열 데이터의 특성(time series complexity)과 통계 모델(e.g., ARIMA, ETS, …) 예측 성능과의 PCA를 통한 상관관계 연구 ❑ 데이터 수(time step)에 따른 entropy값들과 예측 성능과의 분석 ❑ 딥러닝 모델이 아니라 통계 모델이라는 차이점이 존재 47 Comparing method
  • 48. 48 ❑ Shannon entropy ➢ Y값의 분포 ❑ Spectral entropy ➢ Frequency의 분포 ❑ Bubble entropy ➢ Pattern(상승과 하강) 출현에 대한 분포 ❑ Phase entropy ➢ Slope angle에 대한 분포 Entropybasedmeasure ➢ Entropy based measure를 통해 시계열 데이터의 예측가능성, 무작위성을 정량화 할 수 있음
  • 49. ❑ 학습데이터의 데이터 수(time step length)를 늘리면서 각각의 센서에 대해 4가지 entropy들을 측정한 결과 49 Dataratio 10%~ 100% (SWaT) 데이터 수(time step length)에 대해서 entropy가 대체로 flat하기 때문에 성능과 상관관계 연구에서 뚜렷한 경향성을 찾기 힘들 수 있음
  • 50. 50 ❑ 적절한 Sampling rate미만이라면 신호가 왜곡되기 때문에 모델 성능에 결정적 ➢ Noise가 포함 되어있는 sensor 시계열의 경우 sampling rate에 의한 왜곡이 심함 Motivatingexample
  • 51. 51 Motivatingexample Sine data Noised - Sine data ➢ Frequency의 분포를 계산하는 spectral entropy 의 경우, noise에 민감한 것을 확인할 수 있음 ➢ Y값의 분포를 계산하는 shannon entropy의 경우, sampling rate에 민감한 것을 확인할 수 있음 Down sampling rate
  • 52. 52 Motivatingexample Logistic map : Bifurcation : 시간이 충분히 흐른 뒤 반복되어 나타나는 점의 개수를 나타냄 Logistic map을 통해 생성되는 시계열 데이터를 통해 선정한 entropy들이 시계열의 복잡성을 표현하는지 확인할 수 있음
  • 53. 53 Motivatingexample 시계열의 일부 복잡한 성질을 선정한 entropy들이 나타냄을 확인할 수 있음
  • 54. 54 ❑ 각 센서에 대한 4가지 entropy measure Down sampling rate 1-500 (SWaT) 1. down sampling rate에 따라 시계열의 특성이 변화함을 확인할 수 있음 2. 단, model complexity와 data complexity의 고려를 위해 fine-tuning을 통한 effective dimension에서 분석되어야 함