<!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>
      <article-id pub-id-type="doi">10.1007/s10462</article-id>
      <title-group>
        <article-title>Supporting Impaired People with a Following Robotic Assistant by means of End-to-End Visual Target Navigation and Reinforcement Learning Approaches</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nguyen Ngoc Dat</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Valerio Ponzi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Samuele Russo</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Vincelli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer, Control and Management Engineering, Sapienza Univerisity of Rome</institution>
          ,
          <addr-line>00185 Rome</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Psychology, Sapienza University of Rome</institution>
          ,
          <addr-line>via dei Marsi 78 Roma 00185</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <volume>3092</volume>
      <fpage>0000</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>We present an improvement in visual object tracking and navigation for mobile robot implementing the advantage actorcritic (A2C) reinforcement learning architecture on top of the Gym-Gazebo framework. This work provides an easier way to integrate reinforcement learning algorithms for navigation and object tracking tasks in robotics field. We train the convolutional-recurrent model employed for the policy estimation in an end-to-end manner. The robot is able to follow a simulated human walking in an indoor environment by using the sequence of images provided by the robot camera. The input of the algorithm is acquired and processed directly in ROS-Gazebo environment. The policy learned by the robot agent proved to generalize well also in an environment with diferent size and shape with respect to the training one. Moreover, the policy allows the robot to avoid obstacles while following the tracking target. Thanks to these improvements, we can straightforwardly apply the tracking system in a real world robot for a person following task in indoor environments.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Visual Object Tracking</kwd>
        <kwd>Human Tracking</kwd>
        <kwd>Person Following</kwd>
        <kwd>Human Robot Interaction</kwd>
        <kwd>ROS</kwd>
        <kwd>Gazebo</kwd>
        <kwd>Gym-Gazebo</kwd>
        <kwd>Visual Navigation</kwd>
        <kwd>Reinforcement Learning</kwd>
        <kwd>Advantage Actor Critic</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        nition, information retrieval, automation and control. tion of the input frames. It fuses past recurrent states
The tracking procedure finds itself in many applications with current visual features to make predictions of the
like mobile robotics, solar forecasting, particle tracking target object’s movements along the input sequence of
in microscopy images, biological applications, surveil- frames over time. We employed an end-to-end algorithm
lance, to cite the most common ones [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ]. Much of that allows the model to be trained to maximize tracking
the existing work related to object tracking is on passive performance in the long run. This procedure uses
backtracker, where it is assumed that the object of interest is propagation to train the neural network components and
always in the image scene, and there is no need to handle of-policy actor-critic reinforcement learning algorithm
camera control during tracking. This approach is not [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to train the policy network. Recent research in
visuitable for some use-cases, e.g., the tracking performed sual object tracking relies on game engines as simulation
by a mobile robot with a camera mounted or by a drone. environment to perform training of the neural network
For such applications, one should seek a solution to ap- models to be then applied on physical robotic platform
proach active tracking, which unifies the two sub-tasks, and real-world environments. We notice that game
eni.e., the object tracking and the camera control. In the gines are not suitable for mobile robot applications, such
passive tracker approach, it is dificult to jointly tune the as the person following the task considered in this work.
pipeline with the two separate sub-tasks. The tracking Game engines only allow to control the camera position
task may also involve many human eforts for bounding and orientation, without caring about how to control
box labeling. Moreover, the implementation of camera the robot motion and navigation in response to tracking
control is non-trivial and can incur many expensive trial- outputs, since the game engine does not have any robot
and-errors system tuning in the real-world, as shown hardware APIs. For this reason, our approach relies on
in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Active object tracking additionally considers a simulation environment based on ROS/Gazebo
framecamera control compared with traditional object tracking. work for the training process, providing suitable APIs
There exists not much research focus in this approach to deal with camera control by navigation of the robotic
for visual object tracking so far. platform carrying the camera sensor. Our main target
is teaching the mobile manipulator TIAGo, from PAL
Robotics, to follow a human target, while walking in an
2. Related Works indoor environment, for assistance and health-care task.
TIAGo robot and the human tracking target are modeled
Despite the success of traditional trackers based on low- in Gazebo 3D simulator. A sequence of images, acquired
level, hand-crafted features, models based on deep con- by robot camera sensor, is passed as input to the
observolutional neural network (CNN) have dominated recent
visual tracking research. The success of these models evnactioodnesenthcoedteerm; pthoreanl cthoreresleaqtuioenncoef eenxtcroadcetredcofelaletcutrse
arenpdlargely depends on the capability of CNN to learn a good resentation; after these steps, the advantage actor-critic
feature representation for the tracking target. Unfor- (A2C) RL of-policy algorithm is used to optimize the
actunately, for a busy scene with occluding objects, this tor and critic networks through policy gradient and value
approach can fail to find long-term temporal correlations loss and the output of reinforcement learning algorithm
expressing target motion along diferent frames. In this is then used to sample the new action which the robot
work we explore and investigate a more general strat- has to perform to follow the human trajectory.
egy to develop a novel visual tracking approach based Target-driven visual navigation is a relatively new task
on reinforcement learning and convolutional recurrent in the field of robotics research. Only recently,
end-tonetworks. The major intuition behind this method is that, end systems have been specifically developed to address
during the active tracking process, the historical visual this problem. A possible naive approach could be to use
semantics and tracking proposals encode pertinent in- a classic map-based navigation algorithm along with an
formation for future predictions. Such features require image or object recognition model.
continuous and accurate predictions in both spatial and To overcome these limits, map-less methods, which try to
temporal domain over a long period of time, thus de- solve the problem of navigation and target approaching
manding for a novel network architecture design as well jointly, have been proposed [
        <xref ref-type="bibr" rid="ref10">10, 11</xref>
        ]. These systems, like
as proper training algorithms. We formulate the visual ours, do not build a geometric map of the area, instead,
tracking problem as a sequential decision-making pro- they implicitly acquire the minimum knowledge of the
cess and explored a novel framework, referred to as Deep environment necessary for navigation. This is done by
RL Tracker (DRLT). The latter processes video frames as direct mapping visual inputs to motion, i.e. pixels to
aca whole and directly outputs actions to make the camera tions. The DRL framework proves very promising for
able to follow the target in each frame. Our model in- this purpose. In deep reinforcement learning and
agenttegrates convolutional network with recurrent network based models, a reward function is defined based on the
(Figure 2), and builds up a spatial-temporal representa- robot’s perceived state and performed actions. The robot
learns sequential decision making to accumulate more tor) can be reproduced. As described in the previous
rewards while in operation. The overall problem is typi- chapter, the task of the project is the development and
cally formulated as a Markov decision process (MDP) and the improvement of a visual object tracking system
althe optimal action-state rules are learned using dynamic lowing to actively track a human walking in an indoor
programming techniques. These methods are attractive environment in an end-to-end manner by means of an
because they do not require supervision and they imitate actor-critic RL algorithm. To avoid the potential issues
the natural human learning experience. However, they about the diferent operative systems running on our
require complex and lengthy learning processes. DRL machines, the continuous update of dependencies and
for Robotic Applications and Visual Navigation RL is be- deprecated packages, which can prove troublesome for
coming popular in recent times. In [12] it is proposed developing while using a Robot Operating System (ROS)
a solution to the navigation problem of nonholonomic code-base, a Docker container has been built to develop,
mobile robots with continuous control based on deep-RL. run, manage and sync the modules building up the whole
Moreover, training the robot for the motion task in a project (refer to paragraph 3.1) The Gazebo was chosen
virtual environment allows to speed up the learning and as a simulation environment since it can plugin directly
generalization process and also avoid the costs and risks to the ROS framework. Robot simulation is an essential
of a trial and error learning approach in the real-world tool in every robotics toolbox. A well-designed simulator
setup. Equipped with deep ConvNets, RL shows impres- makes it possible to rapidly test algorithms, design robots,
sive successes on visual tracking tasks as shown also in perform regression testing, and train AI systems using
[13]. However, they are distinct from this work, as they realistic scenarios. For the integration of RL algorithm
do not formulate the tracking procedure in an end-to-end in ROS/Gazebo framework we relied on Gym-Gazebo,
manner and do not consider camera controls. A further a toolkit which extends the OpenAI Gym for robotics,
step towards generalization is taken by [14], which intro- providing diferent learning techniques and algorithms
duces a framework that integrates a deep neural network to be compared using the same virtual conditions.
based object recognition module. With this module, the
agent can identify the target object regardless of where 3.1. Docker
the photo of that object is taken. However, it is still
trained or fine-tuned in the same environments where
it is tested. Therefore, it is still not able to generalize to
unseen scenarios.
      </p>
      <p>Docker is a software platform that allows one to build,
test, and deploy applications quickly. Docker packages
software into standardized units called containers that
have everything the software needs to run including
libraries, system tools, code, and runtime. We
man3. System set-up and simulation aged to build a complex Docker container, requiring
environment to sync many packages and tools that are dependent
to each other. For instance, TIAGo robot ROS package
The first step in the development of this work consisted (tiago_public_ws) require ROS Melodic version, ROS
in the setup of a simulation environment in which the Melodic requires Python v2.7 ; about the RL module,
GymTIAGo robot model and a walking human model (ac- Gazebo requires PyTorch machine learning framework</p>
      <sec id="sec-1-1">
        <title>ROS Melodic</title>
      </sec>
      <sec id="sec-1-2">
        <title>TIAGo APIs</title>
      </sec>
      <sec id="sec-1-3">
        <title>Gazebo</title>
      </sec>
      <sec id="sec-1-4">
        <title>Dependencies</title>
      </sec>
      <sec id="sec-1-5">
        <title>NVIDIA Docker</title>
      </sec>
      <sec id="sec-1-6">
        <title>Container</title>
      </sec>
      <sec id="sec-1-7">
        <title>Gym-Gazebo</title>
      </sec>
      <sec id="sec-1-8">
        <title>Gym Environment</title>
      </sec>
      <sec id="sec-1-9">
        <title>RL Framework</title>
      </sec>
      <sec id="sec-1-10">
        <title>Python 3.6v</title>
      </sec>
      <sec id="sec-1-11">
        <title>PyTorch 1.8.0v</title>
      </sec>
      <sec id="sec-1-12">
        <title>Actor-Critic architecture</title>
        <p>and PyTorch requires Python v3.6. Thus we need to setup packages. The main features of the ROS infrastructure
both python2 and python3 for adapting with the sys- are: Nodes. They are the executable processes that
partictem. Having an NVIDIA GPU available, we leverage the ipate in the communication. They can be programmed in
NVIDIA Container Toolkit that allows users to build and C ++ or Python. For this project, Python has been chosen
run GPU-accelerated Docker containers. for its speed and simplicity and the built-in integration
GPU-enabled applications need access to both kernel- with the PyTorch deep learning library. Topics. The
level device drivers and user-level CUDA libraries, and inter-process communication has a Publish/Subscribe
diferent applications may require diferent CUDA ver- model and the communication data are called Topics.
sions. One way to solve this problem is to install the They are the communication channels, defined by a
speGPU drivers inside the container and map the physical cific name and a single type of message that can be posted
NVIDIA GPU device on the underlying Docker host (e.g., to them. Nodes can subscribe to topics to receive the
in/dev/nvidia0) to the container. The problem with this formation published in them or publish information for
approach is that the version of the driver and libraries other nodes to receive it. Callbacks. They are the
ininside the container needs to precisely match. Otherwise, terruption service routines that are generated when a
the application will fail. In such a case, users still have node subscribed to a topic detects that something has
to worry about what drivers and libraries are installed been published on that channel. In this routine, the data
on each host computer to ensure compatibility with con- processing is done, such as saving the position of the
tainerized applications. robot in the callback generated by the topic where an
NVIDIA Docker, instead, provides driver-agnostic CUDA odometry sensor publishes the readings. Launch. A
images. This Docker plug-in enables GPU applications class of files that run and manage multiple nodes for the
running in containers to share graphic acceleration de- robot and its sensors, the simulation environment and
vices on the Docker host without worrying about version the data visualization software, such as Rviz or Gazebo
mismatches between libraries and device drivers. In par- simulator. They are encoded in XML format.
ticular, we employed the rocker toolkit [15] that, building URDF (Undefined Robot Description Format) . They
upon the nvidia-docker2 package, provides an easy are definition files of a robot. The links of the robot’s
way to run the docker container with graphic user inter- kinematic structure are connected to each other by joints.
face and GPU acceleration. The structure of the docker They also define the dynamic, kinematic, visual and
colcontainer is shown in detail in the diagram of Figure 2 lision properties of the robot. As launch files, they are
programmed in XML too.</p>
        <p>Gazebo is a simulator specifically designed for robotics.
3.2. ROS - Gazebo Its convenient design makes it possible to quickly test
ROS is a collection of libraries, drivers, and tools for the algorithms, robots and AI applications. In Gazebo all the
efective development and building of a robot systems. elements present in reality are simulated, the sensors and
It has a Linux-like command tool, an inter-process com- actuators act according to the environment. In this work,
munication system, and numerous application-related Gazebo has been used for the design of the virtual indoor
environment, where all the experiments with the TIAGo
robot are performed.</p>
        <sec id="sec-1-12-1">
          <title>Jetson TX2 Kit that guarantees power-eficient computing</title>
          <p>resources well fitting to deep learning applications.
3.3. TIAGo Robot</p>
        </sec>
        <sec id="sec-1-12-2">
          <title>To better fit our task of the person following via visual</title>
          <p>object tracking algorithm, we consider some robot
platforms, such as TIAGo and Turltebot. Diferently from
TIAGo, Turltebot provides with APIs, packages and open
source ROS plugins. However, we chose TIAGo robot
platform that, although it does not provide as many open
source APIs as Turltebot, it is a more advanced and
modern robot platform and its kinematic structure can better
adapt to our target. Since the aim of our work is to make
a mobile robot to be able to learn in an end-to-end
manner how to actively detect and track a person walking
in an indoor space, the height of TIAGo is more suitable
because the camera mounted on the head of the robot can
catch the full human body of the person to follow, thus
providing better input data to the reinforcement learning
algorithm. Moreover, the robot is a service robot
specifically designed to work in indoor environments, so our
application can be easily deployed on the real platform
and in the real world.</p>
          <p>Following the main components of the TIAGo robot are
described (see Figure 3).</p>
          <p>• The mobile base uses a diferential drive
system and has a maximum speed of 1 m/s. It is
designed for indoor operation. At the base is the
laser sensor that has a variable sensing distance
depending on the model (iron, steel or titanium),
between 5.6 meters and 25 meters. To detect what
lies behind the robot, there are 3 sonars of 1 meter
of detection.
• The body is the central part of the TIAGo robot
and is made up of the arm and torso. The torso
has a prismatic articulation that allows increasing
the height of the robot by 35cm. The arm has
7 degrees of freedom, a length of 87 cm in its
maximum extension, and a load capacity of 3kg.
3.4. Animated human model: actor
Gazebo simulator allows defining animated model (called
’actor’ in Gazebo) which is useful if one wants to have
entities following predefined paths in simulation
without being afected by the physics engine. They have a
3D visualization that can be seen by RGB cameras, and
3D meshes which can be detected by GPU based depth
sensors, so being suitable for computer vision
applications. A closed-loop trajectory is defined for each of the
considered train test cases. Additional plugin files are
used to control animations based on feedback from the
environment. Actors extend common models, adding
animation capabilities. There are two types of animations
that can be used separately or combined together:
• Skeleton animation, which is relative motion</p>
          <p>between links in one model;
• Motion along a trajectory, which carries all of
the actor’s links around the world, as one group;
PAL Robotics ofers diferent ROS packages and libraries
compatibility allowing TIAGo robot to perform complex
perception, navigation, manipulation and human-robot
interaction tasks. The platform is also equipped with a
• The head comprises the neck, having 2 DoF that
allow TIAGo to look in any direction. In the place Both types of motions can be combined to achieve a
skeleof the eyes, there is an RGB-D camera that pro- ton animation that moves in the world. Gazebo supports
vides color and depth images, being able to recre- two diferent skeleton animation file formats: COLLADA
ate the environments using point clouds. The (.dae) and Biovision Hierarchy (.bvh). The actor model
technology is the same as that used by the pop- defined in the project loads a COLLADA file described
ular Kinect cameras. In particular, the robot is within the &lt;skin&gt; tag. Sometimes, it is useful to
comequipped with a built-in Asus Xtion camera. bine diferent skins with diferent animations. Gazebo
allows one to take the skin from one file, and the
animation from another file, as long as they have compatible
skeletons. Scripted trajectories represent the high-level
animation type of actors, which consists of specifying a
series of poses to be reached at specific times. Gazebo
takes care of interpolating the motion between them so
the movement is fluid. The trajectory is defined inside
the .world file containing all the models which are
visualized in simulation. Inside the &lt;script&gt; tag one can
define some of the parameters for the desired trajectory,
such as the start time and the if or not the motion has to
be repeated after it ends. For our actor model’s trajectory
we set the trajectory to loop forever and start playing as
soon as the world is loaded. In particular, the following
parameters are available:
• loop: it is set to true for the script to be repeated
in a loop. For a fluid, continuous motion is worth
setting the last waypoint to match the first one;
• delay_start: this is the time in seconds to wait
before starting the script. If running in a loop, this
time will be waited before starting each cycle;
• auto_start: this attribute is set to true if the
animation should start as soon as the simulation
starts playing. It is useful to set this to false if the
animation should only start playing only when
triggered, for instance, by a plugin.</p>
          <p>Finally, the actual trajectory is built by defining a
sequence of waypoints: The parameter waypoint is
described inside the &lt;trajectory&gt; tag and represents the
intermediate targets the model has to reach along the
trajectory path. Each waypoint consists of a time and a
pose;
deep reinforcement learning, and multi-agent learning.</p>
          <p>For the visual object tracking task this project deals with,
two Actor-Critic methods have been considered: A2C
(Advantage Actor Critic) in [17] and A3C (Asynchronous
Advantage Actor Critic) in [18]. We decided to deploy
the latter since it best fitted the available computational
resources and the environmental settings. Thus the
environment setup can be outlined as follows: a virtual
environment implemented in Gazebo is combined with
a reinforcement learning algorithm developed in ROS
framework, encapsulating the agent description and
reward updating in Gym-Gazebo package. Finally, a
reimplementation of A2C algorithm using PyTorch library
is used to define the policy learning method and manage
the RL environment.
• time the time in seconds, counted from the be- 4.1. Gym gazebo
ginning of the script, when the pose should be
reached;</p>
        </sec>
        <sec id="sec-1-12-3">
          <title>Recent trends in reinforcement learning [16], show vari</title>
          <p>ous applications in robotic fields, such as planning,
control, air-based, under-water, land-based, etc. Moreover,
a diferent state of the art RL techniques ad algorithms
has been employed in this field, including actor-critic,</p>
        </sec>
        <sec id="sec-1-12-4">
          <title>Gym-gazebo is a powerful toolkit for reinforcement</title>
          <p>learning of robotics applications that relies on ROS
• pose: the pose which should be reached. and Gazebo. This package follows the same baseline
structure characterizing OpenAI Gym, and builds a
Once trajectories are created and static animations are ROS/Gazebo environment on top of that. Indeed, in the
loaded, the final step is to combine them in full synchro- past years, non-profit AI research companies, such as
nized animation and trajectory. Our skeleton animation OpenAI, have created a generic set of algorithm and
contains a transnational component in the  − , environment interfaces. In OpenAI’s Gym, agent-state
as we could notice by running the animation without combinations encapsulate information environments,
any trajectory. But that animation is not yet synchro- which will be able to make use of all the available
nized with our trajectory until we enable that by set- algorithms and tools. This abstraction allows easier
ting &lt;interpolate_x&gt; to true inside &lt;animation&gt; implementation and tune of the RL algorithms, but most
tag. Figure 4 shows how an actor is modeled and an- importantly, it creates the possibility of using any kind
imated in Gazebo. of virtual agent. This includes robotics, which Gym is
already supporting with several environments on their
4. Reinforcement learning for roster. Gym-Gazebo toolkit aims to integrate the Gym
APIs with robotic hardware, validating reinforcement
robotics learning algorithms in real environments. Real-world
operation is achieved by combining Gazebo simulator
with ROS, so providing a set of libraries and tools that
help software developers to create robotic applications.</p>
          <p>The architecture consists of three main software blocks:</p>
          <p>OpenAI Gym, ROS and Gazebo. Environments developed</p>
        </sec>
      </sec>
      <sec id="sec-1-13">
        <title>Gym-Gazebo</title>
      </sec>
      <sec id="sec-1-14">
        <title>Environment</title>
      </sec>
      <sec id="sec-1-15">
        <title>Gazebo Launch</title>
      </sec>
      <sec id="sec-1-16">
        <title>Reward Function</title>
      </sec>
      <sec id="sec-1-17">
        <title>State Function</title>
      </sec>
      <sec id="sec-1-18">
        <title>Step Function</title>
      </sec>
      <sec id="sec-1-19">
        <title>Models APIs</title>
      </sec>
      <sec id="sec-1-20">
        <title>Data Processing</title>
      </sec>
      <sec id="sec-1-21">
        <title>ROS Services</title>
      </sec>
      <sec id="sec-1-22">
        <title>Robot APIs</title>
      </sec>
      <sec id="sec-1-23">
        <title>Actor Plugins</title>
      </sec>
      <sec id="sec-1-24">
        <title>Room World</title>
        <p>in OpenAI Gym interact with the Robot Operating
System, which is the connection between the Gym
itself and Gazebo simulator. Gazebo provides a robust
physics engine, high-quality graphics, and convenient
programmatic and graphical interfaces.</p>
        <sec id="sec-1-24-1">
          <title>We created our own environment for object tracking</title>
          <p>tasks and encapsulated it into Gym-gazebo package.</p>
          <p>There are two main observations to do for this step:
ifrst, we needed to correctly build the environment
class following OpenAI Gym format; second, we had
to fully integrate our own environment file inside
the Gym-Gazebo toolkit, by inheriting the properties
of python language. A common interface of OpenAI
Gym environment provides three main methods to be
implemented: reset, step, render. The function reset
is used to re-initialize parameters for new episodes; the
step function is called during training, and the render
function is used to run Gazebo server. In Figure 5 it
shows the architecture of the Gym-Gazebo toolkit and
how it is extended for our implementation.
4.2. Reinforcement learning
Reinforcement Learning (RL) is an area of machine
learning where a software agent learns by interacting with an
environment, observing the results of these interactions
with the aim of achieving the maximum possible
cumulative reward. This imitates the trial-and-error method
used by humans to learn, which consists of taking actions
and receiving positive or negative feedback. In general,
agent learning is based on a policy function that maps
states to an action at each time step. The agent learns
how to maximize the total rewards returned from the
environment. State space - For the considered object
tracking and human following task, the state consists
in a sequence of RGB images, acquired from an action
camera mounted on the robot head, and collected over
time. The input sequence of images includes 15 camera
frames sampled from a list collected in 0.5 seconds.
Images are pre-processed, reshaped to size 128x128x3 and
normalized before to be provided as input to the model.</p>
          <p>Action space - The agent action space is discrete and
consists in three control commands: go forward, rotate
left and rotate right, as described in more detail in the
table Table 1, while the human walking speed along the
trajectory is set to 0.55 m/s.
Network model - The neural architecture defined for
the implemented RL algorithm is shown in Figure 1. We
experimented a more complex and deep neural model
with respect to the network defined in [ 19], among the
improvements proposed, the observation encoder contains
more convolutional layer and also the size of features
maps and kernels are changed. Moreover, the actor-critic
framework is modified to be more suitable for our task.</p>
          <p>The detailed description of network architecture is
provided in Table 2.</p>
          <p>The observation encoder covers layers 1 to 4, the sequence
encoder consists in the recurrent layer 5 and the
actorcritic network is represented by the two fully-connected
layers 6. The observation encoder extracts the features
map of input images acquired from the environment; in- obtained reward is maximized. If the human moves away
put features are collected over time by an LSTM recurrent and changes it orientation w.r.t. the robot, the reward
layer. reduces, so the robot has to learn how to move such that
the human is always in front of the robot and at the right
4.3. Advantage actor-critic architecture distance (since also in case the human is too close to the
robot, the reward value gets worse).</p>
          <p>(A2C) From the reward function in Equation 1 it is computed
In the developed RL-A2C learning framework, the obser- the discount reward :∞ =  + * +1 + 2 * +2 +...,
vation encoder  () extracts from the raw images a fea- that is used to generate the value function for the
actorture vector  which is then used as input for a sequence critic learning algorithm.
encoder. The latter is implemented by a LSTM layer as a Actor-Critic Networks - In A2C, the advantage
funcfunction   =  (1, 2, ...) of the observation history tion  (, ) =  (, ) −  () is approximated to a
(1, 2, ...). After the new feature representation   linear function by neural network. The action value
funcis extracted from the observation, it is provided as in- tion (, ) = [:∞| = ,  = ,  ] stands for
put to both the actor and critic networks. The target of the expected future reward of choosing an action at a
parLSTM layer is to organize the process state over time, in ticular state, and the value function  () = [:∞| =
this case the information of human position in the image ,  ] expresses the value of being in a specific state. The
frame acquired by the robot camera sensor. Each time critic network approximates the value function  () ,
the human moves, the agent needs to collect information which provides the expected future reward. The actor
to choose a suitable action. Processing the input state network outputs the policy distribution  (· ; ) used for
as a sequence of images provides much information and action decision. In A2C,  () and  (· ; ) are used to
opspeeds up the network update. In this project, the encoder timize the network weights during the training process.
function is re-implemented in the form of the function Thus the value and policy functions are evaluated on
ℎ() = (ℎ( − 1), ) where ℎ() is the hidden state the updated model parameters  (,  ′) and  (|;  ′).
of the recurrent network at time step . Reward func- Then, the networks can learn by stochastic policy
gradition - The reward function used to evaluate the outcome ent
of the actions chosen by the robot during the learning
episodes is based on the transform relationship between
the robot and human coordinates reference frames (RF).</p>
          <p>In particular the following parameters are considered:
 ←  + ∇ log (|;  )(, )+ ∇ ( (|;  ))
(2)
•  is the relative angle orientation of the human
w.r.t. the robot (the angle between the x-axis of
the human RF and the x-axis of the robot RF).
•  is the desired distance between the center of
the human RF and the center of the robot RF).</p>
          <p>(3)
Where :+− 1 is the discounted reward for  steps;
 is the discount factor;  is an entropy regularization
factor;  is the networks regularization factor;  ′− is the
model parameters set in the previous time step.</p>
        </sec>
        <sec id="sec-1-24-2">
          <title>The following equation implements the reward function:</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>5. Training process</title>
      <p>=  −  * ( −
√︁2ℎ + ℎ2)2 −  * |  |
(1)
Where  is the maximal reward;  is a scale parameter
for the human position w.r.t robot frame;  is a scale
parameter for the relative orientation of the human w.r.t
robot; ℎ and ℎ are the position coordinates of the
human in the robot RF. The reward shows that if the human
is in front of the robot (so fully captured by the camera
sensor) and at most two meters far from the robot, the</p>
      <sec id="sec-2-1">
        <title>The training is performed from scratch, without exploit</title>
        <p>ing pre-trained model weights. In the training process,
the human moving is set up to follow the trajectory
showed in figure Figure 6. Two training runs
consisting of 1000 and 2000 epochs respectively are performed.</p>
        <p>The Adam optimizer for the training process is used to
speed up and stabilize convergence to the global
minimum in the gradient descent phase. For further details
about hyper-parameters refer to Table 3.
5.1. Training results
During the training process, the accumulated reward
per episode is collected. Figure 7 shows the trend of
total reward increasing during the training epochs. This
demonstrates that A2C framework learned well how to
select robot actions to accomplish the considered visual
object tracking task. At the end of the training process,
the robot can follow the human along the whole
trajectory.</p>
        <p>One of the main improvements in the training process 6. Testing process
achieved in this project is the number of episodes
required to get the cumulative reward converging to high In this section it is described the testing framework used
values, that is smaller with respect to the number of to get quantitative and qualitative evaluations of the
trainepochs required to the training of RL algorithms for anal- ing process. The test process is articulated as follows:
ogous tasks. This is mainly due to the use of the robot
model, instead of the camera view, in the RL process, that • Three testing trajectories are defined to analyze
is more suitable for robotics applications, and to have set and evaluate the performances of the trained
the empty room to make the learning process converging model to track the human target in the same
inquickly. But our training process also has disadvantage door environment used for training.
that is the time of training. There are two main reasons
for that: in Gazebo simulator is not easy to change the
time speed as in game engines (frequently used as
simulation environments for RL applications) and the low
computational resources available.
• A new 3D simulation-world is created to test the
tracking performances of the trained model when
the robot has to move in an indoor environment
showing structural and textural diferences with
respect to the training one.
• Diferent values of robot speed, trajectory (path
and duration) for single action steps, reward
function parameters are also evaluated during test
process.
6.1. Trajectories settings
The trajectories produced for the test process are
designed to show an increasing level of diversity with
respect to the trajectory defined for the training process,
which in turn also determines a gradual increase in the
complexity of the active tracking task to be learned by
the agent. Below a schematic view of the designed
trajectories and an overview of the main features are presented:
Base squared trajectory - A first evaluation of the
experimental results is performed on the same trajectory
used in the training process, aiming to validate the
learning results achieved in the training procedure. In this
case, the diference with respect to the training trajectory
is determined by changes made in the set-up of agent
parameters (speed, action steps) and environment
parameters (speed of human targets, obstacles, light conditions).</p>
        <p>See Figure 8(a).</p>
        <p>Squared rotated and reshaped trajectory A second
level of evaluation is executed on a trajectory which start
showing changes in the shape and in the orientation
of the path with respect to the environment coordinate
frame. Also in this case a diferent set-up of robot and
world parameters is exploited to prove the robustness of
the model learning state. In particular, setting diferent
human target speed and robot action steps showed an
improvement in evaluation results. Refer to Figure 8(b).</p>
        <p>Short and trapezoidal trajectory A further step in
the evaluation process is performed on a new trajectory
which shows no correlation with the training one. The
starting and final position of the agent is changed, the
shape and orientation of the path in the world frame are
diferent.</p>
        <p>The main features of the trajectory set-up are the length
of the path that is less than the previous two test cases
also due to a very acute angle of the first path curve that
enhance the complexity of the visual tracking task.</p>
        <p>Suitable settings of the agent action steps and of the
human speed produced good results for this test case. See
Figure 8(c) Long eight-shaped trajectory Finally, the
task complexity is further increased defining a test case
on a new long trajectory characterized by: diferent start
and end position of the agent, complex shape with more
curvatures with acute and wider angles, orientation and
shaped changed with respect to the trajectory used in
all the previous test cases. Also in this case it has been
possible to define a suitable set-up for the agent and
environment parameters allowing the model to successfully
track most of the human target motion along the whole
trajectory. Refer to Figure 8(d)</p>
        <p>51–63
(a) Base squared trajectory
(b) Rotated &amp; reshaped squared
trajec</p>
        <p>tory
(c) New short &amp; trapezoidal trajectory
(d) New long &amp; height-shaped
trajec</p>
        <p>tory
6.2. New test 3D simulation world model
To better analyse and validate experimental results, a new
simulation indoor world environment is created. The new
space is slightly wider in terms of squared meters area,
with respect to the world model used for training and for
the test study cases described in paragraph 6.1. Moreover,
it has a diferent shapes, with a more irregular
intersection of the perimeter walls and also the presence of some
obstacles which can considerably afect the noisy of the
input images processed by the neural model and obstruct
the robot motion. Due to the strong diferences in the
world setting and also the environmental simplifications
adopted in training process to speed up learning
convergence, the experimental results achieved in this test
case are not as concrete as for the results obtained using
the original world simulation set-up, but they allow to
show anyway some interesting generalization properties
acquired by the neural network model in the policy
learning process. The new experimental environment and the
related test trajectory are shown in Figure 9
• Failure Rate: number of fails (end-of-episode)
over the total number of episodes. This measure
is analogous to the homonyms metric used for
evaluation in the conventional tracking literature.
6.4. Experimental Results
• Episode Length: measures the duration of good
tracking, which shares the same spirit as the
Successfully Tracked Frames 2 used in conventional
tracking applications.</p>
        <p>1In single-target short-term tracking Precision is defined as
the average overlap, i.e., the average value in the sequence overlap
between predicted target’s region form the tracker and the
groundtruth region.</p>
        <p>2This measure reports the number of successfully tracked frames
from the tracker’s initialization to its (first) failure. The choice of
the failure criterion may impact the evaluation result.</p>
        <sec id="sec-2-1-1">
          <title>Test environment</title>
        </sec>
        <sec id="sec-2-1-2">
          <title>Base (training)</title>
        </sec>
        <sec id="sec-2-1-3">
          <title>Rotated &amp; reshaped</title>
        </sec>
        <sec id="sec-2-1-4">
          <title>Short &amp; trapezoidal</title>
        </sec>
        <sec id="sec-2-1-5">
          <title>Long &amp; eight-shaped</title>
          <p>(a) Cumulative-per-episode
rewards (orange) &amp; mean
cumulative reward over
the whole test run (blue)
(b) Average episodes lengths
over the whole test run
(b) Average episodes lengths</p>
          <p>over the whole test run
(a) Cumulative-per-episode
rewards (orange) &amp; mean
cumulative reward over
the whole test run (blue)
and follow the human motion for more than a half of
the total trajectory while also avoiding the obstacles
displaced in the traversed regions of the room (Figure 14)
The strong performance achieved in tracking and
obstacle avoidance task are further proved by the relatively
low failure rate of the test runs on the new environment,
as can be observed by comparing the values in Table 5
and Table 6
(a) Cumulative-per-episode
rewards (orange) &amp; mean
cumulative reward over
the whole test run (blue)
(b) Average episodes lengths</p>
          <p>over the whole test run
Irregular-shaped with obstacles room environment Test environment Total episodes Failure rate
In the end, a further evaluation case is defined, to test the Irregular-shaped
generalization capabilities of the trained model and the with obstacles 100 0.59
possibility to extend it also to a new environment with a
higher degree of complexity (characterized by an
irregular perimeter shape and the presence of obstacles). To
let the model process in a good way the input (noisier 7. Conclusions
due to the obstacles appearing in the camera frames and
the larger field of view required in the considered wider In this project, we provided an improvement in visual
space, we run 100 test episodes, during which both the object tracking problem for robotics application. Our
mean length of the test run and the cumulative reward aim was to accomplish the task of person following for a
gradually increase, reaching peak values comparable with mobile manipulator in an indoor environment for
healththe ones obtained for the much simpler test cases con- care purposes. We modeled the learning task as a Markov
sidered in 6.1. In particular the robot was able to track Decision Process and exploited the use of robot APIs, of</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>G.</given-names>
            <surname>Lo Sciuto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          ,
          <article-title>A cloud-based lfexible solution for psychometric tests validation, administration and evaluation</article-title>
          , volume
          <volume>2468</volume>
          ,
          <year>2019</year>
          , p.
          <fpage>16</fpage>
          -
          <lpage>21</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Illari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Avanzato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          ,
          <article-title>A cloudoriented architecture for the remote assessment and follow-up of hospitalized patients</article-title>
          , volume
          <volume>2694</volume>
          ,
          <year>2020</year>
          , p.
          <fpage>29</fpage>
          -
          <lpage>35</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          ,
          <article-title>A comprehensive solution for psychological treatment and therapeutic path planning based on knowledge base and expertise sharing</article-title>
          , volume
          <volume>2472</volume>
          ,
          <year>2019</year>
          , p.
          <fpage>41</fpage>
          -
          <lpage>47</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Avanzato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Beritelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Vaccaro, Yolov3-based mask and face recognition algorithm for individual protection applications</article-title>
          , volume
          <volume>2768</volume>
          ,
          <year>2020</year>
          , p.
          <fpage>41</fpage>
          -
          <lpage>45</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Wozniak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Napoli</surname>
          </string-name>
          , E. Tramontana, G. Capizzi,
          <string-name>
            <given-names>G.</given-names>
            <surname>Lo</surname>
          </string-name>
          <string-name>
            <surname>Sciuto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Nowicki</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Starczewski</surname>
          </string-name>
          ,
          <article-title>A multiscale image compressor with rbfnn and discrete wavelet decomposition</article-title>
          , volume
          <volume>2015</volume>
          <source>-September</source>
          ,
          <year>2015</year>
          . doi:
          <volume>10</volume>
          .1109/IJCNN.
          <year>2015</year>
          .
          <volume>7280461</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>R.</given-names>
            <surname>Brociek</surname>
          </string-name>
          ,
          <string-name>
            <surname>G. De Magistris</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Cardia</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Coppa</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Russo</surname>
          </string-name>
          ,
          <article-title>Contagion prevention of covid-19 by means of touch detection for retail stores</article-title>
          , volume
          <volume>3092</volume>
          ,
          <year>2021</year>
          , p.
          <fpage>89</fpage>
          -
          <lpage>94</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>B.</given-names>
            <surname>Torkaman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Farrokhi</surname>
          </string-name>
          ,
          <article-title>Real-time visual tracking of a moving object using pan and tilt platform: A kalman filter approach</article-title>
          ,
          <source>in: 20th Iranian Conference on Electrical Engineering (ICEE2012)</source>
          ,
          <year>2012</year>
          , pp.
          <fpage>928</fpage>
          -
          <lpage>933</lpage>
          . doi:
          <volume>10</volume>
          .1109/IranianCEE.
          <year>2012</year>
          .
          <volume>6292486</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Çelik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Altun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Güneş</surname>
          </string-name>
          ,
          <article-title>Color based moving object tracking with an active camera using motion information</article-title>
          , in: 2017
          <source>International Artificial Intelligence and Data Processing Symposium (IDAP)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>4</lpage>
          . doi:
          <volume>10</volume>
          .1109/IDAP.
          <year>2017</year>
          .
          <volume>8090332</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>I. Kostrikov</surname>
          </string-name>
          ,
          <article-title>Pytorch implementations of asynchronous advantage actor critic</article-title>
          , https : / / github.com / ikostrikov / pytorch - a3c,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Mottaghia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Kolve</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. J.</given-names>
            <surname>Lim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Fei-Fei</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Farhadi</surname>
          </string-name>
          ,
          <article-title>Target-driven visual nav-</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>