<!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>SemOI2 - Building Adaptive and Cost-Effective Recognition Applications With Semantic Augmentation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Achim Reiz</string-name>
          <email>achim.reiz@uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Birger Lantow</string-name>
          <email>birger.lantow@uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kurt Sandkuhl</string-name>
          <email>kurt.sandkuhl@uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Rostock University</institution>
          ,
          <addr-line>18057 Rostock</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Neural nets are the backbone for many innovative applications when it comes to making sense out of unstructured data. This technology, however, also has some significant downsides. Training these neural nets requires vast amounts of annotated training data and computational power and is, thus, expensive. Adding, altering, or removing concepts all trigger costly retraining of the neural net. Semantic technologies can curb these systemic disadvantages. They can be connected to the neural net and augment the detection. The ontology can be easily adapted to new situations and use cases without requiring much computational power. This paper presents a prototype application for connecting the general-purpose OpenImages detection with a semantic. Freeto-use training datasets provide a cost-efficient way to use neural nets - often, there exist even pre-trained models for the large machine learning frameworks. The semantic contextualizes the low-level knowledge and enables the realization of specific use cases. We further propose a methodology to transfer the probability of the image detection and the prominence of items in the picture to the ground truth of the ontology by introducing a new measurement Semantic Confidence (SC).</p>
      </abstract>
      <kwd-group>
        <kwd>1 Ontology</kwd>
        <kwd>CNN</kwd>
        <kwd>OpenImages</kwd>
        <kwd>Semantic Augmentation</kwd>
        <kwd>Image Recognition</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Recent advantages brought tremendous progress in image classification, object detection, and computer
vision systems in general. Through the rise in computational power, neural nets are today’s
state-ofthe-art for image recognition tasks and are the backbone of many artificial intelligence (ai) applications.</p>
      <p>However, convolutional neural nets (CNN) also have downsides: They need large quantities of
annotated training data to produce valid results. Due to the extensive amount of required training data,
creating these neural nets is costly in terms of computational and human resources. Every change in the
detection requires a retraining of the neural net, which makes the approach inflexible regarding
fastchanging requirements.</p>
      <p>
        That being said, the use of neural nets and deep learning for recognition tasks are (today) without a
realistic alternative. Nevertheless, a method for strengthening the reuse of neural nets and reducing the
need to collect training data and training itself could significantly mitigate the disadvantages of this
technology. The combination of semantic technologies with a general-purpose image detection (like
OpenImages [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] or COCO [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]) can deliver just that. The general-purpose image detection contains a
large set of freely available, annotated training data. Prominent machine learning (ML) libraries like
TensorFlow or PyTorch often provide pre-trained models for these prominent datasets. The semantic
then sets the detected objects into a new context, adapted to the individual needs of the user.
      </p>
      <p>
        In this paper, we present a semantic augmentation for the popular open images training set. We
implemented a prototype that builds on TensorFlow and connects an ontology that generalizes the
results of the image detection. Further, we introduce a measurement Semantic Confidence (SC) that
transfers the fuzziness of the image detection and the prominence of items in a picture to the ground
truth of the semantic. In a previous paper [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], a first iteration of the prototype already proved the general
feasibility of the endeavor but had issues regarding a high number of false positives and a lack of
performance. This new second iteration tackled a lot of the described problems by reworking the
application completely, improving the augmentation results, the response times, and the SC calculation.
      </p>
      <p>The rest of the paper is structured as follows: The following section gathers the current
state-of-theart in combining ontology and image recognition. Section three then presents the prototype by
describing the architecture of the application and the calculation of the SC value, instructing how to use
the software, and performs a preliminary evaluation before the research is concluded.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        The idea to connect deep learning recognition tasks with a semantic is not entirely new. Two recently
published literature reviews by Ding et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and Bhandari and Kulikajevas [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] collected advances in
the connection of image recognition and semantic. Ding et al.’s paper is structured in single and multiple
object recognition tasks. For the former, they collected methods for improving detection accuracy. For
the latter, they present papers that (A) use ontologies for the connection of detected low-level features
to high-level semantics, using partOf relationships or Wordnet, (B) detect behavior in video analysis,
and (C) classify environmental areas and maps. Bhandari and Kulikajevas collected works for (A)
semantic-based image annotation and labeling label creation, to link the annotated images with each
other and additional factual knowledge, (B) for segmentation tasks, to improve the understanding of
detected features, and (C) to map detected objects to each other and to high-level concepts using isa
and part of relationships. Further, the review presents selected applications for domain-specific tasks,
e.g., applications in robotics, geoinformation systems, and retrieval tasks in sports events.
      </p>
      <p>
        Besides these two literature reviews, we additional consider relevant the works by Reiz et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] that
presents a prototype for the fashion domain to infer sub-items based on the contextualized detected
elements and image classifications. They argue for reduced implementation costs and the possibility of
detecting objects beyond the accuracy of image detection, e.g., because fashion items often look similar
but are worn in different contexts. In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], Zambrano et al. developed a rule-based video analysis that
extracted situations out of CCTV. The videos are analyzed frame by frame and annotated with the type
of objects detected, their position and dimension, and their variation regarding the previous frames. The
semantic now allows the quick and cost-efficient adaption of new detectable scenarios.
      </p>
      <p>As the literature review shows, the idea of connecting a semantic to enrich the results of the image
detection is not entirely new – various authors have already connected the different kinds of ai
technologies. However, our approach is unique in the way that (1) we can eliminate the need for training
the system entirely by building upon and adapting popular, freely available systems and (2) using a
novel metric to connect the level of detection uncertainty and relative importance of an object in the
picture to the semantic.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Prototype</title>
      <p>The following section gives an overview of the developed prototype. At first, the software’s architecture
is presented, followed by an explanation of how to use the software. At last, we perform a preliminary
evaluation of the new approach and derive the next steps.</p>
    </sec>
    <sec id="sec-4">
      <title>Prototype Architecture</title>
      <p>
        SemOI is available under an open source license. The source code is available online in Github2. The
application is written in python and utilizes the web framework “Django”3, running inside a docker4
container. Taking the categorization framework for hybrid systems by [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], it is in its architecture similar
to a system that learns an intermediate abstraction for reasoning, taking in model-free image data and
transferring it into the categorical open images representation before another transformation is carried
out by the semantic.
      </p>
      <p>
        The detection is based on TensorFlow with pre-trained models from the model sharing website
“TensorFlow Hub”5. The models are trained using the OpenImages training data set [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. For the
detection, the user has two different neural nets at their disposal: ResNet and MobilNet6. The former
aims to generate a high accuracy; the latter shows possible integration scenarios for devices with limited
computational power [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. However, it is possible to easily swap the underlying recognition engine due
to standardized, freely available models and training data.
      </p>
      <p>Figure 1 gives an overview on the architecture of the prototype. At first, the out-of-the-box
tensorflow model detects the given objects. After a detection is completed, the application calls the
semantic augmentation unit with a list of the detected items. Each object detector has an ontological
twin in the semantic and can be identified using the detector label or OpenImages classifier ID. The
detectors are connected with new, contextualized items (cf. Figure 2). In the semantic augmentation
unit, the request is translated into a SPARQL-query that fetches results from the ontology, which
returns the context items for further analysis.</p>
      <p>
        After the detected contextualized items are fetched, the semantic confidence  is calculated. While
the  value of the first SemOI version [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] used only the probability of a detected item and the number
of occurrences in the semantic as the foundation for calculating  , the calculation proposed by this
paper also considers the prominence of an item. The prominence ⃗⃗⃗⃗⃗⃗⃗⃗ is calculated as a percentage
value of the area covered by the object’s bounding boxes. The detector’s prominence and probability
value (the detection score of the neural net) ⃗⃗⃗⃗⃗⃗⃗⃗ are summed up, then multiplied with the inferred
element. As the last step, the values of the context elements are aggregated.
2 https://github.com/Uni-Rostock-Win/SemOI and https://doi.org/10.5281/zenodo.5005618
3 www.djangoproject.com and www.django-rest-framework.org
4 https://www.docker.com/
5 www.tensorflow.org, tfhub.dev
6 tfhub.dev/google/faster_rcnn/openimages_v4/inception_resnet_v2/1, tfhub.dev/google/openimages_v4/ssd/mobilenet_v2/1'
      </p>
      <p>= 6,108 nature + 6,374 park + 0,9801 garden
  
= 100% park + 95.8 % park + 15.8% garden
(Step 2)
(Step 3)</p>
    </sec>
    <sec id="sec-5">
      <title>Using the Prototype</title>
      <p>The prototype is available online at semoi2.informatik.uni-rostock.de. At first, one needs to upload a
picture. As soon as the upload is completed and the image is presented in the preview window, the
application asks the user to choose the underlying model – “Faster” triggers the MobileNet, “Accurate”
utilizes the ResNet. Even though on powerful machines (like the server that the application runs on),
the calculation times are not expected to differ widely, this distinction allows the simulation of different
application scenarios.</p>
      <p>A click on “Analyze” triggers the recognition and augmentation tasks. After the analysis is
completed, two boxes appear. The left box “Detected Objects” consists of the results from the image
recognition; the box on the right “Semantic Augmentation” contains the augmentation results given by
the semantic.
While the software is not yet adapted to a productive environment, the evaluation shall outline the
current performance and identify possible weak points. For our analysis, we manually decided for every
picture if it fits to the inferred classes and whether some of them are missing. That being said, the
evaluation does not consider the results or efficacy of the image recognition that is the input for the
semantic. A possible error in the recognition, thus, propagates to the semantic.</p>
      <p>The ontology is currently not targeted at a specific business use case but generalizes the results and
infers contexts. Without these use cases, a precise evaluation scenario is missing. Taking the example
of Figure 3, the semantic inferred the situation garden, nature, and park. One could argue that additional
elements in the ontology fit the picture as well, in this case, e.g., holiday. Thus, applying binary relevant
/ not relevant categories is, at times, fuzzy. In these arguable cases, we evaluated in favor of the
application.</p>
      <p>The values for our analysis are presented in the table below. In total, we analyzed ten pictures. The
application reached a precision value of 73% on average of all figures (67% average of the detected
items) and a recall of 88% (89%). The results of the evaluation are available online7.</p>
      <p>On the one hand, the values indicate that we need to work further on the mapping accuracy and more
carefully design the ontology to prevent irrelevant items from being inferred. On the other hand,
however, the significance of the evaluation is limited without a real-world application scenario. Such a
use case with a specifically developed ontology would further validate the capability of the system.</p>
    </sec>
    <sec id="sec-6">
      <title>4. Conclusion</title>
      <p>Training neural nets for image recognition tasks is a tedious and costly task. While there are free-to-use
models for general-purpose detection jobs available, these models will most likely not fit directly to a
specific use case. The connection with a semantic, however, can provide this adaption.</p>
      <p>In the paper, we presented a new version of SemOI, a prototype for the connection of OpenImages
with a semantic augmentation. The driving idea behind this publication is the simplification of setting
up AI applications using semantic adaptions to pre-trained neural nets. These quick adaptions are
enabled through adjustments of the ontology. Possible changes are manifold: One could add or alter
context items, change, delete and add relations between the contexts and the detected items, or switch
the underlying recognition model to reuse another public accessible or private neural net. The semantic
can be easily adapted to a specific use case, enabling the rapid development of new recognition
applications. We believe that this connection of pre-trained models with ontologies has the potential to
mitigate a lot of the downsides that come with the deployment of image recognition technologies.</p>
      <p>The current ontology is crafted manually. We first built a script for translating the open images
taxonomy into rdf, then connected the given detectors to context items. Future applications might also,
depending on the given use case, consider the application automated ontology creation techniques based
on machine learning or text retrieval algorithms.</p>
      <p>However, the new methodology also has limitations. The target application needs to be concerned
with at least part of the detectors/classifiers in the pre-defined model. The new approach does not work
if no pre-trained data is available, e.g., in highly specific detections like material properties in a factory.</p>
      <p>The presented prototype proves the general feasibility of the idea. Further research is concerned with
implementing more sophisticated detection scenarios. We also plan to further work on the semantic
confidence (SC) value, to incorporate a weighting of the relations, e.g., based on their specificity,
utilizing the research of ontology matching algorithms. At last, implementing the software into a
realworld application would arguably deliver the most learnings regarding the future challenges we need
to tackle. Here, we invite the community to fork and adapt the prototype and share their experiences.
We thank the students Henrik Bongertmann, Carl Pommerencke, and Daniel Hahn for their support in
realizing the Prototype.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>I.</given-names>
            <surname>Krasin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Duerig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Alldrin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Ferrari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Abu-El-Haija</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kuznetsova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Rom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Uijlings</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Popov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kamali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Malloci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pont-Tuset</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Veit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Belongie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Gomes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Chechik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Cai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Feng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Narayanan</surname>
          </string-name>
          , K. Murphy,
          <article-title>OpenImages: A public dataset for large-scale multi-label and multi-class image classification, Dataset available</article-title>
          from https://storage.googleapis.com/openimages/web/index.html (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>T.-Y.</given-names>
            <surname>Lin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Maire</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Belongie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bourdev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Girshick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hays</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Perona</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ramanan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.L.</given-names>
            <surname>Zitnick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Dollár</surname>
          </string-name>
          ,
          <string-name>
            <surname>Microsoft</surname>
            <given-names>COCO</given-names>
          </string-name>
          : Common Objects in Context,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Reiz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Sandkuhl</surname>
          </string-name>
          ,
          <string-name>
            <surname>B. Lantow,</surname>
          </string-name>
          <article-title>SemOI: A Semantical Augmentation for the Open Images Detection</article-title>
          ,
          <source>in: Proceedings of the FRUCT'28</source>
          , Moscow,
          <year>2021</year>
          , pp.
          <fpage>610</fpage>
          -
          <lpage>613</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Ding</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Yao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <article-title>Review of the Application of Ontology in the Field of Image Object Recognition, in: Review of the Application of Ontology in the Field of Image Object Recognition, North Rockhampton</article-title>
          ,
          <string-name>
            <surname>QLD</surname>
          </string-name>
          , Australia, ACM Press, New York, New York, USA,
          <year>2019</year>
          , pp.
          <fpage>142</fpage>
          -
          <lpage>146</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bhandari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kulikajevas</surname>
          </string-name>
          ,
          <article-title>Ontology based image recognition: A review</article-title>
          ,
          <source>in: Proceedings of the International Conference on Information Technologies</source>
          , Kaunas, Lithuania,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Reiz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Albadawi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Sandkuhl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Vahl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Sidin</surname>
          </string-name>
          ,
          <article-title>Towards More Robust Fashion Recognition by Combining of Deep-Learning-Based Detection with Semantic Reasoning, in: Proceedings of the AAAI 2021 Spring Symposium on Combining Machine Learning and Knowledge Engineering (AAAI-MAKE</article-title>
          <year>2021</year>
          ), CEUR-WS, Stanford University, Palo Alto, California, USA,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Zambrano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Toro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Sanín</surname>
          </string-name>
          , E. Szczerbicki,
          <string-name>
            <given-names>M.</given-names>
            <surname>Nieto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Sotaquira</surname>
          </string-name>
          ,
          <article-title>Video Semantic Analysis Framework based on Run-time Production Rules - Towards Cognitive Vision</article-title>
          ,
          <source>Journal of Universal Computer Science</source>
          <volume>21</volume>
          (
          <year>2015</year>
          )
          <fpage>856</fpage>
          -
          <lpage>870</lpage>
          . https://doi.org/10.3217/jucs-021-06-0856.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>F. van Harmelen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ten
            <surname>Teije</surname>
          </string-name>
          ,
          <source>A Boxology of Design Patterns forHybrid Learningand Reasoning Systems, JWE</source>
          <volume>18</volume>
          (
          <year>2019</year>
          )
          <fpage>97</fpage>
          -
          <lpage>124</lpage>
          . https://doi.org/10.13052/jwe1540-
          <fpage>9589</fpage>
          .
          <fpage>18133</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>X.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Sahoo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.C.</given-names>
            <surname>Hoi</surname>
          </string-name>
          ,
          <article-title>Recent advances in deep learning for object detection</article-title>
          ,
          <source>Neurocomputing</source>
          <volume>396</volume>
          (
          <year>2020</year>
          )
          <fpage>39</fpage>
          -
          <lpage>64</lpage>
          . https://doi.org/10.1016/j.neucom.
          <year>2020</year>
          .
          <volume>01</volume>
          .085.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>