You are on page 1of 14

Mini Project Report on

FONT DETECTION USING IMAGE CLASSIFICATION

Submitted in partial fulfillment of the requirement for the award of


the degree of

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE & ENGINEERING 

Submitted by:

Avishka Bahuguna 2018741 

Under the Mentorship of

Ms. Garima Sharma


Designation

Department of Computer Science and Engineering


Graphic Era (Deemed to be University)
Dehradun, Uttarakhand
January 2023
                   
CANDIDATE’S DECLARATION

I hereby certify that the work which is being presented in the project report entitled “Font
detection using image classification” in partial fulfillment of the requirements for the
award of the Degree of Bachelor of Technology in Computer Science and Engineering of
the Graphic Era (Deemed to be University), Dehradun shall be carried out by the under
the mentorship of Ms. Garima Sharma, Designation, Department of Computer Science
and Engineering, Graphic Era (Deemed to be University), Dehradun.

Avishka Bahuguna    2018741 signature


Table of Contents

Chapter Description Page No.


No.
Chapter 1 Introduction  4-6
Chapter 2 Literature Survey 7-9
Chapter 3 Methodology 10 - 12
Chapter 4 Result and Discussion 13
Chapter 5 Conclusion and Future Work 14
References 15
Chapter 1
Introduction
In the following sections, a brief introduction and the problem statement for the work
have been included.

1.1 Introduction

In today’s modern world, technology is advancing day by day and this leads to a huge
amount of data transfer on daily basis, due to this identifying and searching for different
data sets becomes very important. There is an increasing demand for the modern office to
convert paper documents to electronic documents and this requires knowing the text fonts
of the paper documents. This mini-project serves this problem. “Font detection using
image classification” takes an image as input from the user and returns the font type of
the text written on it. This project is based on DeepFont’s paper. Its learning is based on
Model compression and it is domain-based CNN (Convolutional Neural Network). It is
trained on the AdobeVFR dataset which consists of both labeled synthetic data and
partially labeled real-world data.

Font recognition is an important and challenging problem in areas of Document Analysis,


Pattern Recognition, and Computer Vision and with this project, we can recognize the
font we want to use. This paper proposes a convolution neural network font recognition
method.

1.1.1 Working on the project

This project utilizes the concept of deep learning. That is, various data is fed into a
machine so that it can learn the pattern and behavior of the same. In this case, we are
providing a dataset to the machine which includes a few different font types and how all
different letters are written in that particular font. We aim to make the machine familiar
with these fonts so that it can identify these fonts in the image and give us the required
result, that is, the required font type for further use.

We have taken a small part of the AdobeVFR dataset which consists of a few real-world
images. This project first takes the image and then resizes it. After this, the data is
augmented by a few pre-processing techniques such as noise, blur, rotation, and shading.
Then we prepare the dataset and use 75% for training and the rest 25% for testing and
then we convert labels from integers to vectors.

Then we employ a CNN architecture with two subnetworks, that is, a Low-Level sub-
network, which is learned from synthetic and real-world data, and a High-Level sub-
network which learns deep classifiers from low features. The model is then created, fitted,
and tested for loss and accuracy. Experimental data is generated through computer-
embedded fonts and then convolution neural networks are trained to achieve the final
result. We have used Keras to build the whole pipeline as its prototyping and then input
the given image to get the desired font type. And with this, our project is done with
around a test accuracy of 0.9.

Fig 1.2 Some of the fonts types that are used in our databases

1.1.2 Importance of the Project

As we all know font is a basic and crucial part of data and graphic design. The designers
need to know the font type for their designs or to identify a font from a picture to use for
their work. The manual identification of the font from an image or digital design would
be a tedious and time-consuming task, so to solve VFR (Visual Font Recognition)
problem this project has been made with help of CNN.
This is useful for people in finding the font type they like in their day-to-day life from
images in form of texts so that they can use it virtually (like fonts in fig 1.2). There are
many apps or websites to find the font from the image but most of them require high-
quality images and proper pre-processing and their time complexity is high, even then
accuracy is not precise. This project on other hand helps in the automatic selection of the
font type efficiently. This system shows high stability and accuracy.

Fig 1.3 Some of the fonts used in the real world

With the help of Font Recognition people/designers can identify various beautiful fonts
and use them to attract users, and build logos. It helps in typography which in turn helps
to hold the attention of the users and it reflects professionalism.
Chapter 2
Literature Survey
Many researchers and academics are working on font recognition using a variety of
methodologies; below are some literature studies:

2.1 The University of Illinois, Adobe Research, 2015

Zhangyang Wang and others [1] researched “DeepFont: Identify your font from an
image”. They presented a Deep Font system to advance the state-of-the-art for identifying
font type from an image with convolutional neural networks. They build a VFR dataset,
AdobeVFR, consisting of both synthetic and real-world data and then performed
Convolutional Neural Network (CNN) decomposition approach using a domain
adaptation technique based on a Stacked Convolutional Auto-Encoder (SCAE), which
helped their model achieve a precision of more than 80%. They also achieved
compression of the model to around 6 times without much loss.

2.2 Indian Statistical Institute, India, 2020

Shubhankar Ghosh and others [2] collectively surveyed the font recognition problem for a
database of around 10,000 using convolutional neural networks (CNN) architecture in
their research on the topic “Large Scale Font Identification from document images”. They
performed various experiments with many classes to quantify the obtained result for both
synthetic document images and natural document images. At the character level, they
obtained a top-1 accuracy of 63.45% and a top-3 accuracy of 70.76%. Whereas at the
word level, they achieved a top-1 accuracy of 57.18% and a top-3 accuracy of 62.11%
when both rotation and scaling were present.

2.3 Brigham Young University, USA, 2017

Chris Tensmeyer with others [3] presented a simple and straightforward framework based
on Convolutional Neural Networks (CNN) in their research named “Convolutional Neural
Networks for Font Classification”. Their dataset consisted of 40 Arabic computer fonts.
The model obtained a state-of-art performance and a line-level accuracy of 98.8%. They
utilized CNN to classify fonts and large document images in the script. They also
proposed a novel form of data augmentation that improves robustness to text darkness,
which further helps in increasing image classification performance.

2.4 Peking University Research, China, 2018

Yizhi Wang and others [4] did their research on “Font Recognition in Natural image via
transfer learning”. They developed a system to synthesize natural images containing texts,
and a transfer learning scheme to lighten the domain mismatch between synthetic and
real-world text images. Their databases contain numerous labeled natural images
containing Chinese characters in 48 fonts and over 200,000 unlabeled images taken from
the internet with an accuracy of 93.97 percent.

2.5 Daffodil International University, Bangladesh, 2022

Md. Sakibul Hasan and others [5] represented a model to recognize Bangla fonts from
images in their research on “Bangla Font Recognition Using Transfer Learning Method”.
They used 6500 raw images of 5 Bangla fonts and created 26000 images data to train and
2600 images to validate the model, with augmentation. They applied three transfer
models in which the highest accuracy obtained was 96.23 percent.

2.6 University of Missouri Research, USA, 2014

Guang Chen and others [6] addressed the VFR problem in their research on “Large-Scale
Visual Font Recognition”, which automatically recognizes the typeface, weight, and slope
of text in an image without any prior knowledge of the content. They created a dataset of
synthetic word images with 2420 font classes and a small set of real-world images. They
made one picture for each English word for each font class, totaling 2.42 million
fabricated images for the dataset.

2.7 Department of IT, CSE, Tamil Nadu, Karnataka, 2021

Manikandan Sridharan and others [7] proposed a deep learning approach to recognize
Tamil letter fonts from an image in their research “Recognition of Font and Tamil letter
in images using Deep Learning”. The test dataset consisted of 256 Tamil letters and 6 font
types. The trained data, i.e, 15,000 letters were taken from the image dataset and a
512*512*3 layer deep convolution network is created with font and letters. They tested
the result both font-wise and character-wise by TensorFlow and achieved an accuracy
factor of 85% to recognize Tamil letters.

2.8 St. Joseph University Of Beirut, Lebanon, 2019

George E. Sakr and others [8] presented a font recognition method to search fonts from
image using CNN in their paper “Convolution Neural Networks for Arabic Font
Recognition”. The dataset they used contained 2500 images of single word utilizing 50
Arabic fonts, which was used to train various deep neural networks. The sliding window
technique was used and achieved an accuracy of 96%.

2.9 Duzce University, Turkey, 2018

Aylin Sevik and others [9] published their reseach on “Font and Turkish Letter
Recognition in Images with Deep Learning”. They took the texts from the images and
then divided them into characters and recognised for font type. There dataset contained
almost 13,000 characters, and they attained a success rate of 100% in training. They
achieved 79.08% succes rate for character recognition and 75% for font recognition.

2.10 King Abdulaziz University, Saudi Arabia, 2020

Rami Al-Hmouz [10] provided a deep learning method to recognize font type of Arabic
calligraphy in the paper “Deep learning autoencoder approach: Automatic recognition of
artistic Arabic calligraphy types”. This approach obtained recognition rate of 92.1% in
local datasets and 99.5% in the public datasets.
Chapter 3
Methodology
Explain your methodology using phrases, flowcharts, detailed diagrams, etc.
Fonts in Dataset
ACalsonPro BemboStd

BancoStd ZiptyDoStd

CalibanStd RotisSerifStd

ParisianStd
AnnaStd

FalstaffMTStd UmbraStd

Image Acquisition

Image Preprocessing

Image Augmentation

Data Split Test


Train

Test accuracy

Test loss

Result
Chapter 4
Result and Discussion
In this project, we have taken a dataset containing 133 images of 10 font types from the
AdobeVFR dataset to test and train our model. The image selected is resized and then

Model Accuracy 96
Model Loss
Chapter 5
Conclusion and Future Work 
The user just needs to send a link of the image to the program and then this project can
help the user identify different type of fonts with a pretty good accuracy (of about 96%).
Using different type of fonts in a text helps to attract readers and it can hold the reader’s
attention. Therefore, identification of fonts has great value as well.
Currently, this project works on a small dataset of about ------- This dataset can further be
enhanced by increasing the images/values(?) in the dataset. It has an optimum ratio of
75% for training and the rest 25% for testing. By increasing the dataset we can optimise
this project to identify large number of fonts. This project can help artists in various fields
and especially those people who work with posters, logos, designs etc.
Currently, this project can identify only one text if we give an image that has multiple
fonts in it. In future, this problem can be resolved such that it can identify that the image
contains multiple fonts and then identify the font used.
References
 [1] N. K. Kanhere and S. T. Birchfied, “Real-time incremental segmentation and tracking of vehicles
at low camera angles using stable features,” IEEE Trans. Intell. Transp. Syst., vol. 9, no. 1,
pp.148-160, March 2008 (Example : Journal papers)
 [2] K. Onoguchi, “Moving object detection using a cross correlation between a short accumulated
histogram and a long accumulated histogram”, Proc.   18th Int. Conf. on Pattern Recognition,
Hong Kong, August 20 - 24, 2006, vol. 4, pp. 896 – 899 (Example : Conference papers)
[3] T. H. Cormen, C. E. Leiserson, R. L. Rivest and C. Stein, “Introduction to Algorithms”, 2nd ed.,
The MIT Press, McGraw-Hill Book Company, 2001 (Example : Text Book/ Magazine)
[4] Open Source Computer Vision (OpanCV) [Online]. Accessed on 21st April 2022:
http://opencv.willowgarage.com/wiki/ (Example : Website)

You might also like