Anomaly Detection by ADGM / LVAE

15
Anomaly Detection by ADGM / LVAE Naoto Mizuno Mentor : Tanaka-san, Okanohara-san

Transcript of Anomaly Detection by ADGM / LVAE

Page 1: Anomaly Detection by ADGM / LVAE

Anomaly Detectionby

ADGM/LVAE

NaotoMizunoMentor:Tanaka-san,Okanohara-san

Page 2: Anomaly Detection by ADGM / LVAE

Introduction

• Anomalydetection• Data• NABDataset(Artificial)• (Otherdataarenotopentothispresentation)

• Model• AuxiliaryVAE(ADGM)• LadderVAE• VAE(previouswork)

Page 3: Anomaly Detection by ADGM / LVAE

Variational Auto-Encoder(VAE)

• Weassumethatthedata𝑥 aregeneratedfromthelatentvariables𝑧.

• Weuseneuralnetworkasencoder anddecoder.

x x

zz

𝑞$(𝑧|𝑥) 𝑝)(𝑥|𝑧)Encoder Decoder

Data

LatentVariable

Page 4: Anomaly Detection by ADGM / LVAE

VAE

• Weuselowerboundoflog 𝑝) 𝑥 aslossfunction.

log 𝑝) 𝑥 ≥ 𝐸9: 𝑧 𝑥 log𝑝) 𝑥, 𝑧𝑞$ 𝑧 𝑥

𝑝) 𝑥, 𝑧 = 𝑝) 𝑥|𝑧 𝑝) 𝑧

• 𝑝) 𝑧 :Standardnormaldistribution• In training, 𝑧 is chosen from 𝑞$ 𝑧 𝑥 .

Page 5: Anomaly Detection by ADGM / LVAE

ADGM• Semi-supervisedLearning• Detectlabel𝑦 andreconstructdata𝑥.• Auxiliaryvariableincreasetheflexibilityofthemodel.

x

az y

Data

LatentVariable

AuxiliaryVariable

Label

x

az y

x

az y

SDGM

Page 6: Anomaly Detection by ADGM / LVAE

ObjectivefunctionofADGM• Forlabeleddata

• Lowerbound+classificationloss

𝐿 𝑥, 𝑦 = −𝐸9: 𝑎, 𝑧 𝑥, 𝑦 log𝑝) 𝑥, 𝑦, 𝑎, 𝑧𝑞$ 𝑎, 𝑧 𝑥, 𝑦 − 𝛼𝐸9: 𝑎 𝑥 log 𝑞$ (𝑦|𝑎, 𝑥)

• Forunlabeleddata𝑈 𝑥 = −𝐸9: 𝑎, 𝑦, 𝑧 𝑥 log

𝑝) 𝑥, 𝑦, 𝑎, 𝑧𝑞$ 𝑎, 𝑦, 𝑧 𝑥

• Total𝐽 = J 𝐿(𝑥K, 𝑦K)

MN,ON

+J𝑈(𝑥Q)�

MR

Page 7: Anomaly Detection by ADGM / LVAE

ADGMforMNIST

• Semi-supervisedlearning• 100labeled,60000unlabeled• Testerror

ADGM:0.96%SDGM:1.32%

• Generateimage• Choosing𝑧 fromGaussian• Generatewitheach𝑦

SDGM

Withoutauxiliaryvariable

Page 8: Anomaly Detection by ADGM / LVAE

AuxiliaryVAE• UnsupervisedLearning• Severalsamplinglayers(1or2)

x

z

a

a

z

x

z

a

a

z

Page 9: Anomaly Detection by ADGM / LVAE

LadderVAE

• Severalsamplinglayers(~5)• VAEwithseveralsamplinglayersisdifficulttotrain.

• Sharingtheinformationbetweendecoder andencoder.

x x

zd

d z

d z

Page 10: Anomaly Detection by ADGM / LVAE

LadderVAE

• Encoderusedecoderoutputasprior.

𝜎9T =1

𝜎V9WT + 𝜎XWT

𝜇9 =𝜇V9𝜎V9WT + 𝜇X𝜎XWT

𝜎V9WT + 𝜎XWT z

d

𝜇X, 𝜎XPrior

Likelihood Posterior

Sampling

𝜇V9, 𝜎V9 𝜇9, 𝜎9

Page 11: Anomaly Detection by ADGM / LVAE

Anomalydetection

• Modelistrainedwithoutanomalydata.• Modelcannotreconstructanomalydata.𝐴𝑛𝑜𝑚𝑎𝑙𝑦𝑆𝑐𝑜𝑟𝑒 = log 𝐸 log 𝑝)(𝑥|𝑧)

• MNISTwithnoise

Page 12: Anomaly Detection by ADGM / LVAE

NABDataset(Artificial)

• Weconvertrawdatatospectrogram.• Spectrogram:theamplitudesataparticularfrequencyandtime.

• Input:theamplitudesata time.

rawdata

anomalyspectrogram

singleinput

time

frequ

ency

Page 13: Anomaly Detection by ADGM / LVAE

NAB

• Scoresincreaseatanomaly.

train test

ADGM

LVAE

Page 14: Anomaly Detection by ADGM / LVAE

NAB

• Inthiscasemodelscannotdetectanomaly.• Smallinputvaluetendstoresultinsmallscore.

train test

ADGM

LVAE

Page 15: Anomaly Detection by ADGM / LVAE

Conclusion

• AnomalydetectionusingADGM/LVAE.• Anomalyisdetectedaslowprobabilitydata.

• PerformancesarealmostsameasVAE.• Manysamplinglayersarebetter(?)