Deep Learning for Fonts | Fontastic Deep Learning for Fonts | Fontastic Nischal HP | @nischalhp | VP, Engineering, omni:us Raghotham S | @raghothams | Senior Data Scientist, Ericsson Research Strata Data Conference 2019, London Strata Data Conference 2019, London
Data Acquisition Data Acquisition Pass 1: Scrape Font Squirel - Pass 1: Scrape Font Squirel - https:/ /www.fontsquirrel.com/ (https:/ /www.fontsquirrel.com/)
Data Acquisition Data Acquisition Pass 3: Generate Image using PIL Pass 3: Generate Image using PIL Steps Steps 1. Create 4 set of random texts 2. Generate 4k resolution image using the TTF for every random text 3. Take 10 random crop of size 256x256 px from the 4k image With this we have the ability to generate large number of training images
Data Acquisition Data Acquisition Pass 3: Generate Image using PIL Pass 3: Generate Image using PIL Advantages Advantages 1. We control the input text 2. We control the font style and size 3. We control the output image dinemsion
Model Building - 70 Fonts - PyTorch Model Building - 70 Fonts - PyTorch Why PyTorch? Why PyTorch? Easy to customize Flexible to integrate with other visualization projects
Model Building - 70 Fonts - PyTorch Model Building - 70 Fonts - PyTorch Pretrained Model ResNet50 Pretrained Model ResNet50 What is pretrained model? What is transfer learning?
Model Building - 70 Fonts - PyTorch Model Building - 70 Fonts - PyTorch Hyper Parameter Tuning Hyper Parameter Tuning Learning Rate In [23]: lrf.plot()
Model Building - 70 Fonts - PyTorch Model Building - 70 Fonts - PyTorch Result - without LR nder & scheduler Result - without LR nder & scheduler 0.74 f1-score after 40 epochs 0.74 f1-score after 40 epochs
Model Building - 70 Fonts - PyTorch Model Building - 70 Fonts - PyTorch Result - with LR nder & scheduler Result - with LR nder & scheduler 0.96 f1-score after 40 epochs 0.96 f1-score after 40 epochs
Feature Visualization Feature Visualization Activation Atlas Activation Atlas Activation Atlases not only reveal visual abstractions within a model, but they can reveal high-level misunderstandings in a model that can be exploited. For example, by looking at an activation atlas we will be able to see why a picture of a baseball can switch the classi cation of an image from “grey whale” to “great white shark”.