Deep Learning Localization
Deep Learning Localization
Robin Dietrich
School of Electrical Engineering and Computer Science
Oregon State University, Corvallis, Oregon 97331
dietriro@[Link]
1
time step t + 1 by using the controls that are currently (t)
applied to it. This approach works just well in case there
is no uncertainty in the environment and the robot always
ends up in the same state when executing a certain action.
Since this is an assumption that is impossible to make about
the real world, this approach is not feasible for mobile robot
localization because the error introduced by e.g. just a small
(a) 1D laser scan data. (b) 2D laser scan data. bump would propagate over time and lead to a completely
wrong pose estimation. Another approach based on RNNs
Figure 1: Sensor data gathered by a Hokuyo URG-04LX- is introduced by the authors of [11]. The main idea of this
UG01 laser range finder in the ROS STDR-Simulator. paper is to estimate the robots room position based on scan
data from a laser scanner. This is basically a 15-Class Clas-
sification problem that matches 2D 360-degree scan data
scan can be seen in Figure 1, which shows a scan from with map data from the respective rooms to determine in
a Hokuyo URG-04LX-UG01 laser range finder generated which room the robot currently is. The authors achieve a
in the ROS STDR-Simulator. Figure 1a shows the 1D raw high accuracy on this classification which shows that it is
scan as ranges per angle increment and Figure 1b shows a possible to work with 2D laser scan data. Nevertheless it is
reconstructed 2D scan around the robot. This paper intro- insufficient for mobile robot localization since this system
duces a novel Deep Neural Network approach for both 1D just outputs a room where the robot is and not a pose esti-
and 2D feature detection as well as pose estimation from a mate which is necessary in order for the robot to navigate to
laser scan based on Convolutional Neural Networks. The a specified goal in the environment and to avoid obstacles.
rest of the paper is organized as follows. In section 2 a few One idea that is rather similar to the attempt made in this
related work is presented including mostly relative pose es- paper, is introduced in [18]. Their system uses 3D LIDAR
timations based on Recurrent Neural Networks. Section 3 data as an input, converts it into a 2D depth image and uses
presents the two networks that were developed for feature this to feed a CNN. The CNN detects features in the en-
detection and pose estimation. In section 4 the experimen- vironment and based on the difference of these features in
tal environment as well as the results of the two networks two subsequent scans, the distance traveled by the robot is
are presented. Finally, section 5 concludes the results of estimated. The output of the network is the difference in x
this paper and section 6 gives an outlook about the various and y between time t and t + 1. Although the authors were
work that the author will be working on subsequently. able to achieve a higher accuracy than the standard, Itera-
tive Closest Point (ICP), used for this problem, this is just
2. Related Work a relative estimation of the robots position and needs some
kind of initial position. Furthermore the orientation of the
The area of Deep Learning has been of high interest
robot was not incorporated in this system which is however
within the last couple of years and due to that there have
absolutely necessary for a mobile robot in order to interact
been a lot of achievements in a variety of applications using
with its environment.
e.g. Convolutional or Recurrent Neural Networks (RNNs).
Due to the drawbacks of the described approaches in
The idea of Convolution has been around for decades now,
DNN based mobile robot localization, the system that will
early CNN approaches focused on topics like handwriting
be presented in the next sections is indeed similar to the
[16] and face recognition [14] as well as image and speech
two latter approaches presented, however it is using 2D in-
detection [15]. The major problem back in the time was the
stead of 3D LIDAR data and estimates an absolute position
limited computational power as well as the limited amount
as well as orientation of the robot at each time step inde-
of the memory that was available during that time. Today
pendently from each other. By using 2D sensor data, the in-
where computational power and memory are rather small
put dimensionality is reduced from about 700000 (Velodyne
problems due to high-end GPUs, ideas like handwriting
HDL-32E, 3D LIDAR) to about 667 dimensions (URG-
recognition [6] or especially image classification [13] have
04LX-UG01, 2D LIDAR), however this is still sufficient
been improved and extended. Recurrent Neural Networks
for an accurate pose estimation as past work in this area has
went through a similar process and are used to solve prob-
clearly shown by using common approaches such as Monte
lems that have a temporal component such as dynamic sys-
Carlo [20] or EKF localization [5].
tems [10] or Natural Language Processing [17].
So far there haven’t been a lot of approaches of Deep 3. CNN for Localization
Neural Networks in the field of mobile robot localization.
One of them is presented in [3], where the authors use an The two CNNs developed in this paper for learning fea-
RNN to predict the pose (x, y, θ) of the robot for the next tures from a given map as well as an association between
2
Figure 2: The architecture of the Deep CNN used for the 1D input data.
those features and the pose of the robot are generally work-
ing with the exact same input data, a 667 dimensional scan
from a Hokuyo URG-04LX-UG01 laser range finder. It has
a maximum range of 5.6m and a minimum range of 0.02m,
as well as an angular range of 240◦ . The difference between
the input of the two models is the representation which is
described further in the following subsections. One remark
that the author wants to make at this point is, that neither
of these two approaches explicitly models any uncertainty
in the scan or the estimated pose. It was neglected for sim-
plicity at this point but will be part of the future work of
the author on this topic, since a probabilistic estimation of
the pose is common and important in mobile robot localiza-
tion to propagate the uncertainty from sensor and odometry
data. Figure 3: The 1D raw input data for the 1D CNN, where
the measured ranges are visualized as blue crosses and the
3.1. 1D-Input CNN possible features (lines) are surrounded by dashed red lines.
The 1D-CNN works with the plain data obtained by the
sensor. A visualization of this data as range per incremented
angle can be seen in Figure 3. This image visualizes the volutional pair and each fully-connected layer was found
ranges measured by the laser range finder for one time step, useful but with increasing size of input examples the dif-
it also includes the possible features that could be extracted ference between the training and validation loss was so low
or found by the CNN. These features could be e.g. lines, that they weren’t helpful anymore. This will be discussed
corners or other objects with a specific structure like pillars. further in the experimental results in Section 4. The pro-
The Convolutional layers in the network are supposed to de- posed architecture was found to be the most promising one
tect and learn these features, the subsequent fully-connected since it led to the best results, although a lot of other struc-
layers should then learn a mapping from these features to tures were considered, especially using more convolutional
the pose of the robot (x, y, θ). layers with a smaller pooling size. However, none of these
architectures led to better results compared to the one shown
The structure that was chosen for the network is visual-
in Figure 2, although this doesn’t mean that there is no im-
ized in Figure 2 and includes 2 times 2 Convolutional lay-
provement possible in the chosen structure of the CNN.
ers, each pair followed by a max-pooling layer of size 2.
The Convolutional layers include 64/128 filters of size 3x3.
3.2. 2D-Input CNN
The flattened output of these layers is then used as an input
to 4 fully-connected layers, the last one being of size 3 since In addition to the previously described 1D-CNN, the au-
it outputs the estimated pose of the robot as x, y, and θ. The thor proposes a second approach based on the idea to re-
initial input as well as the output of each fully-connected construct a local 2D m̈apäround the robot based on the 1D
layer is normalized. As an activation function for the Con- sensor input. This m̈apı̈s then fed into a 2D-CNN, which
volutional layers was ReLU chosen, for the fully-connected treats it as a normal image except for the fact that it just
layers Sigmoid. Initially a dropout layer after each Con- contains values of either 0 or 1. To implement this, an im-
3
Figure 4: The architecture of the Deep CNN used for the 2D input data.
xi = sin(αi ) ∗ ri (1)
yi = cos(αi ) ∗ ri (2)
Figure 5: A reconstructed 2D image of the 1D range data
Where xi /yi denotes the x/y value for the i-th example obtained by the laser range scanner, where the measured
and ri the range measured for the respective angle αi . Since ranges are visualized as blue crosses and the possible fea-
this just creates coordinates surrounding the robot at the ori- tures (lines) are surrounded by dashed red lines.
gin, these x and y values need to be normalized into the im-
ages’ pixels coordinates with the origin being at the center
of the image. The normalization works as follows: except for the filter size which changed from 3x1 in the one
dimensional case to 3x3 for two dimensions.
size size
imgXi = iround(xi ∗ + ) (3)
2 ∗ max 2 4. Experiments and Results
size size This section evaluates the results obtained by training the
imgYi = iround(yi ∗ + ) (4)
2 ∗ max 2 presented networks. First, the used environment including
Here the image coordinates imgXi /imgYi are calculated simulator, robot and map are specified. Afterwards a com-
based on the euclidean coordinates xi /yi , the size of the im- parison between a simple fully-connected network and the
age (384) as well as the maximum range max of the sensor. 1D/2D CNN developed in this paper is presented. Finally
The result is then rounded to the next integer to fit a pixel in the author elucidates the capabilities of the CNNs by adapt-
the image. This normalizes all values in a range of [0-383] ing the network to another map.
to fit in the image. The result of such a transformation can
4.1. Setup and Environment
be seen in Figure 1b. This image shows not only the scan
points but also the respective features that could be fount by The simulation environment that was used for collect-
the CNN, in this case lines. ing the networks input (sensor/pose) data is the STDR Sim-
In order for the CNN to detect these features the network ulator that is part of the Robot Operating System (ROS),
contains 6 Convolutional layers as shown in Figure 4. The since it is an easy to use 2D simulator. The map used for
amount of filters per layer was here chosen a lot less than the experiments is shown in Figure 6, a simple map with
in the previously described 1D case, since the input dimen- some sparse obstacles and a size of 15.50x14.92m. The
sionality is now about 200 times higher than before and a black parts of the image denote obstacles in this case and the
high number of filters led to a tremendous increase of the white parts identify the free space of the environment. This
runtime. Other than that the architecture is pretty similar, map is part of the STDR package and was chosen because
4
(a) Training Loss. (b) Validation Loss.
in Figure 9.
Figure 6: The map and robot used for the experiments, with The results show that both CNNs clearly outperform the
the red lines being a visualization of the robots laser scan- MLP. The MLP has huge problems with the generalization,
ner. after about 50 epochs the validation error gets stuck around
a value of 2.5 and does not decrease any longer. Both 1D
CNN variants on the other hand outperform the 2D CNN
of its structure compared to other maps that contained e.g. by at least a difference of 0.7 in the training and 0.5 in the
just simple rooms. The robot used for the experiments is validation loss. The 2D CNN turns out to be much harder
based on a simple robot model which is also part of STDR. to learn than the 1D CNN, this could be due to the higher
It is equipped with a Hokuyo URG-04LX-UG01 laser range dimensional input. Sadly it was not possible to run the
finder that outputs a 667 dimensional laser scan of its envi- 2D CNN for longer than 400 epochs, since one epoch took
ronment with a frequency of 10Hz. It has a minimum range around 60-100 seconds. Since already the 1D CNN version
of 0.02m and a maximum range of 5.6m, as well as an an- with 20.000 samples worked significantly better than the
gular range of 240◦ . The robot with its respective sensor two previously mentioned networks, the author focused on
reading is shown in Figure 6 as well. To generate the input the 1D CNN for further improvements and therefor learned
data for the network, the robot was spawned randomly at the network as well with a dataset of 200.000 samples. Al-
a position sampled uniformly from the environment. The though one full epoch takes now instead of 5 about 50-60
data is then split into training (90%) and test data (10%). seconds, the increased sample size by a factor of 10 really
All networks are learned using the Adam optimizer and the led to a significant improvement of the networks perfor-
mean absolute error as loss. mance. The network now converges towards a validation
error of about 0.15 after 400 epochs and since the loss here
4.2. MLP vs. 1D/2D CNN is the mean absolute error, this means, that the error in the
In the first experiment, the basic functionality of the position is less than 0.15m because the error is composed of
CNNs is shown by comparing it to a standard Multi-Layer the error in x, y and θ. This is a very good result for mobile
Perceptron (MLP) [12], since this is known to be a able to robot localization without the incorporation of the robots
universally approximate data. The MLP in this case con- odometry information. Especially because the mean differ-
sists of 3 fully-connected layers with 512 hidden units, 1
layer with 64 and the output layer with 3 hidden units cor-
responding to x, y and θ, respectively. Batch normalization MLP 1D CNN 1D CNN 2D CNN
as well as a dropout of 0.25 were implemented for the MLP, Epochs 2000 5000 400 400
since its biggest problem was to generalize and not overfit Batch Size 100 100 400 100
the training data, however this decreased the convergence Learn Rate 0.01 0.006 0.006 0.01
rate. The ReLU-function worked best as activation and The LR-Decay 0.005 0.0 0.0 0.005
MLP is compared to a 1D CNN learned with a dataset of Dropout 0.25 0.1 - 0.1
20.000 samples, one with 200.000 samples as well as a 2D Samples 20.000 20.000 200.000 20.000
CNN. The structure of the 1D CNNs is here the same, the
difference is just the sample and batch size. The parameters
used for the training of the networks are listed in Table 1 Table 1: The training parameters for the four different mod-
and the results of the training/validation error can be seen els that are part of the first experiment.
5
(a) Training Loss. (b) Validation Loss.
Figure 8: A map with simple rooms and fewer obstacles Figure 9: The training (a) and validation (b) of the 1D CNN
used for the second experiment. learned with randomized and pre-learned data on the map
shown in Figure 8.
ence between the training loss in Figure 7a and the valida-
tion loss in Figure 7b is 0.0131, so almost zero. This shows environment that can be transferred to another one.
that it is indeed possible to learn an implicit representation
of a map using Convolutional layers and with their output 4.4. Real Time Localization
learn a mapping to the pose of the robot in the environment.
For the last experiment in this paper, the initial sparse
obstacle map is used again, since it provides better struc-
4.3. Adaption to a 2nd map
tural properties than the map introduced in the Subsection
The second set of experiments that the author conducted before. In the following the performance of the 1D CNN is
for this paper includes the use of the proposed 1D CNN for compared against a standard implementation of the Monte
learning of a new environment which is pictured in Figure Carlo localization [19] from the ROS package amcl. To de-
8. The map is a lot simpler than the previously introduced crease the error in the pose estimation, another approach,
one. There is not as much structure or obstacles in the envi- Learning Ensembles [4] are introduced for this experiment.
ronment as it was the case before. This was chosen on pur- In addition to using 1 trained model of a 1D CNN for the
pose to see the influence of the map shape on the learning prediction, multiple models are trained and evaluated. The
process. For this experiment two 1D CNNs of the same ar- overall prediction is then simply the mean between the pre-
chitecture are compared. The only difference between them dicted values for one time step. This should make the pose
is, that one of them is initialized with randomized weights estimation more robust and makes it also possible to calcu-
while the other one loads the weights from a model that was late a covariance from the predictions. The CNNs used for
pre-trained for 2000 epochs on the first map using a dataset this experiment are all based on the architecture presented in
of 20.000 samples. This experiment should show on the one Subsection 4.2 and trained with a dataset of 200.000 scans.
hand if the representations or features learned on one map To generate the input data for the CNNs as well as the pose
are actually useful when learning a new environment and on estimation using amcl, a robot was steered through the en-
the other hand it should show if the network architecture is vironment for about 1500 time steps.
just specifically designed for one map or if it is generaliz- The results are presented in Figure 10, which illustrates
able for more. The network is exactly the same as the 1D the position estimations by amcl (10a), the single model
CNN that was introduced in the previous Subsection and CNN (10b) as well as the multi model CNN (10c). The
learned with a dataset 20.000 samples. The training loss of quantitative results of the experiment are shown in Table
the networks can be seen in Figure 9a while the validation 2 and include the mean as well as the standard deviation
loss is presented in Figure 9b. These plots clearly indicate of the pose estimation error (x, y, θ) for all three methods.
that the network is able to learn a pose estimation not only The error in the orientation θ is here calculated as the dif-
for the first map but also within this new environment, al- ference between the sinus values of the true orientation and
though the loss is not as good as in the first map. This could the predicted one.
be due to the lack of structure and obstacles. To investigate The Monte Carlo (MC) localization from amcl definitely
these impacts of the environment on the learning progress outperforms both CNN approaches. This is clearly visi-
will be part of the future work for this paper. Furthermore ble in the visualization of the pose estimates in Figure 10a,
the results unveil an improvement of the networks conver- where the amcl version is almost exactly following the un-
gence with pre-initialized weights compared to randomly derlying true data. It can be also seen in Table 2, where the
initialized ones. Especially in the beginning, both the train- difference in the mean error of the position (x, y) between
ing and validation loss decrease faster. This shows, that the the Monte Carlo localization and the single CNN model is
network actually learns a features representation from one about 0.075m. The multi model CNN on the other hand
6
(a) Monte Carlo (b) Single 1D CNN (c) Multi 1D CNN
Figure 10: The resulting position estimations in the map based on amcls Monte Carlo localization (a), a single (b) as well as
multiple 1D CNNs trained with 200.000 samples. The underlying blue circles indicate the true position of the robot while
the red circles illustrate the position estimation of the respective technique.
7
strengths and weaknesses. To achieve this, the interim re- written Character Classification. In 2011 International Con-
sults of the convolutional layers will be examined. The net- ference on Document Analysis and Recognition, pages 1135–
works will be also trained on several other maps with dif- 1139, Sept. 2011. 00186.
ferent structural properties as well as obstacle densities to [7] F. Dellaert, D. Fox, W. Burgard, and S. Thrun. Monte Carlo
detect possible difficulties the network has with these envi- localization for mobile robots. In Proceedings 1999 IEEE
ronments. International Conference on Robotics and Automation (Cat.
No.99CH36288C), volume 2, pages 1322–1328 vol.2, 1999.
Another approach to decrease the convergence time of
01481.
the network will be to use an Autoencoder to pre-train the
[8] D. Fox, W. Burgard, F. Dellaert, and S. Thrun. Monte carlo
Convolutional layers and learn a representation of the en- localization: Efficient position estimation for mobile robots.
vironment seperately from the association between features AAAI/IAAI, 1999(343-349):2–2, 1999. 01164.
and the output pose. [9] D. Fox, W. Burgard, and S. Thrun. Active Markov localiza-
In mobile robot localization it is common to combine tion for mobile robots. Robotics and Autonomous Systems,
sensor data with the odometry information of the robot to 25(3):195–207, Nov. 1998. 00513.
obtain a more accurate pose estimation. So far, the networks [10] K.-i. Funahashi and Y. Nakamura. Approximation of dynam-
presented in this paper are neither considering the odometry ical systems by continuous time recurrent neural networks.
information of the robot nor the time component. This will Neural Networks, 6(6):801–806, 1993. 00596.
be an area of future research for the author in form of the [11] A. Frster, A. Graves, and J. Schmidhuber. RNN-based Learn-
integration of the presented work into a RNN or LSTM to ing of Compact Maps for Efficient Robot Localization. In
improve the learning of the network dependent on the time ESANN, pages 537–542, 2007. 00008 bibtex: forster rnn-
and additional odometry information received by the robot. based 2007.
The last important extension that needs to be developed [12] K. Hornik, M. Stinchcombe, and H. White. Multilayer feed-
forward networks are universal approximators. Neural net-
and implemented is a model to incorporate and propagate
works, 2(5):359–366, 1989. 13852.
the uncertainty from the sensor data to the pose estimation.
[13] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet
This is a very important part of common probabilistic local-
Classification with Deep Convolutional Neural Networks. In
ization approaches, since no sensor or odometry informa- F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger,
tion is perfect this uncertainty propagates to the pose esti- editors, Advances in Neural Information Processing Systems
mation of the robot. Usually multiple state estimations of 25, pages 1097–1105. Curran Associates, Inc., 2012. 10372.
the robots pose and covariance are maintained and updated [14] S. Lawrence, C. L. Giles, A. C. Tsoi, and A. D. Back. Face
simultaneously. The author considers a similar approach in recognition: a convolutional neural-network approach. IEEE
form of learning an association not only from features to a Transactions on Neural Networks, 8(1):98–113, Jan. 1997.
specific pose but also to a covariance. Another approach for 01375.
this would be to learn a mapping from features to a Proba- [15] Y. LeCun, Y. Bengio, and others. Convolutional networks
bility Density Function over the environment. for images, speech, and time series. The handbook of brain
theory and neural networks, 3361(10):1995, 1995. 00929.
References [16] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E.
Howard, W. Hubbard, and L. D. Jackel. Backpropagation
[1] M. Betke and L. Gurvits. Mobile robot localization using Applied to Handwritten Zip Code Recognition. Neural Com-
landmarks. IEEE Transactions on Robotics and Automation, putation, 1(4):541–551, Dec. 1989. 02195.
13(2):251–263, Apr. 1997. 00707. [17] T. Mikolov, S. Kombrink, L. Burget, J. ernock, and S. Khu-
[2] J. Borenstein, H. R. Everett, L. Feng, and D. Wehe. Mobile danpur. Extensions of recurrent neural network language
robot positioning-sensors and techniques. Technical report, model. In 2011 IEEE International Conference on Acoustics,
DTIC Document, 1997. 00726. Speech and Signal Processing (ICASSP), pages 5528–5531,
[3] H. Brahmi, B. Ammar, and A. M. Alimi. Intelligent path May 2011. 00399.
planning algorithm for autonomous robot based on recurrent [18] A. Nicolai and G. A. Hollinger. Deep Learning for Laser-
neural networks. In 2013 International Conference on Ad- Based Odometry Estimation. 2017. 00000.
vanced Logistics and Transport, pages 199–204, May 2013. [19] S. Thrun, W. Burgard, and D. Fox. Probabilistic robotics.
00008. MIT press, 2005. 06654.
[4] L. Chen. Learning Ensembles of Convolutional Neural Net- [20] S. Thrun, D. Fox, W. Burgard, and F. Dellaert. Robust Monte
works. 00000. Carlo localization for mobile robots. Artificial Intelligence,
[5] L. Chen, H. Hu, and K. McDonald-Maier. EKF Based Mo- 128(1):99–141, May 2001. 01867.
bile Robot Localization. In 2012 Third International Con-
ference on Emerging Security Technologies, pages 149–154,
Sept. 2012. 00008.
[6] D. C. Ciresan, U. Meier, L. M. Gambardella, and J. Schmid-
huber. Convolutional Neural Network Committees for Hand-