{'fraction_non_alphanumeric': 0.030187977909940527, 'fraction_numerical': 0.013885938827527613, 'mean_word_length': 5.171554972964116, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
SemAffiNet: Semantic-Affine Transformation for Point Cloud Segmentation

Conventional point cloud semantic segmentation methods usually employ an encoder-decoder architecture, where mid-level features are locally aggregated to extract geometric information. However, the over-reliance on these class-agnostic local geometric representations may raise confusion between local parts from different categories that are similar in appearance or spatially adjacent. To address this issue, we argue that mid-level features can be further enhanced with semantic information, and propose semantic-affine transformation that transforms features of mid-level points belonging to different categories with class-specific affine parameters. Based on this technique, we propose SemAffiNet for point cloud semantic segmentation, which utilizes the attention mechanism in the Transformer module to implicitly and explicitly capture global structural knowledge within local parts for overall comprehension of each category. We conduct extensive experiments on the ScanNetV2 and NYUv2 datasets, and evaluate semantic-affine transformation on various 3D point cloud and 2D image segmentation baselines, where both qualitative and quantitative results demonstrate the superiority and generalization ability of our proposed approach. Code is available at https://github.com/wangzy22/SemAffiNet.


Introduction
Point cloud semantic segmentation is a fundamental task for both structural representation learning [11,47,59] and stereoscopic scene understanding [15,28,51] in computer vision. It aims at partitioning the scene space into semanticmeaningful regions based on conformation and geometry knowledge inherited in point cloud layouts. Its successful applications in autonomous driving, robotic manipulation, and virtual reality have been motivating researchers to develop more fine-grained and more accurate solutions. Figure 1. Illustration of Semantic-Affine Transformation. The left figure is the input point cloud, with different colors referring to different categories. We select one local part (red circle) and extract its mid-level features, resulting in the top-right figure. Some representations of the points from different categories are entangled with each other in the embedding space, which may be caused by the appearance similarities or spatial adjacency. We propose to perform the semantic-affine transformation on these mid-level features, predicting particular affine parameters for each category respectively. Therefore, once obtaining classification predictions of mid-level points, we can pull points from the same category closer while pushing points from different categories apart via semanticaffine transformation, as is shown in the bottom-right figure.
Recent methods for point cloud segmentation usually adopt an encoder-decoder architecture as image semantic segmentation [4,6,7,53,72], ranging from voxel basedones [11,20,55,70,74] to point-based ones [35,48,57,63]. Despite the popularity of the encoder-decoder architecture, there still exists the local confusion problem as shown in Figure 1. On the one hand, there are local parts from different categories but with similar shapes, such as the similar legs of chairs and desks. On the other hand, adjacent local parts are blended in the input space and may obfuscate the model during segmentation, leaving ambiguous segment boundaries. The reasons are two folds: the heavy use of the local aggregation during feature processing, and the classagnostic nature of the mid-level features. In the commonlyused encoder-decoder architecture, the mid-level features of the decoder are locally aggregated via convolution or set abstraction. The limitation of receptive fields produces similar feature vectors for visually-similar local parts, and the aggregation operation results in entangled mid-level features for spatially-adjacent local parts. Therefore, it is insufficient to use geometric-only information and the encoderdecoder architecture demands more knowledge to separate similar and entangled local representations. One possible solution to this problem is alleviating the reliance on geometric knowledge and introducing additional semantic information to enrich mid-level features. However, most existing literature fails to fully exploit semantic knowledge in the network design of the encoder-decoder architecture, as semantic annotations are mostly used for data augmentation [8,45,68] or supervision on final prediction [47,48,59]. Therefore, the mid-level features from the intermediate layers are only implicitly or weakly supervised via gradient descent, making them almost class-agnostic.
To address the local confusion problem, we propose Semantic-Affine Transformation to transform mid-level decoder features with class-specific affine parameters that encode semantic information, which explicitly pulls features from the same category closer and pushes features from different categories apart. In this way, we enhance the semantic representation ability of mid-level features and boost semantic segmentation performance. Based on the proposed semantic-affine transformation, we design a semantic-aware network named SemAffiNet and introduce Transformer [58] to manage semantic information both implicitly and explicitly. The Transformer encoder implicitly communicates geometric information across modalities via the self-attention technique, while the special design of class queries in the Transformer decoder performs explicit semantic-aware reasoning to predict semantic-affine parameters via the cross-attention mechanism. We conduct extensive experiments on the ScanNetV2 [14] dataset and outperform the previous state-of-the-art BPNet [27] baselines. We also evaluate on the NYUv2 [44] dataset to verify the generalization ability of the SemAffiNet model. As the core of SemAffiNet, the proposed semantic-affine transformation is evaluated on both 3D point cloud and 2D image segmentation baselines under various settings, revealing the generalization ability of the proposed transformation.
In conclusion, the contributions of our paper can be summarized as follows: (1) We propose Semantic-Affine Transformation to enhance the semantic representation ability of mid-level features in encoder-decoder segmentation architecture. (2) We propose SemAffiNet to perform semanticaware segmentation both explicitly and implicitly via special designs of Transformer modules. (3) We conduct experiments on various datasets under different settings, revealing the superiority and generalization ability of our method.

Related Work
Point Cloud Semantic Segmentation. Existing point cloud semantic segmentation methods can be divided into four categories: voxel-based, point-based, projectionbased, and hybrid models. Voxel-based methods aim at partitioning 3D space into ordered voxels and translating 2D convolutional encoder-decoder architectures to 3D conditions, leading by VoxNet [41]. The heavy time expense and memory cost have been addressed by later researches, including sparse convolution [11,20], efficient data structure migration [33,52] and novel voxelization techniques [55,70,74]. Point-based methods directly process points and aggregate local information instead of using conventional regular convolution kernel, leading by PointNet [47] and PointNet++ [48]. Nowadays point-based methods has become the mainstream of point cloud cognition tasks and has been developed into many branches, including MLPbased [16,18,26,47,48], convolution-based [35,57,63,64] and graph-based [34,59] posterity. Projection-based methods are mostly designed for efficient processing, including image projection [1,13] and spherical projection [2,43,61,62]. Hybrid methods are more complicated systems that combine different processing methods or fuse different modality information. Some approaches combine longrange correlations from voxel-based methods and meticulous details from point-based methods [10,38,56,66], while other approaches fuse 2D and 3D knowledge [27,50].
Semantic-Aware Segmentation. As semantic information is critical to the segmentation task, some works elaborately design special semantic-aware approaches to boost semantic segmentation performance [19,40,49]. Some methods aim at reasoning context relations differently between same-category pairs and distinct-categories pairs. Depen-dencyNet [36] for image segmentation unifies dependency reasoning at three semantic levels: intra-class, inter-class and global. CGANet [40] for point cloud segmentation utilizes different aggregation strategies between the same category and different categories. Other methods propose multiscale supervision to realize comprehensive semantic guidance. In 2D vision, CPM [60] introduces intermediate supervision periodically while MSS-net [31] proposes layerwise loss. In 3D vision, RFCC [19] puts forward omnisupervision on all levels of the decoder layers. Different from the above methods, our method achieves comprehensive semantic awareness via semantic-affine  Figure 2. Illustration of the proposed network architecture. (a) shows the pipeline of the SemAffiNet, which consists of two backbone branches (gray), an implicit semantic-aware module (ISAM, dark blue), and two explicit semantic-aware modules (ESAM, light blue dash square). Moreover, ESAM is composed of a Transformer decoder and a Semantic-Affine Transformation module, which is further illustrated in (b). We calculate the weighted sum of class-specific affine parameters to obtain semantic-affine parameters for mid-level points, with mid-level classification confidences as linear combination weights. transformation for mid-level features. Therefore, we don't need different aggregation modules that increase model scale. Additionally, our semantic guidance for intermediate layers is stronger than merely multi-level supervisions.
Transformer for Segmentation. Transformer [58] has achieved a great success in many computer vision tasks, such as classification [17,37], detection [5], and reconstruction [67]. Recent works employ the attention mechanism in Transformer to exploit long-range correlations for deeper context comprehension and better segmentation results [21,71,73]. Maskformer [9] proposes a mask classification model that utilizes Transformer to predict binary masks and unifies both semantic-and instance-level segmentation. SOTR [22] proposes to dynamically generating instance segmentation masks based on Transformer attention module.
While we utilize a similar mask classification structure as Maskformer in our SemAffiNet, we migrate this idea from 2D image processing to 3D point cloud understanding, which is not trivial. Moreover, we propose semanticaffine transformation to further enhance the mask classification pipeline, which brings more progression than mask classification according to our ablation studies.

Approach
In the following section, we will first give an overview of the proposed SemAffiNet in Section 3.1. Then we will present details of the architecture, introducing the proposed semantic affine transformation in Section 3.2, revealing how we wrap it into a plug-and-play explicit semantic-aware module in Section 3.3, and presenting the auxiliary implicit semantic-aware module in Section 3.4. Finally, we will introduce the loss function design in Section 3.5.

Overview
We elaborately design SemAffiNet to perform the semantic-affine transformation on mid-level features from the conventional encoder-decoder model. Figure 2 shows the overall architecture, which can be divided into the following three parts: First of all, the backbone choice of SemAffiNet is flexible and our proposed modules can be easily added to any encoder-decoder segmentation architecture. We choose BP-Net [27] that consists of two encoder-decoder branches for 2D and 3D modalities to evaluate our proposed semanticaffine transformation. Please refer to the BPNet paper or our supplementary material for further details.
Most importantly, ESAM wraps our proposed semanticaffine transformation into a plug-and-play module, that explicitly exploits semantic information in mid-level features with specially designed Transformer decoders. As shown Figure 2, we employ two ESAM blocks in light blue dash square to manage semantic knowledge from different domains respectively. The Transformer decoder utilizes the cross-attention mechanism to obtain long-range dependencies for better semantic perception, while the following Semantic-Aware Transformation Module transforms mid-level features of backbone decoders with class-specific affine parameters to enlarge semantic distinctions across categories.
Last but not least, ISAM utilizes the self-attention mechanism in the Transformer encoder to enhance high-level features that are outputs from the backbone encoder and inputs to ESAM. The proposed ISAM fuses multi-modality information and realizes implicit semantic awareness.

Semantic-Affine Transformation
As semantic-affine transformation is the key contribution of our paper, we will first introduce its conceptual and technical details in this sub-section. The core idea is predicting semantic-affine parameters for each category and then determining affine parameters for each point based on its classification prediction.
Suppose there are N classes and the shape of midlevel features f i at layer i is (n i , d i ), indicating that there are n i points at layer i and each point is represented by a d i -dim feature vector. From Section 3.3 we can predict categories for each point p i j at layer i and obtain a classification confidence vector jk denotes confidence of point p j at layer i belonging to class k. Simultaneously, we regress semantic-affine parameters for each class at layer i, including scale factor Further technical details about the learning process of these semantic-aware parameters can be found in Section 3.3.
Then we can obtain the semantic-specific affine parameters S i j , B i j for each point p j at layer i via linear combination of the affine parameters family s i , b i based on per-point classification confidence vector a i j : Once normalized with zero-mean and unit covariance, can be further enhanced with the semantic-affine transformation to obtain semantic-aware mid-level featuref i j , which is used to replace f i j : Note that we implement a soft semantic-affine parameters assignment that introduces a linear combination instead of a hard one that restricts the searching space within the exact value of s, b. In other words, the hard assignment strategy only considers the highest confidence scores of the category predictions and chooses the exact affine parameters accordingly. The reason is that the mid-level points are aggregation results of itself and its neighbors in the adjacent lower level, and the neighbors may have different categories from the center query point. Therefore, the mid-level points p i may represent multiple classes when its corresponding patch in lower levels lies at the edges. We will further discuss this issue in Section 3.5.
We illustrate the principle of the semantic-affine transformation in Figure 3. The original representations of points from different categories in (a) are entangled with each other. Then we train a network to capture the underlying distinctions of scales and bias between different categories, as is shown in (b). Then we express these distinctions with semantic-affine parameters, which are demonstrated as arrow directions in (c). Finally, in (d), the semantic-affine transformation explicitly transforms mid-level features with similar category distributions towards similar scales and offsets, thus pulling them closer. On the contrary, for midlevel features with distinctive category distributions, their discrepancy in scales and offsets pushes them further apart.
According to the discussions above, the most important prerequisites for semantic-affine transformation are twofold. The first one is a precise class predictor, predicting accurate category distributions for mid-level points. The second one is a powerful semantic-aware module, regressing representative affine transformation parameters for each class. In Section 3.3, we show that these two prerequisites can be satisfied by a multi-layer Transformer decoder.

The Explicit Semantic-Aware Module
Our goal is to wrap the learnable parameters of semanticaware transformation introduced above into a plug-and-play module that can be implemented in most encoder-decoderstyle semantic segmentation architecture. We propose an Explicit Semantic-Aware Module (ESAM) as a multi-layer Transformer decoder module to jointly and explicitly inference semantic class masks and semantic affine parameters.
Cross attention in Transformer decoder. The input to ESAM is the high-level feature f 0 , which is the output from the backbone encoder. Particularly, we design N learnable class queries q (c) to enquire semantic-specific knowledge. Then each layer of ESAM utilizes the attention mechanism to reason semantic information from f 0 : where d k is the scaling factor, and Q, K, V are queries, keys, and values matrix. We employ class queries q (c) as Q, while K, V are mapped embeddings of f 0 . From each layer of ESAM, we can obtain class-specific features h ∈ R N ×d h of d h dimensions that encode both class-wise semantic knowledge from q (c) and geometry knowledge of the scene from f 0 .
Semantic-affine parameters. Based on the multi-layer Transformer decoder architecture of ESAM, we utilize the intermediate outputs from ESAM mid-level layers to calculate the semantic-affine parameters for mid-level layers of the backbone decoder: and there is a oneto-one and order-preserved mapping between backbone decoder mid-layer i and ESAM mid-layer u. The principle is using output features of deeper ESAM layer u to calculate semantic-affine parameters of deeper backbone decoder layer i. Please refer to the supplementary material for detailed correspondence between i and u. The outcoming scale and bias parameters s, b are then used to perform semantic-affine transformation introduced in Section 3.2.
Semantic class masks. The segmentation masks M = {m k ∈ R dm , 1 ≤ k ≤ N } for N classes per-point classification are calculated via the output h −1 from the final layer of ESAM: m k = MLP(h −1 k ). Then we implement dot product on class mask m k and per-point feature where a i jk indicates the confidence of point p j at layer i of the backbone decoder belonging to class k and is utilized in Section 3.2.
Note that in conventional per-point segmentation methods such as FCN [39] or encoder-decoder-style architecture UNet [53], per-point feature f −1 from the final layer of the decoder is further processed by an MLP block as segmentation head to obtain per-point class predictions. However, instead of linearly combining channel-wise values via fully connected layers to predict class confidence, we implement the above mask prediction and dot production with perpoint features to classify mid-level and final point features. The advantages of predicting class masks are two folds. On the one hand, the class masks have clearer interpretive meanings. Each mask m k represents the comprehensive feature of the class k, and the dot product between m k Figure 4. Illustration of ShadowNet that is designed to trace multihot ground truth label for mid-level points. Column (a) shows the local aggregation of stride operation in the backbone encoder. Column (b) shows how we record the class distribution of the points at the higher layer according to the class distribution of its corresponding patch at the lower layer. and the point feature measures the similarity between the point and the class. Therefore, the point is categorized into its most similar class. On the other hand, the class masks are more flexible to be implemented to predict categories of mid-level points. Once M is obtained, the dot-product operation is more lightweight than the MLP forward calculation. Therefore, class mask prediction is more suitable to combine with our proposed semantic-affine transformation.
In conclusion, ESAM explicitly predicts semantic class masks and semantic-affine parameters via a multi-layer Transformer decoder with learnable class queries. Each class query represents a category and inquires class-specific information in scene geometric representations. Then the semantic class masks are used to perform more flexible and lightweight multi-level per-point classification, while semantic-affine parameters are applied to transform midlevel features of the backbone decoder.

The Implicit Semantic-Aware Module
Besides ESAM that explicitly reasons semantic information via specially designed learnable class queries in the Transformer decoder, we also design ISAM to implicitly exploit and fuse semantic knowledge from multi-modalities.
In our implementation, 2D high-level feature f 0,2d and 3D high-level feature f 0,3d are concatenated together to form mixed Transformer encoder input f 0,mix . Then queries, keys, and values matrix are obtained via three different linear transformations of the input mix feature f 0,mix . Therefore, the self-attention calculation in Equation (3) are performed at both inter-modality and intra-modality to obtain more representative high-level featuresf 0,2d andf 0,3d . On the one hand, the intra-modality self-attention reasons long-range dependencies between local parts from the same modality, attaching global information to local part features. On the other hand, the inter-modality self-attention captures similarities between parts from different modalities, creates soft correspondences, and merges knowledge from the other modal to local features. Therefore, the output features of ISAM acquire both long-range global knowledge and multi-modal information, making them more robust and more representative. Thus the implicit semantic-awareness is realized via intra-domain and inter-domain self-attention, where queries that are more semantic-similar to keys contribute more to updating the values matrix.

The Loss Function
Following conventional supervised segmentation approaches, we use the Cross Entropy loss for vanilla 2D perpixel segmentation and 3D per-point segmentation.
Additionally, since we predict category labels for midlevel points in backbone decoders, we calculate the Binary Cross Entropy loss for mid-level segmentation. In order to obtain the mid-level ground truth of backbone decoders, we design ShadowNets to trace the stride operation in their corresponding backbone encoders. As is shown in Figure 4, stride operation in the encoder aggregates points {p i j } within a local patch P i j at layer i into a meta-point p i+1 j at higher layer i + 1. Suppose the one-hot label for point p i j is l i j , then our ShadowNet assigns the meta-point with multi-hot label l i+1 j that records labels of all points within its corresponding patch P i j at the lower layer i: In this way, the multi-hot ground truth labels represent class distributions of points at mid-level layers.

Experiments
In this section, we conduct extensive experiments on various datasets to verify the superiority of the proposed semantic-affine transformation and the SemAffiNet architecture, calculating the class-wise mean intersection over union (mIoU) as evaluation metrics. In Section 4.1, we will present the quantitative and qualitative results of the SemAffiNet, comparing them with previous works. Then in Section 4.2, we will implement the semantic-affine transformation on both 3D point cloud and 2D image segmentation baselines under different conditions to prove its generalization ability. Furthermore, in Section 4.3, we will provide ablation studies to demonstrate the effectiveness of each proposed module. Finally, in Section 4.4, we will discuss the limitations of our proposed approach. Additionally, experiments setup including datasets introduction and implementation details can be found in supplementary materials.

Main Results
Following BPNet [27], we conduct semantic segmentation experiments on ScanNetV2, evaluating both 2cm and 5cm voxel settings on validation set. The quantitative results are shown in Table 1. Under 5cm settings, SemAffiNet exceeds BPNet baseline by 1.5% and 3.1% respectively on 3D mIoU and 2D mIoU metrics. Under 2cm settings, Se-mAffiNet outperforms BPNet by 2.0% and 1.5% respectively on 3D and 2D segmentation results. We also surpass other previous 3D semantic segmentation methods that take point clouds as input [11,19,20,45,48,57,63,65] or use point clouds and auxiliary 2D images as input [30,69]. Besides ScanNetV2 which mainly focuses on 3D point cloud segmentation, we also conduct experiments on the NYUv2 [44] dataset that consists of RGB images and corresponding depth maps. We convert the depth image to pseudo point clouds according to camera pose and employ SemAffiNet. Following BPNet [27], we adopt the 13-class configuration and report the dense pixel classification accuracy. The experimental results are shown in Table 2, and our SemAffiNet outperforms those baselines by a large margin, which verifies its superiority.
The quantitative results are shown in Figure 5. From the first line example, our SemAffiNet is able to recognize the subtle chair crossbeam that BPNet baseline fails to correctly segment. From the second line example, our SemAffiNet correctly classifies the other furniture object which is visually similar to chair. From these qualitative results, we can prove the superiority of the SemAffiNet over the BPNet baseline. On the one hand, it has the ability to recognize subtle local parts that are easy to be confused with the background. On the other hand, it can correctly classify objects that are visually similar to other categories.

Effects of Semantic-Affine Transformation
Besides SemAffiNet architecture, we also evaluate the semantic-affine transformation independently by wrapping it as a plug-and-play module ESAM and inserting it into various 3D point cloud and 2D image encoder-decoder segmentation baselines. Point cloud methods can be further divided into voxel-based and point-based ones.
For voxel-based 3D segmentation methods, we select MinkowskiNet [11] as the baseline given its efficiency and high performance. We conduct semantic segmentation on the ScanNetV2 [14] validation set under both 5cm and 2cm voxelization settings, and the results are shown in the first two lines of Table 3. By inserting ESAM into Minkowsk-iNet, we reach a higher performance on 3D mIoU results.
For point-based 3D segmentation methods, we choose KPConv [57] (rigid) as the baseline, since it is one of the most classical point-based approaches and has been analyzed as the baseline in many recently published papers [19,45]. We conduct semantic segmentation on the S3DIS [3] dataset and the results are shown in the third line of Table 3. The qualitative results demonstrate the improvement made by ESAM, convincing the generalization ability of the semantic-affine transformation on both voxel-based and point-based point cloud segmentation methods. For 2D image segmentation methods, we choose the classical SemanticFPN [32] as the baseline, implementing ResNet-50 and ResNet-101 settings. We conduct semantic segmentation on the Cityscapes [12] dataset and the results are shown in the last two lines of Table 3. The quantitative results show that the proposed ESAM is not restricted within 3D domain and brings consistent improvements to 2D segmentation baseline under different settings.

Ablation Studies
In order to measure the contribution of each SemAffiNet module, we conduct ablation studies on the ScanNetV2 validation set under 5cm setting. ESAM can be divided into two parts: multi-level segmentation and semantic-affine transformation (SA). For multi-level segmentation, we incrementally add mid-level segmentation (M.) besides finallevel segmentation (F.) and replace fully connected classifier (FC) with mask classifier (M). ISAM module fuses multi-modality information (Fuse). The ablation results are shown in Table 4 and we conclude that each block makes its own contribution to the overall progression, where semantic-affine transformation is the most effective one.
Besides ablations on sub-modules of SemAffiNet, we further explore the superiority of the semantic-affine transformation by replacing it with Adaptive Instance Normalization(AdaIN) [29], whose affine parameters are entirely learned with gradient descent and lack explicit semantic guidance. Comparing line e, f, g in Table 4, AdaIN (line f ) brings little improvement compared with the vanilla Batch Normalization (line e). However, semantic-affine transformation (line g) yields more significant progression.
Furthermore, we also conduct ablation experiments on the number of 2D views (VN). According to line a, b, adding views to BPNet [27] baseline doesn't lead to better results but adds computation burden. The reason might be that the potential of the network is exhausted when processing 3 views. However, according to our experiments (line h and i), our SemAffiNet performs better on 3D semantic segmentation when increasing view numbers from 3 to 5. The experimental results show that our SemAffiNet reveals more semantic knowledge and has larger potential.

Limitations
Even though the proposed semantic-affine transformation is a general representation learning technique to enhance the semantic cognition ability of point clouds features, migrating and performing it on broader point cloud understanding tasks is a non-trivial problem. Since we need per-point supervision on mid-level points, we need to develop weakly-supervised or unsupervised learning techniques when the per-point annotation is inaccessible.

Conclusions
In this paper, we propose the semantic-affine transformation to explicitly map mid-level features of the backbone decoder to more semantic-distinct embeddings. Based on this technique, we build a semantic-aware segmentation network SemAffiNet. The ESAM explicitly predicts class masks and regresses semantic-affine parameters via the Transformer decoder with learnable query tokens, while the ISAM fuses multi-modal information via the self-attention mechanism. We conduct experiments with the SemAffiNet on the ScanNetV2 dataset and outperform the previous state-of-the-art BPNet. We also prove the generalization ability of the semantic-affine transformation by wrapping it into a plug-and-play ESAM and evaluating it on both 3D point cloud and 2D image segmentation baselines under various settings. We believe that the semantic-affine transformation will advance related works in the community, given its simple implementation and reasonable insights.
In this supplementary material, we provide the detailed network architecture of SemAffiNet in Section A. Then in Section B, we show additional experiments information, including the datasets introduction, implementation details and class-wise 3D point cloud segmentation mIoU on the ScanNetV2 [14] dataset.

A.1. The Backbone
We choose the BPNet [27] as our backbone, which consists of a 3D sparse convolution encoder-decoder branch and a 2D vanilla convolution encoder-decoder branch. The 3D branch implements the sparse convolution MinkowskiEngine [11] to build a ResNet-style architecture [24], while the 2D branch exploits the ResNet34 model as the encoder. The decoder blocks of these two branches are composed of residual blocks with interpolation operation for the 2D branch and transpose convolution for the 3D branch. Skip connections are added between the corresponding layers of encoders and decoders to pass lowlevel information. The bidirectional links between layers of the 2D branch and the 3D branch from the BPNet are kept to communicate knowledge between the two modalities. Please refer to the BPNet paper for further details about the bidirectional projections between 2D and 3D features.

A.2. The Implicit Semantic-Aware Module
The ISAM is a shared Transformer [58] encoder module that consists of N e = 6 encoder blocks to fuse 2D and 3D multi-modal information. Each encoder block consists of a Multi-Head Attention layer with 8 heads, two Layer-Norm layers and a Feed Forward layer. The input to the Transformer encoder is the concatenation of the high-level features from both 2D and 3D branches.

A.3. The Explicit Semantic-Aware Module
We design two similar explicit semantic-aware modules (ESAM) for 2D and 3D branches respectively. We wrap the learning parameters of ESAM into a Transformer [58] decoder module, predicting semantic-affine parameters and semantic class masks. Then semantic-affine transformations are then applied to multiple mid-level layers of the backbone decoder.
The Transformer decoder consists of N d = 6 decoder blocks. Each decoder block consists of a Multi-Head Attention layer with 8 heads, three LayerNorm layers, a Multi-Head Cross Attention layer with 8 heads and a Feed Forward layer. The input to the Transformer decoder is the output of the ISAM in the corresponding modality and the learnable class queries of shape (N, d h ), where N is the number of classes and d h = 128 is the hidden dimension. The position embeddings for the 2D branch are learnable embeddings with d h dimensions. We obtain the position embeddings for the 3D branch by feeding the coordinates of 3D point clouds to an MLP block with 3 linear layers.
The output features h u of shape (N, d h ) from the Transformer decoder layer u are prepared for predicting semantic-affine parameters and the output feature h −1 from the final layer of the Transformer decoder are used for predicting semantic class masks. Firstly, the output features of the Transformer decoder h −1 are fed through an MLP block with 3 linear layers to get the class masks M of shape (N, d m ), where d m = 128 is the class mask dimension. Secondly, the intermediate output features h u of the Transformer decoder layer u are fed through two separate MLP blocks with 5 linear layers to obtain class-specific affine parameters s i , b i for the backbone decoder layer i, where the correspondence between i and u is u = i + 2.
The Semantic-Affine Transformation is implemented to 3 mid-level layers of the backbone decoders. Once obtaining the backbone decoder feature f i at layer i, we can calculate the per-point or per-pixel classification prediction confidence as A i = M f i . Then the semantic-affine transformation parameters for each point S i , B i can be calculated via Equation(1) in our main paper according to s i , b i and A i . Then we transform the normalized featuref i j of the backbone decoders with Equation(2) in our main paper to enhance semantic information of mid-level features.

B.1. Datasets Introduction
We evaluate our SemAffiNet with both point cloud semantic segmentation task on the ScanNetV2 dataset and RGB-D image segmentation task on the RGB-D NYUv2 dataset. We also verify the generalization ability of the proposed semantic-affine transformation on pure 3D S3DIS dataset and pure 2D Cityscapes dataset. In this subsection, we will introduce these datasets in detail.
ScanNetV2 [14] is one of the most commonly used indoor scenes datasets. It consists of over 1500 scans of indoor scenes annotated with 20 commonly seen semantic classes. The RGB-D video dataset provides both 2D image-level color data and 3D point-cloud geometry data, thus being robust and comprehensive for 3D scene understanding. We follow the official split to train on 1201 training scans and test on 312 validation scans.
S3DIS [3] is another indoor scene dataset. It contains dense 3D point clouds extracted from 6 large-scale areas scanned from 271 rooms in 3 buildings and is annotated by 13 semantic classes. We follow the common protocol to split Area 5 as the test set and use other Areas for training.
NYUv2 [44] is a popular RGB-D dataset that focuses on 2D image segmentation. It consists of 1,449 pairs of aligned  RGB and depth images and we follow the official split to train on 795 samples and leave 654 for testing. We convert the depth image to pseudo point clouds according to camera pose, and the problem is transformed into 3D-2D multi-modality segmentation as ScanNetV2.
Cityscapes [12] is an outdoor 2D street-scene dataset that contains 2975 train images, 500 validation images and 1525 test images. The images have 1024*2048 resolutions and there are 19 classes. We do not use additional 20k images with coarse annotations.

B.2. Implementation Details
We implement our proposed SemAffiNet architecture with PyTorch [46] and utilize SGD optimizer [54] with base learning rate 2e −2 and weight decay 1e −4 . The learning rate of parameters in ISAM and ESAM is reduced by a factor of 0.1 for more stable training. We implement a squared learning rate scheduler with a warming up process. We train the model for 100 epochs with batch size 16. The loss weights for vanilla 3D and 2D segmentation Cross Entropy loss are 1 and 0.1 respectively, following BPNet settings. The loss weights for the auxiliary mid-level Binary Cross Entropy loss for 3D and 2D branches are kept at 1 for our experiments.

B.3. Class-wise Segmentation Results
The class-wise segmentation results on the 3D point cloud segmentation task of ScanNetV2 [14] validation set are shown in Table 5. We compare the proposed Se-mAffiNet with the BPNet baseline under both 5cm and 2cm settings. From the class-wise segmentation results, we can conclude that our SemAffiNet achieves a higher IoU on most categories and a higher mIoU than the BPNet baseline.