Cross-View Semantic Segmentation for Robots
Cross-View Semantic Segmentation for Robots
Abstract—Sensing surroundings plays a crucial role in human Environment Top-down-view Semantic Map
spatial perception, as it extracts the spatial configuration of Pillar
Wall
objects as well as the free space from the observations. To Chair
facilitate the robot perception with such a surrounding sensing
arXiv:1906.03560v3 [[Link]] 18 Jun 2020
agents. In these environments, cameras can be placed at pulled from simulation engines (i.e., for visual navigation
any location in the simulated scene while the observations models [16]). Several techniques have been proposed to ad-
in multiple modalities can be extracted. Thus, we leverage dress the domain adaptation issue when models trained with
the simulation environments to acquire cross-view annotated simulated images are transferred to real scenes [17]. Rather
data. To reduce the domain gap between the synthetic scenes than working on the task of visual navigation directly, our
and the real-world scenes, we transfer the models trained in work aims at parsing the top-down-view semantic map from
the simulation environment to the real-world scenes through the first-view observations. The resulting top-down-view map
domain adaptation. will further facilitate visual navigation.
In this work, we propose a novel framework with View
Parsing Network (VPN) for cross-view semantic segmentation III. CROSS-VIEW SEMANTIC SEGMENTATION
using simulation environments and then transfer them to real- A. Problem Formulation
world environments. In VPN, a view transformer module is
The objective of cross-view semantic segmentation is as
designed to aggregate the information from multiple first-view
follows: given the first-view observations as input, the algo-
observations with different angles and different modalities. It
rithm must generate the top-down-view semantic map. The
outputs the top-down-view semantic map with a spatial layout
top-down-view semantic map is a map captured by a camera
of objects. We evaluate the proposed models on the indoor
at a certain height from the top-down view with the annotations
scene of the House3D environment [5] and the outdoor driving
of the semantic label of each pixel. The input first-view
scene of the CARLA environment [6]. Furthermore, to show
observations are a set of images with different modalities. They
the cross-view semantic task helps visual navigation, we have
are captured at N different angles by the robot’s camera (with
demonstrations of real robot.
360/N degrees apart).
Our main contributions are as follows: (1) We introduce
a novel task named cross-view semantic segmentation to
facilitate robots to flexibly sense the surrounding environment. B. Framework of the View Parsing Network
(2) We propose a framework with View Parsing Network Fig. 2 illustrates two stages of our framework. In the first
which effectively learns and aggregates features across first- stage, we propose View Parsing Network (VPN) to learn and
view observations with multiple angles and modalities. (3) We aggregate features from multiple first-view observations in the
further apply the domain adaptation technique to transferring simulation environment. In VPN, first-view observations are
our model so that it can work in real-world data while without first fed into the encoder to extract first-view feature maps. For
any extra annotations. each modality, VPN has a corresponding encoder to process
it. All of these first-view feature maps from different angles
II. RELATED WORK and different modalities are transformed and then aggregated
A. Semantic Segmentation and Semantic Mapping into one top-down-view feature map in the View Transformer
Deep learning networks for semantic segmentation [7] are Module. Then the aggregated feature map is decoded into a
designed to segment the image pixel-wise within one-view. top-down-view semantic map. Details of how to transform
Image datasets with pixel-wise annotations such as CityScapes and aggregate these first-view feature maps can be found
[3] are used for the training of semantic segmentation net- in Sec. III-D. In the second stage of our framework, we
works. There is also a huge literature about semantic mapping transfer the knowledge which VPN learns from the simulation
in robotics domain [1], [2], [8], [9], which provides the seman- environment to the real-world data. We slightly modified the
tic abstraction of the environment and a way to communicate domain adaptation algorithm proposed by [17] to fit our cross-
with robots. view semantic segmentation task and our VPN architecture.
More details of this part will be revealed in Section III-C.
Pipeline. As shown in Fig. 2, from one spatial position in a
B. Layout estimation and view synthesis
3D environment, we first sample N ×M first-view observations
Estimating layout has been an active topic of research from N angles and M modalities (here N = 6, M = 2 in Fig. 2)
(i.e. room layout estimation [10], free space estimation [11], in even angles so that all-around information is captured.
and road layout estimation [12], [13]). Most of the previous The first-view observations are encoded by M encoders for
methods use annotations of the layout or geometric constraints M corresponding modalities respectively. These CNN-based
for the estimation, while our proposed framework estimates encoders extract N × M spatial feature maps for their first-
the top-down-view map directly from the image, without the view input. Then all of these feature maps are fed into the
intermediate step of estimating the 3D structure of the scene. View Transformer Module (VTM). VTM transforms these
On the other hand, view synthesis has been explored in many view feature maps from first-view space into the top-down-
works [14], [15]. They focus on generating realistic cross- view feature space and fuses them to get one final feature map
view images while cross-view segmentation aims at parsing which already contains sufficient spatial information. Finally,
semantics across different views. we decode it to predict the top-down-view semantic map using
a convolutional decoder.
C. Learning in Simulation Environments View Transformer Module. Although the encoder-decoder
Given that current graphics simulation engines can render structure gets huge success in the classical semantic seg-
realistic scenes, recognition algorithms can be trained on data mentation area [7], our experiment (cf. Table III) shows that
PAN et al.: CROSS-VIEW SEMANTIC SEGMENTATION FOR SENSING SURROUNDINGS 3
First-view Observations
Depth inputs View Transformer Module
top-down-view semantic map
VRM
(simulation)
Depth
…
encoder car
VRM
full top-down-view
First-view feature map road mark
Sensor road car
unknown
Fusion Decoder
RGB inputs car
sidewalk
car
VRM
…
encoder
VRM
Real world Discriminator
(real or simulation?)
Target domain
semantic
segmentation
Real RGB
Generator road
Segmentation car
& mapping
Source Semantic car
domain VPN unknown
sidewalk
car
Synthetic Real masks with top-down-view
masks synthetic style semantic map (real)
Fig. 2: Framework of the View Parsing Network for cross-view semantic segmentation. The simulation part shows the architecture and
training scheme of our VPN, while the real-world part demonstrates the domain adaptation process for transferring VPN to the real world.
it performs poorly in the cross-view semantic segmentation spectively along the flattened dimension, and Ri models the
task. We conjecture that it is because in standard semantic relations between the ith pixel on top-down-view feature map
segmentation architecture the receptive field of the output and every pixel on first-view feature map. Here we simply use
spatial feature map is roughly aligned with the input spatial multilayer perceptron (MLP) in our view relation module R.
feature map. However, in cross-view semantic segmentation, After that, the top-down-view feature map is reshaped back to
each pixel on the top-down-view map should consider all input H ×W ×C. Notice that each first-view input has its own VRM
first-view feature maps, not just a local receptive field region. to get the top-down-view feature map t i ∈ RH×W ×C based on
After thinking about the flaws of the current semantic its own observations. To aggregate the information from all
segmentation structure, we design the View Transformer Mod- observation inputs, we fuse these top-down-view feature map
ule (VTM) to learn the dependencies across all the spatial t i by using VFM. More details of VFM and VRM will be
locations between the first-view feature map and the top-down- introduced in Sec. III-D.
view feature map. VTM will not change the shape of input
feature map, so it can be plugged into any existing encoder- C. Sim-to-real Adaptation
decoder type of network architecture for classical semantic To generalize our VPN to real-world data without the real-
segmentation. It consists of two parts: View Relation Module world ground truth, we implement the sim-to-real domain
(VRM) and View Fusion Module (VFM). The diagram at the adaptation scheme shown in Fig. 2 to narrow the gap. This
central of Figure 2 illustrates the whole process: The first- scheme contains the following pixel-level adaptation and out-
view feature map is first flattened while the channel dimension put space adaptation.
remains unchanged. Then we use a view relation module R Pixel-level adaptation. To mitigate the domain shift, we
to learn the relations between the any two pixel positions in adopt the pixel-level adaptation on the real-world inputs to
flattened first-view feature map and flattened top-down-view make them look more like the style of the simulation data.
feature map. That is: Semantic mask is an ideal mid-level representation without
ft [i] = Ri ( f [1], ..., f [ j], ..., f [HW ]), (1) texture gap while including sufficient information and it is
easy to transfer. This process can be formulated as follows:
where i, j ∈ [0, HW ) are the indices of top-down-view feature
map t ∈ RHW ×C and first-view feature map f ∈ RHW ×C re- {IS } = MReal→Synthetic (PRGB→Mask ({IR })), (2)
4 IEEE ROBOTICS AND AUTOMATION LETTERS. PREPRINT VERSION. ACCEPTED JUNE, 2020
TABLE I: Results on House3D cross-view dataset with different modalities and view numbers.
3D Geometric Baseline X-Fork(RGB) in [15] RGB VPN Semantic VPN Depth VPN
Networks PA mIoU PA mIoU PA mIoU PA mIoU PA mIoU
1-view model 31.3% 2.4% 38.0% 1.5% 55.8% 6.5% 59.6% 13.2% 56.9% 7.6%
2-view model 46.8% 7.2% 40.0% 1.9% 70.1% 14.8% 75.7% 25.9% 70.2% 15.6%
4-view model 63.2% 22.8% 39.5% 2.0% 80.3% 27.2% 85.0% 40.6% 77.3% 22.0%
8-view model 67.6% 27.1% 43.9% 1.8% 81.2% 28.5% 84.7% 41.0% 82.1% 29.9%
TABLE II: Results of cross-modality learning for VPN. Here we TABLE III: Ablation study of View Transformer Module.
compare the results with the inputs from 4 views.
Modality VPN w/o VTM VPN
Method Pixel Accuracy mIoU 1-view Pix. Acc. mIoU Pix. Acc. mIoU
RGB VPN 80.3% 27.2% RGB 53.9% 6.3% 55.8% 6.5%
Depth VPN 77.3% 22.0% Depth 55.7% 6.5% 56.9% 7.6%
Semantic VPN 85.0% 40.6% Semantic 57.4% 10.0% 59.6% 13.2%
R+D (late fusion) 81.2% 27.3% 8-view Pix. Acc. mIoU Pix. Acc. mIoU
R-D VPN 82.8% 31.2%
RGB 60.5% 8.7% 81.2% 28.5%
D+S (late fusion) 83.5% 33.9%
Depth 43.8% 2.5% 82.1% 29.9%
D-S VPN 86.3% 43.2%
Semantic 47.6% 6.5% 84.7% 41.0%
S+R (late fusion) 84.3% 35.7%
S-R VPN 85.1% 42.3%
D+S+R (late fusion) 84.3% 29.4%
D-S-R VPN 86.2% 43.6% last Residual Block and the Average Pool layer so that the
resolution of the encoding feature map remains large, which
better preserves the details of the view. We employ the pyramid
where IR , IS are the real RGB image and synthetic-style se- pooling module used in [7] as the decoder.
mantic mask respectively, PRGB→Mask is the existing semantic View Transformer Module. For each view relation module,
segmentation model which parses the real-world RGB into we simply use the two-layer MLP. We choose this because
semantic mask, and MReal→Synthetic is the semantic category two-layer MLP doesn’t bring too much extra computation so
mapping process where we construct the concept mappings that we can keep our model following the lightweight-and-
between the real world and the simulation environment. efficient rationale. Input and output dimensions of the VRM
Output space adaptation. Beyond the pixel-level transfer are both HI WI , where HI and WI are respectively the height
on input data, we also devise an adversarial training scheme and width of the intermediate feature map. As for the view
in structured output space based on the method proposed fusion module, we just add all the features up to keep the
in [17]. Here the generator G is a view parsing network shape consistent.
generating the top-down-view prediction P, which is initialized Sim-to-real. For the generator G , we use the architecture
by the weights of a VPN trained on the semantic data in the of the 4-view VPN. For the discriminator D, we adopt the
simulation environment as we illustrated before. During the same architecture in [17]. It has 5 convolution layers, each
training phase, we first forward a group of input images from of which is followed by a leaky ReLU with the parameter
the source domain {Is } to G and optimize it with a normal 0.2 (except the last layer). We use HRNet [18] pretrained on
segmentation loss Lseg . Then we use G to extract the feature CityScapes dataset [3] to extract the semantic mask from real-
map Fi (after the softmax layer) of the images from the target world images.
domain {It } and use discriminator to distinguish whether Ft
is from the source domain. The loss function to optimize G IV. EXPERIMENTS
can be written as follows: We first go through the overview of the cross-view segmen-
tation datasets in Section IV-A. Then we show the performance
L ({Is }, {It }) = Lseg ({Is }) + λadv Ladv ({It }), (3)
of VPN on synthetic data of the House3D and CARLA
where Lseg is the cross-entropy loss for semantic segmenta- environment in Section IV-B. Finally in Section IV-C, we
tion, Ladv is designed to train the G and fool the discriminator demonstrate the real-world performance of our VPN which
D. The loss function for the discriminator Ld is a cross- is trained in the simulation environment.
entropy loss for binary source & target classification.
A. Benchmarks
D. Network configuration Here we introduce two synthetic cross-view datasets,
View encoder and decoder. To balance efficiency and per- House3D cross-view dataset and Carla cross-view dataset, and
formance, we use ResNet-18 as the encoder. We remove the one real-world cross-view dataset, nuScenes dataset.
PAN et al.: CROSS-VIEW SEMANTIC SEGMENTATION FOR SENSING SURROUNDINGS 5
House3D cross-view dataset. Each data pair contains 8 first- the late-fusion baseline to compare with our multi-modalities
view input images captured from 8 different orientations with VPN, which simply averages the softmax outputs of each
45 degrees apart. Additionally, each data pair comes with single-modality VPN to obtain the final results. We find that
the top-down-view semantic mask captured in the ceiling- the Depth-Semantic VPN achieves the best performance and
level height. To be complete, we store the input image with makes a great improvement. This may be because semantic
multiple modalities including the RGB images, depth maps, mask and depth map are two complementary information.
and semantic masks. The training set contains 143k data pairs However, the Semantic-RGB combination does not bring too
from 342 scenes while the validation set contains 20k data much improvement. The reason can be that, for this cross-view
pairs from 68 scenes. semantic segmentation task, semantic input contains most of
NuScenes dataset. Each data sample contains in the useful information in the RGB.
NuScenes[19] first-view RGB images from 6 directions Importance of View Transformer Module. We further eval-
(Front, Front-right, Back-right, Back, Back-left, Front-left) in uate our model in Table III to show the importance of the
different modalities. We select 919 data samples without the view transformer module. The baseline network is a classic
top-down-view mask for unsupervised training and 515 data encoder-decoder architecture used in the standard semantic
samples with the binary top-down-view mask for evaluation. segmentation, in which the encoder and the decoder are the
CARLA cross-view dataset. To build the synthetic source same as our VPN. It simply sums up the feature maps from
domain dataset, we extract 28, 000 data pairs with top-down- different views and then feeds it to the decoder. Our VPN
view annotations and different input modalities from 14 driv- easily outperforms the baseline and, in some multi-view cases,
ing episodes in CARLA. Each data pair contains 6 first-view the baseline model does even worse than single-view one due
input image sets captured from the same 6 directions. to the bad fusion strategy.
Comparing with baseline. Table I shows that our VPN can
easily outperform the 3D geometric method. 3D Geometric
B. Evaluation
method is very easy to fail when there are obstacles. In
We present VPN performances on the synthetic data of Fig. 4, we can see that the 3D geometric method is unable
House3D cross-view and CARLA cross-view datasets. to reconstruct the objects which can not be directly observed,
Metrics. We report the results of cross-view semantic seg- even after filling the holes, such as the desk behind the chairs
mentation using two commonly used metrics in semantic shown in the figure. As for X-Fork, we can see that the
segmentation: P IXEL ACCURACY (PA) which characterizes original generator performs badly in our cross-view semantic
the proportion of correctly classified pixels, and M EAN I O U segmentation task. This is because X-Fork doesn’t have a
( M I O U) which indicates the intersection-and-union between necessary module to transform the first-view feature map into
the predicted and ground truth pixels. the top-down-view space. The ablation study in Table III
Baselines. Two methods are included as the comparison shows a similar issue that there is a significant performance
baselines: (1) 3D geometric method. With the observed depth drop when VPN doesn’t contain the VTM.
and RGB images, we can reconstruct the 3D points cloud
with the voxel-level semantic label. (2) Cross-view synthesis. C. Results of sim-to-real adaptation
We also compare with the architecture used in cross-view After we train and test our VPNs in the simulation environ-
image synthesis literature [15], which adopts a conditional ment, we transfer our model to the real-world data. We first
GAN called X-Fork to generate aerial images from street-view train a 6-view semantic VPN model on the predicted semantic
images. masks in CARLA simulator and then transfer it to nuScenes
1) Results of VPNs: We present the results of our VPN dataset by using an unsupervised domain adaptation process
for cross-view semantic segmentation in House3D, including as depicted in Section III-C. We provide the qualitative results
the ones of single-modality and multi-modalities VPN respec- in Fig. 3, from which we can see that our VPN can roughly
tively. To better evaluate our VPN, we impose an upper bound segment various road shapes like crossroads and also sketch
that we perform segmentation using top-view RGB images the relative locations of surrounding objects such as cars and
directly as inputs, where we get the performance of 91.4% buildings. As shown in Table IV, we evaluate the quantitative
pixel acc. and 41.2% mIoU. We also show the comparison results of real-world performance by using binary drivable-
with the geometric baseline and the ablation study of View area ground truth.
Transformer Module.
Single-modality VPN. We show the House3D results of TABLE IV: Results in real world.
single-modality VPN with different modalities and different Method Pix. Acc. Mean Acc. mIoU
numbers of views in Table I. We can see that as VPN receives
more views, the segmentation results improve rapidly. We also Before Adaptation 72.6% 61.4% 28.0%
plot some qualitative results by our VPNs in Fig. 4. On Carla After Adaptation 78.8% 65.2% 31.9%
dataset, we achieve the performance of 84.7% pixel acc. and
33.2% mIoU with a 6-view RGB-input model.
Multi-modalities VPN. We demonstrate the results of multi- V. EXPLORATION WITH TOP-DOWN-VIEW MAP
modalities VPN in Table II to show that our VPN can effec- When exploring an unknown space our humans head to the
tively synthesize information from multiple modalities. We set regions which they have not visited. This intuition reflects that
6 IEEE ROBOTICS AND AUTOMATION LETTERS. PREPRINT VERSION. ACCEPTED JUNE, 2020
Fig. 3: Qualitative results of sim-to-real adaptation. The results of source prediction before and after domain adaptation, drivable area
prediciton after adaptation and the groud-truth drivable area map.
First-view Projected 3D Geometric View Parsing Algorithm 1 Exploration decision policy at time t
observations points method Network Ground truth Input: A top-down-view free-space map Tt and a state map
St at time step t, where Tt , St ∈ {0, 1}L×L .
Output: Policy action at , where at ∈ {Forward, Back, Left-
forward, Right-forward, Done}.
1: Ut ← Tt ¬St ; at ← Done; ds ← +∞
T
Coverage area: 326 Coverage area: 632 Coverage area: 991 Coverage area: 1163
on the experimental results, we demonstrate that VPN can
be applied to mobile robots to facilitate the surrounding
awareness through a lightweight and efficient top-down-view
(a) Random walk (b) IL w/o top-view (c) Top-view navigation (d) Top-view navigation semantic map. In many situations where the height information
with GT
of objects is not essential, VPN could be a good alternative
Fig. 5: Examples of the surrounding exploration. Start point and end compared to the traditional 3D-based methods which are costly
point are marked as red point and green point respectively on both data memory and computation.