Analyzing Artifacts in Discriminative and Generative Models
Richard Zhang (章睿嘉)
Research Scientist, Adobe SF GAMES Webinar Aug 2020
Analyzing Artifacts in Discriminative and Generative Models Richard - - PowerPoint PPT Presentation
Analyzing Artifacts in Discriminative and Generative Models Richard Zhang ( ) Research Scientist, Adobe SF GAMES Webinar Aug 2020 Example classifications P(correct class) P(correct class) not Shift-Invariant Deep Networks are not
Research Scientist, Adobe SF GAMES Webinar Aug 2020
P(correct class) P(correct class)
P(correct class) P(correct class)
c.f. Azulay and Weiss. Why y do deep convo volutional networks ks generalize ze so so poorly y to sm small image transf sformations? s? Arxiv, 2018. JMLR, 2019. Engstrom, Tsipras, Schmidt, Madry. Exp xploring the Landsc scape of Spatial Robust stness.
5
6
7
8
Further squares appear bigger than closer squares
Further away, decreased sampling rate
9
Magical helicopter!
Adapted from Lectures on Digital Photography. Marc Levoy. https://sites.google.com/site/marclevoylectures/schedule
11
Adapted from Lectures on Digital Photography. Marc Levoy. https://sites.google.com/site/marclevoylectures/schedule
Blur/ prefilter
represented
misr sreprese sented
blurring à high freqs unreprese sented
12
Signal
Naïve subsample
Aliased signal Anti-
Adapted from Alexei A. Efros CS 194. https://inst.eecs.berkeley.edu//~cs194-26/fa18/
13
Adapted from Lectures on Digital Photography. Marc Levoy. https://sites.google.com/site/marclevoylectures/schedule
Naïvely subsampled Pr Prefi filte tered, then subsampled
14
Adapted from Lectures on Digital Photography. Marc Levoy. https://sites.google.com/site/marclevoylectures/schedule
Naïvely subsampled Pr Prefi filte tered, then subsampled
15
from Jaakko Lehtinen https://twitter.com/jaakkolehtinen/status/1258102168176951299
Shift to the right Naive Prefiltered
In IC ICML, 2019
Prefi filte ter before subsampling
17
18
19
max
20
max
21
max
22
max
23
max
24
max
25
max
26
max
27
28
max
29
max
30
max
31
max
32
max
33
max
34
35
36
37
pixels conv1 pool1 conv2 pool2 conv3 pool3 conv4 pool4 conv5 pool5 classifier softmax 32x32 1x1
Perfect shift-eq. Large deviation from shift-eq.
39
pixels
conv1
pool1 conv2 pool2 conv3 pool3 conv4 pool4 conv5 pool5 classifier softmax
Perfect shift-eq. Large deviation from shift-eq.
40
pixels conv1
pool1
conv2 pool2 conv3 pool3 conv4 pool4 conv5 pool5 classifier softmax
41
pixels conv1 pool1
conv2
pool2 conv3 pool3 conv4 pool4 conv5 pool5 classifier softmax
Perfect shift-eq. Large deviation from shift-eq.
pixels conv1 pool1 conv2
pool2
conv3 pool3 conv4 pool4 conv5 pool5 classifier softmax
Perfect shift-eq. Large deviation from shift-eq.
pixels conv1 pool1 conv2 pool2
conv3
pool3 conv4 pool4 conv5 pool5 classifier softmax
Perfect shift-eq. Large deviation from shift-eq.
pixels conv1 pool1 conv2 pool2 conv3
pool3
conv4 pool4 conv5 pool5 classifier softmax
Perfect shift-eq. Large deviation from shift-eq.
pixels conv1 pool1 conv2 pool2 conv3 pool3
conv4
pool4 conv5 pool5 classifier softmax
Perfect shift-eq. Large deviation from shift-eq.
Perfect shift-eq. Large deviation from shift-eq.
pixels conv1 pool1 conv2 pool2 conv3 pool3 conv4
pool4
conv5 pool5 classifier softmax
Max x (dense sely) y)
Prese serve ves s sh shift-equiva variance max( x( ) max( x( )
Anti-aliased pooling (MaxBlurPool)
Sh Shift ft-equiva variance lost st; heavy vy aliasi sing max( x( )
Strided-MaxPool
max( x( )
Blu Blur
Prese serve ves s sh shift-eq eq.
Bl Blur ur
Equivalent Interpretation
Sh Shift ft-eq. lost st; heavy vy aliasi sing Shift eq. lost st, but reduced aliasi sing
Subsa sampling
Evaluated together as “BlurPool”
52
max
53
Perfect shift-eq. Large deviation
Perfect shift-eq. Large deviation
Perfect shift-eq. Large deviation
MaxPool
(stride 2)
Max
(stride 1)
BlurPool
(stride 2)
Max Pooling (VGG, AlexNet)
Conv
(stride 2)
ReLU Conv
(stride 1)
ReLU BlurPool
(stride 2)
Strided-Convolution (ResNet, MobileNetv2)
AvgPool
(stride 2)
BlurPool
(stride 2)
Average Pooling (DenseNet)
Shift-invariance Accuracy
Shift-invariance Accuracy
Baseline Antialiased
Shift-invariance Accuracy Antialiasing also improves accur accuracy acy
Baseline Antialiased
63
64
“Deepfakes” GANs
synthetic real
Generative Adversarial Networks
Styl yleGAN Karras 2019 Bi BigGAN AN Brock 2019 Cyc ycleGAN Zhu 2017 St StarGAN Choi 2018 Ga GauGA GAN Park 2019 Se Seeing g in th the d dark Chen 2018 Su Supe perres Dai 2019 Casc scad aded ed re refine Chen 2017 IM IMLE Li 2019 Pr ProGAN Karras 2018 Facesw swap Rossler 2019
Perceptual loss Low-level vision Deepfakes
Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st Train/Test st
Test st: ??? et al. 20XX
synthetic real
Generative Adversarial Networks
Styl yleGAN Karras 2019 Bi BigGAN AN Brock 2019 Cyc ycleGAN Zhu 2017 St StarGAN Choi 2018 Ga GauGA GAN Park 2019 Se Seeing g in th the d dark Chen 2018 Su Supe perres Dai 2019 Casc scad aded ed re refine Chen 2017 IM IMLE Li 2019 Pr ProGAN Karras 2018 Facesw swap Rossler 2019
Perceptual loss Low-level vision Deepfakes
Tr Trai ain Test st: ??? et al. 20XX
Generative Adversarial Networks
Styl yleGAN Karras 2019 Bi BigGAN AN Brock 2019 Cyc ycleGAN Zhu 2017 St StarGAN Choi 2018 Ga GauGA GAN Park 2019 Se Seeing g in th the d dark Chen 2018 Su Supe perres Dai 2019 Casc scad aded ed re refine Chen 2017 IM IMLE Li 2019 Pr ProGAN Karras 2018 Facesw swap Rossler 2019
Perceptual loss Low-level vision Deepfakes
Tr Trai ain Test st
synthetic real
Sheng-Yu Wang Oliver Wang Richard Zhang Andrew Owens Alexei A. Efros
In CVPR CVPR, 2020 (oral).
!(#)
ProGAN detector
Real vs. fake
ProGAN-generated 720K real images, 20 categories from LSUN
Real vs. fake
ProGAN detector
Synthesized images from ot
her CNNs Real images
ProGAN
100
StyleGAN
96
BigGAN
72
CycleGAN
84
StarGAN
100
GauGAN
67
CRN
94
IMLE
90
Seeing dark
96
Super-res.
94
Deep fake
98
Chance Perfect Average Precision
99 88 97 95 98 99 100 100 93 64 66 No augmentation Blur+JPEG aug (at training)
StyleGAN
96
BigGAN
72
CycleGAN
84
StarGAN
100
GauGAN
67
CRN
94
ProGAN
100
IMLE
90
Seeing dark
96
Super-res.
94
Deep fake
98
Chance Perfect Average Precision
99 88 97 95 98 99 100 100 93 64 66
No augmentation Blur+JPEG aug (at training)
ProGAN
100
StyleGAN
96
BigGAN
72
CycleGAN
84
StarGAN
100
GauGAN
67
CRN
94
IMLE
90
Seeing dark
96
Super-res.
94
Deep fake
98
Chance Perfect Average Precision
99 88 97 95 98 99 100 100 93 64 66
No augmentation Blur+JPEG aug (at training)
ProGAN
100
StyleGAN
96
BigGAN
72
CycleGAN
84
StarGAN
100
GauGAN
67
CRN
94
IMLE
90
Seeing dark
96
Super-res.
94
Deep fake
98
Chance Perfect Average Precision
99 88 97 95 98 99 100 100 93 64 66 No augmentation Blur+JPEG aug (at training)
'
Blurring at test-time AP
after er our submission): 100% AP on FFHQ
Note: AP is computed on a collection of images; a real/fake decision on a per-image basis is more difficult
75
https://gizmodo.com/russian-state-tv-photoshops-an-awkward-smile-on-kim-jon-1826529277 June 2018
https://www.youtube.com/watch?v=5Qqv_C6iVvQ
Original
#1 modification
#2 modification
#3 modification
#4 modification
Or Origin/PS’ PS’d
Original
Fl Flow field
Warp Recovered original Photoshopped
Original
Fl Flow field
Warp Recovered original PWC-Net
“G “Ground und trut uth” h” fl flow
fiel eld
Loss Loss
29.0 31.2 42.7 Before Prediction GT Flow
Held-out artist generated data
+0.61 dB With Aug +0.15 dB No aug
Facebook post-processing
collaboration between Adobe, New York Times, and Twitter
119
Making convolutional networks shift-invariant again.
ICML, 2019.
richzhang.github.io/antialiased-cnns/
CNN-generated images are surprisingly easy to spot…for now.
Wang, Wang, Zhang, Owens, Efros. In CVPR CVPR, 2020.
peterwang512.github.io/CNNDetection/ Antialiasing code, models, and weights
Detecting Photoshopped Images by Scripting Photoshop.
Wang, Wang, Owens, Zhang, Efros. In ICCV ICCV, 2019.
peterwang512.github.io/FALdetector/
121
122
123