{'fraction_non_alphanumeric': 0.034554553092011546, 'fraction_numerical': 0.014756912736968988, 'mean_word_length': 4.881417830290011, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Orientation-aware Semantic Segmentation on Icosahedron Spheres

We address semantic segmentation on omnidirectional images, to leverage a holistic understanding of the surrounding scene for applications like autonomous driving systems. For the spherical domain, several methods recently adopt an icosahedron mesh, but systems are typically rotation invariant or require significant memory and parameters, thus enabling execution only at very low resolutions. In our work, we propose an orientation-aware CNN framework for the icosahedron mesh. Our representation allows for fast network operations, as our design simplifies to standard network operations of classical CNNs, but under consideration of north-aligned kernel convolutions for features on the sphere. We implement our representation and demonstrate its memory efficiency up-to a level-8 resolution mesh (equivalent to 640 x 1024 equirectangular images). Finally, since our kernels operate on the tangent of the sphere, standard feature weights, pretrained on perspective data, can be directly transferred with only small need for weight refinement. In our evaluation our orientation-aware CNN becomes a new state of the art for the recent 2D3DS dataset, and our Omni-SYNTHIA version of SYNTHIA. Rotation invariant classification and segmentation tasks are additionally presented for comparison to prior art.


Introduction
We address the problem of spherical semantic segmentation on omnidirectional images. Accurate semantic segmentation is useful for many applications including scene understanding, robotics, and medical image processing. It is also a key component for autonomous driving technology. Deep convolutional neutral networks (CNNs) have pushed the performance on a wide array of high-level tasks, including image classification, object detection and semantic segmentation. In particular, most research on CNNs for semantic segmentation [18,22,30,4] Figure 1. Given spherical input, we convert it to an unfolded icosahedron mesh. Hexagonal filters are then applied under consideration of north alignment, as we efficiently interpolate vertices. Our approach is suited to most classical CNN architectures, e.g. U-Net [22]. Since we work with spherical data, final segmentation results provide a holistic labeling of the environment. spective images. In our work, we focus on omnidirectional images, as such data provides a holistic understanding of the surrounding scene with a large field of view. The complete receptive field is especially important for autonomous driving systems. Furthermore, recent popularity in omnidirectional capturing devices and the increasing number of datasets with omnidirectional signals make omnidirectional processing very relevant for modern technology. While spherical input could be represented as planar equirectangular images where standard CNNs are directly applied, such choice is inferior due to latitude dependent distortions and boundaries. In [25] a perspective network is distilled to work on equirectangular input. The main drawback is that weight sharing is only enabled in horizontal direction. Therefore, the model requires more parameters than a perspective one. SphereNet [9] projects equirectan-gular input onto a latitude-longitude grid. A constant grid kernel is convolved with each vertex on the sphere by sampling on the tangent plane. However, it is not straightforward to implement pooling and up-sampling for dense prediction tasks.
In 3D shape analysis, one of the challenges in applying CNNs is how to define a natural convolution operator on non-euclidean surfaces. Several works [3,20,2] have focused on networks for manifolds or graphs. Unlike general 3D shapes, omnidirectional images are orientable with the existence of north and south poles. Therefore, the lack for shift-invariance on surfaces or graphs could be overcome with an orientation-aware representation.
Most recently, several works propose to use an icosahedron mesh as the underlying spherical data representation. The base icosahedron is the most regular polyhedron, consisting of 12 vertices and 20 faces. It also provides a simple way of resolution increase via subdivision. In [14], UGSCNN is proposed to use the linear combinations of differential operators weighted by learnable parameters. Since the operaters are precomputed, the number of parameters is reduced to 4 per kernel. The main issue of this approach, as observed in our experiments, is that it requires a lot of memory for their mesh convolution if the resolution is lifted for better input/output quality. Similar to our method in the use of icosahedron, [7] proposes a gauge equivariant CNN. Here, filter weights are shared across multiple orientations. While rotation covariance and invariance is essential in applications such as 3D shape classification and climate pattern prediction, it might be undesired in the semantic segmentation task which we consider here. On the contrary, we argue that the orientation information from cameras attached to vehicles or drones is very important a cue and should be exploited. Therefore, we propose and investigate a novel framework for the application of CNNs to omnidirectional input, targeting semantic segmentation. We take advantage of both, the icosahedron representation for efficiency and orientation information to improve accuracy in orientationaware tasks (Fig. 1). Our hypothesis is that aligning all learnable filters to the north pole is essential for omnidirectional semantic segmentation. We also argue that high resolution meshes (i.e. a level-8 icosahedron mesh) are needed for detailed segmentation. Due to memory restrictions, CNN operations need to be implemented efficiently to reach such high resolution.
In our work, we first map the spherical data to an icosahedron mesh, which we unfold along the equator, similarly to cube maps [19,5] and [17,7]. In the icosahedron, vertices have at most 6 neighbors. Therefore, we propose to use a hexagonal filter that is applied to each vertex's neighborhood. After simple manipulation of the unfolded mesh, standard planar CNN operations compute our hexagonal convolutions, pooling and up-sampling layers. Finally we emphasize, since our filters are similar to standard 3 × 3 kernels applied to the tangent of the sphere, weight transfer from pretrained perspective CNNs is possible.
To validate our approach we use the omnidirectional 2D3DS dataset [1] and additionally prepare our Omni-SYNTHIA dataset, which is produced from SYNTHIA data [23]. Qualitative as well as quantitative results demonstrate that our method outperforms previous state-of-theart approaches in both scenarios. Performance on spherical MNIST classification [6] and climate pattern segmentation [21] is also shown in comparison with previous methods in literature. In summary, our contributions are: 1. We propose and implement a memory efficient icosahedron-based CNN framework for spherical data.
2. We introduce fast interpolation for orientation-aware filter convolutions on the sphere.
3. We present weight transfer from kernels learned through classical CNNs, applied to perspective data. 4. We evaluate our method on both non-orientation-aware and orientation-aware, publicly available datasets.

Related Work
CNNs on Equirectangular Images Although classical CNNs are not designed for omnidirectional data, they could still be used for spherical input if the data are converted to equirectangular form. Conversion from spherical coordinates to equirectangular images is a linear one-to-one mapping, but spherical inputs are distorted drastically especially in polar regions. Another artifact is that north and south poles are stretched to lines. Lai et al. [15] apply this method in the application of converting panoramic video to normal perspective. Another method along this line is to project spherical data onto multiple faces of a convex polygons, such as a cube. In [19], omnidirectional images are mapped to 6 faces of a cube, and then trained with normal CNNs. However, distortions still exist and discontinuities between faces have to be carefully handled.
Spherical CNNs In order to generalize convolution from planar images to spherical signals, the most natural idea is to replace shifts of the plane by rotations of the sphere. Cohen et al. [6] propose a spherical CNN which is invariant in the SO(3) group. Esteves et al. [11] use spherical harmonic basis to achieve similar results. Zhou et al. [31] propose to extend normal CNNs to extract rotation-dependent features by including an additional orientation channel.
CNNs with Deformable Kernels Some works [10,13] consider adapting the sampling locations of convolutional kernels. Dai et al. [10] propose to learn the deformable convolution which samples the input features through learned offsets. An Active Convolutional Unit is introduced in [13] to provide more freedom to a conventional convolution by using position parameters. These methods requires additional model parameters and training steps to learn the sampling locations. In our work, we adapt the kernel shape to fit icosahedron geometry. Unlike deformable methods, our sampling locations can be precomputed and reused without the need of training.
CNNs with Grid Kernels Another line of works aim to adapt the regular grid kernel to work on omnidirectional images. Su and Grauman [25] propose to process equirectangular images as perspective ones by adapting the weights according to the elevation angles. Weight sharing is only enabled along the longitudes. To reduce the computational cost and degradation in accuracy, a Kernel Transformer Network [26] is applied to transfer convolution kernels from perspective images to equirectangular inputs. Coors et al. [9] present SphereNet to minimize the distortions introduced by applying grid kernels on equirectangular images.
Here, a kernel of fixed shape is used to sample on the tangent plane according to the location on the sphere. Wrapping the kernel around the sphere avoids cuts and discontinuities.
CNNs with Reparameterized Kernels For the efficiency of CNNs, several works are proposed to use parameterized convolution kernels. Boscani et al. [2] introduce oriented anisotropic diffusion kernels to estimate dense shape correspondence. Cohen and Welling [8] employ a linear combination of filters to achieve equivariant convolution filters. In [28], 3D steerable CNNs using linear combination of filter banks are developed. Recently, Jiang et al. [14] utilized parameterized differential operators as spherical convolution for unstructured grid data. Here, a convolution operation is a linear combination of four differential operators with learnable weights. However, these methods are limited to the chosen kernel types and are not maximally flexible.
CNNs on Icosahedron Related to our approach in discrete representation, several works utilize an icosahedron for spherical image representation. As the most uniform and accurate discretization of the sphere, the icosahedron is the regular convex polyhedron with the most faces. A spherical mesh can be generated by progressively subdividing each face into four equal triangles and reprojecting each node to unit length. Lee et al. [16] is one of the first to suggest the use of icosahedrons for CNNs on omnidirectional images. Here, convolution filters are defined in terms of triangle faces. In [14], UGSCNN is proposed to efficiently train a convolutional network with spherical data . Similar to cubes [19,5], we unfold our mesh (c) and align its 5 components to the standard image grid (d) for efficient computation of convolution, pooling and up-sampling.
mapped to an icosahedron mesh. Liu et al. [17] uses the icosahedron based spherical grid as the discrete representation of the spherical images and proposes an azimuth-zenith anisotropic CNN for 3D shape analysis. Cohen et al. [7] employ an icosahedron mesh to present a gauge equivariant CNN. Equivariance is ensured by enforcing filter weight sharing across multiple orientations.

Proposed Spherical Representation
We represent the spherical input through vertices on an icosahedron mesh (Fig. 2). The mapping is based on the vertices' azimuth and zenith angles -e.g. the input color is obtained from an equirectangular input through interpolation. Similar to cube maps [19,5], the icosahedron simplifies the sphere into a set of planar regions. While the cube represents the sphere only with 6 planar regions, the icosahedral representation is the convex geodesic grid with the largest number of regular faces. In total, our gird consists of 20 faces and 12 vertices at the lowest resolution, and f r = 20 * 4 r faces and n r = 2+10 * 4 r vertices at resolution level r ≥ 0. Note, a resolution increase is achieved by subdivision of the triangular faces at r = 0 into 4 r equal regular triangular parts. In the following, we present an efficient orientation-aware implementation of convolutions in §3.1, and our down-and up-sampling techniques in §3.2. Finally, weight transfer from trained kernels of standard perspective CNNs is discussed in §3.3.

Orientation-aware Convolutions
If a camera is attached to a vehicle, the orientation and location of objects such as sky, buildings, sidewalks or roads are likely similar across the dataset. Therefore, we believe an orientation-aware system can be beneficial, while tasks with arbitrary rotations may benefit from rotation invariance [6] or weight sharing across rotated filters [29,7].

Efficient Convolutions through Padding
We first define the north and south pole as any two vertices that have maximum distance on the icosahedron mesh. Similar to [17,7], the mesh is then converted to a planar representation by unfolding it along the equator (Fig. 2). Finally, we split the surface into five components, and align the vertices with a regular image grid through a simple affine transformation.
Notice, vertices have a neighborhood of either 5 or 6 points. Hence we employ hexagonal filters in our work, instead of regular 3 × 3 kernels. Let us ignore the vertices at the poles (e.g. through reasoning of dropout), and adjust the neighborhood cardinality to 6 for all vertices with 5 neighbors through simple repetition. Now, our planar representation of the icosahedron simplifies the convolution with hexagonal filters to standard 2D convolution with a masked kernel, after padding as shown in Fig. 3.
North-alignment through Interpolation In its natural implementation, our filters are aligned to the icosahedron mesh. Consequently, the filter orientation is inconsistent, since the surfaces near the north and south poles are stitched. We reduce the effect of such distortions by aligning filters vertically through interpolation (Fig. 4).
The naïve convolution with weights {w j } 7 j=1 at vertex v i and its neighbors {v n i j } 6 j=1 , is computed as 6 j=1 w j v n i j + w 7 v i , where n i j holds the neighborhood indices of v i . Instead, we north-align the neighborhood with interpolations using arc-based weights {θ i j } 6 j=1 as follows: Since the hexagonal neighborhood is approximately symmetric, we further simplify (1) by introducing a unified weight α i , such that {α i ≈ θ i j } 6 j=1 holds. Hence we write Thus, north-aligned filters can be achieved through 2 standard convolutions, which are then weighted based on the vertices' interpolations α i . The arc-interpolation α i is based on the angle distance between the direction towards the first and sixth neighbors (i.e. v n i 1 and v n i 6 respectively) and the north-south axis when projected onto the surface of the sphere. In particular, we first find the projective plane of the north-south axis a = 0 1 0 T towards vector v i as the plane with normal n i = vi×a |vi×a| . Since the spherical surface is approximated by the plane of vectors v i − v n i 1 and v i − v n i 6 , we only require the angles between these vectors and the plane given by n i , to find interpolation α i = φi φi+ψi with .

Pooling and Up-sampling
Down-sampling through pooling and bi-linear upsampling are important building blocks of CNNs, and are frequently employed in the encoder-decoder framework of semantic segmentation (e.g. [22]). Pooling is aimed at summarising the neighborhood of features to introduce robustness towards image translations and omissions. Typically, a Figure 5. The weights of conventional 3 × 3 kernels trained on perspective data can be transferred to our model via simple interpolation as our filters operate on the sphere's tangent planes.
very small and non-overlapping neighborhood of 2 × 2 pixels is considered in standard images, to balance detail and redundancy. Bi-linear up-sampling is used in the decoder to increase sub-sampled feature-maps to larger resolutions. We note, in our icosahedron mesh the number of vertices increases by a factor of 4 for each resolution (excluding poles). Therefore during down-sampling from resolution r to r − 1, we summarize a neighborhood of 4 at r with 1 vertex at r − 1. A natural choice is to pool over vertices v i that are represented in both resolutions. Thus, we apply a simple standard 2 × 2 strided pooling with kernel 2 × 2 on each icosahedron part.
Analogously, bi-linear up-sampling or transposed convolutions are applied by padding the icosahedron parts at left and top followed by up-sampling by a factor of 2 in height and width (Fig. 3). Due to padding, this results in a 1-pixel border at each size which we simply remove to provide the expected up-sampling result.
Finally we emphasize, methods like pyramid pooling [30] can be computed by combining our pooling and upsampling techniques.

Weight Transfer from Perspective Networks
Similar to SphereNet [9], our network applies an oriented filter at the local tangent plane of each vertex on the sphere. Consequently, the transfer of pretrained perspective network weights is naturally possible in our setup. Since we apply hexagonal filters with 7 weights, we interpolate from the standard 3 × 3 kernels as shown in Fig. 5. Specifically, we align north and south of the hexagon with the second and eighth weight of the standard convolution kernel respectively. Bi-linear interpolation provides the remaining values for our filter. After transfer, weight refinement is necessary, but can be computed on a much smaller dataset (as done in [9]), or reduced learning iterations. Alternatively, but left for future work, it should be possible to learn hexagonal filter weights directly on perspective datasets [27,12].

Evaluation
The main focus of this paper is omnidirectional semantic segmentation. Both synthetic urban scene and real indoor environments are evaluated. For completeness, we also include our model in comparison with previous state-of-theart methods on spherical MNIST classification in §4.1 and a climate pattern prediction task in §4.2. In §4.3 and §4.4, performance on omnidirectional semantic segmentation tasks are summarized and analysed.

Spherical MNIST
We follow [6] in the preparation of the spherical MNIST dataset, as we prepare non-rotated training and testing (N/N), non-rotated training with rotated testing (N/R) and rotated training and testing (R/R) tasks. Both non-rotated and rotated versions are generated using public source code provided by UGSCNN [14]. 1 Training set and test set include 60,000 and 10,000 digits, respectively. Input signals for this experiment are on a level-4 mesh (i.e. r = 4). The residual U-Net architecture of [14], including the necessary modifications to adapt to the classification task, is used in our experiments. We call this network "HexRUNet-C".
As shown in Table 1, our method outperforms previous methods for N/N, achieving 99.45% accuracy. In R/R, our method performs better than competing Spherical CNN and UGSCNN. Gauge Net benefits from weight sharing across differently oriented filters, and achieves best accuracy for this task amongst all approaches. Similar to [14], our method is orientation-aware by design and thus not rotationinvariant. Therefore, it is expected to not generalize well to randomly rotated test data in the N/R setting, while Spherical CNN performs best in this case.

Climate Pattern Segmentation
We further evaluate our method on the task of climate pattern segmentation. The task is first proposed by Mudigonda et al. [21], and the goal is to predict extreme weather events, i. idation set are shown in Table 2 and Fig. 6 use the same residual U-Net architecture as UGSCNN [14]. We include two variants using different numbers of parameters: HexRUNet-8 and HexRUNet-32 use 8 and 32 as output channels for the first convolution layer, respectively. As is shown, both versions outperform UGSCNN in terms of mean accuracy. With 32 features, HexRUNet-32's mean accuracy is similar to best performing Gauge Net. However, our method does not match Gauge Net in terms of mean average precision (mAP). We attribute this to the fact that there is no direct orientation information to exploit in this climate data. In contrast, Gauge Net shows its advantage of weight sharing across orientations.

Stanford 2D3DS
For our first omnidirectional semantic segmentation experiment, we evaluate our method on the 2D3DS dataset [1], which consists of 1413 equirectangular RGB-D images. The groundtruth attributes each pixel to one of 13 classes. Following [14], we convert the depth data to be in meter unit and clip to between 0 and 4 meters. RGB data is converted to be in the range of [0, 1] by dividing 255. Finally, all data is mean subtracted and standard deviation normalized. The preprocessed signals are sampled on a level-5 mesh (r = 5) using bi-linear interpolation for images and nearest-neighbors for labels. Class-wise weighted cross-entropy loss is used to balance the class examples.
Using our proposed network operators, we employ the residual U-Net architecture of [14], which we call HexRUNet (see Sup. Mat. for details). We evaluate our method following the 3-fold splits, and report the mean intersection over union (mIoU) and class accuracy (mAcc) in Table 3 and 4, respectively. Our method outperforms orientation-aware method UGSCNN [14], rotationequivariant method Gauge Net [7] and the U-Net base- line [22] on equirectangular images that have been subsampled to mach level-5 mesh resolution. As for per-class evaluations, our method achieves best performance in most classes. This demonstrates that semantic segmentation indeed benefits from our orientation-aware network.

Omni-SYNTHIA
To further validate our method on omnidirectional semantic segmentation, we create an omnidirectional version from a subset of the SYNTHIA datset [23]. The SYN-THIA dataset consists of multi-viewpoint photo-realistic frames rendered from a virtual city and comes with pixellevel semantic annotations for 13 classes. We refer the readers to [23] for details. We select the "Summer" sequences of all five places (2×New York-like, 2×Highway and 1×European-like) to create our own omnidirectional dataset. We split the dataset into a training set of 1818 images (from New York-like and Highway sequences) and use 451 images of the European-like sequence for validation. Only RGB channels are used in our experiments. The icosahedron mesh is populated with data from equirectangular images using interpolation for RGB data and nearest neighbor for labels. Again, we report mIoU and mAcc. Here we use the standard U-Net architecture [22] to facilitate weight transfer from perspective U-Net in one of our experiments. We call this network "HexUNet". For an ablation study, we also evaluate our method without north-alignment described in §3.1, denoted as "HexUNet-nI".
Comparison with State-of-the-art We compare our method to UGSCNN [14]    6 (r = 6). We also include planar U-Net [22] using original perspective images, which have been sub-sampled to match the icosahedron resolution (see Sup. Mat. for details). Table 5 and 6 report mIoU and mAcc respectively, while Fig. 8 shows qualitative results. HexUNet outperforms previous state-of-the-art with significant margin across most classes.
The performance on small objects, e.g. "pedestrian" and "sign", is poor, while all methods fail for "cyclist". We attribute this to an unbalanced dataset. Note here, class-wise weighted cross-entropy loss is not used. Finally we emphasize, HexUNet performs slightly better than HexUNet-nI, thus verifying the importance of orientation-aware filters in semantic segmentation.
Evaluation at Different Resolutions Most previous methods limit their mesh resolution to level r = 5 which consists of merely 2,562 vertices to represent omnidirectional input. In contrast, an icosahedron mesh at level r = 8 is required to match the pixel number of 640×1024 images, with 655, 362 ≈ 655, 360. Since we believe high resolution input/output is beneficial for the semantic segmentation task, we evaluate our method at different resolutions (r = {6, 7, 8}), shown in Table 7. Our method achieves best performance at r = 7, while r = 7 and r = 8 perform similar. Since we use a standard U-Net structure consisting of only 4 encoder (and decoder) layers, perception of context is reduced at r = 8. This is further illustrated by the bottom-rightmost result in Fig. 9, where a car's wheel is misclassified as road-markings. Resolution r = 6 and r = 7 are able to adequately label this. Finally, network training times are shown in Table 8.
Evaluation of Perspective Weights Transfer As shown in §3.3, our method utilizes an orientation-aware hexagon convolution kernel which allows direct weight transfer from perspective networks. Initialized with the learned filters (3 × 3 kernels) from perspective U-Net, we perform weight refinement of only 10 epochs (in contrast to up-to 500 epochs otherwise), and report results as "HexUNet-T" in Table 5, 6 and 7. The proposed filter transfer obtains competitive results, especially at resolution level r = 8.

Conclusion
We introduced a novel method to perform CNN operations on spherical images, represented on an icosahedron mesh. Our method exploits orientation information, as we introduce an efficient interpolation of kernel convolutions, based on north-alignment. The proposed framework is simple to implement, and memory efficient execution is demonstrated for input meshes of level r = 8 (equivalent to a 640 × 1024 equirectangular image). In our evaluation on 2D3DS data [1] and our Omni-SYNTHIA version of SYN-THIA [23], our method becomes the new state of the art for the omnidirectional semantic segmentation task. Furthermore, weight transfer from pretrained standard perspective CNNs was illustrated in our work.
One limitation of the proposed approach is the poor seg-  Table 7. Evaluation at different resolution on Omni-SYNTHIA dataset. (The current implementation of [14] could not fit data with resolution higher than r = 6 to our 11Gb GPU memory, thus no results are available for UGSCNN at r = {7, 8}.) r = 6 r = 7 r = 8 UGSCNN 1055s 7817s -HexUNet 238s 406s 978s mentation accuracy for small objects (e.g. "pedestrian" and "cyclist") which we attribute to unbalanced dataset. Future work will incorporate better architectures such as [30,24] for improved segmentation of small objects. Finally, we plan to exploit our framework for further orientation-aware learning tasks, such as localization and mapping.