<!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>Introducing Quality Guarantees for Autoencoders</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Benedikt Böing</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rajarshi Roy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emmanuel Müller</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Neider</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Max Planck Institute for Software Systems</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>TU Dortmund</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Autoencoders are an essential concept in unsupervised learning. Currently, the quality of autoencoders is assessed either internally (e.g., by mean square error) or externally (e.g., by classification performance). Yet, there is no possibility to prove that autoencoders generalize beyond the finite training data, and hence they are not reliable for safety-critical applications requiring formal guarantees for unseen data. To address this issue, we propose the first framework to bound the worst-case error of an autoencoder within a safety-critical region of an infinite value domain, as well as the definition of unsupervised adversarial examples that cause such worst-case errors. Technically, our framework reduces the infinite search space for a uniform error bound to checking satisfiability of logical formulas in Linear Real Arithmetic. This allows us to leverage highly-optimized SMT solvers, a strategy that is very successful in the context of deductive software verification. We demonstrate our ability to find unsupervised adversarial examples as well as formal quality guarantees on a real-world dataset from the medical domain.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Autoencoders are widely used for many unsupervised learning tasks such as cluster analysis [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ],
compression [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], anomaly detection [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], as well as a variety of preprocessing steps [
        <xref ref-type="bibr" rid="ref2 ref4 ref5">4, 2, 5</xref>
        ] in
other machine learning pipelines. The general assumption is that data can be compressed into a
lower dimensional latent space by an encoder function extracting the most relevant features
of the data distribution. From this latent representation the decoder tries to reconstruct the
original input. As the latent representation is an information bottleneck the autoencoder’s input
deviates from its output. Typically the autoencoder reconstructs better in dense regions (i.e.,
regions with many training examples) than in regions with few training examples [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] giving
rise to its application in anomaly detection. Moreover even the small errors in dense regions
are a desirable property as they allow it to be used, e.g., for denoising. At the same time it
is necessary to control the error for all points in dense regions because otherwise the result
whether it is the latent representation or the reconstruction - is of little use. To this end current
approaches to assess autoencoders either measure internally the mean square error (MSE) on
the unsupervised training data or external performance on some supervised application such as
classification performance [
        <xref ref-type="bibr" rid="ref6 ref7 ref8">6, 7, 8</xref>
        ].
      </p>
      <p>However, a major shortcoming of these approaches is that they cannot provide a formal
guarantee in terms of the maximum deviation between input and output of the autoencoder as it
is evaluated on test data only (i.e., with a finite number of inputs). This lack of formal quality
guarantees for autoencoders leads to a very limited applicability of such unsupervised learning
schemes for safety-critical applications. For instance, it is particularly important to consider
the maximum deviation when working with data containing clusters. In such situations the
autoencoder should not mix up the clusters because otherwise the autoencoder’s results are
meaningless. If the maximum deviations for the respective clusters are small enough though,
the autoencoder provably keeps the clusters separated.</p>
      <p>
        To address this and other shortcomings of unsupervised learning with autoencoders, we provide
the first methodology to bound an autoencoder’s worst-case error in a safety-critical region.
Inspired by the vast literature on supervised adversarial attacks [
        <xref ref-type="bibr" rid="ref10 ref11 ref9">9, 10, 11</xref>
        ], we define the notion
of unsupervised adversarial examples as inputs (not necessarily contained in the training data) on
which the autoencoder’s error exceeds a user-defined threshold. Then we define the worst-case
error of an autoencoder as the largest error that can possibly manifest.
      </p>
      <p>
        Following a popular approach in the area of software verification, we reduce the problem of
ifnding an unsupervised adversarial example to a satisfiability check of a formula in linear Real
Arithmetic [
        <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
        ]. This allows us to apply highly-optimized, of-the-shelf satisfiability modulo
theory (SMT) solvers which can efectively reason about the infinite domains and, hence, can
prove the existence or non-existence of unsupervised adversarial examples. Once we have
found an unsupervised adversarial example, it serves as a lower bound for the worst-case error.
Moreover, a binary search allows us to approximate the worst-case error arbitrarily well. We
demonstrate the usefulness of our QUGA (QUality Guarantees for Autoencoders) approach by
proving that a given autoencoder keeps two classes of a medical dataset separated. For more
experiments and details please refer to the extended version of this paper [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. QUGA: Problem Statement</title>
      <p>In general, an autoencoder tries to reproduce its input; that is, it is trained to compute  () = .
However, it does so while propagating it through a latent space which typically has less
dimensions than the input/output space. This latent space serves as an information bottleneck
and therefore introduces errors to the identity function the autoencoder is supposed to learn.
However, as most applications of autoencoders rely on a good approximation of the identity
function, we are naturally interested in quantifying its error. More precisely, our goal is to give
formal guarantees in terms of the maximum deviation from the identity function.</p>
      <p>As a first step towards this goal, we define the notion of adversarial examples of autoencoders.
Intuitively, such adversarial examples are inputs on which the “distance” between the input and
the output of the autoencoder is larger than a (user-defined) threshold  &gt; 0.</p>
      <p>Definition 1 (-adversarial examples). Let  : R → R be an autoencoder, dist : R ×
R → R+ a distance function, and  &gt; 0. An -adversarial example is a point  ∈ R such that
dist (,  ()) &gt; 
(i.e., a point on which the input and output of  deviate more than ).</p>
      <p>Note that our definition of -adversarial examples is not restricted to inputs in the training
or test sets but allows any input  ∈ R. In the context of safety-critical systems, however, it
is not enough to identify individual -adversarial examples, but it is necessary to know the
worst-case (i.e., maximum) error an autoencoder produces. As we cannot expect to find a global
maximum of the unbounded error, we restrict the region for which we want to calculate the
worst-case error.</p>
      <p>Definition 2 (Worst-case error of autoencoders). Let  : R → R be an autoencoder,
dist : R × R → R+ a distance function, and  ⊆ R an (infinite) safety-critical region of
inputs. Then, the worst-case error of  in  is defined as</p>
      <p>wce(, ) = sup {︀ dist (︀ ,  ())︀ ∈ R+ |  ∈ }︀
(i.e., the largest deviation of an input in the region  from its output).</p>
      <p>Definition 2 serves as our novel quality criterion for autoencoders that reflects how good the
identity function is learned in the specific region of interest. It overcomes the limitation of
classical quality metrics that are defined on finite test data only. In total, this leads us to the
main problem statement.</p>
      <p>Problem 1 (QUGA: Quality Guarantees for Autoencoders). Given a region  ⊆ R, an
autoencoder  : R → R and a distance function dist : R × R → R+, compute wce(, ).</p>
      <p>In general, computing the worst-case error is a very challenging and computationally
intractable problem. Hence in the next section we introduce a restricted, solvable version of
it.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Solution Framework</title>
      <p>In this section we outline a framework for computing -adversarial examples and the worst-case
error of autoencoders in a restricted and hence computationally tractable version of Problem 1.
The following restrictions are designed in such a way that the solution framework remains
applicable to a wide range of autoencoders used in practice:
1. We assume the the neurons of the autoencoder have linear or ReLU (Rectified Linear</p>
      <p>Unit) activation functions.
2. We assume the distance function to be the 1 or ∞-norm.
3. We assume the safety-critical region  to be a finite union of convex compact polytopes.
4. We approximate the worst-case error up to a user-defined accuracy.</p>
      <p>
        Given these assumptions we can encode the problem of finding an -adversarial example in a
given region  as an instance of the SMT problem [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. To this end we define formulas encoding
the autoencoder ( ), the region ( ) and the distance function ( dist ) and concatenate them
to   =   ∧   ∧  dist such that the following theorem holds.
      </p>
      <p>Theorem 1. Let  be an autoencoder,  a region, dist a distance function,  &gt; 0, and  ae as
defined above. Then, the following two properties hold:
1. If  contains an -adversarial example, then  ae is satisfiable.</p>
      <p>2. If  ae is satisfiable, then any solution of  ae is an -adversarial example in .
In order to approximate the worst-case error in a region we can thereafter exploit this property
by performing a binary search over the values of  and keeping track of lower and upper bounds
on the worst-case error.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Empirical Evaluation</title>
      <p>We demonstrate our QUGA framework on the ECG5000 dataset (Figure 1), by evaluating the
unsupervised training based on two time series clusters. The goal of a traditional evaluation
would be to show that all training objects are clearly separated in the latent space. In contrast,
we care about all possible (infinitely many) objects in two safety-critical areas (green and red)
that need to be distinguishable in the latent space. In Figure 2 we see the resulting corridors
(green and red) into which points from the corresponding critical regions can be mapped. As the
two corridors do not overlap on all timesteps (e.g., in time 137) the autoencoder keeps the two
safety-critical classes apart allowing for the use of the latent space representations for follow
up tasks such as, e.g., classification.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>QUGA overcomes major shortcomings of unsupervised learning with autoencoders. We provide
the first methodology to bound the error of an autoencoder in a safety-critical region. With our
solution framework based on SMT solvers we propose to search for adversarial examples and
the worst-case error in the infinite search space of a safety-critical region. Our QUGA approach
formulates the autoencoder, the safety-critical region, and the error of the loss function with a
logical conjunction of linear constraints. This allows us to prove separation of the input data in
the latent space for further downstream applications.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>S. E.</given-names>
            <surname>Chazan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gannot</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Goldberger</surname>
          </string-name>
          ,
          <article-title>Deep clustering based on A mixture of autoencoders</article-title>
          ,
          <source>in: 29th IEEE International Workshop on Machine Learning for Signal Processing</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Q.</given-names>
            <surname>Meng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. R.</given-names>
            <surname>Catchpoole</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Skillicom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. J.</given-names>
            <surname>Kennedy</surname>
          </string-name>
          ,
          <article-title>Relational autoencoder for feature extraction</article-title>
          , in: 2017
          <source>International Joint Conference on Neural Networks</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Sakurada</surname>
          </string-name>
          , T. Yairi,
          <article-title>Anomaly detection using autoencoders with nonlinear dimensionality reduction</article-title>
          ,
          <source>in: Proc. of the MLSDA 2014 2nd Workshop on Machine Learning for Sensory Data Analysis</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>L.</given-names>
            <surname>Gondara</surname>
          </string-name>
          ,
          <article-title>Medical image denoising using convolutional denoising autoencoders</article-title>
          ,
          <source>in: IEEE International Conference on Data Mining Workshops</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>L.</given-names>
            <surname>Pasa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Sperduti</surname>
          </string-name>
          ,
          <article-title>Pre-training of recurrent neural networks via linear autoencoders</article-title>
          ,
          <source>in: Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems</source>
          <year>2014</year>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Q. V.</given-names>
            <surname>Le</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ranzato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Monga</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Devin</surname>
          </string-name>
          , G. Corrado,
          <string-name>
            <given-names>K.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Dean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. Y.</given-names>
            <surname>Ng</surname>
          </string-name>
          ,
          <article-title>Building high-level features using large scale unsupervised learning</article-title>
          ,
          <source>in: Proceedings of the 29th International Conference on Machine Learning</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Vincent</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Larochelle</surname>
          </string-name>
          , I. Lajoie,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Manzagol</surname>
          </string-name>
          ,
          <article-title>Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion</article-title>
          ,
          <source>J. Mach. Learn. Res</source>
          . (
          <year>2010</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M. R.</given-names>
            <surname>Min</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. A.</given-names>
            <surname>Stanley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Yuan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. J.</given-names>
            <surname>Bonner</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z. Zhang,</surname>
          </string-name>
          <article-title>A deep non-linear feature mapping for large-margin knn classification</article-title>
          ,
          <source>in: ICDM</source>
          <year>2009</year>
          ,
          <source>The Ninth IEEE International Conference on Data Mining</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>I. J.</given-names>
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Shlens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Szegedy</surname>
          </string-name>
          ,
          <article-title>Explaining and harnessing adversarial examples</article-title>
          ,
          <source>in: 3rd International Conference on Learning Representations</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>N. N.</given-names>
            <surname>Dalvi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. M.</given-names>
            <surname>Domingos</surname>
          </string-name>
          , Mausam,
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Sanghai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Verma</surname>
          </string-name>
          ,
          <article-title>Adversarial classification</article-title>
          ,
          <source>in: Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>C.</given-names>
            <surname>Szegedy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Zaremba</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Sutskever</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Bruna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Erhan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I. J.</given-names>
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Fergus</surname>
          </string-name>
          ,
          <article-title>Intriguing properties of neural networks</article-title>
          ,
          <source>in: 2nd International Conference on Learning Representations</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>G.</given-names>
            <surname>Katz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. W.</given-names>
            <surname>Barrett</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. L.</given-names>
            <surname>Dill</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Julian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Kochenderfer</surname>
          </string-name>
          ,
          <string-name>
            <surname>Reluplex:</surname>
          </string-name>
          <article-title>An eficient SMT solver for verifying deep neural networks</article-title>
          , in: Computer Aided Verification - 29th
          <source>International Conference</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>L. M. de Moura</surname>
          </string-name>
          , N. Bjørner,
          <article-title>Z3: an eficient SMT solver, in: Tools and Algorithms for the Construction and Analysis of Systems</article-title>
          , 14th International Conference,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>B.</given-names>
            <surname>Böing</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Roy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Müller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Neider</surname>
          </string-name>
          ,
          <article-title>Quality guarantees for autoencoders via unsupervised adversarial attacks</article-title>
          ,
          <source>in: Machine Learning and Knowledge Discovery in Databases - European Conference, ECML PKDD</source>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>L. M. de Moura</surname>
          </string-name>
          , N. Bjørner,
          <article-title>Satisfiability modulo theories: introduction and applications, Commun</article-title>
          . ACM (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>