A New Computational Method For Arabic Calligraphy

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

applied

sciences
Article
A New Computational Method for Arabic Calligraphy Style
Representation and Classification
Zineb Kaoudja 1, *, Mohammed Lamine Kherfi 1,2 and Belal Khaldi 3

1 Lab or Artificial Intelligence and Data Science, Kasdi Merbah Ouargla University, Ouargla BP. 511, Algeria;
kherfi.lamine@univ-ouargla.dz
2 LAMIA Laboratory, University du Québec à Trois-Rivières, Trois-Rivières, QC G8Z 4M3, Canada
3 LINATI Laboratory, University of Ouargla-Kasdi Merbah, Ouargla BP. 511, Algeria; bilel.khaldi@gmail.com
* Correspondence: zinebkaoudja@gmail.com

Abstract: Despite the importance of recognizing Arabic calligraphy styles and their potential useful-
ness for many applications, a very limited number of Arabic calligraphy style recognition works have
been established. Thus, we propose a new computational tool for Arabic calligraphy style recognition
(ACSR). The present work aims to identify Arabic calligraphy style (ACS) from images where text
images are captured by different tools from different resources. To this end, we were inspired by
the indices used by human experts to distinguish different calligraphy styles. These indices were
transformed into a descriptor that defines, for each calligraphy style, a set of specific features. Three
scenarios have been considered in the experimental part to prove the effectiveness of the proposed
tool. The results confirmed the outperformance of both individual and combine features coded by
our descriptor. The proposed work demonstrated outstanding performance, even with few training
 samples, compared to other related works for Arabic calligraphy recognition.


Citation: Kaoudja, Z.; Kherfi, M.L.; Keywords: document image analyzing; Arabic calligraphy; feature extraction; machine learning
Khaldi, B. A New Computational
Method for Arabic Calligraphy Style
Representation and Classification.
Appl. Sci. 2021, 11, 4852. https:// 1. Introduction
doi.org/10.3390/app11114852
Document Analysis (DA) is one of the computer vision applications. It is a discipline
that combines image processing and machine learning techniques to process and extract
Academic Editor:
information from document images of different text types such as digits or alphabet. DA
Antonio Fernández-Caballero
attempts to extract the layout from a scanned document page and then reuse it to generate
a new visually similar document with other content. Therefore, it must be capable of
Received: 16 April 2021
Accepted: 21 May 2021
identifying writing characteristics, such as the style used in writing, and employ it to
Published: 25 May 2021
reproduce similar documents with the same style.
DA techniques have been employed in many applications such as document layout
Publisher’s Note: MDPI stays neutral
analysis [1], signature verification [2], writer identification [3], optical character recognition
with regard to jurisdictional claims in
(OCR), optical Font recognition (OFR), etc. For instance, OFR aims to define the text writing
published maps and institutional affil- style from a document image. Based on the purpose of the writing and the source of the
iations. written text, text writing can be classified into two categories, as shown in Figure 1. The
first one is texts written by humans, which in turn comprises two sub-categories namely
ordinary handwriting and calligraphy. The second one is machine-printed texts that
may be written using common styles. Thus, text produced by machine or handwritten
Copyright: © 2021 by the authors.
calligraphy uses well-known styles. Writing styles used by a machine are referred to as
Licensee MDPI, Basel, Switzerland.
fonts, whereas calligraphy refers to the set of styles that might be used in handwriting
This article is an open access article
texts. Fonts and calligraphy also differ in the purpose of use, calligraphy is mostly used for
distributed under the terms and decoration such as in mosque walls, or in artists’ paintings, whereas fonts are mostly used
conditions of the Creative Commons for documentation and communication. Fonts are far less complicated than calligraphy.
Attribution (CC BY) license (https:// They may provide alternatives, ligatures, and some stylized versions, but fundamentally,
creativecommons.org/licenses/by/ they can only be as creative as type designers. When writing letters by hand, there are no
4.0/). limitations to how to write them. Every version of a letter can be written differently. Letters

Appl. Sci. 2021, 11, 4852. https://doi.org/10.3390/app11114852 https://www.mdpi.com/journal/applsci


Appl. Sci. 2021, 11, x FOR PEER REVIEW 2 of 17

Appl. Sci. 2021, 11, 4852 2 of 17


sions, but fundamentally, they can only be as creative as type designers. When writing
letters by hand, there are no limitations to how to write them. Every version of a letter
can be written differently. Letters may be merged or connected even though they are not
may be merged or connected even though they are not adjacent. Consequently, fonts do
adjacent. Consequently, fonts do not offer flexibility compared to handwriting. Such
not offer flexibility compared to handwriting. Such flexibility makes the recognition of
flexibility makes the recognition of calligraphy or reproduction of text using similar cal-
calligraphy or reproduction of text using similar calligraphy styles an extremely difficult
ligraphy styles an extremely difficult task for a DA system. In this work, we aim to pro-
task for a DA system. In this work, we aim to propose a tool that is able to classify Arabic
pose a tool that is able to classify Arabic calligraphy styles.
calligraphy styles.

Figure
Figure 1.1. The
The different
different categories of text
text writing
writing styles.
styles. Our
Our work
workfalls
fallsin
inthe
thehighlighted
highlightedcategory
categoryof
of calligraphy text.
calligraphy text.

Calligraphy
Calligraphy style style recognition
recognition (CSR) (CSR) is is considered an important research area for the
following reasons:
following reasons: (1) (1) It
It helps
helps toto read the text content. In other words, knowing the used
style reflects
style reflects the the rules used in the writing of different characters, which in turn eases the
reading task.
reading task. (2)(2) It
It helps
helps to to recognize
recognize the different parts of a document. Some styles are
defined to
defined to represent
represent specific
specific parts in in the
the document
document such such asas titles,
titles, footers,
footers, paragraphs,
paragraphs, etc.etc.
(3) It also helps to grasp the history of a document. In In paleography,
paleography, CSR is used to define
the era
the era inin which
which the the document
document was was written
written because styles appeared in different eras. (4) It
also helps to define the origins (i.e.,
also helps to define the origins (i.e., geographical geographical area)area) inin which
which aa document
document was was written.
written.
(5) It can be used for tutor purposes. Calligraphy learners use CSR systems to judge the
(5) It can be used for tutor purposes. Calligraphy learners use CSR systems to judge the
quality of
quality of their
their writings
writings in in cases
cases ofof experts’
experts’ absence.
absence.
Arabic is
Arabic isthe
thefourth
fourthmostmostspoken
spokenlanguage
languageininthe theworld,
world, andand it is
it is thethe first
first language
language of
of more
more thanthan 200200 million
million people
people acrossthe
across theworld.
world.Arabic
Arabicscript
scriptisisthe the third
third most
most widely
widely
used script
used script afterafter Latin
Latin script
script [4].
[4]. Similar
Similar to to other
other languages,
languages, itit hashas grammar,
grammar, spelling,
spelling,
punctuation rules, pronunciation, slang, and idioms. Several characteristics beyond the
punctuation rules, pronunciation, slang, and idioms. Several characteristics beyond the
mere differences
mere differences betweenbetween languages
languages make make Arabic
Arabic distinctive,
distinctive, including
including the the number
number of of
variations and the written form. Arabic handwritten text is
variations and the written form. Arabic handwritten text is divided into two main parts:divided into two main parts:
artistic writing
artistic writing called
called calligraphy
calligraphyand andnon-artistic
non-artistic(handwritten
(handwrittenororprinted) printed) scripts.
scripts.Arabic
Ara-
calligraphy (AC) is one of the most significant arts in the world.
bic calligraphy (AC) is one of the most significant arts in the world. It is written only by It is written only by hand.
The first
hand. The style
firstofstyle
calligraphy was developed
of calligraphy at the end
was developed of the
at the end 7thofcentury.
the 7th Over time,
century. the
Over
Muslim and Arab world developed many other styles of calligraphy. Due to the complex
time, the Muslim and Arab world developed many other styles of calligraphy. Due to the
shape of the Arabic text, one must hold a certain level of expertise to be able to write AC
complex shape of the Arabic text, one must hold a certain level of expertise to be able to
texts or recognize a writing style.
write AC texts or recognize a writing style.
Before delving into Arabic calligraphy systems, we must shed some light on Arabic
Before delving into Arabic calligraphy systems, we must shed some light on Arabic
font recognition (AOFR) and how it differs from calligraphy recognition. On the one hand,
font recognition (AOFR) and how it differs from calligraphy recognition. On the one
the AOFR domain has received a lot of attention for several reasons: (a) the availability
hand, the AOFR domain has received a lot of attention for several reasons: (a) the avail-
of public big datasets, (b) the ease of dealing with Arabic fonts due to their fixed shapes,
ability of public big datasets, (b) the ease of dealing with Arabic fonts due to their fixed
(c) and the considerable amount of related works [5,6] on the subject. On other hand, far
shapes, (c) and the considerable amount of related works [5,6] on the subject. On other
less attention has been given to Arabic calligraphy style recognition (ACSR). However,
hand, far less attention has been given to Arabic calligraphy style recognition (ACSR).
for the other languages, several works have been made to this end such as the work [7]
However, for the other languages, several works have been made to this end such as the
in which topological features have been proposed to recognize Hebrew handwriting
work
styles.[7] in which topological
Nonetheless, the complexity features have beenstyles
of calligraphy proposed
makes to itrecognize
possible to Hebrew
use onlyhand-
two
writing styles. Nonetheless, the complexity of calligraphy styles
characters, the character Aleph and the character Lamed. Other attempts have been carried makes it possible to use
only
out fortwo characters,
Chinese stylethe characterinAleph
recognition and the character
[8], proposing a featureLamed.
extraction Other attempts
method have
based on
the regional guided filter (RGF) with reference images, which is generated by K-Nearest
Appl.
Appl.Sci.
Appl. Sci.2021,
Sci. 2021,11,
2021, 11,xxxFOR
11, FORPEER
FOR PEERREVIEW
PEER REVIEW
REVIEW 333of
ofof17
17
17
Appl. Sci. 2021, 11, x FOR PEER REVIEW 3 of 17

been
been carried
been carried out
carried out for
out for Chinese
for Chinese style
Chinese style recognition
style recognition in
recognition in [8],
in [8], proposing
[8], proposing aaa feature
proposing feature extraction
feature extraction
extraction
been carried out for Chinese style recognition in [8], proposing a feature extraction
Appl. Sci. 2021, 11, 4852 method
method
methodbased based
basedonon the
onthe regional
theregional guided
regionalguided filter
guidedfilter (RGF)
filter(RGF) with
(RGF)with reference
withreference images,
referenceimages,images,which which
whichis 3 gen-
isis gen-
ofgen-
17
method based on the regional guided filter (RGF) with reference images, which is gen-
erated
eratedby
erated byK-Nearest
by K-NearestNeighbor
K-Nearest Neighbor(KNN)
Neighbor (KNN)matting
(KNN) mattingand
matting andused
and usedas
used asasthe
theinput
the inputimage
input imagefor
image forRGF,
for RGF,and
RGF, and
and
erated by K-Nearest Neighbor (KNN) matting and used as the input image for RGF, and
in
inin[9]
[9]using
[9] usingdeep
using deepfeatures
deep featureswith
features withSupport
with SupportVector
Support VectorMachine
Vector Machine(SVM)
Machine (SVM)and
(SVM) andNeural
and NeuralNetwork
Neural Network
Network
in [9] using deep features with Support Vector Machine (SVM) and Neural Network
(NN)
(NN)classifiers.
(NN) classifiers.
classifiers.
Neighbor (KNN) matting and used as the input image for RGF, and in [9] using deep
(NN) classifiers.
Despite
Despitethe
Despite thelabor
the laborin
labor inother
in otherlanguages
other languagesto
languages tofind
to findaaacommon
find commonsolution
common solutionfor
solution forstyle
for stylerecognition,
style recognition,
recognition,
features
Despitewith the
Support
laborVector
in other Machine
languages (SVM) andaNeural
to find common Network
solution (NN) classifiers.
for style recognition,
these
these features
thesefeatures
featuresareare not
arenot efficient
notefficient
efficientand and applicable
andapplicable
applicablefor for Arabic
forArabic
Arabicduedue
dueto to their
totheir nature.
nature.Arabic
theirnature. Arabiccal-
Arabic cal-
cal-
theseDespite
features theare
labor
not in other languages
efficient and applicable to findfor a common
Arabic due solution
to their fornature.
style recognition,
Arabic cal-
ligraphy
ligraphytexts
ligraphy textsare
texts areextremely
are extremelysmooth,
extremely smooth,interconnected,
smooth, interconnected,and
interconnected, andhave
and haveaaaunique
have uniquecharacteristic
unique characteristicin
characteristic inin
these features
ligraphy textsare
arenot efficientsmooth,
extremely and applicable for Arabic
interconnected, due
and to their
have nature.
a unique Arabic callig-
characteristic in
their
theirform.
their form.Arabic
form. Arabichas
Arabic has28
has 28letters;
28 letters;each
letters; eachone
each onehas
one hasisolated
has isolatedand
isolated andconnected
and connectedforms
connected forms(at
forms (atthe
(at thebe-
the be-
be-
raphy texts are
their form. extremely
Arabic has 28smooth,
letters; interconnected,
each one has isolated and have and a unique
connected characteristic
forms (at in the their
be-
ginning,
ginning,
ginning, center,
center,
center, and
and
and end),
end),
end), as
as
as illustrated
illustrated
illustrated in
inin Figure
Figure
Figure 2.
2.2.Another
Another
Another difficulty
difficulty
difficulty in
ininArabic
Arabic
Arabic callig-
callig-
callig-
form.
ginning,Arabic has and
center, 28 letters;
end), aseach one has isolated
illustrated in Figureand connected
2. Another forms (atinthe
difficulty beginning,
Arabic callig-
raphy
raphyis
raphy isthe
is thepossibility
the possibility of
ofletters
of letters overlapping one
oneabove the
theother, which is
isisnot
notthethematter
center,
raphy is and possibility
theend),
letters
as illustrated
possibility of letters inoverlapping
overlapping
Figure
overlapping
one
2. Another above
above
one above
the
difficulty other,
other, which
in Arabic
the other,
which
which
not
calligraphy the matter
matter
is
is not the matter the
with
with
with other
other
other languages.
languages.
languages. Additionally,
Additionally,
Additionally, the
the
the shapes
shapes
shapes of
of
ofletters
letters
letters are
are
are affected
affected
affected by
by
by both
both
both the
the
the writing
writing
writing
possibility
with otheroflanguages.
letters overlapping
Additionally, one above
the shapesthe other, whichare
of letters is not the matter
affected by both withtheother lan-
writing
and
andthe
and thewriter’s
the writer’sstyle,
writer’s style,and
style, and
and also
alsoby
also bybythe
thepurpose
the purpose
purpose ofofthe
of thewriting
the writing
writing itself
itself
itself(e.g.,
(e.g.,for
(e.g., fordecoration,
for decoration,
decoration,
guages.
and theAdditionally,
writer’s style,the shapes
and also of byletters are affected
the purpose of thebywriting
both the writing
itself (e.g.,and forthe writer’s
decoration,
documentation,
documentation,
documentation,
style, and also byor
ororother
other
theother purposes).
purposes).
purposes).
purpose of the writing itself (e.g., for decoration, documentation, or
documentation, or other purposes).
other purposes).

(a)
(a)
(a) (b)
(b)
(b)
(a) (b)
Figure
Figure2.
Figure 2.2.Components
Componentsof
Components ofthe
of theArabic
the Arabiclanguage.
Arabic language.(a)
language. (a)The
(a) Thealphabet
The alphabetconsisting
alphabet consistingof
consisting of28
of 28characters
28 charactersand
characters and(b)
and (b)
(b)
Figure 2. Components
Components of the
ofsame
theArabic
Arabic language.
language.(a)(a)
The alphabet
The alphabetconsisting of 28 characters and (b)
consisting
Figure
the
the 2.
thedifferent
different
different forms
formsof
forms ofthe
of the
the same
same character
character
character based
basedon
based onthe
on the
theposition
position
positionin
ininthe
the
the word. of 28 characters and
word.
word.
thethe
(b) different forms
different of the
forms same
of the character
same based
character onon
based thethe
position in the
position word.
in the word.
InInthis
In thispaper,
this paper,we
paper, wepropose
we proposeaaarobust
propose robustsolution
robust solutionfor
solution forAC
for ACACstylestylerecognition
style recognitionfrom
recognition fromimages.
from images.
images.
In this
In this paper,
paper, we we propose
propose aa robustrobust solution
solution for for AC AC style
style recognition
recognition from from images.
images.
Our
Our proposal
Ourproposal
proposalconsistsconsists
consistsof of two
oftwo main
twomain phases:
mainphases:
phases:(1) (1) feature
(1)feature extraction
featureextraction
extractionfrom from
fromAC AC images
ACimagesimagesand and(2)
and (2)
(2)
Our proposal
Our proposal consists consists of of two
two main
main phases:
phases: (1) (1) feature
feature extraction
extraction from from AC AC images
images and and (2)
(2)
classification
classificationthrough
classification throughdecision
through decisionfusion.
decision fusion.The
fusion. Theextracted
The extractedfeatures,
extracted features,which
features, whichrepresent
which representthe
represent thedif-
the dif-
dif-
classificationthrough
classification throughdecisiondecision fusion.
fusion. The The extracted
extracted features,
features, which which represent
represent the dif-
the different
ferent
ferentmorphologies
ferent morphologiesof
morphologies ofAC,
of AC,have
AC, havebeen
have beenused
been usedfor
used forthe
for thefirst
the firsttime
first timein
time inthis
in thiswork
this workand
work andhave
and havebeen
have been
been
morphologies
ferent morphologies of AC, have of AC, been
have usedbeen forused
the first timefirst
for the in this
time work andwork
in this haveand beenhave inspired
been
inspired
inspiredby
inspired bythe
by thecharacteristics
the characteristicsexperts
characteristics experts(calligraphers)
experts (calligraphers)use
(calligraphers) usefor
use forrecognizing
for recognizingAC
recognizing ACstyles.
AC styles.Since
styles. Since
Since
by the characteristics
inspired by the characteristics experts (calligraphers)
experts (calligraphers) use for use recognizing AC styles.
for recognizing Since each
AC styles. Since
each
eachfeature
each featureis
feature isisdedicated
dedicatedto
dedicated todistinguishing
to distinguishingone
distinguishing oneor
one ormore
or morestyles,
more styles,multiple
styles, multipleclassifiers
multiple classifiershave
classifiers have
have
feature is dedicated
each feature is dedicated to distinguishing
to distinguishing one orone moreor styles,
more styles, multiple classifiers
multiple have been
classifiers have
been
beenengaged
been engagedin
engaged ininthe
theprocess
the processof
process ofrecognition
of recognitionin
recognition inwhich
in whichthe
which thedecisions
the decisionsare
decisions arefused
are fusedto
fused toobtain
to obtainaaa
obtain
engaged
been engaged in thein process of recognition
the process of recognition in which the decisions
in which the decisionsare fused to obtain
are fused a finala
to obtain
final
finaldecision.
final decision.It
decision. ItItshould
shouldbe
should bebementioned
mentionedthat
mentioned thatnone
that noneof
none ofthe
of theformer
the formerworks
former workson
works onAC
on ACrecognition
AC recognition
recognition
decision. It should be mentioned that none of the former
final decision. It should be mentioned that none of the former works on AC recognition works on AC recognition has
has
hasimplicated
has implicatedsuch
implicated suchaaawide
such widevariety
wide varietyof
variety ofstyles
of styles(nine
styles (ninestyles)
(nine styles)as
styles) aswe
as wedid
we didin
did inthis
in thiswork
this work(Table
work (Table2).
(Table 2).
2).
implicated such a wide variety of styles (nine styles) as we
has implicated such a wide variety of styles (nine styles) as we did in this work (Table 2). did in this work (Table 2). Our
Our
Our
Our proposal
proposal
proposal achieved
achieved
achieved state-of-the-art
state-of-the-art
state-of-the-art and
and
and also
also
also provided
provided
provided stability
stability
stability against
against
against scale
scale
scale variation
variation
variation
proposal
Our proposal achieved achievedstate-of-the-art
state-of-the-artand also andprovided
also provided stability against
stability scale scale
against variation and
variation
and
andlearning
and learning from a few
fewsamples.
learning
and learning fromfrom
learning fewaaasamples.
afrom
from
few samples.
samples.
few samples.
The
Theremainder
The remainderof
remainder ofthis
of thispaper
this paperis
paper isisorganized
organizedas
organized asfollows.
as follows.In
follows. InSection
In Section2,
Section 2,2,we
weweclarify
clarifyArabic
clarify Arabic
Arabic
The
The remainder
remainder of of this
thispaper
paperisisorganized
organizedas asfollows.
follows. In InSection
Section2,2,we weclarify
clarifyArabic
Arabic
writing
writing
writing characteristics,
characteristics,
characteristics, styles,
styles,
styles, the
the
the writing
writing
writing complexity
complexity
complexity of
ofof each
each
each style,
style,
style, and
and
and the
the
the reasons
reasons
reasons we
we
we
writing
writing characteristics,
characteristics, styles, styles, thethe writing
writing complexity
complexity of of each
each style,
style, andand the the reasons
reasons we we
consider
consider
consider
consider nine
nine
nine styles.
styles.
styles. Section
Section
Section 333lists
lists
lists and
and
and discusses
discusses
discusses highly
highly
highly related
related
related works
works
works in
in
in the
the
the field
field
field of
of
of AC
AC
AC
consider nine nine styles.
styles. Section
Section 33 lists
lists and
and discusses
discusses highly
highly related
related works
works in in the
thefield
fieldof ofACAC
style
style Recognition.
Recognition.Thereafter,
Recognition.
styleRecognition.
style Thereafter,
Thereafter,we
Thereafter, we
we introduce
introduce
weintroduce
introduceour our
our proposal
proposal
ourproposal
proposalin in
in Section
Section4444and
Section
inSection and
and experimentally
experimentally
andexperimentally
experimentally
style Recognition. Thereafter, we introduce our proposal in Section 4 and experimentally
evaluate
evaluateit
evaluate
evaluate ititin
ininSection
Section5.
Section Finally,
Finally,we
5.5.Finally,
Finally, weweinfer
inferaaageneral
infer generalconclusion
general conclusionand
conclusion andsome
and someperspectives.
some perspectives.
perspectives.
evaluate itit in inSection
Section5. 5. Finally,we weinferinferaageneral
generalconclusion
conclusionand andsomesomeperspectives.
perspectives.
2.
2.2.Characteristics
2. Characteristics
Characteristicsof
Characteristics of
of Arabic
Arabic
ofArabic Handwritten
Handwritten
ArabicHandwritten Calligraphy
Calligraphy
HandwrittenCalligraphy
Calligraphyand and
and
andItsIts
Its Complexity
Complexity
ItsComplexity
Complexity
2. Characteristics of Arabic Handwritten Calligraphy and Its Complexity
Arabic consists
Arabicconsists
Arabic consistsofof 17
of17 main
main
17main character
character
maincharacter forms.
forms.
characterforms. With
forms.With
Withthethe
the addition
addition
theaddition
additionof of
of dots
dots
ofdots placed
placed
dotsplaced above
above
placedabove
above
Arabic consists of 17 main character forms. With the addition of dots placed above
or
or below
orbelow certain
belowcertain of
certainof them,
them,itititprovides
ofthem, provides total
providesaaatotal
total of
of
totalof 28
28
of28 letters.
letters.
28letters.
letters.As As shown
Asshown
shownin in (Figure
in(Figure 2)
(Figure2) above,
2)above,
above,
or below certain of them, it provides a total of 28 letters. As shown in (Figure 2) above,
the same
thesame
the letter
sameletter shapecan
shape
lettershape canform
can formaaa“b”
form “b”or
“b” or“baa”
or “baa”sound
“baa” soundwhen
sound whenone
when onedot
one dotis
dot isisplaced
placedbelow
placed below(‫)ﺏ‬,
below ((‫)ﺏ‬,),aaa
(‫)ﺏ‬,
the same letter shape can form a “b” or “baa” sound when one dot is placed below (‫)ﺏ‬, a
a“t”
“t”“t”or
“t” or“taa”
or
or “taa”sound
“taa”
“taa” soundwhen
sound whentwo
when
when twodots
two
two dotsare
dots areplaced
are placed above(((‫ﺕ‬
above
above
placedabove (‫)ﺕﺕ‬,),),or
oraaaa“th”
or “th”or
“th”
“th” or“thaa”
or “thaa”sound
“thaa” sound when
when
soundwhenwhen
“t” or “taa” sound when two dots are placed above (‫)ﺕ‬, or a “th” or “thaa” sound when
three
three
three dots
dots
dots are
are
are added
added
added above
above
above (((‫ﺙ‬
‫ﺙ‬
three dots are added above (‫)ﺙ‬. Short vowels are not included in the alphabet but instead
).
).
).Short
Short
Shortvowels
vowels
vowels are
are
are not
not included
included in
in the
the alphabet
alphabet but
but instead
instead
instead
three dots are added above (‫)ﺙ‬. Short vowels are not included in the alphabet but instead
indicated by signs (diacritics) placed above or below the consonant or long vowel that they
follow. The Arabic writing system is a Right to Left (RTL), which means words are written
and read in RTL way as in Hebrew, Persian, and Urdu. Texts are written in a cursive way
where letters must be interconnected unlike other languages, such as English or French,
indicated
written
also know andbyread
that signs in(diacritics)
a letter RTL
in Arabic way placed ascan in be above
writtenorPersian,
Hebrew, inbelow
three and the
differentconsonant
Urdu. formsTexts or longwritten
are
based onvowel that
in
its loca- a
they
cursive follow.
way The Arabic writing system is a Right to Left (RTL), which means words are
tion
indicated by where
or syllable in the
signs letters
wordmust
(diacritics) (beginning,be interconnected
placed middle,
above or belowor unlike
at the other
theend) aslanguages,
consonant shown orinlong such
Figure as2.
vowel English
that
written and readconnecting
in RTL way as inisHebrew, Persian, and Urdu. Texts are written in a
they follow. The Arabic writing system is a Right to Left (RTL), which means wordsmust
or French, where letters a matter of choice rather than obligation. One are
cursive
also know way where letters must be interconnected in unlike other languages, suchon asitsEnglish
Arabic
written andthat
Calligraphy
read a letter
Styles
in RTL in way Arabic as can be written
in Hebrew, Persian, threeand different
Urdu.forms Texts based are written loca-
in a
Appl. Sci. 2021, 11, 4852 or French,
tion or where
syllable in connecting
the word letters is a middle,
(beginning, matter oforchoice at the rather
end) as than
shown obligation.
in Figure One2. 4 must
of as
17
cursive ACway consists
where ofletters
two main muststyles (Kufi and Naskh),
be interconnected unlikeeach other style has several
languages, suchvariants,
as English
also know that a letter in Arabic can be written in three different forms based on its loca-
well
or as region-specific
French, where connecting styles.letters In theis history a matterofofArabic choice calligraphy,rather than obligation. there wereOne six must
main
tion orCalligraphy
Arabic syllable in Styles the word (beginning, middle, or at the end) as shown in Figure 2.
styles
also namely
know that Kufi,
a letter Diwani,
in Arabic Farisi,
can be Naskh, written Rekaa, in three anddifferent Thuluthforms each based of which on its has loca-its
tion orAC
characteristics consists
syllable and
in ofwriting
the twoword main rules. styles
(beginning, Over (Kufitime,
middle, and over Naskh),
or 100
at each
different
the end) style
as styles
shownhasappeared
several
in Figure variants,
and2. iden- as
where
Arabicconnecting
Calligraphyletters Styles is a matter of choice rather than obligation. One must also know
well as region-specific
tified styles. main In the historyNine of Arabic calligraphy, there of were sixstyles
main
that a driven
letter infromArabic the can former
be written instyles. three different distinctive
forms based categories
on its location cursive
or syllable
stylesAC
Arabic
evolved, consists
namely
Calligraphy
becoming Kufi,ofever
Styles two
Diwani,
moremainrefined styles (Kufi
Farisi, Naskh,
and and
elegant, Naskh),
Rekaa, some andeach of Thuluthstyleare
which has
each several
still ofused variants,
whichand has
some as
its
in the word (beginning, middle, or at the end) as shown in Figure 2.
well as region-specific
characteristics and writing styles. rules. In the
Over history
time, of Arabic calligraphy, there were six main
others ACthat have
consists disappeared.
of two main The
styles commonly
(Kufi andover used
Naskh), 100 styles different
each style styles
nowadays appeared
has several are the and iden-
six basic
variants, as
styles
tified
Arabic
styles namely
driven
Calligraphy fromKufi, the
Styles Diwani,
former Farisi,
main Naskh,
styles. Rekaa,
Nine and
distinctive Thuluthcategories each of
of which
cursive has
styles its
well as(namely: Kufi,
region-specific Diwani,
styles. Farisi, In the Naskh, history Rekaa, of Arabic andcalligraphy,
Thuluth) and there threewere othersix styles
main
characteristics
evolved,
that are becoming
driven and
from writing
ever
them more rules.
which refined Over
are(Kufi and time,
Maghribi, over
elegant, 100
some
Mohakik, different
ofand which stylesare
Square-Kufi. appeared
still used
Unlike and
and iden-
some
other
styles AC namely
consists Kufi,of two Diwani, main Farisi,
styles Naskh, and Rekaa,
Naskh), and each Thuluth
style each
has of which
several has
variants, its
as
tified driven
others
related that
works fromdisappeared.
have
that dealtthe with former a fewmain
The of styles.styles,
commonly
these Nine useddistinctive
in this styleswork, categories
nowadays
we consider of the
are cursive
the six
full styles
basic
list of
well as region-specific
characteristics and writing styles. In the
rules. Over history time, of over
Arabic 100calligraphy,
different styles there appeared
were six main and styles
iden-
evolved,
styles
the nine becoming
(namely:
styles. Kufi,
Table ever
1Diwani, more Farisi,
resumes refined
the and elegant,
Naskh,
different Rekaa,
characteristicssome and of which
Thuluth)
and the are
and
cues still
threeused
that andstyles
other
experts some
use
namely
tified Kufi, Diwani,
driven from theFarisi, former Naskh, mainRekaa, styles.and Nine Thuluth distinctive each ofcategories
which has of its cursive
characteristics
styles
others
that arethat
drivenhave from disappeared.
them which The arecommonly
Maghribi, used astyles
Mohakik, nowadays are Unlike
the six other
basic
in
and identifying
evolved, writingbecomingeach
rules. one
Over
ever of
time,
more these over styles.
refined 100 It also
different
and provides
elegant, styles some appeared of and
representative
which Square-Kufi.
and are sample
identified
still used from
driven
and some each
from
styles
related
style (namely:
works
tothat
show that
how Kufi,
itdealt Diwani,
differs with from Farisi,
adistinctive
few others.of Naskh,
these Rekaa,
styles, inof and work,
this Thuluth) and threethe
we consider other styles
full basic
list of
the
others former main
have styles.
disappeared. Nine The commonly categories used cursive
styles styles
nowadays evolved,
are thebecoming
six
thatnine
the are styles.
driven Tablefrom them 1 resumes which the are Maghribi,
different Mohakik, and
characteristics and Square-Kufi.
the cues that Unlike
experts other
use
ever more
styles (namely: refinedKufi, and elegant,
Diwani, someNaskh,
Farisi, of which Rekaa, are still andused Thuluth) and some and three others thatstyles
other have
Table 1. The nine most common related
in AC works
identifyingstyles that dealt
each
with one
their of withthese
characteristics a few
styles. ofand these
It also
cues styles,
provides
that in used
are thisa work,
representative
by expertswe consider
to sample
identify the full list
from
them. each of
disappeared. The commonly used styles
that are driven from them which are Maghribi, Mohakik, and Square-Kufi. Unlike other nowadays are the six basic styles (namely: Kufi,
the nine
style toworks styles.
show how Table 1
it differs resumes the different characteristics and the cues that experts use
Diwani,
related Farisi,thatNaskh,dealt withfrom
Rekaa, a fewand others.
ofThuluth)
these styles, and three in thisother work,styles we consider that arethe driven
full from
list
Style of
AC Style Example in
them identifying
Image which each
are Table
Maghribi, one of
General these
Mohakik, styles.
Characteristics ItSquare-Kufi.
also provides Cues a representative
Used by Expertssample from each
the nine styles. 1 resumes the and different characteristics Unlike otherthe
and related
cues works
that that
experts
Source
dealt
use
Table 1. The nine most common styleato
with AC
few show
styles how
of these ittheir
withstyles, differs in from
characteristics
thisstyles. others.
work, and we cues
considerthat are the used full bylist
experts
of thetonine identify them.
styles. Table
in identifying eachComposed
one of these It also
of geometrical forms - it is angular provides a representative sample from each1
resumes
style toAC the
show different
how characteristics
it differs from others. and the cues that experts use in identifying each
Styleone
AC Table 1. The nine Example
Style most common Image styles with
such theiras characteristics
Generalstraighta verti-
Characteristicsand cues that are used strokes
- thick
Cues by
Usedexperts by to identify them.
Experts
Kufi of these styles. It also provides representative sample from each style to show how it
Source
differs from others. cals/horizontals lines and distin- - long vertical extended
Table 1. The nine most common AC styles withComposed their characteristics of geometrical and cuesforms that are-used is by
itCues experts to identify them.
angular Style
AC Style Example Image guishable General angles. Characteristics strokes Used by Experts
Source
Table 1. The nine most common AC styles withsuch theiras straight verti-
characteristics and cues that are--used thickby
slant strokes
experts to identify them.
words Style
ACKufiStyle Example Image A Composed
cursiveGeneral
cals/horizontals ofCharacteristics
script, geometrical
beautiful,
lines and distin- forms --Cues
and Used byextended
it is angular
long vertical Experts
- written with a rounded Style Source Source
AC Style Example Image such asGeneral straight Characteristics Cues Used by Experts
harmonious.
guishable
Composed angles. is verti-
ofItgeometricalcharacterized formsby -shape
- thick
strokes
it is angular
strokes
Kufi
thecals/horizontals
rounded shape lines of and suchdistin-
letters. --itlong
is angular vertical extended
Diwani A
Composed
such cursive
of geometrical
asverticals/horizontals
straightscript, verti- forms
beautiful,
as
and ----thick
slant
thick
does words
strokes
not
strokes follow a
Kufi
Kufi guishable
straight
Words angles. skewed de-
are written lines and
--strokes
written
long verticalwith a rounded
cals/horizontals
distinguishable angles.
harmonious. lines and
It istocharacterized distin- -
bystraightlong vertical
extended strokes line extended
scend from right left. Lines start - slant words
shape
guishable
A cursive
the rounded angles.
script, beautiful, and strokes -- the style width changes
Appl.Diwani
Sci. 2021, 11, x FOR PEER REVIEW thick and thenshape attenuate. of letters. -slant
written
--written
does
words with
not follow a rounded 5 of 17
harmonious.
A cursive script, beautiful, It is and harmonious. by-from
characterized slant words
with
thick to a thin a
AWords
Itcursive arescript,
is characterized written
by the skewed
beautiful,
rounded shape de-
and of shape
rounded shape
Diwani the
letters.
scend rounded
Characterized Words
fromare shape
by
written
right the ofletter’s
toskewed
left. letters.
descend
Lines ac-start --straight
written
does
line
with
not follow a a rounded
Diwani harmonious.
from right to left.It is characterized
Lines start thick and by straight
-- the
does not width
style
line followchanges a
Words
curacy
thick
then and arethen
and
attenuate.
written
extension,
attenuate. skewedand byde- its shape
-- simple
the style orientation
width changes from
the rounded shape of letters. straight
from thick line to thinaa
Diwani Mostly,
scend used
from without
right to lack diacritics.
left. Lines start--thick does not
not follow
to thin
Appl. Farisi
Sci. 2021, 11, x FOR PEER REVIEW ease
Words and are clarity
written and skewed ofde- com-
-
does
the style
follow
width changes 5 of 17
Characterized
known
thick and
plexity. with
Farisi thenits by
clipped the
attenuate.
(alt., letter’s
Nasta’liq) letters. ac-
is a -straight
straight line
line
scend
Characterizedfrom right
by to
the letter’s left. Lines
accuracy and start simple
from orientation
thick to thin
curacy
Composed
cursive
extension,text. and
andof extension,
by short,
its ease and straightand and
clarity bylines its ---the simple
simple
style orientation
orientation
width changes
Farisi thick
lack ofand
Characterized then
complexity. attenuate.
by
Farisi the
(alt., letter’s
Nasta’liq) ac-
is a -- written
does not follow above a the base-
Farisi
Rekaa ease
and
Onecursive
and
simple
oftext. clarity
curves, and as
the simplest writing types line lack
well ofas com-
its -
from does
straight thicknot
line follow
to thin a
curacyused
Mostly,
plexity. and
Farisi extension,
without
(alt., and byisitsa straight
diacritics.
Nasta’liq) - simpleline orientation
straight
Characterized
of calligraphy. and even by
Its the lines.
name Itmeans
letter’s is writ-
ac-
Appl. Sci. 2021, 11, x FOR PEER REVIEW
Farisi ease
known
cursive ofand with clarity
text. itsbaseline andtypes
clipped lack ofof
letters. com- --simple -thick
doesstroke not follow a
orientation 5 of 17
tenOne
curacy
“the above the
and
copy Its the
simplest
style”
writing
extension, because except
and by
it has for
its ---simple simple
simple orientation
orientation
calligraphy.
plexity. Farisi name means
(alt., straight “the
Nasta’liq) copy style”is a - straight orientation
linethe baseline
Farisi Composed
One
some
ease of itthe
specific
and of
clarity short,
simplest
letters.
andforlack writing lines
of books.types
com- written on
Naskh
Naskh
because
been used has been
for used
copying copying
books. It is --- written
does
written not
on thefollow
abovebaseline a
the base-
Rekaa and cursive
It
of issimple
recognizable
calligraphy. text. curves,
by its
Its as
balance
name welland as
its
means its
plain -- slight
slight change
change in the in the text
It is
plexity. an elegant,
Farisi cursive
(alt.,
recognizable by its balance and itsline
clear forms. Nowadays, Nasta’liq)
this script
script is used that
is a straight
text thickness line
One
straight ofused the
and simplest
even lines. writing
It elegant
is typesthickness -simple orientation
Mostly,
“the
hasprimarily
cursive
plain copy
large,
clear text. print. without
style”
forms.because
in elongated, diacritics.
and
Nowadays, it writ-
has this - -thick stroke
ten of above
calligraphy. the Its name
baseline except means for written on the baseline
Naskh known
been
letters.
One ofusedwith
It
the has its
for clipped
copying
certain
simplest roles,
writing letters.
books. but types It is- -simple
it overlapping letters
orientation
script
Mostly, isusedused without primarily
diacritics. in print.
known - simple
- slight change orientation in the text
some“the
Composed
recognizable copy
specific style”
of letters.
short,
by because
its straight
balance itshort,
has
lines
and
of with its
could be clipped
calligraphy. changed letters.
Its Composed
according
name of
means to its---thickness -big rounded
written
written
simple on
above
orientation letters
the thebaseline
base-
Naskh straight
been lines
used and simple
for copying curves, as
books.well as It is-simple orientation
Rekaa
Rekaa and
It is
plain simple
an
calligraphers’ elegant,
clear curves,
forms.
“the copy style” because it has
its straight and even cursive
needs.
lines. asIt Itwell
Nowadays,
is script
has
written as
big its
thatthis - - written above
high
-thick
slight number the baseline
change india-of the text
Thuluth recognizable
above theand baseline by
except its balance
for some
line- stroke
and its- written on the baseline
Naskh straight
hasscript
letters,
been large,
usedis
which for even
elongated,
used lines.
primarily
take
copying a bigand Itspace
in
books. isprint.
writ-
elegant It is -critics thickness
- thick
slightstroke
specific letters.
ten plain
letters. above clear
It has the forms.
baseline
certain Nowadays,
except
roles, foritthis changeletters in the text
above
recognizable the baseline;
by the
its balance bigbut over-
and its-- overlapping
it does not consider the
somescript
It
could is an is
elegant,
specific
be used
changed primarily
cursive
letters. script
according that in
has print.
large,
to -thickness
big rounded letters
lapped
plain
elongated, clearcurves
andforms. result in
Nowadays,
elegant letters. big holes
It has certain baseline
this - overlapping letters
calligraphers’
It
thatis an
roles,
script but it could needs.
elegant,
calligraphers
is used becursive
changed
primarily fill Itwithhas
script
according
in bigthat
artistic
print. to -- high
big roundednumber lettersof dia-
Thuluth
Thuluth calligraphers’ needs. It has big letters, - high number of diacritics
letters,
has large,
diacritics. which take
elongated,
which take a big space above the baseline; a big
and space
elegant critics
- it does not consider
the big overlapped curves result in big holes the baseline
above
letters.
It that the
It
hascalligraphers baseline;
has certain
special letterforms theroles, big
fill with artistic which
over-
but
diacritics.
it - it does not consider
overlapping letters the
lapped
could
provide be curves
changed
it with result in
according
a unique bigbeautyholes
to -baseline
big rounded letters
It has special letterforms which provide it
that
andwithcalligraphers
calligraphers’
a unique
make itbeauty
easyneeds.andfillmake
to with
It
read, has artistic
it easy
evenbig to in -- high
- text
number of dia-
orientation
text orientation
Thuluth
Maghribi
Maghribi read, even in long texts. It is marked by -Kufi-Kufi
diacritics.
letters,
long which
texts.lines
descending take
It iswritten
marked a big
with very space
by de- critics
- written on the baseline
- written on the baseline
large
abovehas bowls. the lines baseline; the with big over-
It
scending special letterforms
written which very - it does not consider the
lapped
provide
large bowls. curves
it withresult a unique in big beautyholes baseline
that
and make calligraphers it easy to fillread,witheven artistic in -- text special orientation
orientation
Maghribi Mohakik and Thuluth have al- -Kufi
diacritics.
long texts. It is marked by de- -under
written theon the baseline
baseline
most
It has the
scending special same characteristics.
linesletterforms
written with which very - same diacritics as the -Thuluth
Mohakik
However,
large
provide bowls. letters
it with in Mohakik
a unique beauty are
thuluth style
longer under the
and make it easy to read, even in -- text baseline. special orientation
orientation
Maghribi Mohakik and Thuluth have al- written on the baseline -Kufi
long texts. It is marked by de- -underwritten theon the baseline
baseline
lapped
diacritics. curves result in big holes baseline
that calligraphers
It has special letterforms fill withwhich artistic
diacritics.
provide it with a unique beauty
Itand
hasmakespecial letterforms
it easy to read,which even in - text orientation
Maghribi provide it with a unique beauty -Kufi
Appl. Sci. 2021, 11, 4852 long texts. It is marked by de- - written on the baseline 5 of 17
and make it easy to
scending lines written with very read, even in - text orientation
Maghribi -Kufi
long
largetexts.
bowls. It is marked by de- - written on the baseline
scending lines written with very - special orientation
Mohakik Table and 1. Cont.
Thuluth have al-
large bowls. under the baseline
AC Style Example Image most theGeneral same Characteristics
characteristics. -- special orientation
Cues Used by Experts Style Source
Mohakik Mohakik have al-are same diacritics as the -Thuluth
However,and Thuluth
letters in Mohakik under
- specialthe baseline
orientation under
most the
Mohakik same
and have almost the same thuluth
characteristics.
Thuluth the baselinestyle
Mohakik
Mohakik longer under the baseline.
characteristics. However, letters in Mohakik -- written - same
same diacritics as the as the
diacritics -Thuluth
-Thuluth
However, letters
are longer under in Mohakik are thuluth styleon the baseline
the baseline.
A unique style thuluth style
longer under thedeveloped
baseline. for - written on the baseline

decorating walls rather than pa- - written on the baseline


A unique
pers. usuallystyledesigned
developed with formo-
A unique style developed for decorating
decorating
walls rather than
saic walls
papers.rather
faience, decorative glazed usuallythan pa- - strokes with equal
designed
with mosaic faience, decorative glazed
Square-Kufi
Square-Kufi pers.
facing usually
tiles,
facing tiles, designed
or simple
or simple with
bricks,
bricks, rather mo-
thanra-
- strokes with equal thickness
thickness -Kufi-Kufi
- square angles
saicreed pens
faience,and ink. It has
decorative two strict
glazed rules: (a) - strokes with equal
ther thanofreed
evenness full andpens
emptyand spaces,ink.
andIt (b)has - square angles
Square-Kufi facing
twosquaretiles,
angles and
strict or simple
rules: strict lines.bricks, ra-
(a) evenness of thickness -Kufi
ther thanempty
full and reed pens spaces, andand ink.(b) It has - square angles
two
square angles and strict lines.of
strict rules: (a) evenness
full and empty spaces, and (b)
Due to the complexity of AC and the shared characteristics among its styles, none
of the Due to therelated
former square
complexity angles
works of has
ACand and strict
the lines.
considered shared the characteristics
full list of nineamong styles.itsHowever,
styles, none of
there
the
were former
somerelated
seriousworks effortshas considered
to come up with thesome full list of nine
specific styles. However,
techniques there were
for recognizing AC
some
styles.Due Into
serious the
the complexity
efforts
following to come ofup
section, AC we and
with the
andshared
listsome specific
discuss characteristics
techniques
works among
for
that aimed its styles,
recognizing
at recognizing ACnone
styles.
Arabic of
the
In former related
the following
calligraphy styles works
section, has considered
we list and
using computer discuss
vision the full list of nine styles. However,
works that aimed at recognizing Arabic cal-
techniques. there were
some
ligraphy serious
stylesefforts
usingtocomputer
come up vision with some specific techniques for recognizing AC styles.
techniques.
In3. the following
Related Worksection, we list and discuss works that aimed at recognizing Arabic cal-
ligraphy
3. Related styles
ArabicWorktext using
font computer
recognitionvision has been techniques.
extensively studied owing to the availability of a
hugeArabic
amount textof font
resources that help
recognition hasresearchers
been extensively build new solutions.
studied owingWorks to the on Arabic font
availability of
3.recognition
Related Work can be grouped into two categories, namely handcrafted- and deep learning-
a huge amount of resources that help researchers build new solutions. Works on Arabic
based
font categories.
Arabic text font
recognition can On bethe
recognition one hand,
grouped hasinto been starting
twoextensively with handcrafted-based
categories, studied
namely owing to the
handcrafted-solutions,
and Faten
availability deep of
Kellal
huge [10]
alearning-based usesof
amount discrete
resources curveletthat transform
help researchers(DCT) to
buildconvert
categories. On the one hand, starting with handcrafted-based solutions, new images
solutions. into descriptors,
Works on Arabicand
then,recognition
font
Faten aKellal
backpropagation
[10]can uses neural curvelet
bediscrete
grouped network
into two has been employed
categories,
transform (DCT)namely to to predictimages
handcrafted-
convert the style
and
intoof
deep the
de-
image
learning-basedtext based
scriptors, and then, on
categories. the extracted
On the one hand,
a backpropagation descriptor.
neuralstarting In [11,12],
networkwith the former
has handcrafted-based method
been employed to predict has been
solutions, the
reinforced
Faten Kellalagainst
[10] uses scalediscrete
changescurvelet by usingtransform a steerable(DCT) pyramid texture. images
to convert Hussein.into A.Kde- [5]
has experimented
scriptors, and then, and compared several
a backpropagation neural texturenetworkdescriptors
has been foremployed
Arabic font recognition
to predict the
using extreme learning machine (ELM) and fast learning machine (FLN). On the other
hand, deep convolutional neural networks (DCNN) [13,14] have been utilized in several
occasions to perform Arabic font and font size recognition.
While there has been much research on Arabic font, few researchers have dealt with
Arabic calligraphy. It could be attributed to the lack of resources such as public datasets
and insufficiently related works. However, the reader should know that dealing with
calligraphy is much harder than fonts due to the absence of creativity in the latter. In other
words, calligraphy texts are affected by the calligrapher’s impression, which is not the
case with texts generated using machine fonts. Therefore, we limit ourselves to works
that tackle the issue of recognizing calligraphy styles rather than fonts. Table 2 lists works
conducted on AC style recognition with their respective datasets and the number of styles
taken into account.
In [15], the authors argued that Arabic calligraphy images should be dealt with as
textures, and therefore, they evaluated a set of commonly used texture descriptors for the
task of AC identification. Results indicated that Binarized Statistical Image Features (BSIF)
is the best texture descriptor among all for such a task.
Due to the lack of big datasets of AC and the fine-grained styles (e.g., Mohakik and
Thuluth), most works in the literature have utilized classical machine learning tools instead
of deep learning. Moreover, they attempted to propose their descriptors for this issue
instead of using other common descriptors such as Sift, LBP, etc.
Appl. Sci. 2021, 11, 4852 6 of 17

Table 2. List of related works on ACSR.

Author (Year) Language Dataset No Styles


Z.Kaoudja et al. (2020) [15] Arabic 1685 line image 9
Batainah et al. (2012) [16] Arabic jawi 700 blocks image (privet) 6
Batainah et al. (2013) [17] Arabic-jawi 700 block image (privet) 7
Batainah et al. (2011) [18] Arabic 14 documents images (privet) Unknown
Batainah et al. (2011) [19] Arabic 100 line image (privet) 6
Talab et al.(2011) [20] Arabic 700 line images 7
Azmi et al. (2011) [21] Arabic-jawi 100 character image (privet) 5
Azmi et al. (2011) [22] Arabic-jawi 1019 character images (privet) 4
Adam et al. (2017) [23] Arabic 330 character images (privet) 6
Allaf et al.(2016) [24] Arabic 267 line/word images (privet) 3
Elhmouz et al. (2020) [25] Arabic 421 line/word images (privet) 3
M. Khayyat (2020) [26] Arabic 2653 documents images (privet) 6
Z.Kaoudja et al. (2019) [27] Arabic 1685 line image 9
R.F. Moghaddam et al. (2012) [28] Arabic 27709 word image Unknown

In all of their works, Bilel Bataineh [16–19] and Ahmed Talab [20] attempt to classify
AC styles with a proposed statistical descriptor, named Edge Direction Matrix (EDMs).
They firstly pass through two steps called EDM1 and EDM2, which produce 3 × 3 matrices
counting edges (i.e., pixels’ adjacency), and then extract 22 statistical moments to constitute
the final image descriptor. Unlike the aforementioned global approach, the works in [21–23]
focused on extracting features using local shapes of letters. For instance, Allaf [24] uses
the text geometrical shape, the density of text above and under the baseline, number of
diacritics up and down the text, text orientation, the position of the text baseline, and the
ratio of black and white for the whole image. However, the validity of this solution has been
proven using a small dataset (260 images) comprising only three styles, which is highly
insufficient. To sum up, the aforementioned works can be classified into two categories,
holistic and local approaches. The holistic one is concerned with recognizing styles using
global descriptors. However, these approaches are not dedicated to calligraphy, but they
can be applied to heterogeneous images ignoring the very specific characteristics of AC.
On the other hand, the local approaches look into the characteristics of AC, exaggeratedly,
via letter segmentation which makes it inapplicable especially for complicated styles or
for big datasets. In this paper, we propose a solution that combines the advantages of
both, describing the specific features of each style without resorting to letter segmentation.
Although deep learning has proven itself as the best solution for many issues, it has not
been widely explored for ACSR due to the fine-grained styles and absence of big datasets.
We list the only two works that utilize deep learning nets for ACSR, which are [25,26]. In
the former, a common deep model (stacked-auto encoder) has been trained and utilized for
feature extraction, and a SoftMax has been employed to perform the recognition process.
In the latter, the full MobileNetV1 model has been fine-tuned and used to classify six
AC styles.

4. Proposed Method
In this paper, a new tool is proposed for the task of ACSR. The proposal is capable of
recognizing nine different AC styles and might be extended to other styles. After analyzing
Arabic calligraphy, we found out that the styles are geometrically different. Some styles
have a unique shape, some share similar letter shapes, and some others have special
diacritics. For the visually different styles, it is easy to separate them, whilst for the other
fine-grained styles, we needed to extract one or more distinctive characteristics to separate
them. The proposed solution was inspired by the calligraphy expert. A calligraphy expert
uses tools such as brushes, pens, or markers to create a special writing style that is artistic
recognizing nine different AC styles and might be extended to other styles. After ana-
lyzing Arabic calligraphy, we found out that the styles are geometrically different. Some
styles have a unique shape, some share similar letter shapes, and some others have spe-
cial diacritics. For the visually different styles, it is easy to separate them, whilst for the
Appl. Sci. 2021, 11, 4852 other fine-grained styles, we needed to extract one or more distinctive characteristics to
7 of 17
separate them. The proposed solution was inspired by the calligraphy expert. A callig-
raphy expert uses tools such as brushes, pens, or markers to create a special writing style
that is artistic and expressive. After an in-depth study of each style, looking for the visual
and expressive. After
characteristics used an
by in-depth studyto
calligraphers of distinguish
each style, looking
it, we didfor the
comevisual
up characteristics
with the main
used by calligraphers to distinguish it, we did come up with the main distinctive
distinctive features that need to be extracted for each style or set of styles. In the features
feature
that
extraction section, we explain these visual features and the relationship with their we
need to be extracted for each style or set of styles. In the feature extraction section, cor-
explain thesestyles.
responding visual features and the relationship with their corresponding styles.
Our
Ourproposed
proposedtool
toolconsists
consistsofofthree
threemain
mainsteps:
steps:(a)(a)image
imagepreprocessing:
preprocessing:perform
perform
several
severaltransformations
transformationsto toprepare
preparethetheimage
imageforforfeature
featureextraction,
extraction,(b) (b)feature
featureextraction:
extraction:
extract
extractthe
theproposed
proposeddescriptor
descriptorfrom
fromeacheachimage,
image,andand(c)(c)classification:
classification:useusethe
theextracted
extracted
features
features to predict the style of the input image. Figure 3 illustrates the generalscheme
to predict the style of the input image. Figure 3 illustrates the general schemeofof
our
ourproposed
proposedtool.
tool.

Figure3.3.AAgeneral
Figure generalschema
schemaforforour
our proposed
proposed tool.
tool. The dotted line separates
separates the
the (A)
(A) training
training from
from
(B) test phases. The images pass through a processing sequence starting from preprocessing,
(B) test phases. The images pass through a processing sequence starting from preprocessing, features fea-
extraction, and finally classification. The final descriptor contains eight features, as shown, which
will be explained in Section 4.2.

4.1. Preprocessing
Since we are interested only in the morphology of text letters, all images are first con-
verted into binary (i.e., black text on a white background) after having the texts separated
from backgrounds [29]. It should be known that most images contain either meaningful
texture, which is a part of the decoration or a meaningless one that resulted from the noise
while capturing. In either case, we illuminate the background so it does not affect the
results. Thereafter, we apply the following micro-operations to extract, for each image, a set
of images namely edge image, skeleton image, diacritics image, and no-diacritics image.
Each of these generated images will thereafter be used to define the characteristics of one or
more styles of AC. Figure 4 shows some of the images that resulted from these operations.

4.2. Feature Extraction


In most fields, it is a common practice to ask experts about cues they use to decide for
a certain inquiry. Calligraphers use some specific features, which we will discuss hereafter,
to find the appropriate style for a given text. The main aim of this step is to transform these
features into values that can be fed to a machine so it can decide on the style of a given text
image. It should be mentioned that a feature might specify one or more styles. Features
designated for each style or set of styles might be used in a sequential manner (sequential
decision) or parallel manner. However, in our work, we considered all the features to be
equally important and, therefore, adopt a parallel manner. That is to say, each feature
descriptor is fed to a classification machine, SVM in our case, and the final decision is the
combination of all the decisions of these machines.
meaningful texture, which is a part of the decoration or a meaningless one that resulted
from the noise while capturing. In either case, we illuminate the background so it does
not affect the results. Thereafter, we apply the following micro-operations to extract, for
each image, a set of images namely edge image, skeleton image, diacritics image, and
Appl. Sci. 2021, 11, 4852 no-diacritics image. Each of these generated images will thereafter be used to define
8 ofthe
17
characteristics of one or more styles of AC. Figure 4 shows some of the images that re-
sulted from these operations.

Figure 4.
Figure 4. Operations executed in the preprocessing step to generate a set of accompanying
accompanying images
images
for each
for each image
image in
inthe
thedataset.
dataset.Each generated
Each generatedimage willwill
image thereafter be used
thereafter to extract
be used one or
to extract a set
one or of
a
features. These operations are (a) edge detection using a 3 × 3 Laplacian filter, (b) skeleton detection
set of features. These operations are (a) edge detection using a 3 × 3 Laplacian filter, (b) skeleton
using ‘Zhang-Suen Thinning Algorithm’ [30], and (c) separating diacritics from text using the
detection using ‘Zhang-Suen Thinning Algorithm’ [30], and (c) separating diacritics from text using
flood-fill algorithm [31].
the flood-fill algorithm [31].

4.2. Feature
4.2.1. Extraction
Horizontal and Vertical Straight Lines (HVSL)
In most fields, it isbeen
This descriptor has a common practice
designed to askSquare-Kufi
to separate experts aboutfromcues they
other use to
styles. decide
It mainly
for a certain inquiry. Calligraphers use some specific features, which we will
describes how frequently horizontal and vertical lines appear in a text image. Square-Kufi discuss
Appl. Sci. 2021, 11, x FOR PEER REVIEW
hereafter,
differs from toother
find the
stylesappropriate style
by the high for a of
number given text.and
vertical Thehorizontal
main aimlines
of this step
as shown9 of 17
is in
to
transform
(Figure 5). these features into values that can be fed to a machine so it can decide on the
style of a given text image. It should be mentioned that a feature might specify one or
more styles. Features designated for each style or set of styles might be used in a se-
quential manner (sequential decision) or parallel manner. However, in our work, we
considered all the features to be equally important and, therefore, adopt a parallel man-
ner. That is to say, each feature descriptor is fed to a classification machine, SVM in our
case, and the final decision is the combination of all the decisions of these machines.

4.2.1. Horizontal and Vertical Straight Lines (HVSL)


This descriptor has been designed to separate Square-Kufi from other styles. It
mainly describes how frequently horizontal and vertical lines appear in a text image.
Square-Kufi differs from other styles by the high number of vertical and horizontal lines
as shown in (Figure 5).

Figure 5. Vertical and horizontal lines as basic


basic features
features of
of Square-Kufi.
Square-Kufi.

HVSL is
HVSL is not
not extracted
extracted from
from the
the input
input image,
image, but
but rather
rather from
from the
the edge
edge image
image resulted
resulted
from the preprocessing step. The final HVSL descriptor holds the following
from the preprocessing step. The final HVSL descriptor holds the following features: features:
(a)
(a) The appearance frequency of vertical and horizontal (i.e., V/H) lines, which
The appearance frequency of vertical and horizontal (i.e., V/H) lines, which is the main is the main
cue used
cue used to
to distinguish Square-Kufi, (b)
distinguish Square-Kufi, (b) The
The difference
difference ratio
ratio between
between thethe number
number of
of the
the
pixels that constitute the texts edge and the sum of V/H lines appearance
pixels that constitute the texts edge and the sum of V/H lines appearance frequency. frequency.

4.2.2. Text Orientation from Edge/Skeleton (ToE/ToS)


4.2.2. Text Orientation from Edge/Skeleton (ToE/ToS)
One of the main characteristics of all the Arabic calligraphy styles is text orientation.
One of the main characteristics of all the Arabic calligraphy styles is text orientation.
Each style is usually written in a specific direction that defines its unique shape. By
Each stylewe
direction, is usually
mean thewritten inthe
slope of a specific direction
pen while writingthat defines
words. For its uniquethe
instance, shape.
pen inByKufi
di-
rection,
is used towe mean
write onthe
theslope of the
baseline pen while
without writing
any slope, words. in
whereas, For instance,
Rekaa, the penisinslightly
the writing Kufi is
used to write on the baseline without any slope, whereas, in Rekaa, the writing is slightly
sloping. The pen itself might be held by the calligrapher vertically or in a sloppily way
based on the style intended to be adopted. A vertical grasp of the pen results in flat tails
whereas a sloping grasp results in pointed ones, as Figure 6 shows.
cue used to distinguish Square-Kufi, (b) The difference ratio between the number of the
pixels that constitute the texts edge and the sum of V/H lines appearance frequency.

4.2.2. Text Orientation from Edge/Skeleton (ToE/ToS)

Appl. Sci. 2021, 11, 4852


One of the main characteristics of all the Arabic calligraphy styles is text orientation.
9 of 17
Each style is usually written in a specific direction that defines its unique shape. By di-
rection, we mean the slope of the pen while writing words. For instance, the pen in Kufi is
used to write on the baseline without any slope, whereas, in Rekaa, the writing is slightly
sloping. The pen itself might be held by thethe calligrapher
calligrapher vertically or in
in aa sloppily
sloppily way
way
based on the
the style
style intended
intended to
to be
be adopted.
adopted. A vertical grasp of the
the pen
pen results
results in
in flat
flat tails
tails
whereas a sloping grasp results in pointed ones, as Figure 6 shows.
whereas a sloping grasp results in pointed ones, as Figure 6 shows.

(a) (b)
Figure 6. The
Figure Theeffect
effectofofpen
penhold
hold manner
manner onon
thethe
writing. In (a),
writing. the pen
In (a), is held
the pen straight
is held vertical
straight vertical
whereas, in
whereas, in (b),
(b), the
the pen
pen is
is held
held in
in aa sloping
slopingmanner.
manner.

To
To capture
capturethetheorientation
orientationofofwords, wewe
words, utilize thethe
utilize skeleton
skeletonimage, whereas
image, to capture
whereas to cap-
the
tureeffect of pen
the effect of sloping, we use
pen sloping, we the
usetext
the edge image.
text edge From
image. eacheach
From image, the the
image, orientation
orienta-
at each
tion pixelpixel
at each levellevel
is extracted andand
is extracted then codified
then codifiedinto a ahistogram
into histogram(i.e.,
(i.e.,ToE
ToEfor
for edge
edge
Appl. Sci. 2021, 11, x FOR PEER REVIEW
orientations and ToS for skeleton orientations). Figure 7 shows a representative 10 of of
example 17
orientations and ToS for skeleton orientations). Figure 7 shows a representative example
the process.
of the process.

(a) (b)
Figure 7. Extracting
Figure Extractingorientations
orientationstotobebe
used
usedto to
generate ToEToE
generate andand
ToSToS
histograms. Orientations
histograms. ex-
Orientations
tracted from (a) the skeleton image, and (b) the edge image.
extracted from (a) the skeleton image, and (b) the edge image.

4.2.3.
4.2.3. Long
Long Vertical
Vertical Lines
Lines (LVL)
(LVL)
Since
Since Kufi
Kufi and
and Square-Kufi
Square-Kufi share share common
common features
features such
such asas vertical
vertical and
and horizontal
horizontal
lines,
lines, HVSL will consider Kufi images as Square-Kufi and separate them from styles.
HVSL will consider Kufi images as Square-Kufi and separate them from other other
However, Kufi hasKufi
styles. However, a distinctive characteristic,
has a distinctive compared
characteristic, to Square-Kufi,
compared which is the
to Square-Kufi, long
which is
vertical straight lines. The Long Vertical Lines (LVL) descriptor has
the long vertical straight lines. The Long Vertical Lines (LVL) descriptor has been des- been designated to
eliminate
ignated to theeliminate
conflict between texts written
the conflict betweenin kufi
textsand the ones
written inofkufi
Square-Kufi.
and the Itones
mainly of
describes how vertical lines in a text vary.
Square-Kufi. It mainly describes how vertical lines in a text vary.
After having the vertical straight lines extracted from the skeleton image as Figure 8
shows, the having
After following thefive measurements
vertical are extracted
straight lines calculated:from(a) the
thetext heightimage
skeleton from the bottom8
as Figure
to top, (b) the number of detected vertical lines, (c) the length of
shows, the following five measurements are calculated: (a) the text height from the bot-the highest detected
vertical line,(b)
tom to top, (d)the
thenumber
difference ratio between
of detected verticalthe text(c)
lines, height and the
the length ofhighest vertical
the highest line,
detected
and (e) the variance among the vertical lines.
vertical line, (d) the difference ratio between the text height and the highest vertical line,
and (e) the variance among the vertical lines.
Square-Kufi. It mainly describes how vertical lines in a text vary.

After having the vertical straight lines extracted from the skeleton image as Figure 8
shows, the following five measurements are calculated: (a) the text height from the bot-
Appl. Sci. 2021, 11, 4852 10 of 17
tom to top, (b) the number of detected vertical lines, (c) the length of the highest detected
vertical line, (d) the difference ratio between the text height and the highest vertical line,
and (e) the variance among the vertical lines.

Figure 8.
Figure Vertical straight
8. Vertical straight lines
lines detection.
detection.
4.2.4. Text Thickness (Tth)
4.2.4. Text Thickness (Tth)
Stroke thickness plays an important role in defining the style. Some styles use a
Stroke
flat pen, thickness
whereas someplays an important
others role one.
use a pointed in defining
In some the style.calligraphers
styles, Some styles usealtera the
flat
pen, whereas some others use a pointed one. In some styles, calligraphers
thickness while writing (via pushing down the pen or the opposite), whereas in others, the alter the
thickness while writing (via pushing down the pen or the opposite), whereas
thickness is always preserved. Modeling such a feature in form of a descriptor will help in others,
the thicknesstoisunderstand
the machine always preserved. Modelingof
more specificities such
eacha style.
featureTextin thickness
form of a(Tth)
descriptor will
descriptor
help the machine to understand more specificities of each style. Text thickness
codifies the appearance frequency of different line thicknesses in a text image. To extract (Tth) de-
scriptor codifieswe
this descriptor, theemploy
appearance frequency
both the skeletonofand
different line thicknesses
edge image. To find theinthickness
a text image.
levelToat
extract this
a pixel of thedescriptor,
skeleton, wewecalculate
employ the
both the skeleton
distance between and theedge image.on
two points Toafind the thick-
perpendicular
ness levelpasses
line that at a pixel of thep.skeleton, we calculate the distance between the two points on a
through
perpendicular line that passes through p.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 11 of 17
4.2.5. Special Diacritics (SDs)
4.2.5.Thuluth
Special Diacritics
and Mohakik(SDs)have a similar writing style that is decorated with diacritics
having specialand
Thuluth shapes, as shown
Mohakik have ainsimilar
Figure writing
9. An SDs descriptor
style will be used
that is decorated withtodiacritics
inspect
having special shapes, as shown in Figure 9. An SDs descriptor will be used to inspectrep-
existence
the of
existence such
of diacritics
such in
diacriticsa given
in a text
given image.
text To
image. this
To end,
this each
end, of
each the
of diacritics
the diacritics
the
resented in in
represented Figure 9 is
Figure explicitly
9 is explicitlysegmented
segmentedand andthen
thenrepresented
representedwith
with aa vector of HuHu
moments [32]. Thereafter, the distance among these moments and those extracted
moments [32]. Thereafter, the distance among these moments and those extracted from the from
the input
input image’simage’s diacritics
diacritics are calculated
are calculated to decideto decidethe
whether whether
image isthe image is Thu-
Thuluth/Mohakik
luth/Mohakik
or not. or not.

Figure 9.
Figure 9. Thuluth and Mohakik
Mohakik diacritics.
diacritics.

It
It is
is worth
worth mentioning
mentioning that
that SDs
SDs has
has not
not been
been designed
designed toto identify
identify Thuluth
Thuluth from
from
Mohakik
Mohakik but
but rather
rather to
to separate
separate both
both of
of them
them from
from other
otherstyles.
styles.

4.2.6.
4.2.6. Word’s
Word’s Orientation
Orientation (WOr)
(WOr)
One
One of the salient featuresofofthe
of the salient features theDiwani
Diwani style is the
style words
is the written
words in ainslanted
written format,
a slanted for-
as Figure 10 shows. WOr descriptor mainly specifies how, on average, words
mat, as Figure 10 shows. WOr descriptor mainly specifies how, on average, words in text in text images
are oriented.
images The flood-fill
are oriented. algorithm
The flood-fill is used to
algorithm detecttowords
is used detectfrom
wordsno from
diacritics images
no diacritics
that are generated in the processing step. After calculating each word’s orientation,
images that are generated in the processing step. After calculating each word’s orienta- the
mean orientation along with the number of detected words are combined
tion, the mean orientation along with the number of detected words are combined to to form the final
WOr descriptor.
form the final WOr descriptor.
WOr algorithm was used to distinguish Diwani from other styles. Diwani style yield
an orientation average of about 45 degrees compared to 0 degrees by other styles.

Figure 10. A slanted word from Diwani style, with its orientation measured, detected using the
flood-fill algorithm.

WOr algorithm was used to distinguish Diwani from other styles. Diwani style yield
an orientation average of about 45 degrees compared to 0 degrees by other styles.
4.2.6. Word’s Orientation (WOr)
One of the salient features of the Diwani style is the words written in a slanted for-
mat, as Figure 10 shows. WOr descriptor mainly specifies how, on average, words in text
images are oriented. The flood-fill algorithm is used to detect words from no diacritics
Appl. Sci. 2021, 11, 4852 images that are generated in the processing step. After calculating each word’s orienta-
11 of 17
tion, the mean orientation along with the number of detected words are combined to
form the final WOr descriptor.

Figure 10.
Figure 10. AA slanted
slantedword
wordfrom
fromDiwani
Diwanistyle,
style,with
withitsits
orientation measured,
orientation detected
measured, using
detected the the
using
flood-fill algorithm.
flood-fill algorithm.

4.2.7.WOr
Horizontal Profile
algorithm wasProjection (HPP)
used to distinguish Diwani from other styles. Diwani style yield
an orientation
In some AC average
styles,ofallabout
words45are
degrees
written compared to 0 degrees
on a baseline, whereas byinother
somestyles.
other styles,
words are not subjected to a baseline. Horizontal profile projection is a descriptor that
4.2.7. Horizontal
specifies how wordsProfile Projection
are vertically (HPP)within a text image. First, a sub-image that exactly
spread
fits the
In text
some is AC
cropped
styles,from the text
all words areimage,
written andonthen, all pixels
a baseline, are projected
whereas in some to a vertical
other styles,
histogram,
words are using the following
not subjected EquationHorizontal
to a baseline. (1), to find profile
how pixels are vertically
projection spread. that
is a descriptor
specifies how words are vertically spread within a text image. First, a sub-image that
HPP =from
exactly fits the text is cropped ∑ N the
I ( M,text
N )/max
image,
M
(∑
and I ( M, N ))
N then, all pixels are projected to a
(1)
vertical histogram, using the following Equation (1), to find how pixels are vertically
In an image in which words are written on a baseline, HPP will have only one bin
spread.
with a high value, whilst, in an image in which words are vertically spread, HPP will have
more than one bin with high𝐻𝑃𝑃 value. ∑ 𝐼 𝑀, 𝑁 max ∑ 𝐼 𝑀, 𝑁 (1)

In an imageResults
5. Experimental in which
andwords are written on a baseline, HPP will have only one bin
Discussion
with a high value, whilst, in an image in which words are vertically spread, HPP will
This section is dedicated to evaluating the performance of the proposed solution.
have more than one bin with high value.
Three scenarios have been carried out; the first one is meant to evaluate each descriptor
individually to validate the role it has been proposed for in the first place. In the second
5. Experimental Results and Discussion
scenario, the decisions yielded by all classifiers are combined to produce a final decision.
This section
We devote is scenario
this final dedicatedtoto evaluating
examine the performance
the effect of using fewof the proposed
samples solution.
for training. All
Three scenarios have been carried out; the first one is meant to evaluate
the experiments have been carried out under the following configuration: each descriptor
individually to validate the role it has been proposed for in the first place. In the second
• Dataset: We use the same dataset adopted in our previous works [15,27]. It consists
scenario, the decisions yielded by all classifiers are combined to produce a final decision.
of nine (9) classes each of which represent an Arabic style. The total number of the
dataset’s images is 1685. Each style has several images that vary from 180 to 195.
• Classification: For image classification, we use the well-known classifier Support
Vector Machine (SVM). Support Vector Machine classifier is a supervised machine
learning technique. The main goal of this supervised method is to find a function
in a multidimensional space that is able to separate training data with known class
labels. SVM can be used for linear as well as nonlinear data classification. In our case,
we use the Polynomial Kernel. This choice is a result of the outperformance SVM
showed compared to other classifiers. To avoid overfitting, 3-fold cross-validation has
been adopted.
• Metrics: To validate our model, we use four metrics, namely: Recall (R), Precision (P),
F1-score, and Accuracy given by the following formulas.

treue positi f
R=
true positi f + f alse negati f
true positi f
P=
true positi f + f alse positi f
R· P
F1 − score = 2·
R+P
true positi f + true negati f
Accuracy =
true positi f + f alse positive + true negati f + f alse negati f
Scenario 1. Experimenting with each descriptor individually:
Appl. Sci. 2021, 11, 4852 12 of 17

As we discussed beforehand, some descriptors have been mainly proposed to identify


one single style, whereas some others are general and can be used to separate multiple
styles. This scenario is dedicated to analyzing the results for each descriptor individually.
It should be mentioned that each descriptor has been used to train a separated SVM.
Table 3 presents the accuracies yielded by each feature descriptor for each style.

Table 3. The accuracies yielded by each descriptor. The first column holds descriptors with the respective style they have
been proposed for. Horizontal and Vertical Straight Lines (HVSL), Text orientation from Edges (ToE), Text orientation
from Skeleton (ToS), Long Vertical Lines (LVL), Text thickness (Tth), Special Diacritics (SDs), Word’s Orientation (WOr),
Horizontal Profile Projection (HPP).

Diwani Naskh Farisi Rekaa Thuluth Maghribi Kufi Mohakik Square-Kufi


HVSL (Square-Kufi) 63% 62% 34% 37% 83% 62% 87% 74% 100%
ToE (General) 93% 88% 94% 87% 88% 81% 94% 86% 99%
ToS (General) 96% 88% 91% 83% 90% 80% 91% 86% 98%
LVL (Kufi) 54% 77% 28% 44% 49% 34% 89% 25% 91%
Tth (General) 47% 61% 51% 52% 66% 51% 76% 43% 82%
SDs (Thuluth + Mohakik) 13% 2% 0% 10% 86% 11% 17% 62% 18%
WOr (Diwani) 85% 24% 9% 21% 9% 6% 8% 18% 62%
HPP (General) 76% 97% 58% 76% 83% 92% 97% 78% 100%

From Table 3, we can see that the descriptors that have been proposed for one or
two specific styles have performed adequately. HVSL and WOr as instances generated
accuracies of 100% and 85% respectively, which are the highest ones compared to others.
However, LVL yielded a similar performance for both Kufi and Square-Kufi, although it
has been proposed for the former. This could be attributed to the similarity between these
two styles. The Tth descriptor works well for several styles that are characterized by their
thickness. Those styles are Naskh, Thuluth, Kufi, and Square-Kufi. The highest accuracy
was for Square-Kufi with a correct rate of 82%. In contrast, the lowest accuracy was for
Mohakik style with 43%. HPP descriptor has worked well with most of the styles because it
is a representation of a general characteristic. The lowest accuracy, which is 58%, produced
with the style Farisi because it can be written in different manners (some texts are written
on the baseline; in some others, words are written one above another).
We can conclude that general descriptors have the highest accuracies. Nevertheless,
by combining these general descriptors with the specific ones, even better results can be
achieved. In the following scenario, we evaluate the impact of combining all the descriptors
and compare the results to other proposed methods including deep learning.
Scenario 2: combine the descriptors
After having proved the efficiency of the individual descriptors, we combine them to
get a powerful descriptor that can be used to distinguish the nine AC styles effectively. To
this end, each descriptor is used to train a separated classifier (SVM in our case) and the
overall decision will be the sum of the decisions generated by all the classifiers. In other
words, the final decision will be the one with the highest votes. Figure 11 represents the
precision and recall yielded by our combined descriptor compared to other methods from
state of the art [16,17,20,24,25].
From Figure 11, it seems that our proposed method outperforms all other related
works with a precision of 97%. This remarkable performance of ours is a result of combining
all AC features used by calligraphers to recognize different styles in one descriptor. The
method proposed in [20] (EDM1+LBP) has scored the second-best performance. This
is because the latter deals with AC images as texture that is an approach; we prove its
effectiveness in [22]. Although the work [23] has opted for morphological descriptors as
we did, the results were too weak. This is because the authors have taken into account the
general features only and did not consider the specificity of each AC style. On the other
written on the baseline; in some others, words are written one above another).
We can conclude that general descriptors have the highest accuracies. Nevertheless,
by combining these general descriptors with the specific ones, even better results can be
achieved. In the following scenario, we evaluate the impact of combining all the de-
Appl. Sci. 2021, 11, 4852 scriptors and compare the results to other proposed methods including deep learning. 13 of 17

Scenario 2: combine the descriptors


After having proved the efficiency of the individual descriptors, we combine them
tohand, stacked auto-encoder
get a powerful descriptor thathascan
scored the worst
be used precisionthe
to distinguish (resp.
ninerecall) among
AC styles all. This is
effectively.
because using stacked auto-encoders needs tens of thousands of images to tune
To this end, each descriptor is used to train a separated classifier (SVM in our case) and thousands
of overall
the parameters that constitute
decision will be thethe network,
sum of the especially since the input
decisions generated by allofthe
the classifiers.
network isIn the
pixels of the image itself rather than a descriptor. Yet, no AC dataset contains
other words, the final decision will be the one with the highest votes. Figure 11 represents this huge
number
the of images.
precision To yielded
and recall further evaluate the performance
by our combined of these
descriptor methods,
compared F1-score
to other at the
methods
style-level
from state ofhas
the been estimated and listed in Table 4.
art [16,17,20,24,25].

100%
Recall Precision
90%

80%

70%

60%

50%

40%

30%

Our Method
EDM1+LBP/R
EDMS/DT

Allaf/NN

Auto-encoder
EDM1/NN

Figure 11.11.
Figure Recall and
Recall precision
and generated
precision byby
generated the proposed
the method
proposed compared
method comparedtotoother
otherAC-related
AC-relatedworks.
works.

Table 4. F1-score at style-level


From Figure 11, ityielded
seems by ourour
that method and other
proposed relatedoutperforms
method works. all other related
works with a precision of 97%. This remarkable performance of ours is a result of com-
EDMS/Decision EDM1+LBP/Random Auto-Encoder
EDM1/NN [17] calligraphersAllaf/NN [24] Our Method
Tree [16] bining all AC features used by [20]
Forest to recognize different
[25] styles in one de-
Diwani 76%
scriptor. The
75%
method proposed in [20] (EDM1+LBP)
90% 30%
has scored the35%
second-best perfor-
98%
mance. This is because the latter deals with AC images as texture that is an approach; we
Naskh 92% 87% 98% 81% 48% 99%
prove its effectiveness in [22]. Although the work [23] has opted for morphological de-
Farisi 56% 58% 80% 23% 2% 97%
scriptors as we did, the results were too weak. This is because the authors have taken into
Rekaa 54%
account the general features only and did not consider the specificity of each AC98%
53% 77% 45% 12%
style.
Thuluth 63% 56% 78% 73% 43%
On the other hand, stacked auto-encoder has scored the worst precision (resp. recall) 94%
Maghribi 66% among all. 77%
This is because using
75% stacked auto-encoders
46% needs tens of thousands97%
15% of im-
Kufi 64% ages to tune72%thousands of parameters
93% that constitute
73% the network, 14%especially since
98% the
Mohakik 41% input of the60%
network is the pixels
79% of the image itself
45%rather than a descriptor.
33% Yet, 94%
no AC
S-Kufi 96% 94% 97% 94% 80% 99%

At first glance, Table 4 shows that our proposed method outperforms other methods
in all styles. S-kufi seems to be the most distinguishable style among the others due to its
unique features. In contrast, Thuluth, Mohakik, and Rakaa seem to be harder to distinguish.
This can be attributed to the common way of writing of Rakaa and the similarity between
Mohakik and Thuluth. Nevertheless, our proposed method has yielded satisfying results
because we took advantage of slight changes among styles such as the unique way of
writing diacritics. With most of the styles, our proposed method has produced more
than 97% accuracy. However, with Thuluth and Mohakik, our method yields the lowest
accuracy, which is 94%. To get an idea about how the styles Thuluth and Mohakik are
misclassified, we generate and present the confusion matrix in Table 5.
Appl. Sci. 2021, 11, 4852 14 of 17

Table 5. The confusion matrix, of the nine AC styles, generated by our proposed method.

Style Diwani Naskh Farisi Rekaa Thuluth Maghribi Kufi Mohakik S-Kufi
Diwani 100% 0% 0% 0% 0% 0% 0% 0% 0%
Naskh 0% 100% 0% 0% 0% 0% 0% 0% 0%
Farisi 2% 0% 96% 2% 0% 0% 0% 0% 0%
Rekaa 0% 0% 1% 98% 0% 1% 0% 0% 0%
Thuluth 0% 0% 1% 0% 95% 0% 0% 3% 1%
Maghribi 0% 0% 1% 0% 1% 99% 0% 0% 0%
Kufi 0% 0% 0% 0% 0% 2% 98% 0% 0%
Mohakik 0% 0% 0% 0% 5% 0% 0% 94% 1%
S-Kufi 0% 0% 0% 1% 0% 0% 1% 0% 99%

From Table 5, we can see that our proposed method produces satisfying results with
most of the styles. However, Mohakik and Thuluth have misclassified one as the other
in some cases, which decreases the accuracy. This is because both styles Mohakik and
Thuluth have similar shapes with less unique features that can be used to distinguish one
from the other.
Scenario 3: Compare to other texture and deep learning methods
In a previous work [15], we proved that AC is better to be dealt with as texture.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 15 of 17
Since AC text is relatively a homogeneous (i.e., stationary) texture with repeated patterns
(characters, diacritics, etc.), using statistical feature descriptors yields better results than
learning-based including deep learning [33]. Furthermore, descriptors that are designed to
signed
be used to be heterogenous
with used with heterogenous imagestoare
images are harder harder
train to train
(i.e., more (i.e., are
images more images
needed) are
than
needed) than
descriptors descriptors
dedicated dedicated
to a specific to a of
family specific
images.family
That of images.
is to say, allThat is to say, allthat
the descriptors the
descriptors
we compare that we
to our compare
method willtopoorly
our method
performwill poorly
in cases of aperform in cases
small training set.ofToaprove
small
training set. To prove these claims, an evaluation of statistical against learning-based
these claims, an evaluation of statistical against learning-based (deep learning) methods in
(deep
both learning)
normal and methods in both
small training setnormal
size hasand
beensmall training
carried set size
out. Figure 12has been carried
represents out.
precision
Figure 12inrepresents
obtained both cases.precision obtained in both cases.

100%
10% Train 33% Train
95%

90%

85%

80%

75%

70%

65%

60%

55%

50%
BSIF LPQ Resnet-50 Rest net 101 Alexnet Our method

Figure12.
Figure 12.Related
Relatedworks
worksevaluated
evaluated and
and compared
compared against
against our
our method
method using
using 33%
33% and
and 10%
10% images
images
subset respectively for training.
subset respectively for training.

FromFigure
From Figure12,
12,it it appears
appears that
that ourour method
method outperforms
outperforms all other
all other methods
methods in 33%
in both both
33%10%
and andtraining
10% training
cases. As cases. As we
we have haveabove,
stated statedstatistical
above, statistical
descriptorsdescriptors
(e.g., BSIF (e.g., BSIF
and LPQ)
and are
that LPQ) that aretodesigned
designed be used to be used
with with heterogeneous
heterogeneous textures
textures have have performed
performed well with well
AC
withrecognition.
style AC style recognition.
However, we However, we have
have claimed claimed
that such that such
descriptors losedescriptors
performance lose
in per-
the
formance in the case of using a few samples for training. The proof of this claim can easily
be noted in the accuracy drop of all methods in the case of using a small image set for
training. Our method, on the other hand, seems not to be greatly affected by reducing the
size of the training subset to 10%. By this last scenario, we confirm that using dedicated
Appl. Sci. 2021, 11, 4852 15 of 17

case of using a few samples for training. The proof of this claim can easily be noted in the
accuracy drop of all methods in the case of using a small image set for training. Our method,
on the other hand, seems not to be greatly affected by reducing the size of the training
subset to 10%. By this last scenario, we confirm that using dedicated descriptors for some
specific datasets, which is the case with AC, is far more effective than general descriptors.

6. Conclusions
The main aim of this research was to investigate employing cues used by the calligra-
pher for AC style recognition. To this end, the features used by calligraphers have been
codified into descriptors, some of which are dedicated to distinguishing specific styles and
some others being for general features and some others are for general features. We did
experiment our proposed descriptor in two different ways as individual features, as some
descriptors have been made to identify one single style, whereas some others are general
and can be used to separate multiple styles; in combined form, we combined them to get a
powerful descriptor that can be used to distinguish the nine AC styles effectively using
a rich dataset containing 1685 images categorized into nine styles. The results indicated
the outperformance of the proposed method compared to other related works including
deep learning. By these results, we have confirmed that exploiting the calligrapher’s
expertise rather than using general image features highly improves the performance of
the AC recognition. Furthermore, the experiment outcomes proved that our descriptor
was not highly affected by the small size of the training data, unlike other general-purpose
descriptors. In this work, we have considered the most common features used by callig-
raphers in distinguishing styles. However, additional efforts should be spent to explore
other less common features. Such features will surely further improve the results and
extend the system’s capability to other styles. Another aspect that needs to be tackled is
text transformation, such as rotation, which is the case with most decorative texts.

Author Contributions: Conceptualization, Z.K., M.L.K. and B.K.; methodology, Z.K.; software, Z.K.;
validation, Z.K., M.L.K. and B.K.; formal analysis, Z.K. and B.K.; investigation, Z.K.; resources, Z.K.;
data curation, Z.K.; writing—original draft preparation, Z.K.; writing—review and editing, M.L.K.
and B.K.; visualization, Z.K.; supervision, M.L.K.; project administration, M.L.K. All authors have
read and agreed to the published version of the manuscript.
Funding: This research received no external funding.
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Data Availability Statement: The data that support the findings of this study are available from the
corresponding author upon reasonable request.
Conflicts of Interest: The authors declare no potential conflict of interests.

References
1. Binmakhashen, G.M.; Mahmoud, S.A. Document Layout Analysis: A Comprehensive Survey. ACM Comput. Surv. 2019, 52, 109.
[CrossRef]
2. Stauffer, M.; Maergner, P.; Fischer, A.; Riesen, K. A Survey of State of the Art Methods Employed in the Offline Signature Verifica-
tion Process. In New Trends in Business Information Systems and Technology: Digital Innovation and Digital Business Transformation;
Dornberger, R., Ed.; Springer Science and Business Media LLC: Berlin/Heidelberg, Germany, 2020; pp. 17–30.
3. Rehman, A.; Naz, S.; Razzak, M.I. Writer identification using machine learning approaches: A comprehensive review. Multimed.
Tools Appl. 2019, 78, 10889–10931. [CrossRef]
4. Available online: https://www.worldatlas.com/articles/the-world-s-most-popular-writing-scripts.html (accessed on 10
May 2021).
5. Hussein, A.K. Fast learning neural network based on texture for Arabic calligraphy identification. Indones. J. Electr. Eng. Comput.
Sci. 2021, 21, 1794–1799. [CrossRef]
6. Luqman, H.; Mahmoud, S.A.; Awaida, S. Arabic and Farsi Font Recognition: Survey. Int. J. Pattern Recognit. Artif. Intell. 2015,
29, 1553002. [CrossRef]
Appl. Sci. 2021, 11, 4852 16 of 17

7. Bar Yosef, I.; Kedem, K.; Dinstein, I.; Beit-Arie, M.; Engel, E. Classification of hebrew calligraphic handwriting styles: Preliminary
results. In Proceedings of the First International Workshop on Document Image Analysis for Libraries, Palo Alto, CA, USA, 23–24
January 2004; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2004; pp. 299–305.
8. Wang, L.; Gong, X.; Zhang, Y.; Xu, P.; Chen, X.; Fang, D.; Zheng, X.; Guo, J. Artistic features extraction from chinese calligraphy
works via regional guided filter with reference image. Multimed. Tools Appl. 2018, 77, 2973–2990. [CrossRef]
9. Pengcheng, G.; Gang, G.; Jiangqin, W.; Baogang, W. Chinese calligraphic style representation for recognition. Int. J. Doc. Anal.
Recognit. 2017, 20, 59–68. [CrossRef]
10. Kallel, F.; Mezghani, A.; Kanoun, S.; Kherallah, M. Arabic Font Recognition Based on Discret Curvelet Transform. In Proceedings
of the Third International Afro-European Conference for Industrial Advancement—AECIA 2016; Advances in Intelligent Systems and
Computing Series; Springer Science and Business Media LLC: Berlin/Heidelberg, Germany, 2018; Volume 565, pp. 360–369.
11. Jaiem, F.K.; Kherallah, M. A novel Arabic font recognition system based on texture feature and dynamic training. Int. J. Intell.
Syst. Technol. Appl. 2017, 16, 289.
12. Jaiem, F.K.; Slimane, F.; Kherallah, M. Arabic font recognition system applied to different text entity level analysis. In Proceedings
of the 2017 International Conference on Smart, Monitored and Controlled Cities (SM2C) 2017, Sfax, Tunisia, 17–19 February 2017;
pp. 36–40.
13. Sakr, G.; Mhanna, A.; Demerjian, R. Convolution Neural Networks for Arabic Font Recognition. In Proceedings of the 2019 15th
International Conference on Signal-Image Technology & Internet-Based Systems (SITIS), Sorento, Italy, 26–29 November 2019;
Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2019; pp. 128–133.
14. Amer, I.M.; Mostafa, M.G. Deep Arabic Font Family and Font Size Recognition. Int. J. Comput. Appl. 2017, 176, 1–6. [CrossRef]
15. Kaoudja, Z.; Khaldi, B.; Kherfi, M.L. Arabic Artistic Script Style Identification Using Texture Descriptors. In Proceedings of the
2020 1st International Conference on Communications, Control Systems and Signal Processing (CCSSP), El Oued, Algeria, 16–17
May 2020; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2020; pp. 113–118.
16. Bataineh, B.; Abdullah, S.N.H.S.; Omar, K. A novel statistical feature extraction method for textual images: Optical font recognition.
Expert Syst. Appl. 2012, 39, 5470–5477. [CrossRef]
17. Bataineh, B.; Abdullah, S.N.H.S.; Omar, K.; Batayneh, A. Arabic-Jawi Scripts Font Recognition Using First-Order Edge Direction
Matrix. In Proceedings of the International Multi-Conference on Artificial Intelligence Technology, Shah Alam, Malaysia, 28–29
August 2013; pp. 27–38.
18. Bataineh, B.; Abdullah, S.N.H.S.; Omar, K. Arabic calligraphy recognition based on binarization methods and de-graded images.
In Proceedings of the 2011 International Conference on Pattern Analysis and Intelligent Robotics, ICPAIR 2011, Putrajaya,
Malaysia, 28–29 June 2011; pp. 65–70.
19. Bataineh, B.; Abdullah, S.N.H.S.; Omar, K. Generating an Arabic Calligraphy Text Blocks for Global Texture Analysis. Int. J. Adv.
Sci. Eng. Inf. Technol. 2011, 1, 150–155. [CrossRef]
20. Talab, M.A.; Abdullah, S.N.H.S.; Razalan, M.H.A. Edge direction matrixes-based local binary patterns descriptor for invariant
pattern recognition. In Proceedings of the 2013 International Conference on Soft Computing and Pattern Recognition (SoCPaR),
Hanoi, Vietnam, 15–18 December 2013; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2013;
pp. 13–18.
21. Azmi, M.S.; Omar, K.; Nasrudin, M.F.; Ghazali, K.W.M.; Abdullah, A.; Abdullah, A. Arabic calligraphy identification for Digital
Jawi Paleography using triangle blocks. In Proceedings of the 2011 International Conference on Electrical Engineering and
Informatics, Bandung, Indonesia, 17–19 July 2011; IEEE: Piscataway, NJ, USA, 2011; pp. 1–5.
22. Azmi, M.S.; Omar, K.; Nasrudin, M.F.; Muda, A.K.; Abdullah, A. Arabic calligraphy classification using triangle model for
Digital Jawi Paleography analysis. In Proceedings of the 2011 11th International Conference on Hybrid Intelligent Systems (HIS),
Malacca, Malaysia, 5–8 December 2011; pp. 704–708.
23. Adam, K.; Al-Maadeed, S.; Bouridane, A. Letter-based classification of Arabic scripts style in ancient Arabic manuscripts:
Preliminary results. In Proceedings of the 2017 1st International Workshop on Arabic Script Analysis and Recognition (ASAR),
Nancy, France, 3–5 April 2017; pp. 95–98. [CrossRef]
24. Allaf, S.R.; Al-Hmouz, R. Automatic Recognition of Artistic Arabic Calligraphy Types. J. King Abdulaziz Univ. 2016, 27, 3–17.
[CrossRef]
25. Al-Hmouz, R. Deep learning autoencoder approach: Automatic recognition of artistic Arabic calligraphy types. Kuwait J. Sci.
2020, 47, 3.
26. Khayyat, M.; Elrefaei, L. A Deep Learning Based Prediction of Arabic Manuscripts Handwriting Style. Int. Arab. J. Inf. Technol.
2020, 17, 702–712. [CrossRef]
27. Kaoudja, Z.; Kherfi, M.L.; Khaldi, B. An efficient multiple-classifier system for Arabic calligraphy style recognition. In Proceedings
of the 2019 International Conference on Networking and Advanced Systems (ICNAS), Annaba, Algeria, 26–27 June 2019; Institute
of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2019; pp. 1–5.
28. Moghaddam, R.F.; Cheriet, M.; Milo, T.; Wisnovsky, R. A prototype system for handwritten sub-word recognition: Toward
Arabic-manuscript transliteration. In Proceedings of the 2012 11th International Conference on Information Science, Signal
Processing and their Applications (ISSPA), Montreal, QC, Canada, 2–5 July 2012; pp. 1198–1204.
29. Otsu, N. A threshold selection method from gray-level histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62–66. [CrossRef]
Appl. Sci. 2021, 11, 4852 17 of 17

30. Cheriet, M.; Kharma, N.; Liu, C.-L.; Suen, C. Character Recognition Systems: A Guide for Students and Practitioners; John Wiley &
Sons: Hoboken, NJ, USA, 2007.
31. Lutf, M.; You, X.; Cheung, Y.-M.; Chen, C.P. Arabic font recognition based on diacritics features. Pattern Recognit. 2014, 47,
672–684. [CrossRef]
32. Hu, M.-K. Visual pattern recognition by moment invariants. IEEE Trans. Inf. Theory 1962, 8, 179–187. [CrossRef]
33. Khaldi, B.; Aiadi, O.; Kherfi, M.L. Combining colour and grey-level co-occurrence matrix features: A comparative study. IET
Image Process. 2019, 13, 1401–1410. [CrossRef]

You might also like