<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>An Approach How to Automate Labeling Data for the Training ANN Models for Page Layout Analysis</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Andrey Mikhailov</string-name>
          <email>mikhailov@icc.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Matrosov Institute for System Dynamics and Control Theory of SB RAS</institution>
          ,
          <addr-line>134 Lermontov st., Irkutsk</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Object detection and recognition is an important task in many document analysis applications. It is a di cult problem due to di erent page layouts and representation formats. Recently the deep learning in computer vision has signi cantly boosted the data-driven image-based approaches for page layout analysis. In this paper, we consider open formats of electronic documents to generate training datasets. Formats of these documents should contain markup allowing obtaining information about page layout regions. It will allow us to generate a training dataset automatically for training ANN models of page layout analysis.</p>
      </abstract>
      <kwd-group>
        <kwd>document layout analysis</kwd>
        <kwd>PDF accessibility</kwd>
        <kwd>ANN models arti cial intelligence</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Arbitrary documents are a common way of presenting information on the web.
The big volume and structure of such documents make them a valuable source
in data science and business intelligence applications. However, as a rule, they
haven't included semantics for machine interpretation of their content as
considered by their author. The information accumulated in them is often unstructured
and not standardized. The analysis of these data requires transformation to a
structured representation with a given formal model. In document analysis and
recognition, this task commonly named as document layout analysis. In recent
years, approaches for page layout analysis based on deep neural networks for
object detection and classi cation have been actively developing. This is
evidenced by the results of one of the main scienti c conferences on document
analysis - ICDAR 1. Since 2001, this conference has hosted the RDCL document
layout analysis competitions (2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015,
2017, 2019). For the competition are published datasets. For example, in 2019 a
dataset was published that includes only 4, 500 examples.</p>
      <p>This amount of data is not enough for high-quality training of deep neural
networks, since their modern architectures have many free parameters and are
very sensitive to the volume and quality of data. Modern layout analysis systems
based on ANN models are focused mainly on a small count of the same document
types. This is due to the fact that either open-source or hand-tagged datasets
were used to develop page layout analysis ANN models. In this paper, we propose
an idea to automate the process of labeling datasets. For this, it is proposed to
develop methods for automatic data labeling for training deep neural for page
layout analysis. Which should reduce the process of developing layout analysis
systems for new types of documents, and improve the quality of the analysis.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Works</title>
      <p>Document images are often generated from physical documents by digitization,
using scanners or various generation programs (printers). Many documents, such
as newspapers, magazines and brochures, have very complex layouts due to the
placement of pictures, headings and captions, complex backgrounds, artistic text
formatting, etc.</p>
      <p>
        A person uses a lot of additional clues such as context, conventions, language
information. Automatic analysis of an arbitrary document with a complex
layout is an extremely di cult task and goes beyond the capabilities of modern
document layout analysis systems. In the scienti c literature, a large number of
methods for analyzing the layout of documents have been proposed. According to
article [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], they can be divided into three groups: methods of classi cation based
on areas [
        <xref ref-type="bibr" rid="ref13 ref17">17, 13</xref>
        ]; classi cation methods based on pixel analysis [
        <xref ref-type="bibr" rid="ref11 ref12">12, 11</xref>
        ]; analysis
of connected components [
        <xref ref-type="bibr" rid="ref15 ref3 ref6">6, 15, 3</xref>
        ]. With the increasing e ciency and popularity
of convolutional neural networks, their eld of application is constantly
expanding. Since 2014, the rst attempts to use arti cial neural networks to solve the
problem of analyzing the layout of documents have been known [
        <xref ref-type="bibr" rid="ref16 ref2 ref8 ref9">9, 8, 2, 16</xref>
        ].
These works have demonstrated their e ectiveness in comparison with classical
approaches, which is con rmed by the results of the 2017 competition at the
ICDAR conference [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. On the other hand, the 2019 competition showed that on a
variety of data, with a large number of classes (10), the combination of classical
methods [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is most e ective compared to deep neural networks. This is due to
the lack of a su cient amount of diverse tagged data with a large number of
classes. While for special cases, neural networks work much more e ciently [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
It should be noted that to solve the problem of analyzing the arrangement of
documents in these works, either neural networks of the R-CNN architecture or
author's developments are used. For training neural networks, open datasets of
labeled data are usually used; in rare cases, the authors of the articles indicate
that they have labeled their own training set. These samples rarely reach 20,000
copies and are often not publicly available. The author is not aware at the
moment of open datasets large enough to train neural networks for document layout
analysis. It should be noted that it was the creation of such datasets as ImageNet
that made it possible to obtain outstanding results using convolutional neural
networks for natural image recognition.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>An Idea</title>
      <p>The Internet contains a large number of original LaTex documents. One of the
most well-known resources is arXiv 2. arXiv is a free distribution service and
an open-access archive for more than 1,7 million scholarly articles in the elds
of physics, mathematics, computer science, quantitative biology, quantitative
nance, statistics, electrical engineering and systems science, and economics.
PDF documents can be generated from these documents using special compiler
programs. PDF is a page orientated graphic format. It simply puts images and
glyphs at various coordinates on a page.</p>
      <p>Since 2006, PDF includes special tags for support reading order and logical
order. With reading order, the characters on the page are understood to have a
linear sequence of appearance. Logical order allows introducing concepts such as
tables, lists, and headings, as well as provide alternate text for images, descriptive
text for links and form elds, and so on.</p>
      <p>Traditionally, there are three ways to obtain PDF document from LaTex.
{ LaTeX source le converted to a DVI le, which could then be converted
to PostScript with dvips. This, in turn, can be converted to a PDF le by
ps2pdf 3 tool.</p>
      <p>latex dvips ps2pdf
text.tex -------&gt; text.dvi -------&gt; text.ps --------&gt; text.pdf
{ The step with conversion to PostScript can be skipped.</p>
      <p>latex dvipdfm
text.tex -------&gt; text.dvi -------&gt; text.pdf
{ Directly from the LaTeX source to PDF le by pd atex program.</p>
      <p>pdflatex
text.tex --------&gt; text.pdf</p>
      <p>The rst two ways are not allows for tagging PDF. Because the DVI format
does not allow saving additional tags. For the direct compilation of LaTex into
PDF there is a special LaTex package - accessibility 4.
2 https://arxiv.org/
3 https://www.ps2pdf.com/
4 https://github.com/AndyClifton/accessibility</p>
      <p>
        Accessibility [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] was written as a proof-of-concept showing how to improve
the structure and tagging of PDF les generated from LaTeX. These features
make PDF documents machine-readable and thus enable document readers to
automatically process and present the document. Andy Clifton took on
maintenance of the package in May 2019 with permission and support from Babett
Schalitz. This package is predominantly targeted at documents produced using
the KOMA-Script document classes [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>+ Accessibility
pdflatex</p>
      <p>PDFBox</p>
      <p>+</p>
      <p>BBoxes</p>
      <p>The idea of automating data labeling is shown in the gure [img_concept].
We propose to use the Accessibility package for generating tagged PDF
documents. This package is easy to use. In order to get a tagged document, the only
short preamble is needed to add to the document and compiled using pd atex
tool. The next step is to extract the tagged information from the tagged
document. PDFBox allows to extract content from documents and render PDF to
image. We propose to use this tool to generate training dataset from tagged
PDFs.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we presented an idea how to automate dataset labeling from
LaTex documents. The main idea is use special LaTex package Accessibility. This
package allows adding tags to produced PDF documents. To extract information
about layout from tagged PDFs we suggest to use PDFBox library. We expect
that the explained principles can be used for designing software for page layout
analysis.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgment</title>
      <p>The research was supported by the Program of the Fundamental Research of the
Siberian Branch of the Russian Academy of Sciences, project num. IV.38.1.2 (reg.
num. AAAA-A17-117032210079-1). Results are achieved using the Centre of
collective usage Integrated information network of Irkutsk scienti c educational
complex.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>AndyClifton.</surname>
          </string-name>
          <article-title>The Accessibility LaTeX package</article-title>
          .
          <source>2019 (accessed August 21</source>
          ,
          <year>2020</year>
          ). url: https://github.com/AndyClifton/accessibility.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Dario</given-names>
            <surname>Augusto</surname>
          </string-name>
          <article-title>Borges Oliveira and Matheus Palhares Viana. \Fast CNNbased document layout analysis"</article-title>
          .
          <source>In: Proceedings of the IEEE International Conference on Computer Vision Workshops</source>
          .
          <year>2017</year>
          , pp.
          <volume>1173</volume>
          {
          <fpage>1180</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Syed</given-names>
            <surname>Saqib</surname>
          </string-name>
          <string-name>
            <surname>Bukhari</surname>
          </string-name>
          , Mayce Ibrahim Ali Al Azawi,
          <string-name>
            <given-names>Faisal</given-names>
            <surname>Shafait</surname>
          </string-name>
          , and Thomas M Breuel. \
          <article-title>Document image segmentation using discriminative learning over connected components"</article-title>
          .
          <source>In: Proceedings of the 9th IAPR International Workshop on Document Analysis Systems</source>
          .
          <year>2010</year>
          , pp.
          <volume>183</volume>
          {
          <fpage>190</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Christian</given-names>
            <surname>Clausner</surname>
          </string-name>
          , Apostolos Antonacopoulos, and Stefan Pletschacher. \
          <article-title>Icdar2017 competition on recognition of documents with complex layoutsrdcl2017"</article-title>
          .
          <source>In: 2017 14th IAPR International Conference on Document Analysis and Recognition (ICDAR)</source>
          . Vol.
          <volume>1</volume>
          . IEEE.
          <year>2017</year>
          , pp.
          <volume>1404</volume>
          {
          <fpage>1410</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Christian</given-names>
            <surname>Clausner</surname>
          </string-name>
          , Apostolos Antonacopoulos, and Stefan Pletschacher. \
          <article-title>ICDAR2019 competition on recognition of documents with complex layoutsrdcl2019"</article-title>
          . In: 2019 International Conference on
          <article-title>Document Analysis and Recognition (ICDAR)</article-title>
          .
          <source>IEEE</source>
          .
          <year>2019</year>
          , pp.
          <volume>1521</volume>
          {
          <fpage>1526</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Lloyd</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Fletcher</surname>
            and
            <given-names>Rangachar</given-names>
          </string-name>
          <string-name>
            <surname>Kasturi</surname>
          </string-name>
          .
          <article-title>\A robust algorithm for text string separation from mixed text/graphics images"</article-title>
          .
          <source>In: IEEE transactions on pattern analysis and machine intelligence 10.6</source>
          (
          <issue>1988</issue>
          ), pp.
          <volume>910</volume>
          {
          <fpage>918</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Liangcai</given-names>
            <surname>Gao</surname>
          </string-name>
          , Yilun Huang, Herve Dejean,
          <string-name>
            <surname>Jean-Luc</surname>
            <given-names>Meunier</given-names>
          </string-name>
          , Qinqin Yan, Yu Fang, Florian Kleber, and Eva Lang. \
          <article-title>Icdar 2019 competition on table detection and recognition (ctdar)"</article-title>
          . In: 2019 International Conference on
          <article-title>Document Analysis and Recognition (ICDAR)</article-title>
          .
          <source>IEEE</source>
          .
          <year>2019</year>
          , pp.
          <volume>1510</volume>
          {
          <fpage>1515</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Adam</surname>
            <given-names>W Harley</given-names>
          </string-name>
          , Alex Ufkes, and Konstantinos G Derpanis.
          <article-title>\Evaluation of deep convolutional nets for document image classi cation and retrieval"</article-title>
          .
          <source>In: 2015 13th International Conference on Document Analysis and Recognition (ICDAR)</source>
          .
          <source>IEEE</source>
          .
          <year>2015</year>
          , pp.
          <volume>991</volume>
          {
          <fpage>995</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Le</given-names>
            <surname>Kang</surname>
          </string-name>
          , Jayant Kumar, Peng Ye,
          <string-name>
            <given-names>Yi</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and David</given-names>
            <surname>Doermann</surname>
          </string-name>
          . \
          <article-title>Convolutional neural networks for document image classi cation"</article-title>
          .
          <source>In: 2014 22nd International Conference on Pattern Recognition. IEEE</source>
          .
          <year>2014</year>
          , pp.
          <volume>3168</volume>
          {
          <fpage>3172</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Viet</given-names>
            <surname>Phuong</surname>
          </string-name>
          <string-name>
            <given-names>Le</given-names>
            , Nibal Nayef, Muriel Visani,
            <surname>Jean-Marc Ogier</surname>
          </string-name>
          , and Cao De Tran. \
          <article-title>Text and non-text segmentation based on connected component features"</article-title>
          .
          <source>In: 2015 13th International Conference on Document Analysis and Recognition (ICDAR)</source>
          .
          <source>IEEE</source>
          .
          <year>2015</year>
          , pp.
          <volume>1096</volume>
          {
          <fpage>1100</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <article-title>Michael A Moll and Henry S Baird. \Segmentation-based retrieval of document images from diverse collections"</article-title>
          .
          <source>In: Document Recognition and Retrieval XV</source>
          . Vol.
          <volume>6815</volume>
          .
          <source>International Society for Optics and Photonics</source>
          .
          <year>2008</year>
          , p.
          <fpage>68150L</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Michael</surname>
            <given-names>A Moll</given-names>
          </string-name>
          ,
          <article-title>Henry S Baird, and Chang An. \Truthing for pixelaccurate segmentation"</article-title>
          .
          <source>In: 2008 The Eighth IAPR International Workshop on Document Analysis Systems. IEEE</source>
          .
          <year>2008</year>
          , pp.
          <volume>379</volume>
          {
          <fpage>385</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Oleg</surname>
            <given-names>Okun</given-names>
          </string-name>
          , David D rmann, and Matti Pietikainen.
          <article-title>Page segmentation and zone classi cation: the state of the art</article-title>
          .
          <source>Tech. rep. OULU UNIV (FINLAND) DEPT OF ELECTRICAL ENGINEERING</source>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Babett</given-names>
            <surname>Schalitz</surname>
          </string-name>
          .
          <article-title>Accessibility-erhohung von latex-dokumenten.</article-title>
          <string-name>
            <surname>Diplomarbeit</surname>
          </string-name>
          , Fakultat Informatik .
          <source>Tech. rep. Technische Universitat Dresden</source>
          ,
          <year>July 2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Karl</surname>
            <given-names>Tombre</given-names>
          </string-name>
          , Salvatore Tabbone, Lo c Pelissier,
          <string-name>
            <surname>Bart Lamiroy</surname>
          </string-name>
          , and Philippe Dosch. \
          <article-title>Text/graphics separation revisited"</article-title>
          .
          <source>In: International Workshop on Document Analysis Systems</source>
          . Springer.
          <year>2002</year>
          , pp.
          <volume>200</volume>
          {
          <fpage>211</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>Nicole</given-names>
            <surname>Vincent</surname>
          </string-name>
          and
          <string-name>
            <surname>Jean-Marc Ogier</surname>
          </string-name>
          . \
          <article-title>Shall deep learning be the mandatory future of document analysis problems?"</article-title>
          <source>In: Pattern Recognition</source>
          <volume>86</volume>
          (
          <year>2019</year>
          ), pp.
          <volume>281</volume>
          {
          <fpage>289</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Kwan</surname>
            <given-names>Y.</given-names>
          </string-name>
          <string-name>
            <surname>Wong</surname>
          </string-name>
          , Richard G. Casey, and
          <string-name>
            <surname>Friedrich</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Wahl</surname>
          </string-name>
          . \
          <article-title>Document analysis system"</article-title>
          .
          <source>In: IBM journal of research and development 26.6</source>
          (
          <issue>1982</issue>
          ), pp.
          <volume>647</volume>
          {
          <fpage>656</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>