Skip to content

Analysis of font shape using Variational Autoencoder with Convnets

License

Notifications You must be signed in to change notification settings

hngskj/Font-VAE

Repository files navigation

Font-VAE: Font Shape Analysis using Variational Autoencoder with Convolutional Neural Networks


VAE architecture

The VAE has a modular design. The encoder, decoder and VAE are 3 models that share weights. After training the VAE model, the encoder can be used to generate latent vectors. The decoder can be used to generate font images by sampling the latent vector from a Gaussian distribution with mean=0 and std=1.

encoder decoder

Used dataset

dataset size = train 5000 & validation 1000 per each class
width, height = 112, 112
font size = 25
used characters = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
images are generated with font2png.py
fonts are from Google Fonts

idx font name sample images
0 EBGaramond
1 PT_Serif
2 NotoSans
3 Roboto
4 Righteous
5 Bangers
6 Pacifico
7 DancingScript
8 Inconsolata
9 VT323

Trainging history

epoch 20 50 200
log
latent space

Training progress in epochs

1 frame = 1 batch
1 epoch = 196 batchs

epoch=1 epoch=2 epoch=3
epoch=4 epoch=5 epoch=6

Experiment with 3 dimentional latent space


References:

[1] Kingma, Diederik P., and Max Welling. "Auto-encoding variational bayes."
[2] Keras Blog: Building Autoencoders in Keras
[3] Keras example: VAE
[4] Erik Bernhardsson. "Analyzing 50k fonts using deep neural networks"
[5] TJ TORRES. "A Fontastic Voyage: Generative Fonts with Adversarial Networks"
[6] Julien Despois. "Latent space visualization — Deep Learning bits #2"

Releases

No releases published

Packages

No packages published

Languages