Language Conditioned Spatial Relation Reasoning for 3D Object Grounding
Abstract
Localizing objects in 3D scenes based on natural language requires understanding and reasoning about spatial relations.
In particular, it is often crucial to distinguish similar objects referred by the text, such as "the left most chair" and "a chair next to the window".
In this work we propose a language-conditioned transformer model for grounding 3D objects and their spatial relations.
To this end, we design a spatial self-attention layer that accounts for relative distances and orientations between objects in input 3D point clouds.
Training such a layer with visual and language inputs enables to disambiguate spatial relations and to localize objects referred by the text.
To facilitate the cross-modal learning of relations, we further propose a teacher-student approach where the teacher model is first trained using ground-truth object labels, and then helps to train a student model using point cloud inputs.
We perform ablation studies showing advantages of our approach.
We also demonstrate our model to significantly outperform the state of the art on the challenging Nr3D, Sr3D and ScanRefer 3D object grounding datasets.
Introduction
In order to enable robots to carry out human instructions in the real world, it is important for them to understand natural language and to ground the mentioned objects in 3D environments.
Therefore, research attention is shifting from object grounding in 2D images [1, 2, 3, 4, 5, 6] to the 3D object grounding task [7, 8], which localizes an object referred by a sentence in a 3D point cloud.
Language expressions often refer to objects by their relative spatial locations in 3D scenes.
Figureillustrates example scenes and corresponding sentences where object grounding requires disambiguation between objects of the same class.
For instance, “the backpack closest to the piano” requires to compare relative distances among objects, while “choose the door on the left when facing them” requires to infer the correct viewpoint and understand relative directions.
The complexity and diversity of spatial language make it extremely challenging for spatial reasoning in 3D scenes.
Given the critical role of the spatial language, many existing methods attempt to model spatial relations for 3D object grounding.
Early work [9, 10, 11, 12] explicitly build 3D visual graphs based on distances between objects and apply graph neural networks to learn relationships.
However, since only nearest neighbors are considered in the graph, it remains difficult to infer relationships between distant objects such as “farthest” .
More recently, transformer architectures [9, 13, 14, 15, 16] have been used, as they have the potential to learn relations between pairs of objects with a multi-head selfattention mechanism [17].
Enabling transformers to better understand 3D spatial relations expressed by natural language, however, remains an open research problem.
In addition, 3D object grounding suffers more from the scarcity of training data compared to its 2D counterpart.
The success of 2D object grounding models [18, 19] can be largely attributed to large-scale datasets with image-text pairs [1, 2, 20, 21], whereas the limited amount of 3D scene- [Figure] language pairs increases the difficulty of 3D object reasoning.
To address this challenge, Yang et al .
[14] propose to use 2D-3D alignments to assist the training of 3D models, but require additional high-quality 2D images and camera parameters which are not always available.
In this work, we propose
a Vi sion-and-
L anguage 3D Rel ation reasoning model (ViL3DRel) to tackle the above issues in 3D object grounding.
We design a new spatial self-attention layer for the transformer architecture to enhance 3D spatial understanding.
This layer encodes relative distances and orientations for all pairs of objects, and explicitly learns spatial attention to capture spatial relations referred by the the language expressions.
We propose a sigmoid softmax function to effectively fuse the spatial attention with standard self-attention.
Rotation augmentation is used to further improve view invariant reasoning.
To alleviate the negative effect of noisy object features, we further propose a teacher-student training approach.
The teacher and student share the same model architecture, but use different inputs.
The teacher uses ground-truth object labels, which enables to better learn the relation reasoning.
The learned relation knowledge is distilled to the student taking point cloud features as input.
Our code and models are available on the project webpage [22].
To summarize, our contributions are three-fold:
• We propose a ViL3DRel model for the 3D object grounding task.
It uses a new spatial self-attention to explicitly encode pairwise 3D spatial relations in the transformer layer for better language conditioned spatial understanding.
• We employ a teacher-student training strategy, which facilitates the cross-modal learning of relations.
The student with point cloud inputs benefits from the relation reasoning model of the teacher trained with ground-truth object label input.
• We evaluate our ViL3DRel approach on the challenging Nr3D, Sr3D [9] and ScanRefer [7] benchmarks. Our
model significantly outperforms state-of-the-art approaches, with 9.3, 8. absolute gains on Nr3D and Sr3D given ground-truth object proposals, and 4.47 points on ScanRefer using the same detected object proposals compared to the previous work [16] .
Related Work
2D and 3D Object Grounding.
The object grounding task aims to localize objects in 2D images or 3D point clouds given a sentence.
Existing approaches can be categorized into two groups, namely one- and two-stage frameworks.
The one-stage methods densely fuse the text features with patch- or point-level visual representations to directly regress the bounding box [18, 23].
These approaches are flexible to detect various objects given the input sentence.
The two-stage methods adopt a detection-then-matching pipeline [1, 7, 8, 24], where the detection stage generates object proposals, and then the matching stage selects the best proposal according to the sentence.
The decoupled object perception and cross-modal matching make the two-stage methods easier to analyze [15].
The benchmark datasets for 3D object grounding are ReferIt3D (Nr3D and Sr3D) [8] and ScanRefer [7], which are all built upon scenes and object annotations in the ScanNet dataset [25].
Graph-based approaches [26, 27] are widely adopted in early works to infer spatial relations.
The object graph is constructed by connecting each object with its top nearest neighbors [8, 10, 11] based on Euclidean distance.
Inspired by the success of transformers [17], recent works [9, 14, 15, 16, 23] have adopted transformers for 3D object grounding.
BEAUTY-DETR [28] and 3D-SPS [23] are one-stage methods.
However, most works follow the two-stage framework with pre-detected object proposals.
LanguageRefer [15] converts the cross-modal task into a language modeling problem with predicted object labels.
SAT [14] adopts a multimodal transformer and transfers 2D semantics to assist the training of the 3D model.
Multi-view transformer [16] aggregates object representations from multiple views to improve view robustness.
Perhaps most similar to our work, 3DVG-Transformer [13] proposes a coordinate-guided attention module to encode spatial distances among objects.
In contrast, we introduce a spatial self-attention module, which explicitly encodes both relative distances and relative orientations among objects.
It also conditions spatial relations on the language and presents a more effective strategy for attention fusion.
Transformers in Vision-and-Language.
Transformer-based architectures have led to significant improvements in various vision-and-language tasks such as text-video retrieval [29], visual grounding [18, 30], image captioning [31], vision question-answering [32] and vision-and-language navigation [33, 34].
Most of the methods project textual and visual inputs into a sequence of tokens, and use multimodal transformers to learn cross-modal semantic relationships.
While relative positional encoding (RPE) [35] has been explored mostly separately in vision and language transformers, we here integrate RPE with a cross-modal transformer and show its benefits for resolving spatial object relations referred by text.
Knowledge Distillation.
Knowledge distillation [36] is typically used to compress a large network (teacher) into a compact model (student).
The common objective is to let the student model mimic the soft logits of the teacher model.
Beyer et al .
[37] show that a consistent and patient teacher is essential in knowledge distillation.
Jiao et al .
[38] further demonstrate that the intermediate representations learned by the teacher are beneficial.
In contrast to distilling knowledge from a heavy model to a light one, our teacher network first learns cross-modal object relations using ground-truth object labels.
We then transfer this knowledge to the target student network that uses noisy inputs.
Method
Given a sentence S , the goal of 3D object grounding is to detect an object referred in S by locating its 3D bounding box B T ∈ R 6 in a 3D point clouds P scene .
We assume P scene ∈
R K × 6 contains
K points each represented by XYZ coordinates and RGB values.
We follow the detection-thenmatching framework [7, 8, 13, 14, 16] for 3D object grounding and assume to be given a list of object proposals ( O 1 , · · · , O N ) obtained via automatic 3D instance segmentation or ground-truth annotations (depending on the evaluation setup).
Each object O i is represented by a subset of K i points P i ⊂ P scene ,
P i ∈
R K i × 6 .
Our work is focused on interpreting spatial relations and selecting the target object O T , T ∈ [1 , N ] among N object proposals.
We first present an overview of our
ViL3DRel model in Section 3.1.
We then introduce our language-conditioned spatial self-attention module and the teacher-student training approach in Sections 3.2 and 3.3 respectively.
3.1 Architecture Overview
Figure 2 shows an overview of our ViL3DRel model, consisting of four modules: text encoding, object encoding, multimodal fusion and a grounding head as described next.
Text encoding.
Given the sentence S with M word tokens, we use a pre-trained BERT model [39] to encode S into a sequence of word features ( s cls , s 1 , · · · , s M ) , s i ∈ R d , where s cls is a special classification token and d is the dimensionality of the feature.
Object encoding.
For each object O i , we first normalize the coordinates of its point cloud P i into a unit ball, and then use PointNet++ [40] to compute the object feature o 0 i ∈ R d .
We also obtain the object center c i =
[ c x , c y , c z ] ∈ R 3 and the object size z i =
[ z x , z y , z z ] ∈ R 3 from object points P i as the mean and the spatial extent of P i respectively.
We use a linear projection layer to obtain the absolute 3D location feature as l i =
W l [ c i ; z i ] ∈ R d .
Multimodal fusion.
A stack of transformer layers [17] are applied to fuse the text and object modality features.
Each transformer layer is composed of a spatial self-attention layer, a cross-attention layer and a feed-forward neural network (FFN).
Our new spatial self-attention layer aims to improve the understanding of spatial relations among objects referred by the sentence.
Assume o li is the input embedding for object proposal O i before the i -th layer, we first add it with its absolute 3D location feature l i to enhance the spatial information. The spatial self-attention then generates contextualized object representations ˆ o li . We will describe the proposed spatial self-attention in details in Section 3.2. The cross-attention layer takes ˆ o li as queries and text features ( s cls , s 1 , · · · , s M ) as keys and values
… 3D Object Proposals (𝑂 ! ,…,𝑂 " ) Sentence 𝑆 ⊕
SpatialSelf-Attention
Cross-Attention
Feed-forwardNetwork x L
Net++Point ⊕
Net++Point
GroundingHead … 𝑝 !
𝑝 " “The correct [Figure] is the one farthest from the piano in the corner.” [Figure]
𝑓 !!
# 𝑓 !"
# 𝑓 "!
# 𝑓 ""# … … … … … 𝑐 ( … 𝑐 ) … … … … absolutepositions 𝑔 !"
SpatialAttentionMatrix
Linear 𝑊 # 𝜔 !!"
𝜔 !$" 𝜔 $!"
𝜔 $$" 𝑐 " ,𝑧 " 𝑐 ! ,𝑧 !
𝑜 (, … 𝑜 ),
Linear [Figure] [Figure]
Linear 𝑊 ’ 𝑠 !"
# ⊕ 𝑔 $ [Figure]
… ScaledDot- [Figure] … … … … … 𝜔 !!
( 𝜔 !$( 𝜔 [Figure]
( 𝜔 [Figure]
SigSof [Figure] tmax ⨂ $𝑜 (, … $𝑜 ), objecttokens sentencetoken
Self
AttentionMatrix to learn cross-modal relations.
The final FFN uses two fully connected layers to encode each output tokens after the attention layer.
For detailed explanation of Transformer attention and FFN layers please refer to [17].
Object grounding.
We use a two-layer feed-forward neural network as the object grounding head to predict the target object.
Given the output embedding o Li from the last multimodal fusion layer, the grounding head generates a scalar score for each object proposal O i and applies softmax function to obtain the probability p i .
The object proposal with the maximum probability is predicted as target.
3.2 Spatial Self-Attention
The standard self-attention relies on token embeddings to learn relations among tokens.
However, the input embeddings of object proposals are mixed with semantic features and absolute 3D locations, making it difficult to accurately infer spatial relations among objects such as relative distances or orientations in Figure 1.
As spatial relations among objects referred by language are important to distinguish object instances, we propose to inject a language conditioned spatial attention that explicitly captures pairwise spatial relations to complement the standard self-attention.
We first describe the standard self-attention and then introduce our proposed spatial self-attention as illustrated in the right part of Figure 2.
Given the feature matrix X ∈ R N × d for N object proposals, the self-attention mechanism first computes the query, key and value embeddings from X as Q = XW Q , K = XW K , V = XW V respectively, where W Q , W K ,
W V ∈ R d × d h are learnable parameters and d h is the dimensionality of the output embedding.
It then calculates attention weights given the query and key embeddings and aggregates the value embeddings as follows:
[Equation]
where Ω o is an N × N attention matrix, whose elements ω oij is the attention weight between the i -th and j -th object proposal.
In order to capture more diverse relations, multi-head self-attention is used where each head computes an independent SelfAttn ( Q, K, V ) and the outputs from all heads are concatenated.
To model spatial relations among objects, we propose to use explicit pairwise spatial features f sij ∈ R 5 , i, j ∈ [1 , N ] .
For each pair of objects ( O i , O j ) , we compute their Euclidean distance d ij = ||
c i − c j || 2 as well as horizontal and vertical angles θ h , θ v of the line connecting object centers c i and c j .
The computation details of the angles are provided in the appendix A.
We then define the pairwise spatial feature f sij as:
[Equation]
We automatically generate a language conditioned weight g si to select relevant spatial relations for each object proposal O i as we mainly care about spatial relations described in the text for an object:
[Equation]
[Figure] Attention Distillation Hidden State Distillation where
W S ∈ R
d × 5 is a learnable parameter and we omit the bias term for simplicity.
We then define the spatial relevance for ( O i , O j ) as:
[Equation]
We modulate the self-attention in Eq (1) with the above language conditioned spatial relevancy using the sigmoid softmax (sigsoftmax) fusion function:
[Equation]
where σ ( · ) is the sigmoid function.
In this way, we compute the new self-attention matrix Ω =
[ ω ij ] N × N which explicitly considers 3D relative spatial locations, absolute spatial locations and object appearances in relation reasoning.
We also use the multi-head mechanism to support different types of spatial relations and compute multiple spatial attentions to fuse with the standard self-attention.
We concatenate the outputs from all heads in the spatial self-attention layer.
3.3 Teacher-Student Training
Incorrect estimation of object classes from P i can deteriorate the cross-modal alignment and spatial relation reasoning.
To improve object grounding in point clouds previous work [14] relies on additional supervision in 2D images.
Here, instead, we propose a new teacher-student training approach using no additional training data.
The teacher and student models share the same transformer architectures except for the object encoding module.
The teacher uses ground-truth object semantic features, while the student uses 3D point clouds.
Since there is less cross-modal gap between the teacher’s inputs and the sentence, the teacher model can excel at learning language relevant spatial relations among objects and aligning objects with the sentence.
Such knowledge can then be distilled to the student model to improve its training.
Figure 3 illustrates the teacher-student training pipeline.
We describe the inputs of the teacher and the knowledge distillation objectives in the following.
Teacher’s inputs.
We use ground-truth class labels and dominant colors of the object as the object representations for the teacher model, since the color is the most widely used attributes in the sentence.
Specifically, we encode the ground-truth object class label using pre-trained Glove word vectors [41].
To obtain the dominant colors of the object, we fit a Gaussian Mixture model on the RGB values of all points in the object, where the mixture component is set to 3.
We linearly project the mean value in each component into a color embedding and use the mixture weights of the components to average all the color embeddings.
The final object representation is the sum of the class label embedding and the averaged color embedding.
Knowledge distillation objectives.
We transfer the attention weights and hidden states in the multimodal fusion module of the teacher model to the student model.
The self-attentions learned by the teacher capture spatial relations among objects, and the cross-attentions measure cross-modal matching, which are both essential for 3D object grounding but hard to learn given noisy object features.
We facilitate student learning by forcing it to mimic all the attention matrices Ω of the teacher using the following objective function:
[Equation]
where Ω S · and Ω T · are attention weights in student and teacher model respectively, MSE ( · ) is the mean square error function, L is the number of multimodal fusion layers and H is the number of heads in self-attention.
In addition to distilling the relation knowledge in attention weights, we also distill the output embeddings of the transformer layers:
[Equation]
Training.
We follow the previous works [8, 7] to use multiple auxiliary losses in training the transformer model, including a 3D object grounding loss L og , sentence classification loss L sent and two object classification losses L uobj and L mobj .
L sent relies on s cls to predict the target object class from the sentence.
L uobj and L mobj use unimodal object representation o
i and multimodal fused object representation o Li respectively to predict the classes for input object proposals. Details are in appendix A.
Therefore, the overall training objective is as follows:
[Equation]
where λ a , λ h are two hyper-parameters to balance the losses.
Experiments 4.1 Datasets
Nr3D dataset [8].
It contains 37,842 human written sentences that refer to annotated objects in the 3D indoor scene dataset ScanNet [25].
The dataset includes 641 scenes with 511 (resp. 130) scenes for training (resp. validation).
It covers 76 target object classes.
The annotated sentences are designed to refer to objects with multiple same-class distractors in the scene.
The sentences are split into “easy” and “hard” subsets in evaluation, where the target object in “easy” subset only contains one same-class distractor in the scene while it contains multiple ones in the “hard” subset.
According to whether the sentence requires a specific viewpoint to ground the referred object, the dataset can also be partitioned into “view depedent” and “view independent” subsets.
Sr3D dataset [8].
It uses templates to automatically generate sentences.
The sentences only utilize spatial relations to distinguish objects of the same class.
It has 1,018 training scenes andvalidation scenes from ScanNet and 83,570 sentences in total.
The dataset can be split in the same way as Nr3D during evaluation.
ScanRefer dataset [7].
It has 51,583 human written sentences for 800 scenes in ScanNet.
We follow the official split and use 36,665 and 9,508 samples for training and validation respectively.
According to whether the target object is a unique object class in the scene, the dataset can be divided into a “unique” and a “multiple” subset.
4.2 Experimental Setting
Evaluation Metrics.
We evaluate models under two evaluation settings.
One uses ground-truth object proposals, which is the default setting in the Nr3D and Sr3D datasets.
The metric is the accuracy of selecting the target bounding box among the proposals.
The other setting does not provide ground-truth object proposals and requires the model to regress a 3D bounding box, which is the default setting for the ScanRefer dataset.
The evaluation metrics are acc@0.25 and acc@0.5, which is the percentage of correctly predicted bounding boxes whose IoU is larger than 0.25 or 0. with the ground-truth.
Implementation details.
For the model architecture, we set the dimension d = 768 and use 12 heads for all the transformer layers.
The text encoding module is a three-layer transformer initialized from
BERT [39], and the multimodal fusion module contains four layers.
The object encoding module
PointNet++ [40] samples 1024 points for all the objects.
These architecture parameters are the same as in previous work [14, 16] to ensure a fair comparison.
We first train the PointNet++ for object classification on ScanNet, which achieves 61.9% accuracy on the validation set.
Its weights remain fixed during the following training steps.
Rotation augmentation is used to increase the viewpoint invariance.
The hyper-parameters in the loss function Eq (8) are set to λ a = 1 and λ h = 0 .
We train the model with a batch size of 128 and a learning rate of 0.0005 with warm-up of 5000 iterations and cosine decay scheduling.
The AdamW algorithm [42] is used in the optimization.
We train forepochs for the teacher model and 100 epochs for the student model on Nr3D and ScanRefer datasets.
The training epochs are reduced to half on the Sr3D dataset, as it is larger and easier to converge.
All models are trained on a single NVIDIA RTX A6000 GPU. [Table]
4.3 Ablation Studies
We carry out extensive experiments on the Nr3D dataset to demonstrate the effectiveness of our proposed spatial self-attention and teacher-student training. The ablations on the ScanRefer dataset are provided in appendix B.
4.3.1 Spatial Relation Reasoning
We evaluate the proposed spatial self-attention with ground-truth object labels, which decouples the object perception from spatial relation reasoning.
Table 1 presents the results on the Nr3D dataset.
Baselines.
Our baseline R1 is the teacher model in the left part of Figure 3 without the object color, the proposed spatial self-attention and the rotation augmentation.
This baseline achieves similar performance as the state-of-the-art LanguageRefer [15] (Overall accuracy: 54.3%) which also utilizes ground-truth object labels.
Row R2 shows that the additional color information helps the object grounding, since the sentences often describe the color attributes.
The rotation augmentation brings additional gains; it improves from 55.1% (R2) to 62.4% (R3).
It is more effective for view independent sentences (+8.7%) than for view dependent sentences (+4.5%) because rotation augmentation mainly improves view invariance.
The performance of R3 serves as a strong baseline.
We will show the contributions of our proposed model on top of it.
Pairwise spatial features: distance vs. orientation.
In R4-R5, we compare different pairwise spatial features of Eq (2).
R4 only uses the pairwise distances, while R5 only uses the pairwise orientations.
We can see that the pairwise distances benefit the view independent sentences which contain distance-related spatial relations such as “next to” and “farthest from” , but do not improve the performance for view dependent sentences.
In contrast, pairwise orientations significantly boost the performance for view dependent sentences (+10.2%).
This shows that explicitly encoding the relative orientations facilitates the learning of view dependent spatial relations such as “in front of” and “to the left of” .
The relative distance and orientation features are also complementary.
Their combination achieves the best performance as shown in our full model (R9). [Table]
Table 3 provides a more systematic analysis of R3-5 and R9 in
Table 1 to show the contribution of spatial relation modeling to different types of sentences.
We categorize sentences into four groups according to whether a sentence describes distances or orientation spatial relations.
We can see that the explicit pairwise distance modeling contributes most to the distance only sentences but has little influence on orientation related sentences.
The pairwise orientation modeling instead can dramatically improve orientation related sentences by 10.5%. Combining both pairwise distance and orientation modeling achieves the best performance on all categories. Pairwise spatial feature computation. We compute the pairwise distances and angles using the coordinates of object centers and design the spatial features as shown in Eq (2).
In Table 2, we further compare the proposed method with two variants to show its
[Table]
effectiveness.
One uses the bottom center of objects to compute pairwise vertical angles which ignores the height of objects and could be more accurate to measure vertical relations; for the other, we directly concatenate the bounding boxes of two objects and use a multi-layer perceptron (MLP) to learn the pairwise spatial relations rather than hardcoding the spatial features.
We can see that using the bottom center achieves similar performance as using the object center, which suggests that the object center is sufficient to capture the vertical spatial relations of objects in the textual descriptions.
The learnable MLP, however, achieves much worse performance than our approach.
This indicates that it is challenging to implicitly learn pairwise spatial relations and the proposed spatial features designed by domain knowledge are beneficial.
Multi-head spatial attention. The model in R6 uses single-head attention for the spatial relevance ω sij in Eq (5) though keeps multi-head for the standard attention weight ω oij .
Compared to the full model R9 with multi-head spatial attention, such single-head spatial attention achieves significantly worse performance.
This suggests that the multi-head is necessary to learn spatial relations. [Table]
Attention fusion.
We utilize a sigmoid softmax function in Eq (5) to aggregate the spatial attention and the standard self-attention weights.
We compare the proposed fusion mechanism with standard relative positional encoding methods [35] in vision transformers: bias mode and contextual mode.
The bias mode adds the spatial attention weight as a bias term in the standard self-attention, while the contextual mode further considers the interaction with queries by injecting the pairwise spatial features into the key embeddings.
From the results in R7 and R8, we can see that the standard relative positional encoding methods fail to model 3D spatial relations among objects; they even perform worse than the strong baseline (R3), which doesn’t rely on relative positional encoding.
The proposed sigmoid softmax function is by far more effective to modulate the standard self-attention with spatial relations. Text encoding.
We follow recent works [14, 16] to use the first three layers of BERT textual encoder, while [11] uses weaker textual encoder (Glove+GRU). To compare these different textual encoders, Table 4 provides results of our proposed models under the setting in Table 1. We can see that more
BERT layers do not lead to better performance.
The reason might be that the representations from higher BERT layers are less generalizable to different domains.
Moreover, more layers are more prone
[Table]
to overfit and harder to optimize.
The pretrained BERT model achieves much better performance than GRU model trained from scratch.
4.3.2 Teacher-Student Training
[Table]
The teacher model with ground-truth object labels learns well how to perform spatial relation reasoning given the input sentence.
Figure 4 provides a qualitative example of the learned cross- and self-attention weights at all multimodal fusion layers in the teacher model.
For the cross-attention weights, we can see that the teacher first aligns the object proposal with the correct words in the text, and then gradually shifts its attentions to relation words to perform spatial relation reasoning.
For the self-attention weights, in the first layer, the teacher mostly attends to nearby objects to be aware of the context; then in the second layer, it focuses more on the reference object mentioned in the sentence ( e.g . , the whiteboard); finally, it concentrates on the same-class distractors to distinguish them.
Such reasoning steps are promising to ease the training of the student model.
In the following, we evaluate the proposed teacher-student training to distill relational knowledge from the teacher to a student with point cloud inputs extracted from the ground-truth object proposals.
Table 5 presents the performance of different student models.
The first row in the student block does not use any knowledge from the teacher model.
In the second row, we use the weights in the teacher model to initialize the student model since the teacher and student share the same architecture except for the input object representations.
Such simple weight initialization already facilitates the training of the student, and achieves 4.5% gains.
The attention distillation in Eq (6) and hidden state distillation in Eq (7) are both beneficial to improve the student model compared to the first row without knowledge distillation.
It is more effective to distill the relation knowledge in the attention weight matrices.
The combination of L attn and L hidden is helpful and achieves the best performance.
We empirically find that combining weight initialization and the two distillation losses performs similarly as using the distillation losses alone.
4.4 Comparison with state-of-the-art Methods
In Table 6, we compare our ViL3DRel model with state-of-the-art methods on Nr3D and Sr3D datasets.
All the compared works use ground-truth object proposals, but no ground-truth labels.
Our model achieves significant improvements over the previous best method [16], with 9.3% and 8.3% absolute gains on Nr3D and Sr3D respectively.
We outperform [13] by even larger margins on the two datasets.
This work also use spatial information, but doesn’t use a spatial attention module.
[Table] Table 7 and Table 8 present results on ScanRefer dataset with ground-truth object proposals and detected object proposals, respectively.
For fair comparison, we utilize a pre-trained PointGroup [43] model to generate object proposals, which is trained on 18 classes in ScanNet.
To be noted, the upper block in Table 8 optimizes the detection stage or utilizes single-stage pipeline.
These methods use [Table] more data to train the object proposals, so the comparison to these methods is not entirely fair.
There is a large gap between the ground-truth and detected proposals (over 12% for our method), because the detected proposals might not include the target or reference objects in the sentence.
However, our ViL3DRel model still outperforms the state of the art in both settings.
Though our proposed spatial relation module can also be plugged into transformer-based 3D object detectors [44] to improve the 3D object proposal generation, we leave it to future work.
Figurecompares our ViL3DRel model and a baseline without spatial selfattention and teacher-student training.
We present more qualitative comparisons in the appendix C.
Conclusion
In this work, we propose a ViL3DRel model for 3D object grounding.
It contains a newly designed spatial self-attention module to improve language conditioned spatial relation reasoning in the transformer layer, which explicitly considers relative distances and orientations among objects.
A teacher-student training approach is further proposed to transfer relation knowledge from a teacher with ground-truth object labels to a student with point cloud inputs.
The proposed model significantly outperforms the state of the art on Nr3D, Sr3D and ScanRefer datasets.
Beyond the application of 3D object grounding, the general approach of incorporating priors into a self-attention layer for a transformer to combine multimodal input can be of wide interest.
Since our model belongs to the two-stage framework, it is limited by imperfect object proposals in the first detection stage.
We also did not explore to explicitly extract object orientations to more accurately estimate pairwise spatial relations as the automatic object poses prediction remains a challenging problem.
In addition, the evaluation can suffer from the fact that existing datasets do not represent a rich diversity of environments though we carried out extensive ablations to mitigate the problem.
This paper has minimal ethical, privacy and safety concerns.
Acknowledgments and Disclosure of Funding
This work was granted access to the HPC resources of IDRIS under the allocation 101002 made by
GENCI.
It was funded in part by the French government under management of Agence Nationale de la Recherche as part of the “Investissements d’avenir” program, reference ANR19-P3IA- (PRAIRIE 3IA Institute), the ANR project VideoPredict (ANR-21-FAI1-0002-01) and by Louis
Vuitton ENS Chair on Artificial Intelligence.
Checklist
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] See the conclusion section.
(c) Did you discuss any potential negative societal impacts of your work?
[Yes] See the conclusion section.
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[N/A] (b) Did you include complete proofs of all theoretical results?
[N/A] 3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[No] We will release the code, data and instructions upon acceptance.
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
[Yes] See the experiment section.
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes] See the supplementary material.
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] See the experimental section.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] (b) Did you mention the license of the assets?
[Yes] (c) Did you include any new assets either in the supplemental material or as a URL?
[No] (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[N/A] (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A]
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] Appendix A Implementation Details A.1 Computing horizontal and vertical angles between two objects
For two objects A and B, assume that the coordinates of the object center are ( x a , y a , z a ) and ( x b , y b , z b ) . We can compute the Euclidean distance between A and B as d . The horizontal angle θ h is arctan2 ( y b − y a x b − x a ) and the vertical angle θ v is arcsin ( z b − z a d ) . In other terminology, the horizontal angle corresponds to the azimuth direction while looking from point A to B, while the vertical angle corresponds to the elevation.
The rotation augmentation is to rotate the whole point clouds by different angles. Specifically, we randomly select one from four angles [0°, 90°, 180°, 270°]. A.3 Training losses
We utilize auxiliary losses L sent and L ∗ obj following previous works [7, 9, 13, 14, 16] which have shown to be beneficial for the performance.
They are all cross entropy losses.
L sent is to predict the target object class from the sentence.
L ∗ obj is to predict the object class for each object token.
When training the teacher model, all the losses are used; while when training the student model, since the pointnet is fixed, the L uobj will not influence the model weights.
B Additional Results B.1 Ablations Studies on ScanRefer Dataset
In the main paper, we provide ablation studies on the Nr3D dataset.
Here, we further evaluate our method on the ScanRefer dataset to demonstrate the effectiveness of the proposed spatial self-attention and teacher-student training.
with groundtruth object labels.
Dist stands for Distance; Ort for Orientation; MHA for Multi-Head spatial Attention; RotAug for Rotation Augmentation; sigs for sigsoftmax in Eq (5); and ‘-’ means not applicable.
Spatial
[Table] Reasoning RotAug Color
Overall Dist
Ort
MHA
Fusion
R - - - - × × 56.
R - - - - × ✓ 57.
R - - - - ✓ ✓ 59.
R ✓ × ✓ sigs ✓ ✓ 63.
R × ✓ ✓ sigs ✓ ✓ 60.
R ✓ ✓ × sigs ✓ ✓ 63.
R ✓ ✓ ✓ bias ✓ ✓ 59.
R ✓ ✓ ✓ ctx ✓ ✓ 58.
R ✓ ✓ ✓ sigs ✓ ✓ 63.
Table 9 presents the grounding accuracy using the ground-truth object labels on the ScanRefer dataset.
By comparing R1-R3, we observe that the color information and rotation augmentation is beneficial to provide a stronger baseline.
The proposed spatial selfattention (R9) significantly improves the strong baseline (R3), with the absolute gain of 4.79%.
However, different from the Nr3D dataset, the sentences in the
ScanRefer dataset are less focused on spatial relations and contain more attribute descriptions such as colors and shapes to refer to target objects.
Therefore, the overall performance gain from R3 to R9 is smaller compared to the Nr3D dataset.
The rows R4 and R5 analyze the contributions of relative spatial features to the performance.
We can see that both relative distances and orientations outperform the baseline in R3, and that the relative distances are more important in the ScanRefer dataset.
Their combination achieves the best performance in R9.
The multi-head attention is also beneficial comparing R6 and R9.
In R7 and R8, we compare the proposed sigmoid softmax function with the other two common relative position encoding methods.
Our proposed fusion method is most effective to exploit both the spatial attention and the standard self-attention weights.
[Table]
Table 10 compares models using ground-truth object proposals on the ScanRefer dataset.
The first row in the student model block does not utilize any knowledge from the teacher model which uses ground-truth object labels as inputs.
Initializing from the weights in the teacher only brings a slight improvement as shown in the second row.
However, our proposed knowledge distillation achieves over 2% boost compared to the baseline in the first row.
Both attention weights and hidden states are beneficial to train a better student model with noisy object features.
The hidden state distillation slightly outperforms attention distillation which is different from the results on the Nr3D dataset.
The reason could be that the spatial relations are mentioned more frequently in the Nr3D dataset while object attributes are more typical in the ScanRefer dataset.
B.2 Robustness to Random Seeds
[Table]
We use the same random seed of 0 for all the experiments.
In the following, we verify the robustness of the proposed ViL3DRel model by measuring the average and standard derivations of the grounding accuracy under 5 different random seeds.
From the results in Table 11, we can see that the proposed model is stable with low derivations across different random seeds.
C Qualitative Results
Figure 5 compares predictions by our proposed ViL3DRel model and the baseline model without the spatial self-attention and knowledge distillation.
We can see that our model is better at object perception (left example) while reasoning about different types of spatial relations such as relative distances (middle example) and orientations (right example).
In Figure 6, we further provide some failure cases of the ViL3DRel model.
Example on the left is missing object proposals for the outlet and television.
Since our model belongs to the two-stage method, its performance is highly dependent on the quality of object proposals in the first stage.
The middle example suggests that the current model still suffers from recognizing fine-grained attributes from the point clouds.
The right example further requires reasoning about object orientations, which might be hard to estimate from noisy point clouds.
[Figure]
[Figure]