<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by okgo on Medium]]></title>
        <description><![CDATA[Stories by okgo on Medium]]></description>
        <link>https://medium.com/@bold_cerise_elk_500?source=rss-7bc78076c311------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fRUqR4w59Kyhauw8</url>
            <title>Stories by okgo on Medium</title>
            <link>https://medium.com/@bold_cerise_elk_500?source=rss-7bc78076c311------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:51:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bold_cerise_elk_500/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Towards Visually Explaining Variational Autoencoders : 리뷰]]></title>
            <link>https://medium.com/@bold_cerise_elk_500/towards-visually-explaining-variational-autoencoders-%EB%A6%AC%EB%B7%B0-c7a63d5001de?source=rss-7bc78076c311------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7a63d5001de</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[okgo]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 16:33:35 GMT</pubDate>
            <atom:updated>2020-09-08T04:54:07.013Z</atom:updated>
            <content:encoded><![CDATA[<h3>Towards Visually Explaining Variational Autoencoders : 리뷰</h3><p>본 포스트는 2020 CVPR에 Oral presentation으로 선정된 <a href="https://arxiv.org/pdf/1911.07389.pdf">Towards Visually Explaining Variational Autoencoders</a>를 소개합니다.</p><p>딥러닝 모델의 예측을 시각화하고 설명하기 위해 <a href="https://arxiv.org/pdf/1610.02391.pdf">Grad-CAM</a>, <a href="https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0130140">LRP</a>, <a href="https://arxiv.org/pdf/1602.04938.pdf">LIME</a>과 같은 시각화 메소드가 제안되었습니다. 하지만 지금까지 시각화 메소드들은 classification과 categorization task을 위해 주로 설계되었습니다. 본 논문에서는 Generative models을 시각화하기 위한 메소드를 제안하며 Generative model 중 하나인 Variational Autoencoders(VAE)에서 실험합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*l1XGGBfnEuxgq34fYwElvQ.png" /><figcaption>그림 1. 학습된 VAE로부터 latent vector z가 생성한 결과 시각화</figcaption></figure><p>본 논문은 아래와 같은 기여를 합니다.</p><ul><li>Visually explaining VAE 방법</li><li>Visually explaining VAE 기반의 Anomaly localization 방법</li><li>Attention disentanglement loss 제안</li></ul><h3>Visually explaining VAE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*Qs1r4PCYU6rbToIBqr-bCA.png" /><figcaption>그림 2. ImageNet의 King Snake, Mastiff 클래스 시각화<a href="https://github.com/utkuozbulak/pytorch-cnn-visualizations">[1]</a></figcaption></figure><p>기존의 Classification task의 시각화 메소드는 class selection에 영향을 끼친 픽셀을 highlight하기 위해 노력합니다. 그림2은 시각화 메소드 중 class selection에 영향을 끼친 gradient를 기반으로 시각화하는 메소드 Grad-CAM의 결과입니다 (Grad-CAM에 대한 다른 자세한 내용은 잘 정리되어있는 자료가 많아 생략합니다). 본 논문의 시각화 타겟인 VAE는 generative model이므로 class에 대한 정보가 없습니다. 본 논문에서는 VAE의 latent vector z가 입력에 영향을 끼친 픽셀을 시각화하기 위해 노력합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*mzXsniCRvLnhb9Xoaorscg.png" /><figcaption>그림 3. VAE attention 생성 단계</figcaption></figure><p>VAE의 Encoder는 data distribution p(z|x)를 표현하기 위한 mean vector와 variance vector을 나타내며 reparameterization trick을 사용해 latent vector z를 생성합니다. 본 논문에서는 latent vector z를 시각화하기 위해 gradient-based visualization method중 하나인 Grad-CAM을 기반으로 하여시각화합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*ZqtO3rJKWIVFU6096XPGEA.png" /><figcaption>식 1. Grad-CAM partial linearization</figcaption></figure><p>위 식1의 <em>a^c_k</em>는 Grad-CAM에서 partial lineariation을 나타냅니다. 이는 target class c에 대한 예측 벡터 y에서 k번째 feature map A의 i,j번째 픽셀이 가지는 importance를 나타냅니다. partial lineariation는 대응되는 feature map과 linear combination하여 feature map의 중요한 정보를 highlight할 수 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/1*YCUijm7vIpCfWnomtHSa3g.png" /><figcaption>식 2. Explaning VAE partial linearization</figcaption></figure><p>식2는 본 논문에서 제안한 기법으로 Grad-CAM에서 partial lineariation을 계산한 방법과 같게 작동됩니다. 여기서는 VAE의 Encoder의 feature map과 latent vector z 사이에 importance를 계산합니다. latent vector z의 i번째 가 feature map k의 p,q번째 픽셀에 gradient information을 사용합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/1*hxTQBPG9SOm6dVPDRHSElg.png" /><figcaption>식 3. Attention map 계산</figcaption></figure><p>계산된 partial linearization의 scalar값과 그에 대응되는 feature map A를 linear combination하고 ReLU를 적용하여 attention map M^i를 얻습니다. 계산된 M^i들은 모두 더하고 평균되여 영상에 대한 attention map을 계산합니다. 이 방법도 Grad-CAM을 계산하는 방법과 동일합니다.</p><p>결국 classification task에서 <strong>예측값 score</strong>와 마지막 <strong>feature map</strong>사이의 gradient를 계산하는 것 대신, 본 논문에서는 VAE에서는 Encoder의 mean, variance feature로부터 생성된<strong> z</strong>와 생성하기 전 <strong>feature map</strong> 사이의 gradient를 계산하여 시각화를 시도합니다.</p><h3>Anomaly localization method</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_dl-2idvsOuXb7mNgG2bbg.png" /><figcaption>그림 4. explaining VAE를 사용한 anomaly localization 방법</figcaption></figure><p>이 논문에서 VAE를 사용한 anomaly detection/localization 방법은 다음과 같습니다.</p><ol><li>Normal data를 사용자가 정의하여 오직 VAE에 normal data만 학습하여 normal manifold를 구성.<br>(예, MNIST의 10가지 숫자 중 1을 normal data, 나머지 숫자를 abnormal로 가정).</li><li>숫자 1로 학습된 VAE에 숫자 5가 입력이 된다면 VAE의 mean, variance feature는 기존에 생성하던 분포와 다른 분포를 생성.</li><li>정상 데이터 x에 대한 분포와 입력 데이터 y에 대한 분포의 차이를 계산하고 그 분포로 부터 latent vector z 생성.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*ijSxWtNumzSLL11M8WH8Hg.png" /><figcaption>식 4. 두 Gaussian distribution의 차이 계산 방법</figcaption></figure><p>여기서 x는 항상 정상이고 y는 정상, 비정상일 수 있습니다. 만약 x와 y가 둘 다정상일 경우, 두 분포의 차이 값은 매우 적고 샘플링한 vector z의 원소 값들도 0에 가깝게 됩니다. 0에 가까운 latent vector와 입력에 대해 Grad-CAM을 적용하면 이는 거의 highlight하는 영역이 없으며 이는 anomaly area가 없다는 뜻이 됩니다. 반대로 x는 정상, y는 비정상일 경우 두 분포의 교집합된 영역은 사라지며 비정상 분포만 남아 latent vector z는 abnormal vector를 생성합니다. abnormal vector를 입력에 대해 Grad-CAM을 적용하면 abnormal vector에 영향을 끼친영역이 localization되게 됩니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*YSs3x_VGgWsTJyG4nfzFbw.png" /><figcaption>그림 5 . MNIST에서 anomaly localization 수행 결과</figcaption></figure><p>그림 5는 MNIST에서 anomaly localization의 수행 결과이며 1을 학습한 VAE의 경우 7에서는 1의 특징인 세로 획을 정상으로 인식하고 가로 획을 비정상으로 localization으로 나타내는 모습을 보여줍니다. 이 외에도 보행자 데이터셋인 UCSD Ped1 Dataset와 Anomaly Detection dataset인 MVTec-AD에서도 실험되었으며 MVTec-AD에서는 SOTA localization performance를 보여주었습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*mUF6p8TWyxHvrsaUX2MBAw.png" /><figcaption>그림 6. MVTec-AD에서 pixel level segmentation 결과. 위: ROC AUC 성능, 아래: IOU 성능</figcaption></figure><h3>Attention disentanglement loss</h3><p>VAE의 latent space를 disentangled나 factorized하기 위한 메소드들이 제안되었습니다 (예, beta-VAE, Info-VAE, Factor-VAE 등). latent space를 disentanglement라 함은 하나의 generative factor에만 민감하고 다른 factor는 변하지 않는 않게 하여 factor를 control하기 위함입니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*zVP2vStB2D29J8DKtaQh6w.png" /><figcaption>그림 7. VAE의 Disentanglement 결과 (beta-VAE)</figcaption></figure><p>예를 들어 VAE의 latent space가 잘 disentanglement되어 있다면 위 그림7과 같이 latent vector의 어떤 factor를 조절하여 한 가지 factor만 변화시킬 수 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*SU2APCCo_Um0aU6xLVWXLw.png" /><figcaption>그림 8. VAE에 attention disentanglement loss 결합</figcaption></figure><p>본 논문에서는 latent space disentanglement를 위해 attention disentanglement loss라는 새로운 loss function을 제안합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*y1ApbgBBWm1ipUOItLlzxA.png" /><figcaption>식 5. Attention disentanglement loss</figcaption></figure><p>위 식5는 처음 설명된 explaining VAE의 Attention map A¹, A² 두 개를 사용하여 high-response pixel regions에서 최대한 분리를 시도합니다. 이 수식은 latent space에 관여되는 attention map 분리하여 latent space를 하는 시도가 보입니다. Attention disentanglement loss는 beta-VAE, Factor-VAE등 기존 손실 함수에 추가되어 사용될 수 있다고 합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*3tZCPwKGaIL4I_0C21UfuQ.png" /><figcaption>그림 9. disentanglement 실험 결과</figcaption></figure><p>Beta-VAE, Factor-VAE, Factor-VAE에 Attention disentanglement loss를 추가한 AD-FactorVAE로 실험하여 disentanglement의 성능 향상을 보여주었습니다.</p><h3>Conclusion</h3><p>이 논문은 VAE를 시각화하는 기술을 제안하고, Anomaly localization에서 정량적, 정성적으로 좋은 결과를 보여주며, latent space의 disentanglement를 위한 손실함수를 제안했습니다. 이 논문을 기반으로 Generative models의 latent vector를 시각화를 위한 논문이 많이 나오길 기대합니다.</p><h3><strong>Reference</strong></h3><p>Paper: <a href="https://arxiv.org/pdf/1911.07389.pdf">https://arxiv.org/pdf/1911.07389.pdf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7a63d5001de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>