Skip to content

mihailot01/face-features-vae-psiml9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Facial features manipulation using VAE

PSIML 9 Project


The goal of this project was to manipulate facial features (like beard and glasses) using Variational Autoencoder.
The dataset used for training is CelebA.
Motivation: https://arxiv.org/abs/1611.05507

Variational Autoencoder

Autoencoder is a neural network designed to learn an identity function to reconstruct the original input while compressing the data in the process so as to discover a more efficient and compressed representation. It is made from two parts: an encoder and a decoder.
The encoder takes input and maps it to low-dimensional latent space.
Decoder takes that vector and decodes it back to the original image
In the variational autoencoder, the encoder part doesn't map an input to a vector but to distribution, so latent space is filled better.

vae

Manipulating features in latent space

The main idea was to train VAE and after that calculate the average encoding of images with and without some feature. When we subtract those values we will get a vector by which we should translate the encoding of an image so after decoding we would get an image with or without that feature.

Screenshot 2023-08-03 134717 Screenshot 2023-08-03 134749

Architecture

Screenshot 2023-08-03 135048

Loss function

Loss is constructed from two parts Reconstruction loss and KL-divergence loss.
Reconstruction loss is penalizing the model for differences in input and output images.
KL-divergence loss should bring distributions returned by the encoder closer to standard normal distribution.

Screenshot 2023-08-03 140731

Results

Average person with and without beard Average person with and without glasses
Screenshot 2023-08-03 140926 Screenshot 2023-08-03 140942
Images are made by decoding average of encodings

Screenshot 2023-08-03 140902

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published