You are on page 1of 36

TASNİF DIŞI

DEEPFAKE
SAFA DEMIRHAN

TASNİF DIŞI
TASNİF DIŞI

KONU BAŞLIKLARI

1. Deepfake Definition
2. Dataset Creation
3. Deepfake Creation
4. Deepfake Detection
1. Detection In Images
2. Detection In Videos

5. Code Review and Demos

TASNİF DIŞI
TASNİF DIŞI

WHAT IS DEEPFAKE

• In a narrow definition, deepfakes are created by techniques that can superimpose face
images of a target person onto a video of a source person to make a video of the target
person doing or saying things the source person does.

• In a broader definition, deepfakes are AI-synthesized content that can also fall into two
other categories, lip-sync and puppet-master.

TASNİF DIŞI
TASNİF DIŞI

SHORT HISTORY

• Deepfake videos are manipulated videoclips which were first created by a Reddit user,
deepfake, who used TensorFlow, image search engines, social media websites and
public video footage to insert someone else’s face onto pre-existing videos frame by
frame.

TASNİF DIŞI
TASNİF DIŞI

SHORT HISTORY

A worrying reminder is the example of Gabon’s president Ali Bongo: In late 2018, the
president fell ill, not appearing in public for months. As the public grew weary, the
government released a video of the president, only to be immediately labeled as a deep
fake.

TASNİF DIŞI
TASNİF DIŞI

SHORT HISTORY

Albeit never to be confirmed as such, one week later the military launched an
unsuccessful coup, citing the video as part of the motivation

TASNİF DIŞI
TASNİF DIŞI

POSITIVE & MALICIOUS USES

• The realistic nature of deepfake videos also makes them a target for generation of fake
news, fake surveillance videos, and malicious hoaxes. These fake videos have already
been used to create political tensions and they are being taken into account by
governmental entities.

TASNİF DIŞI
TASNİF DIŞI

POSITIVE & MALICIOUS USES

There is also positive use of deepfakes such as their applications in visual effects, digital
avatars, snapchat filters, creating voices of those who have lost theirs or updating
episodes of movies without reshooting them.

TASNİF DIŞI
TASNİF DIŞI

POSITIVE & MALICIOUS USES

• Deepfakes can have creative or productive impacts in photography, video games,


virtual reality, movie productions, and entertainment, e.g., realistic video dubbing of
foreign films, education through the reanimation of historical figures, and so on.

TASNİF DIŞI
TASNİF DIŞI

1. DATASET
CREATION

TASNİF DIŞI
TASNİF DIŞI

DEEPFAKE DATASET CREATION

• Deepfake veri setleri 3 nesilden oluşuyor.


• Nesiller arası değişkenlik gösteren en temel etmen ise video veya saniye başına kare
sayısı.
• İlk iki nesil veri setlerinin bir eksiği ise, iki kişinin suratlarının takas edilmesiyle
oluşan verilerin, homojen şekilde dağılmamış olması ve bunun overfit’e neden
olabileceği.

TASNİF DIŞI
TASNİF DIŞI

LİTERATÜRDE VAR OLAN VERİ SETLERİ

TASNİF DIŞI
TASNİF DIŞI

DFDC DATASET

• DFDC veri seti ise 3. nesil bir veri seti ve hem daha iyi çözünürlükte veri sunmakla
kalmıyor, hem de görüntüleri kullanılan bireylerin hepsinden onay alınmış durumda.
• 25 TB’lık ham veri içermekte, 3426 kişi tarafından, kişi başı ortalama 14.4 video
1080p çözünürlüğünde çekilmiş ve 48190 adet, toplamda 38 gün uzunluğunda video
mevcut.

TASNİF DIŞI
TASNİF DIŞI

VERİ SETLERİ BÜYÜKLÜK


KARŞILAŞTIRMASI

TASNİF DIŞI
TASNİF DIŞI

• DFDC Dataset example face


swaps

TASNİF DIŞI
TASNİF DIŞI

2. DEEPFAKE
CREATION

TASNİF DIŞI
TASNİF DIŞI

USING GANS
The GAN architecture consisting of a generator and a
discriminator, and each can be implemented by a neural
network. The entire system can be trained with
backpropagation that allows both networks to improve
their capabilities.

TASNİF DIŞI
TASNİF DIŞI

USING AUTOENCODERS

An image of face A is encoded with the


common encoder and decoded with
decoder B to create a deepfake
(bottom). The reconstructed image is
the face B with the mouth shape of face
A. Face B originally has the mouth of
an upside-down heart while the
reconstructed face B has the mouth of a
conventional heart.

TASNİF DIŞI
TASNİF DIŞI

TASNİF DIŞI
TASNİF DIŞI

3. DEEPFAKE
DETECTION

TASNİF DIŞI
TASNİF DIŞI

3.1. DETECTION IN IMAGES

• Frequency Artifacts.
• Görsellerde Deepfake tespitinde frekans kullanılabilir.
• GAN yapısı gereği “upsampling” işlemi yapar ve bu işlem oluşturulan sahte görselde
bazı izler bırakır.
• Bunu kullanarak Deepfake tespiti yapmak mümkündür.

TASNİF DIŞI
TASNİF DIŞI

A side-by-side comparison of real and generated faces in image and frequency


domain. The left side shows an example and the mean DCT spectrum of the FFHQ
data set. The right side shows an example and the mean DCT spectrum of a data set
sampled from StyleGAN trained on FFHQ. We plot the mean by averaging over
10,000 images.

TASNİF DIŞI
TASNİF DIŞI

DETECTION IN IMAGES

• Görsellere “Discrete Cosine Transform” (DCT) uygulanır ve frekans alanına geçiş bu


şekilde sağlanmış olur.
• Upsample uygulanırken 3 farklı yöntem kullanılmış: Nearest Neighbor, Bilinear,
Binomial.
• Kullanılan bu teknikler, Deepfake ile oluşturulmuş görsellerdeki izleri azaltan sırada
verilmiştir. Bundan yola çıkarak, Binomial kullanılarak oluşturulan GAN’larda tespit
başarımı düşer.

TASNİF DIŞI
TASNİF DIŞI

The spectra of images generated by different neural networks trained on the Stanford
dog data set. The left-most heatmap depicts the mean spectrum of the Stanford dog
data set. The rest depicts the mean spectra of images generated by different GANs.
We plot the mean of the DCT spectra by averaging over 10,000 images.

TASNİF DIŞI
TASNİF DIŞI

3.2. DETECTION IN VIDEOS

1. Yöntem: CNN ve LSTM Kullanarak


CNN ile kare (frame) başı öznitelik çıkarımı yapıp, daha sonra LSTM ile anlık
(temporal) dizi analizi yapmak. Sistem, uçtan uca öğrenir, çıkarım yapar ve bir video
dizisi verildiğinde, bunun Deepfake olma olasılığını verir. Conv. LSTM alt ağına
sahiptir.

TASNİF DIŞI
TASNİF DIŞI

What makes deepfakes possible is


finding a way to force both latent
faces to be encoded on the same
features. This is solved by having
two networks sharing the same
encoder, yet using two different
decoders (top). When we want to do
a new faceswapp, we encode the
input face and decode it using the
target face decoder (bottom).

TASNİF DIŞI
TASNİF DIŞI

3.2. DETECTION IN VIDEOS

2. Yöntem: Surat Çarpıtan İzleri Kullanarak


• Face Warping Artifacts, Resolutional Inconsistency
• Deepfake algoritmaları, belirli bir çözünürlükte surat görseli oluşturduğundan ve bu da
görselde bazı çarpıklıklar oluşturduğundan, bunları tespit ederek videolarda Deepfake
tespiti yapmak.
• CNN kullanarak surat çevresinde çözünürlük bozulmaları tespit edilir.

TASNİF DIŞI
TASNİF DIŞI

Görseldeki surat tespit edilir ve haricindeki yerler çıkarılır. Yüzler birden çok ölçeğe
hizalanır ve rastgele bir ölçek seçilir. Bu ölçek Gauss bulanıklığı ile yumuşatılır. Bu
süreç, yüz çarpıtmada ortaya çıkan farklı çözünürlük tutarsızlıklarını daha iyi simüle
edebilmeyi amaçlar. Düzleştirilmiş yüz, Deepfake üretim hattındaki hataları ortaya
çıkarmak için, aynı boyutlardaki orijinal yüzlerle karşılaştırılır.

TASNİF DIŞI
TASNİF DIŞI

3.2. DETECTION IN VIDEOS

3. Yöntem: Göz Kırpma Sıklığı Kullanarak


• Psikolojik sinyal
• Deepfake videolardaki göz kırpma sıklığının, ortalama bir insanın göz kırpma sayısına
oranla çok daha az olduğundan yola çıkarak, Deepfake tespiti yapmak.

TASNİF DIŞI
TASNİF DIŞI

Overview of our LRCN method. (a) is the original sequence. (b) is the sequence after
face alignment. We crop out eye region of each frame based on eye landmarks p1 ∼6 in
(b) and pass it to (c) LRCN, which consists of three parts: feature extraction, sequence
learning and state prediction.

TASNİF DIŞI
TASNİF DIŞI

3.2. DETECTION IN VIDEOS

• CNN ve RNN’in kombinasyonu olan Long-Term Recurrent CNN (LRCN)’i


kullanarak, açık/kapalı göz tespiti yapılır. 
• Video içerisinde kare başına bazı ön işlemeler yapılır: Yüz tespiti, göz, burun, ağız
tespit edilir, belirli bir boyuta sabitlenir, tespit edilen yerler görselde ortalanır ve gözler
yatayda eşitlenir. Ön işleme ardından boru hattı şu şekildedir: Ardışık kareler arası
CNN ile öznitelik çıkarımı yapılır. Ardından bu sekans LSTM’e beslenir ve LSTM
durum tahimininde bulunur. LRCN bu boru hattının tamamını içermektedir. 

TASNİF DIŞI
TASNİF DIŞI

5. CODE REVIEW
AND DEMOS

TASNİF DIŞI
TASNİF DIŞI

FIRST ORDER MODEL FOR IMAGE


AUTOMATION
• When it came to building deepfakes, was the need for additional information.
• This model animates a source image given a driving video, without any additional
information or annotation about the object to automate.
• Apart from this, once the model was trained, it can be used for transfer learning and it
can be applied to an arbitraty object of the same category.

TASNİF DIŞI
TASNİF DIŞI

FIRST ORDER MODEL FOR IMAGE


AUTOMATION: MOTION EXTRACTION

The motion extractor utilizes an autoencoder to detect keypoints and extracts first-order
motion representation that consists of sparse keypoints and local affine transformations.

TASNİF DIŞI
TASNİF DIŞI

MY DEEPFAKE ATTEMPTS

TASNİF DIŞI
TASNİF DIŞI

MY DEEPFAKE ATTEMPTS

TASNİF DIŞI

You might also like