<!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>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Comprehensive Tool for Event Log Comparison</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Aaron Friedrich Kurz</string-name>
          <email>aaron.kurz@unisg.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ronny Seiger</string-name>
          <email>ronny.seiger@unisg.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Franceschetti</string-name>
          <email>marco.franceschetti@unisg.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Barbara Weber</string-name>
          <email>barbara.weber@unisg.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>Detection, Event Log Comparison</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Business Process Management, Internet of Things</institution>
          ,
          <addr-line>Activity Recognition, Activity Detection, Sequence</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of St. Gallen</institution>
          ,
          <country country="CH">Switzerland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Nowadays, event logs are not only created by traditional information systems, but also new data sources such as the IoT are considered to derive and construct event logs. This makes it necessary to evaluate the quality of these detected event logs and their underlying detection methods by comparison with given ground truth logs. We present AquDeM, enabling the comparison of XES-based event logs to evaluate activity and sequence detection methods. AquDeM features 1) a Python library that allows for programmatic comparison of event logs featuring a comprehensive set of metrics, and 2) a web app for visual event log comparison.</p>
      </abstract>
      <kwd-group>
        <kwd>Comparison</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>
        An often investigated subject at the intersection of Business Process Management (BPM) and
the Internet of Things (IoT) is the abstraction of low-level IoT events to BPM-level activities [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ],
which can be seen as a multi-class activity detection problem. In previous work, we presented a
corresponding method [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] that has the goal of detecting business process activities in real-time,
based on annotated IoT data streams to enable online process conformance checking [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. While
investigating methods to evaluate the quality of the IoT-based detection of activities, which we
capture in event logs in XES [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] format, we realized that most event log comparison tools that
exist in the BPM field are not suitable to evaluate activity detection methods. They do not provide
helpful metrics for the comparison of a detected event log (e.g., created from IoT data by the
detection method) with a ground truth event log (representing the correct sequence and timing
of activities as manually annotated or predefined) to evaluate and improve a specific detection
method, since they i) focus on variant comparison to derive insights for process analysts
regarding business outcomes (i.e., comparing process performance indicators) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]; and/or ii)
they produce results that are not suitable for rapid comparison due to non-quantitative outputs
(e.g., graphs or natural language) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Thus, we sought out methods from other relevant fields
in the literature.
      </p>
      <p>
        Core requirements for the event log comparison tools and metrics derived from our
usecases [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] are: i) they need to provide insights relevant for the detection quality of an activity
detection method, i.e., on whether the activities are detected to be in-/active at the right times
and/or whether the sequence of detected activities is correct w.r.t. a given ground truth;
ii) they need to provide quantitative results for rapid and automatable comparison (e.g., for
programmatic exploration of a potentially large number of method parameters); and iii) they
should provide insights over multiple cases within the event logs. We found multiple suitable
metrics in the areas of information theory, signal processing, and general activity recognition.
However, none of them could be directly applied to BPM-related concepts (i.e., XES-based event
logs): some important metrics (e.g., from [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]) were not available as open implementations, and
some others needed modification to make sense in the context of BPM (e.g., cross-correlation).
Thus, we decided to implement, modify, extend, and integrate them in a tool ourselves.
      </p>
      <p>
        The result is the Python library AquDeM1: Activity and Sequence Detection Evaluation
Metrics, which takes two event logs in XES format as an input–one ground truth (GT) log and
one log containing the detected (DET) activities–and allows for the calculation of a variety of
comparison metrics for evaluation. Besides the library as core contribution, we have created a
web application that utilizes the library, allowing for quick, intuitive, visual comparison of two
event logs. In our research [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ], the Python library is not only used in this web app, but also
in other more automated pipelines. The separation into library and web app allows for more
varied use-cases without impacting the functionality or usability of either.
      </p>
    </sec>
    <sec id="sec-3">
      <title>2. Innovation and Features</title>
      <p>2.1. Library
The metrics available in AquDeM can be categorized into activity level metrics and sequence
level metrics. Activity level metrics are calculated for each activity type in each case separately.
A sequence level metric is calculated for each case separately, but over all activity types in that
case. For calculations that span multiple cases/activities, the results are aggregated, currently
using the mean. Another categorization is into frame-based or event-based metrics [cf. 6].
Frame-based metrics are calculated based on specific time points when an activity is detected
as (in-)active, making them dependent on the (IoT) data’s sampling frequency (i.e., how often
data is recorded). Event-based metrics work on the classification of events themselves and do
not take the sampling frequency into account. For the calculation of the metrics, the event logs
must minimally adhere to these requirements: i) each activity execution needs both a start
and a complete event; and ii) the logs need a sampling frequency for the frame metrics.</p>
      <p>The metrics were selected from literature, implemented and modified based on the
requirements in Section 1. To get a better understanding of the metrics, we provide intuitive
(noncomplete) explanations below. Note, that all of these metrics are also available in normalized
form in the library, allowing for comparison among diferent event logs. In Table 1 we give an
1Video: https://youtu.be/dM4Y-80L3gA; Code: https://github.com/ics-unisg/aqudem, tags: pkg-v0.1.1, fe-v0.1.1
overview of the metrics regarding the categories described above, together with references to
their definitions. Furthermore, we provide a usage example of AquDem in Listing 1.
• Cross Correlation (CC) measures the similarity between the DET and GT time series by
determining the shift at which they are most alike and quantifying that similarity, relative to
perfect equality for time series of that length.
• Two Set (TS) metrics classify frames into categories such as true positive, true negative,
deletions, fragmentations, mergings, insertions, and over-fillings or under-fillings at the start
and end of an activity instance.
• Event Analysis (EA) metrics categorize the GT events as correct, deleted, fragmented,
merged, or both fragmented and merged; and DET events as correct, inserted, fragmenting,
merging, or both fragmenting and merging.
• The Levenshtein-Distance (LD) calculates the minimum number of single activity instance
edits (insertions, deletions, or substitutions) needed to transform the sequence of activity
instances in DET to match GT.
• The Damerau-Levenshtein-Distance (DLD) extends the LD metric by also considering the
transposition of two adjacent activity instances as a single edit.
1 import aqudem
2 aqu_context = aqudem.Context("ground_truth_log.xes", "detected_log.xes")
3 aqu_context.activity_names # get all activity names present in logs
4 aqu_context.cross_correlation() # aggregate over all cases and activites
5 aqu_context.event_analysis(activity_name="Pack", case_id="1") # filter on case and activity
6 aqu_context.two_set(activity_name="Pack") # filter on activity, aggregate over cases</p>
      <sec id="sec-3-1">
        <title>Listing 1: Example usage of AquDeM Python library.</title>
        <p>
          2.2. Web App
The web app, built using streamlit,2 has proven to be useful for the iterative and exploratory
process of evaluation and development of the detection method in [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. Notably, the library has
been developed in tandem with the web app: it is built with interactive and repeated calculations
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>2https://streamlit.io/, last accessed 3rd May 2024</title>
        <p>in mind, i.e., browsing metrics and going back-and-forth with diferent analysis parameters. The
library internally relies on caching to speed up recurring requests and to re-use computations
from previous requests for similar requests (e.g., a filtered view that contains data calculated in
a previous view). Screenshots of the web app can be seen in Figure 1. After uploading two XES
logs, the user can choose a certain metric to visualize. The visualization, tabular presentation,
and further options for filtering are varied for each metric to ofer suitable presentations for
exploration with that particular metric. The app provides specific visualizations we deemed
useful (based on our use-cases), with a more flexible exploration being possible with the library.
3. Maturity and Evaluation
- small-synth: synthetic logs, 2
cases each and 34 start /
complete events in total
- medium-exp: experimental
logs, 1 case each and 262
start / complete events in
total
- large-exp: experimental logs,
4 cases each and 1290 start /
complete events in total
Machine:
CPU cores: 16; Model: AMD
Ryzen 7 7840HS with Radeon
780M Graphics; Threads per
core: 2; RAM: 32.0 GiB</p>
        <p>
          We consider the maturity of the library and web app to be relatively high: they are continually
improved and extended as they are used in our research, and include an automated test suite
with combined branch and line coverage of &gt; 90%. To better understand the library from a
performance and usability perspective, we have measured runtimes with a variety of event log
pairs (GT and DET), including experimental logs from the smart factory scenario described in
[
          <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
          ]. The results can be seen in Figure 2, indicating acceptable performance and scalability.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>In this work we presented AquDeM: a tool featuring activity and sequence detection evaluation
metrics to be used for event log comparison by BPM researchers. Besides the main,
programmatically usable Python library, we provide a web app for fast, visual comparison of two event
logs. The modular and decoupled design of library and web app allows for flexible usage. Given
the increasing research attention in the area of activity detection in BPM and the absence of
appropriate tools, we believe this to be a valuable addition to the pool of community resources.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This work has received funding from the Swiss National Science Foundation under Grant
No. IZSTZ0_208497 (ProAmbitIon project).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>C.</given-names>
            <surname>Janiesch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Koschmider</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mecella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Weber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Burattin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Ciccio</surname>
          </string-name>
          , et al.,
          <article-title>The internet of things meets business process management: A manifesto</article-title>
          ,
          <source>IEEE Systems, Man, and Cybernetics Magazine</source>
          <volume>6</volume>
          (
          <year>2020</year>
          )
          <fpage>34</fpage>
          -
          <lpage>44</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>R.</given-names>
            <surname>Seiger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Franceschetti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Weber</surname>
          </string-name>
          ,
          <article-title>Data-driven generation of services for iot-based online activity detection</article-title>
          ,
          <source>in: International Conference on Service-Oriented Computing</source>
          , Springer,
          <year>2023</year>
          , pp.
          <fpage>186</fpage>
          -
          <lpage>194</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Franceschetti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Seiger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J. G.</given-names>
            <surname>González</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Garcia-Ceja</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. A. R.</given-names>
            <surname>Flores</surname>
          </string-name>
          , L. GarcíaBañuelos,
          <string-name>
            <given-names>B.</given-names>
            <surname>Weber</surname>
          </string-name>
          ,
          <article-title>Proambition: Online process conformance checking with ambiguities driven by the internet of things</article-title>
          ., in: CAiSE Research Projects Exhibition,
          <year>2023</year>
          , pp.
          <fpage>52</fpage>
          -
          <lpage>59</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <article-title>[4] Ieee standard for extensible event stream (xes) for achieving interoperability in event logs and event streams</article-title>
          , IEEE Std 1849
          <article-title>-2023 (Revision of IEEE Std 1849-</article-title>
          <year>2016</year>
          ) (
          <year>2023</year>
          )
          <fpage>1</fpage>
          -
          <lpage>55</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>F.</given-names>
            <surname>Taymouri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. L.</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <article-title>Business process variant analysis: Survey and classification</article-title>
          ,
          <source>Knowledge-Based Systems</source>
          <volume>211</volume>
          (
          <year>2021</year>
          )
          <fpage>106557</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Ward</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Lukowicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. W.</given-names>
            <surname>Gellersen</surname>
          </string-name>
          ,
          <article-title>Performance metrics for activity recognition</article-title>
          ,
          <source>ACM Trans. Intell. Syst. Technol</source>
          .
          <volume>2</volume>
          (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>D.</given-names>
            <surname>Lyon</surname>
          </string-name>
          ,
          <source>The Discrete Fourier Transform, Part</source>
          <volume>6</volume>
          :
          <string-name>
            <surname>Cross-Correlation</surname>
            <given-names>.</given-names>
          </string-name>
          ,
          <source>The Journal of Object Technology</source>
          <volume>9</volume>
          (
          <year>2010</year>
          )
          <fpage>17</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>V. I.</surname>
          </string-name>
          <article-title>Levenshtein, others, Binary codes capable of correcting deletions, insertions, and reversals</article-title>
          ,
          <source>in: Soviet physics doklady</source>
          , volume
          <volume>10</volume>
          ,
          <string-name>
            <surname>Soviet</surname>
            <given-names>Union</given-names>
          </string-name>
          ,
          <year>1966</year>
          , pp.
          <fpage>707</fpage>
          -
          <lpage>710</lpage>
          . Issue:
          <volume>8</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>F. J.</given-names>
            <surname>Damerau</surname>
          </string-name>
          ,
          <article-title>A technique for computer detection and correction of spelling errors</article-title>
          ,
          <source>Communications of the ACM</source>
          <volume>7</volume>
          (
          <year>1964</year>
          )
          <fpage>171</fpage>
          -
          <lpage>176</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>