AI News, Analyzing 50k fonts using deep neural networks

Analyzing 50k fonts using deep neural networks

Ex-Spotify, co-organizing NYC ML meetup, open source sometimes (Luigi, Annoy), blogs random stuff For some reason I decided one night I wanted to get a bunch of fonts. A

For every font you find the max y and min y of the bounding box, and the same thing for each individual letter.

The result is a tensor of size 56443 * 62 * 64 * 64.

guess I practically begged for it, stealing fonts from various sketchy places all over the web.In particular most of the fonts don’t even have lower case versions of the letters.

The model has seen other characters of the same font during training, so what it does is to infer from those training examples to the unseen test examples.

For instance, characters with thin black lines are very hard to predict for the model, since if it renders the line just a few pixel to the side, that’s twice the loss of just rendering whitespace.

(btw internet god — please forgive me for wasting bandwidth on all the animated gifs in this blog post!) We can also generate completely new fonts.

If we model the distribution of font vectors as a multivariate normal, we can sample random vectors from it and look at the fonts they generate.

An interesting thing here is that the model has learned that many fonts use upper case characters for the lower case range — the network interpolates between Q and q seamlessly.

In particular, if I had more time, I would definitely explore generative adversarial models, which seems better at generating pictures.

And finally the network architecture itself could probably benefit from doing deconvolutions instead of fully connected layers Feel free to download the data and play around with it if you’re interested!

Analyzing 50k fonts using deep neural networks

For some reason I decided one night I wanted to get a bunch of fonts.

An hour later I had a bunch of scrapy scripts pulling down fonts and a few days later I had more than 50k fonts on my computer.

For every font you find the max y and min y of the bounding box, and the same thing for each individual letter.

The result is a tensor of size 56443 * 62 * 64 * 64.

The model has seen other characters of the same font during training, so what it does is to infer from those training examples to the unseen test examples.

For instance, characters with thin black lines are very hard to predict for the model, since if it renders the line just a few pixel to the side, that’s twice the loss of just rendering whitespace.

(btw internet god – please forgive me for wasting bandwidth on all the animated gifs in this blog post!) We can also generate completely new fonts.

If we model the distribution of font vectors as a multivariate normal, we can sample random vectors from it and look at the fonts they generate.

An interesting thing here is that the model has learned that many fonts use upper case characters for the lower case range – the network interpolates between Q and q seamlessly.

In particular, if I had more time, I would definitely explore generative adversarial models, which seems better at generating pictures.

And finally the network architecture itself could probably benefit from doing deconvolutions instead of fully connected layers Feel free to download the data and play around with it if you’re interested!

This Is What Happens When You Let a Neural Network Design Fonts

Neural networks are increasingly taking on jobs that used to be the preserve of the human brain.

To feed the fonts to the AI, he created grids of characters—each character fitting in a 64x64 pixel box—so they could then be directly compared with one another.

In the process he got the neural net to create what he calls a “font vector”—a kind of abstract mathematical construct that singularly defines the font.

It’s pretty smart, too: It’s learned, for instance, that many fonts use upper case characters for the lower case set, and it intelligently switches between the two depending on the type of font it’s creating.

Computer font

A computer font (or font) is implemented as a digital data file containing a set of graphically related glyphs, characters, or symbols such as dingbats.

Although the term font first referred to a set of movable metal type pieces in one style and size, since the 1990s it is generally used to refer to a set of digital shapes in a single style, scalable to different sizes.

There are three basic kinds of computer font file data formats: Bitmap fonts are faster and easier to use in computer code, but non-scalable, requiring a separate font for each size.[1] Outline and stroke fonts can be resized using a single font and substituting different measurements for components of each glyph, but are somewhat more complicated to render on screen than bitmap fonts, as they require additional computer code to render the outline to a bitmap for display on screen or in print.

Advantages of bitmap fonts include: The primary disadvantage of bitmap fonts is that the visual quality tends to be poor when scaled or otherwise transformed, compared to outline and stroke fonts, and providing many optimized and purpose-made sizes of the same font dramatically increases memory usage.

The earliest bitmap fonts were only available in certain optimized sizes such as 8, 9, 10, 12, 14, 18, 24, 36, 48, 72, and 96 points (assuming a resolution of 96 DPI), with custom fonts often available in only one specific size, such as a headline font at only 72 points.

Improvements in hardware have allowed them to be replaced with outline or stroke fonts in cases where arbitrary scaling is desirable, but bitmap fonts are still in common use in embedded systems and other places where speed and simplicity are considered important.

Some graphics systems that use bitmap fonts, especially those of emulators, apply curve-sensitive nonlinear resampling algorithms such as 2xSaI or hq3x on fonts and other bitmaps, which avoids blurring the font while introducing little objectionable distortion at moderate increases in size.

Therefore, outline font characters can be scaled to any size and otherwise transformed with more attractive results than bitmap fonts, but require considerably more processing and may yield undesirable rendering, depending on the font, rendering software, and output size.

Outline fonts have a major problem, in that the Bézier curves used by them cannot be rendered accurately onto a raster display (such as most computer monitors and printers), and their rendering can change shape depending on the desired size and position.[3] Measures such as font hinting have to be used to reduce the visual impact of this problem, which require sophisticated software that is difficult to implement correctly.

The advantages of stroke-based fonts over outline fonts include reducing number of vertices needed to define a glyph, allowing the same vertices to be used to generate a font with a different weight, glyph width, or serifs using different stroke rules, and the associated size savings.

Although Monotype and Bitstream have claimed tremendous space saving using stroke-based fonts on East Asian character sets, most of the space saving comes from building composite glyphs, which is part of the TrueType specification and does not require a stroke-based approach.

It draws glyphs using strokes produced by moving a polygonal or elliptical pen approximated by a polygon along a path made from cubic composite Bézier curves and straight line segments, or by filling such paths.

A Fontastic Voyage: Generative Fonts with Adversarial Networks

Two weeks ago there was a lot of buzz around Erik Bernhardsson’s blog post, where he trained an autoencoder on more than 50,000 fonts.

A few months back we released a package called fauxtograph, which performs unsupervised deep learning on images via variational autoencoding (VAE).

We will train both VAE and GAN models on fonts and then explore the font-space by printing out arbitrary strings in a font that interpolates between randomly generated fonts using our trained models.

To follow along with the notebook make sure to do the following: Now we’ll import the VAE and GAN model classes from fauxtograph as well as the dependencies to read the dataset and display images in the notebook.

If you don’t have a CUDA-capable gpu then just set the flag_gpu argument to False Notice: This process takes some time to fully converge, but you should start to notice reasonable generated images in a few minutes on a GPU.

If you are serious about modeling the font reconstructions though, you should be feeding the letters in one at a time (as is done when training the GAN below), ideally adding a one-hot encoding at the latent stage…or you could do something similar with an adversarial autoencoder.

It processes both the randomly generated images from the Generator and training images from a dataset, then it tries to predict whether the processed images came from the Generator or the training set.

Over time the Generator can become rather adept at producing reasonable looking images from the starting chosen vector, thus as with the VAE, we can use the generative portion of the model to generate new fonts.

Since we have used our GAN to encode over a two dimensional space, we can actually visualize the encoding space as an image by using each discrete grid point in a cartesian grid as an input to our generator.

Create Advanced 3D Vector Tube Script Text in Illustrator with Custom Text & Blend Tool

CREATE THIS EFFECT IN 5 MINUTES! | Break a Typeface Down and Convert it to this Effect | We will cover the Pencil Tool, Type Tool, Blend Tool, Pathfinder, ...

How Make Passive Income as Graphic Designer | Making Passive Income Online as a Creative

5 Ways to Make Passive Income as a Graphic Designer or Creative. Creative Professionals can actually make things, which means you can sell your art and ...

Lecture 10: Neural Machine Translation and Models with Attention

Lecture 10 introduces translation, machine translation, and neural machine translation. Google's new NMT is highlighted followed by sequence models with ...

Lecture 15: Coreference Resolution

Lecture 15 covers what is coreference via a working example. Also includes research highlight "Summarizing Source Code", an introduction to coreference ...

The Fan Fictional History of Marceline

View the original drawing here: OR here: This After .

Detecting and Recognizing Text in Natural Images

Text in natural images possesses rich information for image understanding. Detecting and recognizing text facilitates many important applications. From a ...

InDesign Advanced Course - Adobe InDesign CC 2018

Full course at: Free Exercise Files: Adobe InDesign Advanced Tutorial by Bring Your Own Laptop, get your free .

e-Learning Education - Flat Animated Icons and Elements | After Effects template

Download now 'e-Learning Education - Flat Animated Icons and Elements' ...

6 ILLUSTRATOR TRICKS FOR GRAPHIC DESIGN WORKFLOW

6 more Illustrator tricks for your graphic design workflow. Another video on tricks and tips you can utilise in Adobe Illustrator, perfect for upping your graphic ...

We are Huemans — After Effects project | Videohive template

Download now 'We are Huemans' — Download music: ..