<!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>
      <journal-title-group>
        <journal-title>Workshop on Artificial Intelligence and Formal Verification, Logics, Automata and Synthesis (OVERLAY),
September</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Adversarial Learning of Robust and Safe Controllers for Cyber-Physical Systems</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luca Bortolussi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesca Cairoli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ginevra Carbone</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Franchina</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Mathematics and Geoscience, University of Trieste</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Modelling and Simulation Group, Saarland University</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <volume>25</volume>
      <issue>2020</issue>
      <fpage>81</fpage>
      <lpage>85</lpage>
      <abstract>
        <p>We introduce a novel learning-based approach to synthesize safe and robust controllers for autonomous Cyber-Physical Systems and, at the same time, to generate challenging tests. This procedure combines formal methods for model verification with Generative Adversarial Networks. The method learns two Neural Networks: the first one aims at generating troubling scenarios for the controller, while the second one aims at enforcing the safety constraints. We test the proposed method on a variety of case studies.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>defender, which in turn tries to learn how to face them without violating some safety constraints. The
outcome of this training procedure is twofold: on one side we get a robust controller, whereas on the other
we get a generator of adverse tests.</p>
      <p>
        The learned controller is a black-box device that should be able to deal with adverse or unobserved
scenarios, but that does not provide worst-case guarantees. In this regard one could additionally rely on a
shield-based approach, as proposed in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Problem Statement</title>
      <p>
        Safety of a system is guaranteed by the satisfaction of a set of requirements. Checking the satisfiability
of properties in hybrid systems, where both discrete and continuous components are involved, is often
too computationally complex or undecidable [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]; this especially holds true in the presence of stochastic
components. A popular approach to mathematically express safety requirements is by means of Signal
Temporal Logic (STL) [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Temporal logic is a logical formalism used in the context of formal verification
to formalize the behaviour in time of systems. It extends propositional logic with a set of modal operators
capturing the temporal properties of events [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. STL, in particular, deals with properties of continuous-time
signals [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] (i.e. multivariate time series), featuring time-bounded since and until modal operators. In our
application, we rely on STL quantitative semantics, which returns a real valued measure of satisfiability
capturing how much the input signal can be shifted without changing the truth value. Such measure is
often referred to as robustness and is exploited in this work as the objective function of an optimization
problem.
      </p>
      <p>
        We model the interaction of an agent with an adversarial environment as a zero-sum game, similarly
to the strategy behind GANs [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The concept of zero-sum game is borrowed from game theory and
denotes those situations in which one player’s gain is equivalent to another’s loss. In such situations, the
best strategy for each player is to minimize its loss, while assuming that the opponent is playing at its
best. This concept is known in literature as minmax strategy. In practice, we use GAN architectural and
theoretical design to reach two main objectives: a controller, that safely acts under adverse conditions,
and an attacker, which gains insights about troubling scenarios for the opponent.
      </p>
      <p>Agent-Environment Model. Due to coexistence of continuous and discrete components, CPSs are
typically represented as hybrid models: the continuous part is represented by differential equations that
describe the behaviour of the plant; the discrete part, instead, identifies the possible states of the controller.
We decompose our model in two interacting parts: the agent a and the environment e. Both of them are
able to observe at least part of the whole state space S, i.e. they are aware of some observable states
O ⊂ S. By distinguishing between the observable states of the agent Oa ⊆ O and of the environment
Ob ⊆ O, we are able to force uneven levels of knowledge between them.</p>
      <p>Let Ua and Ue be the spaces of all possible actions for the two components. We discretize the
evolution of the system as a discrete-time system with step Δt, which evolves according to a function
ψ : S × Ua × Ue × R −→ S. By taking control actions at fixed time intervals of length Δt, we obtain a
discrete evolution of the form si+1 = si + ψ(si, uia, uie, ti), where ti := t0 + i · Δt, ui := u(ti) and si := s(ti).
Therefore, we are able to simulate the entire evolution of the system over a time horizon H via ψ and to
obtain a complete trajectory ξ = s0 . . . sH−1 in the state space.
Optimization strategy. The proposed framework builds on GAN architectural design, in which two
NNs compete in a minmax game to reach opposite goals. One network, denoted by A, represents the
attacker, while the other, denoted by D, represents the defender. The aim of the former is to generate
environment configurations in which the defender is not able to act safely, whereas, the latter tries to keep
the CPS as safe as possible. In practice, the defender D can be interpreted as a controller for the agent.
The safety requirement is expressed as a Signal Temporal Logic formula Φ over a finite time horizon H.
We are leveraging the notion of robustness in quantitative semantics to measure the satisfiability of the
STL property and to determine how safe the system is in a given configuration. We denote robustness
as a function RΦ : SH → R, measuring the maximum shift that can be applied to a given trajectory
ξ = s0 . . . sH−1 without violating the requirements of Φ. It is straightforward to use this measure as the
objective function in the minmax game. When the system is in a state s0, the evolution of ξ is obtained
by evaluating ψ at time steps ti = t0, . . . , tH−1 over two sequences of actions ua = (u0a, . . . , uaH−1) and
ue = (ue0, . . . , ueH−1). We introduce two policy functions, ΠA for the attacker and ΠD for the defender, with
the aim of reducing the output dimension. The two policies ΠA : ΘA × R → Ue and ΠD : ΘD × R → Ua
are represented by a finite set of basis functions of time, with coefficients given by the output of the
networks; in this work they are polynomial functions. For example, ΠA can encode the output θA of
network A as a polynomial function of degree dA
and the resulting ue(t) is evaluated at each time step, from t0 to tH−1, to produce the desired sequence
of actions ue. The same reasoning holds for ΠD and ua. These policies have the benefit of producing a
smoothing of the chosen actions, that prevents incoherent behaviours at subsequent instants.</p>
      <p>Let wA be the weights of the attacker’s network A and wD the weights of the defender’s network
D. The formalism introduced by the two policies transfers the problem of finding the best sequences of
actions, ua and ue, to that of finding the best networks’ parameters, wD and wA. The minmax game can
now be expressed in terms of the loss function L (wA, wD) = −RΦ(s0, wD, wA) as
min max L (wA, wD).</p>
      <p>wD wA</p>
      <p>In this setting, the defender aims at generating safe actions by tuning its weights in favour of a loss
minimization (i.e. robustness maximization). The attacker, instead, aims at generating troubling scenarios
for the opponent by maximizing the loss (i.e., minimizing the robustness).
3</p>
    </sec>
    <sec id="sec-3">
      <title>Experimental Results</title>
      <p>
        Car platooning. A platoon [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is a group of vehicles travelling together very closely and safely. This
problem is usually faced with techniques that coordinate the actions of the entire pool of vehicles as a single
entity [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This approach, though, requires specific hardware and a distributed system of coordination
that might be difficult to realise in complex scenarios. Our method, instead, builds a robust controller for
individual decision-making, hence it fits into the autonomous driving field. In this setting, we assume that
all vehicles are equipped with an hardware component called LIDAR scanner, which is able to measure
the distance between two cars by using a laser beam.
Training and Testing. Platooning involves n cars that can only move forward along a straight line.
We first consider the simple case of two cars, one leader l and one follower f , whose internal states
are position x, velocity v and acceleration a. The follower f acts as the agent of this system, while the
leader l is considered to be part of the environment, representing for instance a cyber-attack scenario.
They have the same observable states oa = oe = (vl, vf , d), given by their velocities and by their relative
distance d. The policy functions ΠA and ΠD output the accelerations ua = (af ) and ue = (al), which
are used to update the internal states of both cars. We describe the dynamic of a car with mass m
and velocity v as m ddvt = main − νmg, where ain is the input acceleration provided by one of the two
policies, ν is the friction coefficient and g is the gravity constant. We impose the STL requirement
Φ = globally(d ≤ dmax ∧ d ≥ dmin) on the distance d = xl − xf between the two vehicles, where dmin and
dmax are the minimum and maximum distances allowed. Note that the globally operator forces the STL
condition to hold for the whole trajectory of the car.
      </p>
      <p>Results. Car platooning problem trivially extends to the case of n cars, where the first one is the
leader and each of the other cars simply follows the one in front. Our simulations start from an initial
configuration of equispaced vehicles, thus the first couple of subsequent cars acts as described in the
two-cars model, while the other followers are controlled by copies of the same defender’s network.</p>
      <p>This model has been tested in four different adverse configurations. The leader in Figure 1 acts
according to the attacker’s policy, with sudden accelerations and brakes, and all followers are able to
manage the unpredictable behaviour of the attacker by maintaining their relative distances within the
safety range. We ran 10k simulations of different trajectories for each possible scenario. At each time step
we computed the total percentage of safe trajectories and 100% of them achieved positive robustness.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>Classical control theory fails in giving adequate safety guarantees in many complex real world scenarios.
New reinforcement learning techniques aim at modelling the behaviour of complex systems and learning
optimal controllers from the observed data. Therefore, they are particularly suitable for stochastic optimal
control problems where the transition dynamics and the reward functions are unknown. We proposed a
new learning technique, whose architecture is inspired by Generative Adversarial Networks, and tested its
full potential against the vehicle platooning problem. Our approach has been able to enforce safety of the
model, while also gaining insights about adverse configurations of the environment. As future work, we
plan to test more scenarios and investigate the scalability of this approach. We also plan to extend this
control synthesis strategy to stochastic hybrid systems.1</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>K.</given-names>
            <surname>Arulkumaran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. P.</given-names>
            <surname>Deisenroth</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Brundage</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Bharath</surname>
          </string-name>
          .
          <article-title>A brief survey of deep reinforcement learning</article-title>
          .
          <source>arXiv preprint arXiv:1708.05866</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>G.</given-names>
            <surname>Avni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Bloem</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Chatterjee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. A.</given-names>
            <surname>Henzinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Könighofer</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Pranger</surname>
          </string-name>
          .
          <article-title>Run-time optimization for learned controllers through quantitative games</article-title>
          .
          <source>In International Conference on Computer Aided Verification</source>
          , pages
          <fpage>630</fpage>
          -
          <lpage>649</lpage>
          . Springer,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>L.</given-names>
            <surname>Banjanovic-Mehmedovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Butigan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Mehmedovic</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Kantardzic</surname>
          </string-name>
          .
          <article-title>Hybrid automaton based vehicle platoon modelling and cooperation behaviour profile prediction</article-title>
          .
          <source>Tehnicki vjesnik - Technical Gazette</source>
          ,
          <volume>25</volume>
          (
          <issue>3</issue>
          ),
          <year>Jun 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>I.</given-names>
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pouget-Abadie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mirza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Warde-Farley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ozair</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Courville</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          .
          <article-title>Generative adversarial nets</article-title>
          .
          <source>In Advances in neural information processing systems</source>
          , pages
          <fpage>2672</fpage>
          -
          <lpage>2680</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>V.</given-names>
            <surname>Goranko</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Rumberg</surname>
          </string-name>
          .
          <article-title>Temporal logic</article-title>
          . In E. N. Zalta, editor,
          <source>The Stanford Encyclopedia of Philosophy</source>
          . Metaphysics Research Lab, Stanford University, spring
          <year>2020</year>
          edition,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S.</given-names>
            <surname>Howes</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Mohler</surname>
          </string-name>
          , and
          <string-name>
            <given-names>N.</given-names>
            <surname>Bolf</surname>
          </string-name>
          .
          <article-title>Multivariable identification and pid/apc optimization for real plant application</article-title>
          .
          <source>In ACHEMA-World Forum and Leading Show for the Process Industries</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>D.</given-names>
            <surname>Jia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , and
          <string-name>
            <given-names>X.</given-names>
            <surname>Shen</surname>
          </string-name>
          .
          <article-title>A survey on platoon-based vehicular cyber-physical systems</article-title>
          .
          <source>IEEE Communications Surveys &amp; Tutorials</source>
          ,
          <volume>18</volume>
          (
          <issue>1</issue>
          ):
          <fpage>263</fpage>
          -
          <lpage>284</lpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>O.</given-names>
            <surname>Maler</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Nickovic</surname>
          </string-name>
          .
          <article-title>Monitoring temporal properties of continuous signals</article-title>
          . In Y. Lakhnech and S. Yovine, editors,
          <source>Formal Techniques, Modelling and Analysis of Timed and Fault-Tolerant Systems, Joint International Conferences on Formal Modelling and Analysis of Timed Systems, FORMATS 2004</source>
          and
          <article-title>Formal Techniques in Real-Time and</article-title>
          <string-name>
            <surname>Fault-Tolerant</surname>
            <given-names>Systems</given-names>
          </string-name>
          ,
          <string-name>
            <surname>FTRTFT</surname>
          </string-name>
          <year>2004</year>
          , Grenoble, France,
          <source>September 22-24</source>
          ,
          <year>2004</year>
          , Proceedings, volume
          <volume>3253</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>152</fpage>
          -
          <lpage>166</lpage>
          . Springer,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>V.</given-names>
            <surname>Mnih</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kavukcuoglu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Silver</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Rusu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Veness</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. G.</given-names>
            <surname>Bellemare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Graves</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Riedmiller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. K.</given-names>
            <surname>Fidjeland</surname>
          </string-name>
          , G. Ostrovski,
          <string-name>
            <given-names>S.</given-names>
            <surname>Petersen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Beattie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Sadik</surname>
          </string-name>
          , I. Antonoglou,
          <string-name>
            <given-names>H.</given-names>
            <surname>King</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kumaran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Wierstra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Legg</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Hassabis</surname>
          </string-name>
          .
          <article-title>Human-level control through deep reinforcement learning</article-title>
          .
          <source>Nature</source>
          ,
          <volume>518</volume>
          (
          <issue>7540</issue>
          ):
          <fpage>529</fpage>
          -
          <lpage>533</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>X.</given-names>
            <surname>Zheng</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Julien</surname>
          </string-name>
          .
          <article-title>Verification and validation in cyber physical systems: Research challenges and a way forward</article-title>
          .
          <source>In 2015 IEEE/ACM 1st International Workshop on Software Engineering for Smart Cyber-Physical Systems, page 15-18</source>
          . IEEE, May
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <article-title>1This work has been partially supported by the PRIN project “SEDUCE” n</article-title>
          .
          <year>2017TWRCNB</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>