<!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>Context Aware Software Stacks for Mobility</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Composive.ai Overview</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Burak Saglam Eteration Istanbul</institution>
          ,
          <country country="TR">Turkey</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Deniz Memis Eteration Istanbul</institution>
          ,
          <country country="TR">Turkey</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Naci M. Dai Eteration Istanbul</institution>
          ,
          <country country="TR">Turkey</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>-Humans are very good at adapting to and driving in very different conditions and environments. Complex AI based software such as Autonomous vehicles (AV) are biased by the training data and they do not do well in different contexts. Environment perception and context awareness can be used to adapt and deploy complex networks of AI systems that are expected to perform safely on many different environments and edge cases. Typical Autonomous Drive (AD) software stacks provide localization, object detection and tracking using an array of sensor data. Additional sources of information such as V2X connectivity, passenger behavior, person-to-device mapping, urban context, degradation of traffic etc. complements the sensor data that can be used to describe a context. This context is used to predict and adapt the system of software and applications that are deployed to the vehicle. Context Aware Software Stack for Mobility (CASSM) describes a model based approach for definition of a software stack for complex systems such as those found in autonomous vehicles. Machine Learning is used to detect a context and adapt the software stack, which can then be used to identify and deploy services to autonomous vehicles. CASSM will be an open source in-vehicle delivery of context-driven services and applications. This paper describes an architecture to define context-aware personalized &amp; dynamically provisioned capabilities, applications &amp; services to autonomous vehicles. Index Terms-Autonomous Vehicles, Context Awareness, Adaptive Software Stacks, Machine Learning</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>Experienced human drivers are good at adapting to different
driving conditions and environments. They can instinctively
transfer their earlier learning to the current driving context.
The advent of big data and availability of computing allowed
statistical deep learning methods to power innovation in many
applications including AD. AD software are complex systems
of various interconnected AI and deterministic modules. These
software do very well in the context that they are designed
and trained for, but perform poorly in other environments.
Starting with Darpa challenges, statistical learning methods
have been used in implementing very successful AD software.
The quality of these solutions depend on their statistical
models and the big data that is used to train them. These
systems are very good at learning, perceiving and adapting
to the environment. These cars can successfully, and safely
drive on highways and in the cities, interacting with the
environment, the traffic, other cars and pedestrians.</p>
      <p>
        There are still many challenges to this learning process as
huge learning data leads to many difficult to explain biases
and edge cases where the algorithms come up with unexpected
results. Deep neural networks learn from the data to cleanly
separate the dataspace for the intrinsic dimensionality (nicely
demonstrated by Colah’s Neural Networks, Manifolds and
Topology [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]), and require careful engineering and modelling
to do this efficiently. These systems have very little or no
contextual capability, or ability to abstract knowledge or
reason about the drive [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. DARPA recently announced the
Next AI challenge, and is focusing its investments on a third
wave of AI that brings forth machines that understand and
reason in context [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] (See Fig.1.).
      </p>
      <p>The Contextual Adaptation means the systems construct
explanatory models for classes of real world phenomena and
the explanations and the context can be used to adapt both
the learning models and in our case the overall AD software
stack.</p>
      <p>Fig. 1. DARPA - The Next Wave of AI (Figure Adapted from John
Launchbury)</p>
      <p>Humans are very successful at understanding the context
such as parking, urban driving, or driving fast on a highway,
abstracting experiences and transferring ideas and reacting
appropriately. However, for AD software the design,
capabilities, sensors and actions taken for these contexts can differ
significantly. Even urban driving in a well organized city
versus a city with narrow streets (i.e. Istanbul) will require
training with completely different datasets, probably using
different models.</p>
      <p>
        We can define the context as the set of all the inputs from the
sensors, and additional inputs from the environment, people’s
behavior, even if they are not used in the AD stack. The action
of driving takes place and all these inputs interact with the
system and change its behavior. It involves the driver, the
vehicle physics, its parts, brakes, steering, mechanical
components, the weather condition, the destination etc.
Contextawareness means that a service, although given the same
request parameters, is perceived differently with respect to a
given context [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In autonomous driving context-awareness
means, (1) Semantics and modelling the context for which
AD software is trained and designed for and (2) Using the
information about the context to adapt how AD perceives,
predicts, and acts.
      </p>
      <p>II. CONTEXTUAL AI AND CONTEXT AWARENESS FOR</p>
      <p>AUTONOMOUS VEHICLES</p>
      <sec id="sec-1-1">
        <title>A. Contextual AI</title>
        <p>
          Contextual AI is focused on providing a service or
information to the user that is relevant to the acquired (explicit
or implicit) context information [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. This approach allows
contextually-aware systems to provide tailor-made services
and solutions under varying circumstances. There are mainly
four pillars to Contextual AI, based on these the system must
be [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]:
        </p>
        <p>Intelligible: Ability to explain what it knows, how it
knows and what it is doing.</p>
        <p>Adaptive: Ability to meet user’s needs and expectations
under varying environmental circumstances.</p>
        <p>Customizable: Ability to be controlled fully by the user.</p>
        <p>Context-aware: Ability to perceive at a human level.</p>
        <p>Even for the most successful AD software, its capabilities
are still bounded by its compatibility to the current context
and the constraints it was trained for, making such systems
heavily dependent on human intervention when it is faced with
individual cases where the inferences and plan fail.</p>
      </sec>
      <sec id="sec-1-2">
        <title>B. Explainable AI</title>
        <p>
          Like all other safety and sensitive applications of AI,
Explainability of AD software is strongly related to
contextawareness. AD software travelled successfully for billions of
kilometers but when they fail, the reasons are not easily
interpretable by a human. Interpreting and explaining is important
to gain trust into the prediction, and to identify potential data
selection biases or artefacts. We need to know when an AD
system is operating within the limits of its training. These
limits identify contexts that the AD is designed to safely and
reliably operate, and prevent dangerous inferences and outputs.
For example, if the perception system cannot classify the intent
of a cyclist, being able to explain why the input data led
to an incorrect calculation will help in the adaptation of the
underlying learning models. The explanations could be related
to the structure or models of the system, of single decisions or
cases, or generalize to the complete overall behavior. Samek et.
al [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. provide an extensive review of methods and applications
of some of the most recent advances in AI explanations.
        </p>
      </sec>
      <sec id="sec-1-3">
        <title>C. Context Awareness</title>
        <p>Numerous context-aware systems have been presented in
the literature, they albeit differ in the way context related
data is acquired and utilized; the main commonalities of these
systems’ structure could be listed as below:</p>
        <p>Acquiring information.</p>
        <p>Manipulating the information (filtering, compressing,
transforming) to contextually represent the system.
Interpreting the context.</p>
        <p>Distributing information based on the contextual
interpretation.</p>
        <p>
          In the AV domain, these systems have been utilized in a
variety of applications such as ”route planning and
learning [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]–[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], real time perception of traffic congestion [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ],
collision avoidance [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] and finding vacant car parks [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]”.
Considering these use cases that provide a service to the user
and above mentioned system characteristics there are two key
aspects relevant to context-awareness: First is the knowledge
acquired about the context of the service to be provided and
the second is to adjust the service to be contextually aware
considering the information within the context.
        </p>
        <p>
          The first absolute benefit of context-awareness for AV, as
is true for all autonomous systems, is adaptation [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
Adaptation implies modifying a service that will, given the same
parameters, yield a relevant distinguished output depending
on the context and the objective. This may include different
realizations such as refining or tracking other information,
invoking or inhibiting other services. The other and relatively
more sophisticated benefit compared to other autonomous
systems is proactivity, currently provided reactive services
work upon the invocation of the user (a pull type service), on
the other hand proactive services could deliver the information
without any explicit action required by the user. Furthermore,
these proactive services could keep delivering based on the
predicted outcome of future context [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>
          III. THE MODEL DRIVEN ADAPTIVE SOFTWARE STACK
Simon described means-end analysis with the notion of
adaptation, which is finding the difference between an existing
state and a desired state and then finding the correlating
process that will erase the difference [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ].
        </p>
        <p>Our work focuses on software systems that are amenable
to model-driven methods. It is possible to dynamically adapt
these models to better address a given context. A large
percentage of AD software is based on the Robot Operating
System (ROS). ROS has the concept of computational nodes
that can be connected with the data flowing between them.
Many AD implementations involve sensor data, and higher
level objects that are produced by sensor-fusion, prediction,
planning and control tasks that are implemented with ROS.
This is typically done with a code-first, development heavy
practice.</p>
        <p>
          RobMoSys attempts to address this difficulty by providing
standards for composable models and Software for Robotics
Systems. We are exploring RobMoSys model-driven approach
to define models for the proven ROS based open-source
AD frameworks such as Autoware [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ], Baidu Apollo [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
Refactoring existing systems as model-based software will
provide fast and effective feedback for the functionality and
also will prove the platform independence. The
metamodeldriven approach, that composes the building blocks (or a
combination of them) into various systems in a purposeful
way, the context detection models and algorithms (ROS nodes)
will be in use. According to context, these nodes will be
used to create a context-level metamodel and will enable other
nodes to be deployed and to be used.
        </p>
        <p>The contextual adaptation of an AD software stack would
change the active stack to better address the constraints and
trade-offs of the context. Each stack model is mapped to a
context that reflects the conditions of its training data. It is
conceivable that one can define an “uber” model that would
satisfy most contexts and there will be no need for adaptation,
but this is probably not achievable with today’s understanding.
Instead, we propose a pragmatic context-based adaptation
approach that will identify a context based on the inputs of the
system and dynamically change the software stack (a
modelbased computation graph) to satisfy the requirements in the
new context (See Fig.2. &amp; Fig.3.).
typical software stack like the ones used by Autoware (See
Fig.4.).</p>
        <p>
          In their work, they improve inferences by using the notions
of adapting the composer model and policy preferences.
Alternatively, MROS [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ] leverages the RobMoSys [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]
modelbased approach at runtime, to provide a solution for ROS2
systems, based on architectural self-adaptation driven by
ontology reasoning on the architecture models.
        </p>
        <p>Of course this approach is not limited to AD. The
applications in the mobility space exist in many different
domains. Connected cars and smart cities make use of cloud
based services and innovative human computer interactions.
The same context-based adaptation techniques can be applied
to model-based software applications in these domains. For
example, the service orchestrations based on BPMN-like flows
or component-based user interfaces that are amenable to
viewflow like structures would also benefit from this solution.
Composive.ai, will deliver our components and tools for
building adaptive software stacks as open-source software (See
Fig.5.).</p>
        <p>
          Similar approaches produced promising results for other
problems. Odena et.al [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] use reinforcement learning to
change model behavior at test-time. They use a composer
model, which consists of a set of modules and a controller
network. The composer network is a graph of deterministic and
stochastic nodes made of neural networks that are organized
into ‘metalayers’. The composer network is very similar to the
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>CONCLUSION</title>
      <p>State of the art AD software makes extensive use of
statistical learning methods with proven results. These applications
are typically limited by the context, size and quality of the
datasets that were used to train them. Contextual adaptivity
and reasoning is the natural next step for AI methods to get
closer to human like capabilities. In our project, Composive
Context Aware Software Stacks for Mobility, is a solution for
adapting model-driven complex autonomous systems (such as
AD). Composive will solve the adaptation problem by being
able to define a context and detecting the variations within the
defined context from a repository of pre-existing models using
a metamodel-driven approach, subsequently it will adapt and
deploy other context-driven services that are compatible with
the future contextual model.</p>
    </sec>
    <sec id="sec-3">
      <title>IV. ACKNOWLEDGMENTS This work is being partially funded by The Scientific and Technological Research Council of Turkey, TEYDEB 1509 grant.</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1] http://colah.github.io/posts/2014-03
          <string-name>
            <surname>-NN-</surname>
          </string-name>
          Manifolds-Topology/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Launcbury</surname>
          </string-name>
          , John,
          <source>A DARPA Perspective on Artificial Intelligence</source>
          ,
          <year>2017</year>
          https://youtu.be/-O01G3tSYpU
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>AI</given-names>
            <surname>Next Campaign</surname>
          </string-name>
          , https://www.darpa.
          <article-title>mil/work-with-us/ai-nextcampaign</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Pichler</surname>
          </string-name>
          , Mario et al. ”
          <article-title>Context-awareness and artificial intelligence”</article-title>
          .
          <source>O¨ GAI Journal 23</source>
          . (
          <year>2004</year>
          ):
          <fpage>4</fpage>
          -.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Contextual</surname>
            <given-names>AI</given-names>
          </string-name>
          :
          <source>The Next Frontier of Artificial Intelligence</source>
          ,https://blog.adobe.com/en/2019/04/09/contextual-ai
          <article-title>-thenext-frontier-of-artificial-intelligence</article-title>
          .
          <source>htmlgs.ytw2bv</source>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>W</given-names>
            <surname>Samek</surname>
          </string-name>
          , G Montavon,
          <string-name>
            <given-names>S</given-names>
            <surname>Lapuschkin</surname>
          </string-name>
          ,
          <string-name>
            <surname>C Anders</surname>
          </string-name>
          , KR Mu¨ller,
          <source>Explaining Deep Neural Networks and Beyond: A Review of Methods and Applications Proceedings of the IEEE</source>
          ,
          <volume>109</volume>
          (
          <issue>3</issue>
          ):
          <fpage>247</fpage>
          -
          <lpage>278</lpage>
          ,
          <year>2021</year>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Younes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Boukerche</surname>
          </string-name>
          , and
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Rom'an-Alonso, “An intelligent path recommendation protocol (ICOD) for VANETs,”</article-title>
          <string-name>
            <surname>Comput. Netw.</surname>
          </string-name>
          , vol.
          <volume>64</volume>
          , pp.
          <fpage>225</fpage>
          -
          <lpage>242</lpage>
          , May
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M. B.</given-names>
            <surname>Younes</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Boukerche</surname>
          </string-name>
          , “
          <article-title>A performance evaluation of a contextaware path recommendation protocol for vehicular ad-hoc networks,”</article-title>
          <source>in Proc. IEEE Global Telecommun. Conf. (GLOBECOM)</source>
          ,
          <year>Dec</year>
          .
          <year>2013</year>
          ,
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Masikos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Demestichas</surname>
          </string-name>
          , E. Adamopoulou, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Theologou</surname>
          </string-name>
          , “
          <article-title>Energy-efficient routing based on vehicular consumption predictions of a mesoscopic learning model</article-title>
          ,
          <source>” Appl. Soft Comput.</source>
          , vol.
          <volume>28</volume>
          , pp.
          <fpage>114</fpage>
          -
          <lpage>124</lpage>
          , Mar.
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>J.</given-names>
            <surname>Liu</surname>
          </string-name>
          et al., “
          <article-title>High-efficiency urban-traffic management in context-aware computing and 5G communication,” IEEE Commun</article-title>
          . Mag., vol.
          <volume>55</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>34</fpage>
          -
          <lpage>40</lpage>
          , Jan.
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>B.</given-names>
            <surname>Kihei</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Copeland</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Chang</surname>
          </string-name>
          , “
          <article-title>Automotive Doppler sensing: The Doppler profile with machine learning in vehicle-to-vehicle networks for road safety,”</article-title>
          <source>in Proc. IEEE Workshop Signal Process. Adv. Wireless Commun</source>
          .
          <source>(SPAWC)</source>
          ,
          <year>Jul</year>
          .
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>A.</given-names>
            <surname>Alhammad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Siewe</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A</given-names>
            .
            <surname>Al-Bayatti</surname>
          </string-name>
          , “
          <article-title>An infostation-based context-aware on-street parking system,”</article-title>
          <source>in Proc. Int. Conf. Comput. Syst. Ind. Inform. (ICCSII)</source>
          ,
          <year>Dec</year>
          .
          <year>2012</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Pichler</surname>
            ,
            <given-names>Mario</given-names>
          </string-name>
          <string-name>
            <surname>Bodenhofer</surname>
            ,
            <given-names>Ulrich</given-names>
          </string-name>
          <string-name>
            <surname>Schwinger</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          . (
          <year>2014</year>
          ).
          <article-title>Contextawareness and artificial intelligence</article-title>
          .
          <source>O¨GAI Journal</source>
          .
          <volume>23</volume>
          .
          <fpage>4</fpage>
          -.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <source>[14] Sciences of the Artificial, Herbert Simon</source>
          ,
          <year>1996</year>
          , MIT Press
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Autoware</surname>
          </string-name>
          Foundation - https://www.autoware.org/
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Apollo</surname>
          </string-name>
          Auto - https://apollo.auto/
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Augustus</surname>
            <given-names>Odena</given-names>
          </string-name>
          , Dieterich Lawson, Christopher Olah -
          <article-title>Changing Model Behavior at Test-Time using Reinforcement Learning</article-title>
          , Workshop track - ICLR
          <year>2017</year>
          https://arxiv.org/pdf/1702.07780.pdf
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>[18] https://robmosys.eu/mros/</mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19] https://robmosys.eu
          <source>Composable Models and Software for Robotics Systems</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>