FEW-SHOT CONCEPT LEARNING
Year: 2021

Abstract:
We present neural architectures that disentangle RGB-D images into objects’ shapes and styles and a map of the background scene, and explore their applications for few-shot 3D object detection and few-shot concept classification. Our networks incorporate architectural biases that reflect the image formation process, 3D geometry of the world scene, and shape-style interplay. They are trained end-to-end self-supervised by predicting views in static scenes, alongside a small number of 3D object boxes. Objects and scenes are represented in terms of 3D feature grids in the bottleneck of the network. We show that the proposed 3D neural representations are compositional: they can generate novel 3D scene feature maps by mixing object shapes and styles, resizing and adding the resulting object 3D feature maps over background scene feature maps. We show that classifiers for object categories, color, materials, and spatial relationships trained over the disentangled 3D feature sub-spaces generalize better with dramatically fewer examples than the current state-of-the-art, and enable a visual question answering system that uses them as its modules to generalize one-shot to novel objects in the scene.

heading: 1 INTRODUCTION
text: Humans can learn new concepts from just one or a few samples. Consider the example in Figure 1. Assuming there is a person who has no prior knowledge about blue and carrot, by showing this person an image of a blue carrot and telling him “this is an carrot with blue color”, the person can easily generalize from this example to (1) recognizing carrots of varying colors, 3D poses and viewing conditions and under novel background scenes, (2) recognizing the color blue on different objects, (3) combine these two concepts with other concepts to form a novel object coloring he/she has never seen before, e.g., red carrot or blue tomato and (4) using the newly learned concepts to answer questions regarding the visual scene. Motivated by this, we explore computational models that can achieve these four types of generalization for visual concept learning.
We propose disentangling 3D prototypical networks (D3DP-Nets), a model that learns to disentangle RGB-D images into objects, their 3D locations, sizes, 3D shapes and styles, and the background scene, as shown in Figure 2. Our model can learn to detect objects from a few 3D object bounding box annotations and can further disentangle objects into different attributes through a self-supervised view prediction task. Specifically, D3DP-Nets uses differentiable unprojection and rendering operations to go back and forth between the input RGB-D (2.5D) image and a 3D scene feature map. From the scene feature map, our model learns to detect objects and disentangles each object into a 3D shape code and an 1D style code through a shape/style disentangling antoencoder. We use adaptive instance normalization layers (Huang & Belongie, 2017) to encourage shape/style disentanglement within each object. Our key intuition is to represent objects and their shapes in terms of 3D feature representations disentangled from style variability so that the model can correspond objects with similar shape by explicitly rotating and scaling their 3D shape representations during matching.
Project page: https://mihirp1998.github.io/project_pages/d3dp/ ∗Equal contribution †Work done while at Carnegie Mellon University
With the disentangled representations, D3DP-Nets can recognize new concepts regarding object shapes, styles and spatial arrangements from a few human-supplied labels by training concept classifiers only on the relevant feature subspace. Our model learns object shapes on shape codes, object colors and textures on style codes, and object spatial arrangements on object 3D locations. We show in the supplementary how the features relevant for each linguistic concept can be inferred from a few contrasting examples. Thus the classifiers attend only to the essential property of the concept and ignore irrelevant visual features. This allows them to generalize with far fewer examples and can recognize novel attribute compositions not present in the training data.
We test D3DP-Nets in few-shot concept learning, visual question answering (VQA) and scene generation. We train concept classifiers for object shapes, object colors/materials, and spatial relationships on our inferred disentangled feature spaces, and show they outperform current stateof-the-art (Mao et al., 2019; Hu et al., 2016), which use 2D representations. We show that a VQA modular network that incorporates our concept classifiers shows improved generalization over the state-of-the-art (Mao et al., 2019) with dramatically fewer examples. Last, we empirically show that D3DP-Nets generalize their view predictions to scenes with novel number, category and styles of objects, and compare against state-of-the-art view predictive architectures of Eslami et al. (2018).
The main contribution of this paper is to identify the importance of using disentangled 3D feature representations for few-shot concept learning. We show the disentangled 3D feature representations can be learned using self-supervised view prediction, and they are useful for detecting and classifying language concepts by training them over the relevant only feature subsets. The proposed model outperforms the current state-of-the-art in VQA in the low data regime and the proposed 3D disentangled representation outperforms similar 2D or 2.5D ones in few-shot concept classification.

heading: 2 RELATION TO PREVIOUS WORKS
text: Few-shot concept learning Few-shot learning methods attempt to learn a new concept from one or a few annotated examples at test time, yet, at training time, these models still require labelled datasets which annotate a group of images as “belonging to the same category”(Koch et al., 2015; Vinyals et al., 2016b). Metric-based few-shot learning approaches (Snell et al., 2017; Qi et al., 2018; Schwartz et al., 2018; Vinyals et al., 2016a) aim at learning an embedding space in which objects of the same category are closer in the latent space than objects that belong to different categories. These models needs to be trained with several (annotated) image collections, where each collection contains images of the same object category. Works of Misra et al. (2017); Purushwalkam et al. (2019); Nikolaus et al. (2019); Tokmakov et al. (2019) compose attribute and nouns to detect novel attribute-noun combinations, but their feature extractors need to be pretrained on large annotated image collections, such as Imagenet, or require annotated data with various attribute compositions. The proposed
model is pretrained by predicting views, without the need for annotations regarding object classes or attributes. Our concept classifiers are related to methods that classify concepts by computing distances to prototypes produced by averaging the (2D CNN) features of few labelled examples (Snell et al., 2017; Qi et al., 2018; Schwartz et al., 2018). The work of Prabhudesai et al. (2020) learns 3D prototypes in a self-supervised manner, but they do not disentangle their representation into style and shape codes. We compare against 2D and 3D few shot learning methods and outperform them by a significant margin. The novel feature of our work is that we learn concept prototypes over disentangled 3D shape and 1D style codes as opposed to entangled 3D or 2D CNN features.
Learning neural scene representation Our work builds upon recent view-predictive scene representation learning literature (Tung et al., 2019; Sitzmann et al., 2019; Eslami et al., 2016). Our scene encoders and decoders, the view prediction objective, and the 3D neural bottleneck and egostabilization of the 3D feature maps is similar to those proposed in geometry-aware neural networks of Tung et al. (2019). Sitzmann et al. (2019) and Eslami et al. (2016) both encode multiview images of a scene and camera poses into a scene representation, in the form of 2D scene feature maps or an implicit function. Sitzmann et al. (2019) only considers single-object scenes and needs to train a separate model for each object class. We compare generalization of our view predictions against Eslami et al. (2016) and show we have dramatically better generalization across number, type and spatial arrangements of objects. Furthermore, the above approaches do not explicitly disentangle style/shape representations of objects. Zhu et al. (2018) focuses on synthesizing natural images of objects with a disentangled 3D representation, but it remains unclear how to use the learnt embeddings to detect object concepts. Different from most inverse graphics networks (Tung et al., 2017; Kanazawa et al., 2018) that aim to reconstruct detailed 3D occupancy of the objects, our model aims to learn feature representations that can detect an object across pose and scale variability, and use them for concept learning. Our shape-style disentanglement uses adaptive instance normalization layers (Huang et al., 2018; Huang & Belongie, 2017) that have been valuable for disentangling shape and style in 2D images. Here, we use them in a 3D latent feature space.

heading: 3 DISENTANGLING 3D PROTOTYPICAL NETWORKS (D3DP-NETS)
text: The architecture of D3DP-Nets is illustrated in Figure 2. D3DP-Nets consists of two main components: (a) an image-to-scene encoder-decoder, and (b) an object shape/style disentanglement encoder-decoder. Next, we describe these components in detail.

heading: 3.1 IMAGE-TO-SCENE ENCODER-DECODER
text: A 2D-to-3D scene differentiable encoder Esc maps an input RGB-D image to a 3D feature map M ∈ Rw×h×d×c of the scene, where w, h, d, c denote width, height, depth and number of channels, respectively. Every (x, y, z) grid location in the 3D feature map M holds a c-channel feature vector that describes the semantic and geometric properties of a corresponding 3D physical location in the 3D world scene. We output a binary 3D occupancy map Mocc ∈ {0, 1}w×h×d from M using an occupancy decoder Docc. A differentiable neural renderer Dsc neurally renders a 3D feature map M to a 2D image and a depth map from a specific viewpoint. When the input to D3DP-Nets is a sequence of images as opposed to a single image, each image It in the sequence is encoded to a corresponding 3D per frame map Mt, the 3D rotation and translation of the camera with respect to the frame map of the initial frame I0 is computed and the scene map M is computed by first rotating and translating Mt to bring it to the same coordinate frame as M0 and then averaging with the map built thus far. We will assume camera motion is known and given for this cross frame fusion operation.
D3DP-Nets are self-supervised by view prediction, predicting RGB images and occupancy grids for query viewpoints. We assume there is an agent that can move around in static scenes and observes them from multiple viewpoints. The agent is equipped with a depth sensor and knowledge of its egomotion (proprioception) provided by the simulator in simulated environments.We train the scene encoders and decoders jointly for RGB view prediction and occupancy prediction and errors are backpropagated end-to-end to the parameters of the network:
Lview−pred =‖Dsc (rotate(M, vq))− Iq‖1 + log(1 + exp(−Oq ·Docc((rotate(M, vq)) , vq))), (1)
where Iq and Oq are the ground truth RGB image and occupancy map respectively, vq is the query view, and rotate(M, vq) is a trilinear resampling operation that rotates the content of a 3D feature
map M to viewpoint vq. The RGB output is trained with a regression loss, and the occupancy is trained with a logistic classification loss. Occupancy labels are computed through raycasting, similar to Harley et al. (2020). We provide more details on the architecture of our model in the supplementary material. We train a 3D object detector that takes as input the output of the scene feature map M and predicts 3D axis-aligned bounding boxes, similar to Harley et al. (2020). This is supervised from ground-truth 3D bounding boxes without class labels.

heading: 3.2 OBJECT SHAPE/STYLE DISENTANGLEMENT
text: As the style of an image can be understood as a property which is shared across its spatial dimensions, previous works (Huang et al., 2018; Karras et al., 2019) use adaptive instance normalization (Huang & Belongie, 2017) as an inductive bias to do style transfer between a pair of images. D3DP-Nets uses this same inductive bias in its decoder to disentangle the style and 3D shape of an object. We believe that 3D shape is not analogous to 3D occupancy, but it is a blend of 3D occupancy and texture (spatial arrangement of color intensities).
Given a set of 3D object boxes {bo|o = 1 · · · |O|} where O is the set of objects in the scene, D3DP-Nets obtain corresponding object feature maps Mo = crop(M, bo) by cropping the scene feature map M using the 3D bounding box coordinates bo. We use ground-truth 3D boxes at training time and detected boxes at test time. Each object feature map is resized to a fixed resolution of 16 × 16 × 16, and fed to an object-centric autoencoder whose encoding modules predict a 4D shape code zoshp = Eshp(M o) ∈ Rw×h×d×c and a 1D style code zosty = Esty(M o) ∈ Rc. A decoder D composes the two using adaptive instance normalization (AIN) layers (Huang & Belongie, 2017) by adjusting the mean and variance of the 4D shape code based on the 1D style code: AIN(z, γ, β) = γ ( z−µ(z) σ(z) ) + β, where z is obtained by a 3D convolution on zshp, µ and σ are the channel-wise mean and standard deviation of z, and β and γ are extracted using single-layer perceptrons from zsty. The object encoders and decoders are trained with an autoencoding objective and a cycle-consistency objective which ensure that the shape and style code remain consistent after
composing, decoding and encoding again (see Figure 2 (b)):
Ldis = 1 |O| |O|∑ o=1 ‖Mo −D(Eshp(Mo),Esty(Mo))‖2︸ ︷︷ ︸ autoencoding loss + ∑ i∈O\o Lc−shp(Mo,Mi) + Lc−sty(Mo,Mi)︸ ︷︷ ︸
cycle-consistency loss
 , (2)
where Lc−shp(Mo,Mi) = ‖Eshp(Mo)−Eshp(D(Eshp(Mo),Esty(Mi)))‖2 is the shape consistency loss and Lc−sty(Mo,Mi) = ‖Esty(Mo)−Esty(D(Eshp(Mi),Esty(Mo)))‖2 is the style consistency loss.
We further include a view prediction loss on the synthesized scene feature map M̄, which is composed by replacing each object feature map Mo with its re-synthesized version D(zoshp, zosty), resized to the original object size, as shown in Figure 2(c). The view prediction reads: Lview−pred−synth = ‖Dsc ( rotate(M̄, vt+1) ) − It+1‖1. The total unsupervised optimization loss for D3DP-Nets reads:
Luns = Lview−pred + Lview−pred−synth + Ldis. (3)

heading: 3.3 3D DISENTANGLED PROTOTYPE LEARNING
text: Given a set of human annotations in the form of labels for object attributes (shape, color, material, size), our model computes prototypes for each concept (e.g. "red" or "sphere") in an attribute, using only the relevant feature embeddings. For example, object category prototypes are learned on top of shape codes, and material and color prototypes are learned on top of style codes. In order to classify a new object example, we compute the nearest neighbors between the inferred shape and style embeddings from the D3DP-Nets with the prototypes in the prototype dictionary, as shown in Figure 3. This non-parametric classification method allows us to detect objects even from a single example, and also improves when more labels are provided by co-training the underlying feature representation space as in Snell et al. (2017).
To compute the distance between an embedding x and a prototype y, we define the following rotationaware distance metric:
〈x, y〉R = { 〈x, y〉 if x, y are 1D maxr∈R〈Rotate(x, r), y〉 if x, y are 4D
(4)
where Rotate(x, r) explicitly rotates the content in 3D feature map x with angle r through trilinear interpolation. We exhaustively search across rotationsR, in a parallel manner, considering increments of 10◦ along the vertical axis. This is specifically shown in the bottom right of Figure 3 while computing the Filter Shape function.
Our model initializes the concept prototypes by averaging the feature codes of the labelled instances. We build color and material concept prototypes, e.g., red or rubber, by passing the style codes through a color fully connected module and a material fully connected module respectively, and then averaging the outputs. For object category prototypes, we use a rotation-aware averaging over the (4D) object shape embeddings, which are produced by a 3D convolutional neural module over shape codes. Specifically, we find the alignment r for each shape embedding that is used to calculate 〈z0, zi〉R, and average over the aligned embeddings to create the prototype. When annotations for concepts are provided, we can jointly finetune our prototypes and neural modules (as well as D3DP-Net weights) using a cross entropy loss, whose logits are inner products between neural embeddings and prototypes. Specifically, given P (oa = c) =
exp(〈fa(zo),pc〉R)∑ d∈Ca exp(〈fa(z
o),pd〉R) where 〈·, ·〉R represents the rotation-aware distance metric, fa is the neural module for attribute a, Ca is the set of concepts for attribute a, and oa is the value of attribute a for object o, and pc is the prototype for concept c. The loss used to train prototypes is:
Lprototype = − 1 |O| ∑ o∈O ∑ a∈A ∑ c∈Ca 1oa=c logP (oa = c) + 1oa 6=c logP (oa 6= c) (5)
where A is the set of attributes.

heading: 4 EXPERIMENTS
text: We test D3DP-Nets in few-shot learning of object category, color and material, and compare against state-of-the-art 2D and 2.5D shape-style disentangled CNN representations (Sections 4.1). We integrate these concept classifiers in a visual question answering modular system (see Figure 3) and show it can answer questions about images more accurately than the state-of-the-art in the few-shot regime (Section 4.2). In addition, we test D3DP-Nets on novel 3D scene generation. We also test D3DP-Nets on view prediction and compare against alternative scene representation learning methods (Section 4.3). Furthermore, we show our model can generate a 3D scene (and its 2D image renders) based on a language utterance description (Section 4.4).

heading: 4.1 FEW-SHOT OBJECT SHAPE AND STYLE CATEGORY LEARNING
text: We evaluate D3DP-Nets in its ability to classify shape and style concepts from few annotated examples on three datasets: i) CLEVR dataset (Johnson et al., 2017): it is comprised of cubes, spheres and cylinders of various sizes, colors and materials. We consider every unique combination of color and material categories as a single style category. The dataset has 16 style classes and 3 shape classes in total. ii) Real Veggie dataset: it is a real-world scene dataset we collected that contains 800 RGB-D scenes of vegetables placed on a table surface. The dataset has 6 style classes and 7 shape classes in total. iii) Replica dataset (Straub et al., 2019): it consists of 18 high quality reconstructions of indoor scenes. We use AI Habitat simulator (Manolis Savva* et al., 2019) to render multiview RGB-D data for it. We use the 152 instance-level shape categories provided by Replica. Due to lack of style labels, we manually annotate 16 style categories. Details on manual annotation process are present in the supplementary material. Figure 4 shows one example for both shape and style category.
We train D3DP-Nets self-supervised on posed multiview images in each dataset and learn the prototypes for each concept category. During training, we consider 1 and 5 labeled instances for each shape and style category in the dataset. During testing, we consider a pool of 1000 object instances.
In this experiment, we use ground-truth bounding boxes to isolate errors caused by different object detection modules. We compare D3DP-Nets with 2D, 2.5D and 3D versions of Prototypical Networks (Snell et al., 2017) that similarly classify object image crops by comparing object feature embeddings
to prototype embeddings. Specifically, we learn prototypical embeddings over the visual representations produced by the following baselines: (i) 2D MUNIT (Huang et al., 2018) which disentangles shape and style within each object-centric 2D image RGB patch using the 2D equivalent of the shape-style disentanglement architecture of our model, and learns using an autoencoding objective (ii) 2.5D MUNIT an extension of 2D MUNIT which uses concatenated RGB and depth as input. (iii) 3DP-Nets, a version of D3DP-Nets where object shape-style disentanglement is omitted, this version corresponds to the scene representation learning model of Tung et al. (2019). (iv) Generative Query Network GQN of Eslami et al. (2016) which encodes multiview images of a scene and camera poses into a 2D feature map and is trained using cross-view prediction, similar to our model. (v) D3D-Nets, a version of D3DP-Nets where prototypical nearest neighbour retrieval is replaced with a linear layer which predicts the class probabilities. (iv) Meta-Baseline MB of Chen et al. (2020) is the SOTA supervised few-shot learning model, pre-trained using ImageNet. All baselines except MB are trained with the same unlabeled multiview image set as our method. All models classify each test image into a shape, and style category. Few-shot concept classification results are shown in Table 1. D3DP-Nets outperforms all unsupervised baselines. Interestingly, D3DP-Nets give better classification accuracy on the 1-shot task than almost all of the unsupervised baselines on the 5-shot task. Figure 5 shows a visualization of the style codes produced by D3DP-Nets (left) and 2.5D MUNIT baseline (right) on 2000 randomly sampled object instances from CLEVR using t-SNE (Maaten & Hinton, 2008). Each color represents a unique CLEVR style class. Indeed, in D3DP-Nets, codes of the same class are placed together, while for the 2.5D MUNIT baseline, this is not the case.

heading: 4.2 FEW-SHOT VISUAL QUESTION ANSWERING
text: We integrate concept detectors built on the D3DP-Nets representation into modular neural networks for visual question answering, in which a question about an image is mapped to a computational graph over a small number of reusable neural modules including object category detectors, style detectors and spatial expression detectors. Specifically, we build upon the recent Neuro-Symbolic Concept Learner (NSCL) (Mao et al., 2019), as shown in Figure 3. In NSCL, the input and output of different neural modules are probability distributions over 2D object proposals denoting the probability that
Published as a conference paper at ICLR 2021
Ground Truth RGB Eslami et al’s (GQN) Ours
the executed subprogram is referring to each object, and their object category, color and material classifiers also use nearest neighbors over learnt prototypes. For example, in the question “How many yellow objects are there?”, the model first uses the color classifier to predict for all objects the probability that they are yellow, and then uses the resulting probability map to give an answer. NSCL learns 1D prototypes for object shape, color and material categories and classifies objects to labels using nearest neighbors to these prototypes. In our D3DP-Nets-VQA architecture, we have 3D instead of 2D object proposals, and disentangled 3D shape and 1D color/material and spatial relationship prototypes instead.
We compare D3DP-VQA against the following models: i) NSCL-2D (with and without ImageNet pretraining), the state of the art model of Mao et al. (2019) that uses a ResNet-34 pretrained on ImageNet as input feature representations ii) NSCL-2.5D, in which the object visual representations for shape/color/material are computed over RGB and depth concatenated object patches as opposed to RGB alone. This model is pretrained with a view prediction loss using the CLEVR dataset in Sec. 4.1 iii) NSCL-2.5D-disentangle that uses disentangled object representations generated by our 2.5D MUNIT disentangling model, iv) D3DP without 3D shape prototypes, a version of D3DP-
Nets that replaces the 3-dimensional shape codes with 1D ones obtained by spatial pooling v) D3DP without disentanglement, that learns prototypes for shape, color and material on top of entangled 3D tensors.
We consider the same supervision for our model and baselines in the form of densely annotated scenes with object attributes and 3D object boxes. We use ground-truth neural programs so as to not confound the results with the performance of a learned parser. More details on the VQA experimental setup and additional ablative experiments are included in the supplementary file.
VQA performance results are shown in Table 2. We evaluate by varying the number of training scenes from 10 to 250. For each training scene we generate 10 questions. The original CLEVR dataset included 70,000 scenes and 700,000 questions, so even when training with 250 scenes, we are training with 0.35% the number of original scenes. Our full model outperforms all of the alternatives, showing the importance of both the 3D feature representations as well as disentanglement of shape and style. To test our model’s one shot generalization ability on questions about object categories it had not seen in the original training set, we introduce a new test set consisting of only novel objects. We generate a test set of 500 scenes in the CLEVR environment with three new objects: “cheese”, “garlic”, and “pepper” and introduce them to our model and baselines using one example image of each, associated with its shape category label. We provide example scene/question pairs for this setting in the supplementary. The results described in Table 2 indicate that our model is able to maintain its ability to answer questions even when seeing completely novel objects and with very few training examples. The SOTA 2D model outperforms our model on the in domain test set because it is able to exploit pretraining on ImageNet, which our models are unable to do. However, our model is able to adapt much better than both the 2D and 2.5D baselines in few-shot regime.

heading: 4.3 VIEW PREDICTION
text: We qualitatively compare our model with the Generative Query Network (GQN) of Eslami et al. (2016) on the task of view prediction in Figure 6 (a). The figure shows view prediction results for a scene with more objects than those at training time. D3DP-Nets dramatically outperforms GQN, which we attribute to the 3-dimensional representation bottleneck that better represents the 3D space of the scene, as compared to the 2D bottleneck of Eslami et al. (2016).

heading: 4.4 3D SCENE GENERATION FROM LANGUAGE UTTERANCES
text: We test D3DP-Nets on the task of scene generation from language utterances. Given annotations for each prototype, our model can generate 3D scenes that comply with a language utterance, as seen in Figure 12 (b). We assume the parse tree of the utterance is given. Our model generates each object’s 3D feature map by combining shape and style prototypes as suggested by the utterance, and placing them iteratively on a background canvas making sure it complies with the spatial constraints in the utterance (Prabhudesai et al., 2019). Our model can generate shape and style combinations not seen at training time. We neurally render the feature map to generate the RGB image.

heading: 5 CONCLUSION AND FUTURE DIRECTIONS
text: We presented D3DP-Nets, a model that learns disentangled 3D representations of scenes and objects and distills them into 3D and 1D prototypes of shapes and styles using multiview RGB-D videos of static scenes. We trained classifiers of prototypical object categories, object styles, and spatial relationships, on disentangled relevant features. We showed that they generalize better than 2D representations or 2D disentangled representations, with less training data. We showed modular architectures for VQA over our concept classifiers permit few-shot generalization to scenes with novel objects. We hope our work will stimulate interest in self-supervising 3D feature representation for 3D visual recognition and question answering in domains with few human labels. Finally adding deformation to our model which will permit a prototype to match against more instances of the same class and expanding to diverse natural language datasets of VQA which will require us to add more diverse programs are direct avenues of future work.

heading: 6 ACKNOWLEDGEMENTS
text: This work has been partly funded by Sony AI, DARPA Machine Common Sense and the Air Force Office of Scientific Research under award number FA9550-20-1-0423. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Air Force.

heading: A DATASET PREPARATION
text: CLEVR Dataset. We construct four different datasets using the CLEVR Blender simulator as a base (Johnson et al., 2017). One key difference from the original simulator is that we generate RGB-D images of scenes instead of RGB images.
The first dataset is a support dataset containing 1200 scenes in the training split and 400 scenes in the validation split. For each scene, 12 different RGB-D views are generated (4 different azimuths, 3 different elevations). The azimuths are in 90◦ increments and the elevations are 20◦, 40◦, and 60◦. This dataset is used in the unsupervised training of the D3DP-Nets.
The second dataset generated contains 5000 scenes in the training split and 1500 scenes in each of the validation and testing splits, with 10 questions generated for each scene. Each scene is rendered according to the specification of the original CLEVR dataset. This dataset is used for the training of all VQA models. Examples can be seen in Figure 7.
The third and fourth datasets are used to test the one-shot learning capabilities of the VQA models. They introduce three new shapes: cheese, garlic, pepper. The prototype split for both datasets contains one scene for each object with a single viewpoint rendered for each scene. The scene for each object contains that object centered on floor with the large size and random color and material. The test split for the third dataset contains 500 scenes with a mix of the shapes seen during training and novel shapes. The test split for the fourth dataset contains 500 scenes with only the novel shapes. Each scene in the test split is rendered from a single viewpoint (approximately the same as the viewpoint used in the second dataset) and has 10 questions generated about it. Examples from the novel only dataset can be seen in Figure 8. The results for the novel only dataset are shown in the main paper, and the results for the mixed dataset are shown in Appendix E.

heading: Q: How many cheeses are either small gray shiny objects or small objects?
text: CARLA Dataset. We use CARLA dataset to show detector improvement results in Appendix D. We use the 26 vehicle classes available in Carla 0.9.7 to prepare our dataset. We call each recorded datapoint a scene. Each scene consists of multiview RGB and depth images of static vehicles placed at randomly selected spawn locations. We generate two separate datasets: datasets with scenes consisting of only single vehicles and datasets with scenes consisting of 3-6 vehicles. The single vehicle scenes are used to train the 3D detector. The multi-vehicle scenes are used to evaluate the trained 3D detector. For clarity, we will use a = Uniform(b, c) to mean that ’a’ takes a random value between ’b’ and ’c’. For each scene, we first randomly select a map from the available CARLA maps. Then we randomly perturb the weather conditions by setting cloudiness = Uniform(0, 70), precipitation = Uniform(0, 75), and sun_altitude_angle = Uniform(30, 90). We place a total of 18 RGB-D cameras in the scene. The origin of a selected player vehicle serves as the origin with respect to which the extrinsics of all the cameras is calculated. For single-vehicle scenes, we randomly select a spawn point and place the vehicle there. This vehicle then also acts as the player vehicle. For multi-vehicle scenes, we again randomly select a spawn point, place a vehicle there, and mark it as the player vehicle. Then, we randomly determine how many more vehicles to place. We then find all spawn points that are within 17 units distance from the first spawn point and randomly select some of them to place the extra vehicles. Selecting nearby spawn locations helps ensure that most of the vehicles will be visible in the majority of the camera views. For vehicles in CARLA, the x-axis points forward, the y-axis points to the right, and the z-axis points upwards. For all scenes, we place the first camera at x = Uniform(8, 13), y = 0, z = 1, pitch = 0◦, yaw = −180◦, roll = 0◦. The next 8 cameras are placed on the boundary of a circle centered at the player vehicle, with radius = Uniform(7, 14) (radius is randomly sampled for each camera position), z = 5.5, pitch = 0◦, roll = 0◦, and yaw decremented uniformly by 35◦ from −40◦ to −285◦. The next 8 cameras follow the same setup but with pitch = −40◦ and z = 6.5. Finally, the last RGB-D camera is placed overhead at x = 0, y = 0, z = Uniform(6, 10), pitch = −90◦, yaw = 0◦, and roll = 0◦.
Real World Veggie Dataset. Our real world veggie dataset consists of multiview RGB-D scenes of vegetables placed on a table recorded with Microsoft Azure Kinect camera. For each scene, we place 1 to 6 vegetables on a table and move the camera around the table randomly to capture RGB and depth images. A SLAM package then takes the camera output and provides us with the extrinsics. To get the 3D bounding boxes of objects in the scene, we fire a 2D object detector on each RGB image and triangulate the 2D detections to generate the 3D bounding boxes.
Replica Dataset. Replica dataset (Straub et al., 2019) provides high quality reconstructions for 18 indoor scenes. We use AI Habitat simulator (Manolis Savva* et al., 2019) to render multiview RGB-D data for these meshes. Specifically, to capture one scene, we load a random mesh in the simulator, select one object (primary object) in the mesh randomly, and spawn the agent near that object. We then move the agent around that object, ensuring that agent is between 1m to 2m from the primary object, and capture RGB-D images from 24 different viewpoints. We use 256× 256 spatial resolution for RGB and depth images. These images can also include objects in the vicinity of the primary object we selected. For a particular view, we only store information for objects that occupy more than 500 pixels in the RGB image for that view. We also manually annotate the style and shape category for each object visible in any of the 24 views. For shape category, we use the instance id provided by the AI Habitat simulator. This gives us 152 shape categories. For style, we annotate each object with a color and use the color label as style for that object. This gives us 16 different style categories.

heading: B ARCHITECTURE DETAILS
text: For all the models, Esc and Dsc trained over view prediction losses are used as the base model.
The input RGB and depth images are resized to a resolution of 320× 480 for all the datasets. While training using view prediction, we randomly sample 2 views from each multi-view scene. During testing, we only use a single view. Our model converges in 10-12hrs of training and requires 0.8 seconds for an inference step on a single RTX 2080.
B.1 D3DP-NETS
2.5D-to-3D Lifting (Esc) and 3D-to-2.5D Projection (Dsc and Docc). Our 2.5D-to-3D lifting, 3D occupancy estimation and 2D RGB estimation modules follow the exact same architecture as Harley et al. (2020). However, unlike their architecture, we do not use batch normalization in our network because we did not find it to be compatible with adaptive instance normalization which is used later in the pipeline. Our 2D-to-3D Lifting module takes as input RGB-D images, camera intrinsics, and camera extrinsics and outputs a 3D feature map of size 72× 72× 72× 32, where 32 is the number of channels and 72 is the height, width, and depth. We explain the implementation details of each of these modules below.
• 2.5D-to-3D lifting Our 2.5D-to-3D unprojection module takes as input RGB-D images and converts it into a 4D tensor U ∈ Rw×h×d×4, where w, h, d is 72, 72, 72. We use perspective (un)projection to fill the 3D grid with samples from 2D image. Specifically, using pinhole camera model (Hartley & Zisserman, 2003), we find the floating-point 2D pixel location that every cell in the 3D grid, indexed by the coordinate (i, j, k), projects onto from the current camera viewpoint. This is given by [u, v]T = KS[i, j, k]T , where S, the similarity transform, converts memory coordinates to camera coordinates and K, the camera intrinsics, convert camera coordinates to pixel coordinates. Bilinear interpolation is applied on pixel values to fill the grid cells. We obtain a binary occupancy grid O ∈ Rw×h×d×1 from the depth image D in a similar way. This occupancy is then concatenated with the unprojected RGB to get a tensor [U,O] ∈ Rw×h×d×4. This tensor is then passed through a 3D encoder-decoder network, the architecture of which is as follows: 4-2-64, 4-2-128, 4-2-256, 4-0.5-128, 4-0.5- 64, 1-1-F . Here, we use the notation k-s-c for kernel-stride-channels, and F is the feature dimension, which we set to F = 32. We concatenate the output of transposed convolutions in decoder with same resolution feature map output from the encoder. The concatenated tensor is then passed to the next layer in the decoder. We use leaky ReLU activation after every convolution layer, except for the last one in each network. We obtain our 3D feature map M as the output of this process. • 3D occupancy estimation. In this step, we want to estimate whether a voxel in the 3D
grid is “occupied“ or “free“. The input depth image gives us partial labels for this. We voxelize the pointcloud to get sparse “occupied“ labels. All voxel cells that are intersected by the ray from the source-camera to each occupied voxel are marked as “free“. We give M as input to the occupancy module. It produces a new tensor C, where each voxel stores the probability of being occupied. We use a 3D convolution layer with a 1 × 1 × 1 filter followed by a sigmoid non-linearity to achieve this. We train this network with the logistic loss, Locc = (1/ ∑ Î) ∑
Î log(1 + exp(−Ĉ · C)), where Ĉ is the label map, and Î is an indicator tensor, indicating which labels are valid. Since there are far more “free” voxels than “occupied”, we balance this loss across classes within each minibatch.
• 2D RGB estimation. Given a camera viewpoint vq, this module projects the 3D feature map M to “render“ 2D feature maps. To achieve this, we first obtain a view-aligned version, Mvq , by resampling M. The view oriented tensor, Mvq , is then warped so that perspective viewing rays become axis-aligned. This gives us the perspective-transformed tensor Mprojq . This tensor is then passed through a CNN to get a 2D feature map vq. The CNN has the following architecture (using the notation k-s-c for kernel-stride-channels): max-pool along the depth axis with 1× 8× 1 kernel and 1× 8× 1 stride, to coarsely aggregate along each camera ray, 3D convolution with 3-1-32, reshape to place rays together with the channel axis, 2D convolution with 3-1-32, and finally 2D convolution with 1-1-E, where E is the channel dimension, E = 3.
Object-Centric Encoder Eo Our object encoder Eo consists of two sub encoders, the content encoder Eshp and the style encoder Esty. Both Eshp and Esty take as input an object centric 3D feature map of size 16×16×16×32. Esty uses two 3D convolutions with the following architecture (our notation is k-s-c-p-pt for kernel size, stride, output channels, padding, and padding type): 3-1-64- 1-constant, 4-2-128-1-constant. Each 3D convolution operation is followed by ReLU non-linearity. The output of the second ReLU is averaged pooled spatially to get a linear output, which is the style code. This style code is then passed through two linear layers, both producing 256 dimensional output.
We use ReLU non-linearity only after the first linear layer. The final output of the linear layer is used as adaptive instance normalization (AdaIN) parameters to re-normalize the intermediate features generated by D. Eshp also uses two 3D convolution layers with the following architecture: 3-1-64-1- constant, 4-2-128-1-constant. Both convolution operations are followed by Instance Normalization (Ulyanov et al., 2016) and ReLU non-linearity.
Object-Centric Decoder D The object-centric decoder D takes as input the shape and style codes from Eshp and Esty , and compose them back into a complete object-centric feature maps. It consists of two 3D convolution layers with the architectures: 3-1-128-1-constant, 3-1-32-1-constant. The output of the first 3D convolution is re-normalized using the AdaIN parameters generated by Esty, before passing through a ReLU non-linearity. This output is then upsampled by a factor of 2 and passed through the second 3D convolution. The output of D is an object centric feature map with content and style dictated by the inputs of Eshp and Esty respectively.
3D Detector We use the same 3D detector architecture as in Tung et al. (2019). This 3D detector extends the Faster RCNN architecture (Ren et al., 2015) to use 3D feature maps to predict 3D bounding boxes, instead of predicting 2D bounding boxes using 2D feature maps. The output of our 2D-to-3D Lifting module, with size 72× 72× 72× 32, is fed as input to the 3D detector. The 3D detector consists of one down-sampling layer and three 3D residual blocks. Each layer has 32 channels. At each grid location in the 3D feature map, we use a single cube shaped anchor box of side length 12 units.
B.2 VISUAL QUESTION ANSWERING (VQA)
The VQA model architecture is similar to the Neuro-Symbolic Concept Learner (NSCL) (Mao et al., 2019). We assume each object in a scene can have certain attributes and each pair of objects can have a relationship associated with it. For our tasks, the object attributes are shape, color, material, and size; the relationships are all spatial. The model has a neural operator for each of the possible attributes/relationships. These operators take as input features corresponding to a specific instance of an object/relationship. The outputs of the operators are compared to a dictionary of embeddings representing specific concepts (e.g. red or sphere) to compute the probability that the instance matches the concept. We do this by computing the cosine similarity of the computed embeddings with the stored embeddings, and using those similarities as logits in our probability calculation. For the shape attribute, our embeddings are 4D, while for the others, the embeddings are 1D. This allows us to do a rotation aware similarity calculation for shape, as described in the main paper.
For every object in the scene, five disentangled feature sets are created: shape and style from the D3DP-Nets and center location, size, and rotation from the bounding box description. For every pair of objects, the relationship feature sets are created by concatenating the corresponding feature sets of both objects (e.g. content with content).
Since the feature sets we input into the operators are disentangled, we can feed specific inputs into each operator. The feature set descriptions and the usage of the feature sets by each attribute operator are shown in Table 3. The 1D feature sets are first passed through a linear layer with output dimension 256. The content feature set is passed through a 3-1-256-1-constant 3D convolution. The relevant feature set is then passed to each attribute operator. For the shape attribute, we use two 3D convolution layers to produce the final embedding: 1-1-256-0-constant and 1-1-64-0-constant. For the other attributes, we use a linear layer with output dimension 256 and a linear layer with output dimension 64. Every layer described above except for the final attribute operator layers is followed by a ReLU non-linearity. These embeddings are the ones compared to the stored concept embeddings in the model’s dictionary. Every VQA model is trained for 60 epochs with early stopping. We use the Adam optimizer (Kingma & Ba, 2014) initialized with a learning rate of .001.
We also trained a semantic parser to be able to answer questions for which we do not have a symbolic program generated. The architecture of this parser follows the architecture described in Mao et al. (2019). Instead of training it with reinforcement learning during the VQA training, we train the parser separately in a supervised manner with teacher forcing using a small set of question, program pairs. The accuracy of this parser is 94%, allowing us to use it for most questions that are of similar form to those in the CLEVR dataset.
In figure 9, we show example scene/question pairs for the in domain test set and one shot test set.

heading: C FEATURE SUBSPACE SELECTION USING CONTRASTIVE EXAMPLES
text: In this section we show that, given contrastive examples, our disentangled representation can be used to infer relevant feature subspace for each concept category. We do this by selecting the feature subspace which has the minimum cosine similarity given a contrastive example. For example, in order to find what input we should give to Color module, we take 3D object centric feature maps for two objects differing only in their color. We then disentangle the feature maps into content and style features. We finally calculate the cosine similarity between corresponding content and style features for both the objects and use the features which has lower similarity. If our disentanglement is good, we should be able to infer correct feature subspace for different concept categories, as changes in one feature subspace should leave the other disentangled feature subspaces unchanged. In Table 5 we show the accuracy of selecting the correct feature subspace given 10 contrastive examples for each concept category. For retrieving a cosine similarity friendly feature subspace for size and spatial relation categories, we train an auto-encoder on top of their inputs, and use their encoded representation as the relevant feature subspace. In Figure 11, we show contrastive examples for each concept category.

heading: D LEARNING 3D OBJECT DETECTORS BY GENERATION
text: Upon training, D3DP-Nets maps a novel RGB-D image to a set of 3D object boxes, their shape and style codes, and the background scene feature map. We generate (simulate) novel 3D scene feature maps by adding object feature maps against background scene maps while randomizing object 3D locations, 3D pose and 3D sizes. We make sure each added 3D object box does not intersect in 3D with the predicted scene occupancyMocc and objects added thus far. We train our 3D object detectors using additional annotations from such labelled imagined scene feature maps. We show below that such mental augmentations are beneficial for generalization of 3D object detector from
few examples, and can generate improvements, especially in the low IoU evaluation regime. Note that D3DP-Nets’s imaginations do not attempt to match the training scene distribution. Rather, they target combinatorial generalization (Battaglia et al., 2018), using basic spatial reasoning of free space encoded in the 3D neural representations. In Figure 10, we visualize RGB neural renders of our generated novel 3D feature maps. We generate (simulate) novel 3D scene feature maps Msim by adding entangled object feature maps against background scene maps while randomizing object 3D locations and 3D sizes as shown in Figure 1. We consider 50, 100 and 200 annotations of 3D bounding box on single object scenes in CARLA and CLEVR datasets. We use those annotations to train corresponding category agnostic 3D object detectors. D3DP-Nets weights are initialized with self-supervised view-prediction using a support dataset made up of 1600 scenes with 12 views each (4 different azimuths, 3 different elevations). Implementation details of our 3D detector architecture can be found in the supplementary file. We generate neural scene imaginations following the method described above, and use it as additional training data. Specifically, we consider randomly placing 3-10 objects around the (real) object in the inferred 3D scene maps of the training images. We test the model with 300 scenes from each simulated environment, with each having around 3-8 objects present. We compare a 3D detector trained on joint real and hallucinated data, with one trained on real data alone. We use L2 weight regularization in all methods, and cross-validate the weight decay. We use an early stopping technique to avoid overtraining of the detector. In Table 4, we show that training the 3D detector on real and hallucinated neural scenes outperforms just using real images alone. We found that most of our improvement in mean AP comes from placing more objects and randomizing their location and not from composing unique shape-style. We believe this is because our entangled object representation generated from unique shape/style composition is distinguishable from the actual real object, which the detector exploits.
E VQA ADDITIONAL RESULTS
Further ablations We introduce three more ablations of our VQA model that were not presented above due to space considerations.
The first ablation entangles all the disentangled feature sets together before feeding them into the attribute operators. It does so by concatenating the different feature sets after upsampling/downsampling to match dimensions, and then passing through either a linear layer or 3D convolution layer depending on if the input/desired output embedding is 1D or 4D.
The second ablation involves using a simple method to extract content and style embeddings. We take the input 3D tensors, normalize by channel to get the content embedding, concatenate the channel means and channel standard deviations to get the style embedding. This simple baseline performs surprisingly well at the higher data settings we test. The full results for both ablations are shown in Table 6.
The final ablation removes all disentanglement and 3D prototypes. This model is pretrained only with view prediction, and does not do any shape/style disentanglement. It also pools any 3D prototypes to 1D prototypes before comparison instead of doing a rotation aware check.
Attribute classifier accuracy We present the classification accuracy of the attribute modules for the VQA experiments in this paper in Tables 7,8, 9, and 10.
For the shape classifier in particular, we find that our full model is worse than the 2D baseline when tested on in domain examples, but when tested on the one shot dataset, the shape classification accuracy of the 2D baseline decreases sharply. The 3D models meanwhile are able to maintain decent performance. Our full model does not have the best shape classification accuracy on the one shot dataset, but it still shows a respectable performance. Finally, we note our model tended to do worse on the shape classification accuracy when trained with more examples in the training phase. This phenomenon requires further exploration, but a possible explanation could be that more training examples of the original shapes encodes stronger biases into the model, making it more difficult to identify the one shot objects.
Mixed one shot only dataset We present results on the mixed one shot test dataset introduced in Appendix A. This dataset contains a mix of objects seen in training and novel objects. Table 11 shows results on this dataset.

heading: F QUALITATIVE RESULTS FOR ONE SHOT 3D NEURAL SCENE IMAGINATION USING LANGUAGE DESCRIPTIONS
text: The disentangled representations from D3DP-Nets allow us to render novel scenes which can have objects with content-style combinations not seen during training.
If the available scenes are accompanied with annotations of object categories, colors and materials, then our model can generate 3D scenes that comply with a scene description, following the method of Prabhudesai et al. (2019), assuming a parse of the scene description. We explain the experiment in detail and show some qualitative results in Section 4.4 of the main paper. We show some additional results for the same in Figure 12.

Review summaries:
This paper describes an approach that learns a disentangled shape and style representation of objects in a self-supervised way from RGB-D images.  The approach is based on various components, like a 3D feature volume, a bounding box detector, and a disentanglement network. Neural rendering (e.g. recomposing the various disentangled parts into an image) is used as the learning signal for self-supervision. Various applications of this representation  are shown, examples are few-shot shape learning and Visual Question Answering.

The paper presents a framework that combines 1) multi-view prediction for 3D reconstruction from a single image and 2) content-style disentangled representation learning using instance-norm-based auto-encoders. It aims at learning disentangled 3D representation of input images. The authors show that these methods can be applied to few-shot recognition, visual question-answering (VQA), view prediction, and image generation from texts.

This paper presents a modular network architecture for few-shot concept learning. The architecture consists of image-to-scene module that maps input RGBD images to 3D scene features and an object-centric disentangling auto-encoder that crops object features to generate shape and style codes, and finally a neural rendering module that put back the reconstructed object and background features to image domain. The proposed network is verified in few-short recognition task and VQA task with comparisons to state-of-the-art methods.