Year: 2019

Abstract:
Compositional structures between parts and objects are inherent in natural scenes. Modeling such compositional hierarchies via unsupervised learning can bring various benefits such as interpretability and transferability, which are important in many downstream tasks. In this paper, we propose the first deep latent variable model, called RICH, for learning Representation of Interpretable Compositional Hierarchies. At the core of RICH is a latent scene graph representation that organizes the entities of a scene into a tree structure according to their compositional relationships. During inference, taking top-down approach, RICH is able to use higher-level representation to guide lower-level decomposition. This avoids the difficult problem of routing between parts and objects that is faced by bottom-up approaches. In experiments on images containing multiple objects with different part compositions, we demonstrate that RICH is able to learn the latent compositional hierarchy and generate imaginary scenes.

heading: 1 INTRODUCTION
text: Compositional hierarchies prevail in natural scenes where primitive entities are recursively composed into more abstract entities. Modeling such compositional generative process allows discovery of modular primitives that can be reused across a variety of scenes. Hence, it would bring interpretability and transferability, in which current deep learning models are not quite successful. Due to expensive labeling, such compositional relationships should ideally be learned in an unsupervised manner. Unsupervised approaches can also provide more flexibility and generalization ability since the model is allowed to choose the most appropriate compositional hierarchy for a given scenario.
Despite its importance, there has not been much work on unsupervised generative modeling of the compositional hierarchy. Earlier work on hierarchical representation learning (Lee et al., 2009) obtains a feature hierarchy that captures concepts at different levels of abstraction, with no explicit modeling of composition. Recent researches on deep latent variable models (Maaløe et al., 2019; Zhao et al., 2017; Sønderby et al., 2016; Bachman, 2016) mainly focus on architectural designs and training methods that harness the full expressive power of hierarchical generative models. Although they have shown impressive generation quality and disentanglement of learned representation, the compositional hierarchy is still not captured in a modular and interpretable way. To obtain interpretable scene representation, recent work (Tieleman, 2014; Eslami et al., 2016; Crawford & Pineau, 2019; Wu et al., 2017; Yao et al., 2018; Romaszko et al., 2017; Deng et al., 2019) has introduced domain-specific decoders that take object pose and appearance information as input and render the object in a similar way to graphics engines. This forces the encoder to invert the rendering process, producing interpretable object-wise pose and appearance representation.
In this paper, we extend the interpretable object-wise representation to the hierarchical setting. We propose a deep generative model, called RICH (Representation of Interpretable Compositional Hierarchies), that can use its hierarchy to represent the compositional relationships among interpretable symbolic entities like parts, objects, and scenes. To this end, taking inspiration from capsule networks (Sabour et al., 2017; Hinton et al., 2018) and the rendering process of computer graphics, we propose a probabilistic scene graph representation that describes the compositional hierarchy as a latent tree. The nodes in the tree correspond to entities in the scene, while the edges indicate the compositional relationships among these entities. We associate an appearance latent with each node to summarize all lower-level composition, and a pose latent with each edge to specify the
transformation from the current level to the upper level. To enforce interpretability, the probabilistic scene graph is then paired with a decoder that renders the scene graph by recursively applying the specified transformations. We also introduce learnable templates for the primitive entities. Once learned, RICH is able to generate all lower-level latents and render a partial scene given the latent at a specific level.
To infer the scene graph is, however, challenging, since both the tree structure and the latent variables need to be simultaneously inferred. Capsule networks have provided a bottom-up solution to learning the tree structure, but it faces the difficult routing problem caused by the exponentially many possible compositions. Instead, RICH takes a top-down approach that avoids the routing problem. The intuition is that for a given scene, it is natural to first decompose it into high-level objects. If we devote our attention to one of the objects, we can then figure out its constituent parts. In cases where parts are close or have occlusion, we expect the appearance latent of the higher-level object to guide lower-level decomposition, since it summarizes the typical composition for that object.
The contributions of this paper are as follows. We propose RICH, the first interpretable representation learning model for compositional hierarchies through probabilistic latent variable modeling. We then implement a three-level prototype of RICH and demonstrate its effectiveness in extensive experiments. RICH is able to learn the hierarchical scene graph representation from images containing multiple compositional objects. Further, it shows decent generation quality and generalization ability to unseen number of objects.

heading: 2 RELATED WORK
text: Interpretable object-wise representation. AIR (Eslami et al., 2016) is the first generative model that learns interpretable object-wise scene representation. It is able to assign a latent vector (zpres, zwhere, zwhat) to each object in the scene, describing the presence, size, center position, and appearance of the object. SPAIR (Crawford & Pineau, 2019) improves the scalability of AIR to images containing a large number of objects. It divides the image into spatially distributed cells, and auto-regressively infers the latent vector for each cell. This crucially reduces the search space for individual cells, since they are each responsible only for explaining objects near themselves. RICH builds upon SPAIR to infer the structure of the probabilistic scene graph. To enable efficient hierarchical inference, we use mean-field approximation for the posterior, allowing inference of all cells to be done in parallel.
Hierarchical scene representation. Modeling the part-whole relationship in scenes has attracted growing interest, and it has been utilized for improving image classification, parsing, and segmentation. Two representative models that have inspired our work are hierarchical compositional models (HCMs) and capsule networks. In HCMs (Zhu et al., 2008), the hierarchical structure is represented as a graph, where leaf nodes interact with image segments, and upper-level nodes store the average position and orientation of lower-level nodes (with respect to the image coordinates). In capsule networks (Sabour et al., 2017; Hinton et al., 2018), the part-whole relationship is used for achieving viewpoint invariance. The key insight is that the relative pose of parts with respect to objects is viewpoint invariant, and is thus suitable to be learned as network weights. However, neither of these two approaches uses generative modeling, and they have been applied only to scenes with one dominant object. More recently, the part-whole relationship has been explored in modeling 3D shapes (Tulsiani et al., 2017; Li et al., 2017; Zhu et al., 2018) and motion decomposition (Xu et al., 2019). Although they have employed generative modeling, the latent space is not hierarchically structured, and typically only contains the top-level representation. In contrast, RICH represents the entire scene graph in latent space, modeling both the hierarchical structure and the object pose and appearance at each level as latent variables. This representation is arguably richer, and enables simultaneous learning of a collection of generative models for parts, objects, and scenes.

heading: 3 THE PROPOSED MODEL: RICH
text: RICH (Representation of Interpretable Compositional Hierarchies) is a generative model that captures the recursive compositional structure inherent in natural scenes. It builds a tree-structured representation similar to scene graphs in computer graphics (Foley et al., 1996). The nodes in the tree describe entities at various levels of abstraction in the scene, and the edges indicate the compo-
sitional relationships among these entities. Specifically, each leaf node represents a primitive entity that is not further decomposed. Each internal node represents an abstract entity that is composed from its children nodes. The composition is specified by the relative pose of each child node with respect to the parent node, and this pose information is stored on the corresponding edges.

heading: 3.1 GENERATIVE PROCESS
text: To make a generative model, we associate an appearance vector zapprv with each node v, and a pose vector zposev with the edge between node v and its parent pa(v), as shown in Figure 1A. The intuition is that zapprpa(v) represents the entity at pa(v) in its canonical pose, summarizing all lower-level composition in the subtree rooted at pa(v). Conditioning on zapprpa(v), we can then sample z appr v and z pose v , the relative pose of v with respect to pa(v). Thus, the latent vectors in any subtree can be recursively generated. Let V be the set of all nodes, r ∈ V be the root node, and L ⊆ V be the set of leaf nodes. The generative model for the entire scene x can be written as follows:
p(x) = ∫ p(x | zposeV \{r}, z appr L ) p(z appr r ) ∏ v∈V \{r} p(zposev | z appr pa(v)) p(z appr v | z appr pa(v)) dz, (1)
where we assume conditional independence among all latents zposev and z appr v that have the same pa(v). This gives disentangled and interpretable scene representation.
We design the decoder p(x|zposeV \{r}, z appr L ) to closely follow the rendering process from a given scene graph. First, for each leaf node v ∈ L, we use a neural network to decode its appearance vector into a small image patch x̂v and a (close to) binary mask m̂v the same size as x̂v . Here we assume that x̂v has already been masked by m̂v , meaning x̂v(i, j) = 0 for all pixel locations (i, j) where m̂v(i, j) = 0. We then recursively compose these primitive patches into the entire scene by applying affine transformations level by level. Specifically, let u be an internal node, and ch(u) be the set of its children. We compose the higher-level image patch x̂u and mask m̂u as follows:
x̂u = ∑
v∈ch(u)
αv ST −1(x̂v, zposev ), m̂u = ∑
v∈ch(u)
αv ST −1(m̂v, zposev ), (2)
where a spatial transformer ST (Jaderberg et al., 2015) is used to properly place x̂v and m̂v into the coordinate frame of the parent node u, according to the scaling, rotation and translation parameters given by zposev . In addition, z pose v also provides relative depth information that helps deal with occlusion. Entities with smaller depth will appear in front of entities with larger depth. This is enforced by a transparency map αv that assigns pixel-wise weights to each transformed patch according to its relative depth. See Figure 1C for an illustration. To ensure that unoccluded part of entities will
remain visible, we normalize αv after applying the transformed mask m̃v = ST −1(m̂v, zposev ), namely for all pixel locations (i, j),
αv(i, j) = 0 if m̃v(i, j) = 0, ∑
v∈ch(u)
αv(i, j) = 1 if ∑
v∈ch(u)
m̃v(i, j) > 0. (3)
The final decoder output p(x|zposeV \{r}, z appr L ) = N (x̂r, σ2I), where σ is a hyperparameter.

heading: 3.2 INFERENCE AND LEARNING
text: Since computing p(x) in Equation 1 is intractable, we train RICH with variational inference. The approximate posterior is designed to factorize z in the top-down fashion similar to the generative process, such that a higher-level appearance representation guides lower-level decomposition:
p(z | x) ≈ q(z | x) = q(zapprr | x) ∏
v∈V \{r}
q(zposev | z appr pa(v),xpa(v)) q(z appr v | z appr pa(v),xv). (4)
Here xv is the region of input image x that corresponds to the entity that node v represents. This region is specified by all the predicted pose vectors along the path from root r to node v. More precisely, we define xr = x, and recursively extract xv = ST (xpa(v), zposev ), as shown in Figure 1B. Notice that the relative pose zposev of v with respect to pa(v) needs to be inferred from xpa(v). After applying spatial transformer ST , we assume the captured xv is in its canonical pose. This top-down inference process avoids the challenging routing problem in capsule networks (Sabour et al., 2017; Hinton et al., 2018), leading to more efficient inference. In cases where entities are close or have occlusion, the higher-level appearance vector zapprpa(v) could provide some guidance on separating these entities.
In general, all latents are assumed to be continuous, with both prior and posterior being Gaussian distributions. However, it may bring additional flexibility and interpretability to introduce some discrete latents, as we explain in Section 3.3. For continuous latents, we compute posterior via precision-weighted combination similar to Ladder-VAE (Sønderby et al., 2016), and use reparameterization trick (Kingma & Welling, 2013) to sample from the posterior. For discrete latents, we use Gumbel-Softmax trick (Jang et al., 2016; Maddison et al., 2016). Thus, the entire model can be trained end-to-end via backpropagation to maximize the following evidence lower bound (ELBO):
L = Eq(z|x)[log p(x | zposeV \{r}, z appr L )]−DKL[q(z appr r | x) ‖ p(zapprr )] (5) − ∑
v∈V \{r} Eq(z|x)[DKL[q(zposev | z appr pa(v),xpa(v)) ‖ p(z pose v | z appr pa(v))]]
− ∑
v∈V \{r} Eq(z|x)[DKL[q(zapprv | z appr pa(v),xv) ‖ p(z appr v | z appr pa(v))]].

heading: 3.3 IMPLEMENTATION DETAILS
text: Structural inference. In our description above, we have assumed that the tree structure is already known. We now relax this assumption and introduce structural inference. First, we set a maximum out-degree for each node so that the number of all possible structures is bounded. For simplicity, in our implementation nodes within one level share the same maximum out-degree. To determine the structure, it then suffices to specify the presence of each possible edge. Hence, for an arbitrary edge between node v and its parent, we introduce a Bernoulli variable zpresv to indicate its presence. If zpresv = 0, meaning the edge is not present, then z pose v along with all latents in the subtree rooted at v are excluded from the representation. To encourage sparse structures, we initialize the prior p(zpresv | zapprpa(v)) and the posterior q(z pres v | zapprpa(v),xpa(v)) to have small Bernoulli parameters.
Node grounding. Due to the symmetric tree structure, there are numerous equivalent entity-tonode assignments for a given scene, each yielding a different permutation of the pose vectors. This can cause difficulties in the learning process. In particular, the model has to learn a consistent assignment strategy such that the pose vector at each edge can be well captured by a unimodal Gaussian distribution. To alleviate this problem, we impose some inductive bias on the assignment strategy. Inspired by SPAIR (Crawford & Pineau, 2019), for each internal node u, we divide xu into a grid of Nu cells, where Nu is the maximum out-degree of u. Each child of u is assigned to one
of these cells, and is responsible for explaining only the entity whose center position is within that cell. Assuming that xu captures the entity u in its canonical pose, this assignment strategy ensures that each child of node u is almost always associated with the same component of entity u. To deal with occlusion, we let neighboring cells have slight overlap.
Primitive templates. It is often reasonable to assume that the vast number of complex entities can be composed from only a modest number of primitive entities. Identifying such primitive entities through discrete latent variables would bring additional interpretability. Hence, we introduce an external memory M with variational addressing (Bornschein et al., 2017) to learn a set of primitive templates. For each leaf node v ∈ L, we decompose its appearance vector into zapprv = (zaddrv , zwhatv ). Here, zaddrv is a one-hot vector that points one of the templates in M, and z what v is a continuous vector that explains the remaining variability. We assume that zapprpa(v) captures the identity but not the exact appearance of entity v, since zapprpa(v) is intended for summarization. Therefore, we factorize the prior and the posterior as follows:
p(zapprv | z appr pa(v)) = p(z addr v | z appr pa(v),M) p(z what v |M[zaddrv ]), (6)
q(zapprv | z appr pa(v),xv) = q(z addr v | z appr pa(v),M,xv) q(z what v |M[zaddrv ],xv), (7)
where M is considered as model parameter, and M[zaddrv ] is the deterministically retrieved memory content. We implement M to be a stack of low-dimensional embeddings of templates. To decode from zapprv , we first retrieve the embedding indexed by zaddrv , and decode it into a single-channel image patch. This serves as both the template and the mask, namely m̂v = g(M[zaddrv ]). We then apply multiplicative modification controlled by zwhatv and obtain x̂v = m̂v h(zwhatv ). Here, x̂v has the same number of channels as the input x, and both g(·) and h(·) are implemented as spatial broadcast decoders (Watters et al., 2019).
Canonical size. To avoid undesired effects in cascaded affine transformations, we constrain the spatial transformer to always preserve aspect ratio. Thus, for a square input image, each entity is assumed to occupy a square image region. Considering the various possible compositions, this region may not capture the entity’s canonical size well. Hence, we introduce a latent variable zratiou to represent the aspect ratio of entity u. This could give a tighter bounding box inside the square region. We consider zratiou as part of the appearance vector, namely z appr u = (zwhatu , z ratio u ), and factorize the prior and the posterior as follows:
p(zappru | z appr pa(u)) = p(z what u | z appr pa(u)) p(z ratio u | zwhatu ), (8)
q(zappru | z appr pa(u),xu) = q(z what u | z appr pa(u),xu) q(z ratio u | zwhatu ,xu). (9)
For simplicity, we introduce zratiou only for intermediate nodes u ∈ V \ (L ∪ {r}). To properly learn zratiou , we feed it as an additional argument to the spatial transformer. This has two effects. First, the region outside the bounding box given by zratiou is masked out during transformation in both inference and reconstruction. This forces the bounding box to capture the entity in its entirety. Second, during training, we inject zero-mean Gaussian noise to the reconstruction inside the bounding box region. The noise level is annealed as training proceeds. This encourages tight bounding boxes without affecting generation quality.

heading: 4 EXPERIMENTS

heading: 4.1 DATASETS AND A THREE-LEVEL PROTOTYPE
text: We have implemented a prototype of RICH with part-, object-, and scene-level representation. We will refer to the latents as zP , zO, and zS respectively. The maximum out-degree is set to be 4 for each internal node. For evaluation, we have made two datasets of 2D and 3D scenes. Both datasets contain 128×128 color images, split into 64000 for training, 12800 for validation, and 12800 for testing. They present challenges of (i) multi-pose, variable number of objects and parts, (ii) multiple occurrences of the same type of objects and parts within one scene, and (iii) severe occlusion in 3D scenes. In making each dataset, we first choose a set of primitive shapes to be the parts, and then construct the objects and scenes by recursively composing these parts. Specifically, we have chosen three shapes as parts, and defined ten types of objects in terms of the identity of the constituent parts
and their relative position, scale, and orientation. Among these ten types, three contain a single part, another three contain two parts, and the remaining four contain three parts. To construct a scene, we first randomly sample the number of objects (between one and four) and their types, and then instantiate these objects. This means for each object, we choose a random color for each of its parts, apply random scaling (within 10% of object size), and draw it at a random position in the scene. In 2D case, the instantiation process also includes random perturbation of parts and random rotation of the object as a whole. We ensure that different objects have minimal overlap. In 3D case, we use MuJoCo (Todorov et al., 2012) to place the objects on a plane, and then take observations from ten different viewpoints, some of which can lead to severe occlusion.

heading: 4.2 SCENE DECOMPOSITION
text: RICH is able to give interpretable, tree-structured decomposition of scenes into objects and parts. We visualize such decomposition in Figure 2 and Figure 3 for 2D and 3D scenes respectively, where we also show the learned memory templates for parts. Notice that the templates should be in gray scale, but for visualization purposes we have assigned a color to each template. The bounding boxes are drawn on top of the input images, according to the inferred pose of objects and parts with zpres = 1. Object bounding boxes are drawn in white, while part bounding boxes are drawn in color to indicate the template chosen for each part.
We find that the templates have learned the appearance of parts at several canonical poses (rotation in 2D and viewpoint in 3D), and RICH predicts the pose of parts with respect to these canonical poses. This makes the decomposition even more interpretable. Moreover, equipped with templates, RICH is able to correctly identify the parts even when they have severe occlusion. See Figure 3A third row where a ball occludes an equally sized cube. This example (and many others) also demonstrate that RICH can successfully deal with objects composed of multiple parts that are of the same type.
In addition to part-level templates, we believe that the learned object-level zapprO also helps scene decomposition, especially when there is ambiguity in part assignment and occlusion between objects. For example, in Figure 2A first column, the triangle and circle near the center are close to each other and may well constitute an object. However, because this pose configuration is relatively rare in the training set (compare second column), RICH has correctly rejected this composition and instead assigned these two parts to separate objects, which better agrees with the training distribution. In Figure 3A fourth row, object 1 is occluded by object 3. RICH has successfully detected object 1 and added in the reconstruction a ball of the same color as the occluded part. This is quite reasonable since the augmented object is one of our predefined types and appears frequently in the dataset.
To quantify RICH’s ability of scene decomposition and representation learning, we report absolute counting error, precision, and recall for detection of objects and parts in Table 1, and compare the negative log-likelihood of RICH with a VAE (Kingma & Welling, 2013) baseline in Table 2. Here the counting error measures the absolute difference between the predicted and true number of objects
and parts. To obtain precision and recall, we need to match the predictions with the groundtruth. We set the matching priority as the distance between the predicted and true center positions, namely closer pairs of prediction and groundtruth will be matched first. We only match the pair if their distance is less than 10 pixels (less than half of the size of large parts). This ensures that the matched predictions will have approximately correct center positions. The VAE baseline shares the same scene-level encoder with RICH, and uses sub-pixel convolution (Shi et al., 2016) for the decoder. We approximate the negative log-likelihood using 50 importance-weighted samples. The counting error, precision, and recall are also averaged over 50 samples from the posterior. As can be seen from Table 1, RICH gives almost perfect detection of objects and parts on 2D dataset, and still performs reasonably well on the challenging 3D dataset. We observe that RICH tends to split a long cylinder into two parts, leading to the drop in precision for parts.

heading: 4.3 OBJECT AND SCENE GENERATION
text: Apart from learning the part-level templates, RICH also has the ability to generate objects and scenes by recursively composing the learned templates. We show generation results in Figure 4. To generate the scenes, we first sample zapprS ∼ N (0, I), and then sample other latents following the learned conditional prior distributions, and finally use the decoder to render the image. The objects are generated similarly, except that we decode up to the object level and ignore zpresO and z pose O . We find that RICH has captured many predefined object types in the dataset, and also managed to come up with novel compositions. The generated scenes are also reasonable, with moderate distance and occlusion between objects.

heading: 4.4 GENERALIZATION PERFORMANCE
text: RICH represents the scene as composition of objects and parts. This naturally enables generalization to novel scenes. Here we evaluate RICH’s capacity to generalize to scenes with novel number of objects. The training and validation sets of this task contain scenes of one and three objects only. We trained RICH and the VAE baseline again, and report the metrics in Table 1 and Table 2 on two test sets, one having two-object scenes only, and the other having four-object scenes only. We also show qualitative results in Figure 5 and Figure 6. As can be seen, RICH demonstrates quite decent generalization performance in both 2D and 3D scenes. We notice that in 3D case, there is a drop in recall when RICH is tested on four-object scenes. One reason is that four-object scenes exhibit more severe occlusion than the training set, and we have observed that when two objects are close and have occlusion, RICH would sometimes merge them into one object. Another reason is that in four-object scenes, objects are more likely to be partially outside the scene. In this case, RICH has difficulty predicting the precise object position, leading to unmatched predictions when we compute the recall.

heading: 4.5 DATA EFFICIENCY IN DOWNSTREAM TASKS
text: The compositional hierarchy learned by RICH can be useful in downstream tasks that require reasoning of part-object relationships. Here we consider a classification task. The input images are generated from the same distribution as described in Section 4.1 but with different random seeds. The label for each image is obtained by first counting the number of distinct parts within each object, and then summing the count over all objects. We expect the representation learned by RICH to
bring better data efficiency compared to non-hierarchical baselines like SPAIR (Crawford & Pineau, 2019). To verify this, we use pretrained RICH and SPAIR to obtain the latent representation for each image, and then train a classifier on top of the representation to predict the label. Specifically, the unnormalized class probabilities yRICH for RICH are computed as follows:
yRICH = fMLP3 ∑ u wu · fMLP2  ∑ v∈ch(u) wv · fMLP1 ( zpresu · zpresv ·M[zaddrv ] ) , (10) where u and v are indices of objects and parts respectively, wu and wv are attention weights also computed by MLPs. Because RICH provides the compositional hierarchy, the classifier can explicitly merge information from parts that belong to the same object. For SPAIR that detects parts with no notion of objects, we include pose vectors as additional input for fair comparison. This allows the classifier to group parts into objects based on their positions. The unnormalized class probabilities ySPAIR for SPAIR are computed as follows:
ySPAIR = fMLP3 (∑ u wu · fMLP2 (∑ v w(u)v · fMLP1 (zpresv · concat[zapprv , zposev ]) )) . (11)
The difference here is that we have multiple sets of attention weights w(u), each should learn to select the parts that belong to one specific object.
We train the two classifiers using varying number of training samples. We ensure that the classifiers have comparable number of parameters. We use a parallel implementation of SPAIR that, as suggested by Anonymous (2020), has similar detection performance but faster training speed. We choose the best learning rate for both classifiers using a fixed validation set of size 12800. We report classification accuracy on a fixed test set also of size 12800. As shown in Figure 7, RICH representation approximately doubles the data efficiency on this downstream task compared to SPAIR representation.

heading: 5 CONCLUSION
text: We have proposed RICH, the first hierarchical generative model for learning interpretable compositional structures. RICH takes a top-down approach to infer the probabilistic scene graph representation for a given scene. This utilizes the higher-level appearance information to guide lower-level decomposition, thus avoiding the difficult routing problem faced by bottom-up approaches. Through extensive experiments, we have demonstrated that RICH is able to learn the compositional hierarchy from images containing multiple objects. An interesting future direction is to extend RICH to the sequential setting.

heading: A DEALING WITH DEFORMABLE PRIMITIVES
text: In Section 4, we have demonstrated the effectiveness of RICH on two datasets of 2D and 3D scenes. However, these datasets only contain non-deformable primitives, meaning each primitive has only one possible shape. Here, we introduce a compositional MNIST dataset where the primitives are handwritten digits with considerable shape variation. Through the same set of experiments as in Section 4, we show that with slight modification, RICH can successfully deal with such deformable primitives.
A.1 COMPOSITIONAL MNIST DATASET
We define the primitive parts to be individual digits from the MNIST database (LeCun et al., 1998). We have excluded the digit 1, since it can be used as sub-parts in other digits like 4 and 7, and thus may interfere with our definition of primitives. We then define nineteen types of objects, of which nine contain a single digit, six contain two digits, and the remaining four contain three digits. Here, the object definition specifies the class of each digit that an object should contain, and the relative position and orientation of these digits. We allow overlap among digits that constitute one object.
The dataset contains 128×128 color images, split into 64000 for training, 12800 for validation, and 12800 for testing. Each image describes a scene that contains one to four objects. To instantiate an object from its definition, we first sample the digits from the corresponding classes and resize them to 36×36. Next, we assign a random color to each digit. The colors are guaranteed to be distinct. Finally, we apply random scaling (within 10% of object size) and random rotation (within ±30 degrees) to the object as a whole, and draw it at a random position in the scene. We ensure that different objects have minimal overlap, and that disjoint sets of digit samples are used for the training, validation, and test sets.
A.2 MODIFICATIONS TO RICH
RICH decomposes the appearance vector of primitive v into zapprv = (zaddrv , z what v ), and decodes the mask m̂v and the image patch x̂v as m̂v = g(M[zaddrv ]) and x̂v = m̂v h(zwhatv ). Although in principle, such element-wise multiplication has the ability to model deformation, we empirically find this to be hard. In fact, h(zwhatv ) tends to produce an image patch filled with a single color, and is thus unable to distort the shape of template given by m̂v .
To deal with deformable primitives, we add more inductive bias to the decoder. In particular, zwhatv is further split into zshapev and zcolorv during the decoding process. z shape v is designated to explain the shape variation, and is concatenated with the template embedding M[zaddrv ] to modify the shape of template as m̂v = g(concat[M[zaddrv ], z shape v ]). As mentioned in Section 3.3, m̂v is in gray scale, so we then use zcolorv to colorize the modified template m̂v and produce x̂v = m̂v h(zcolorv ).
One challenge here is to disentangle deformation from pose changes. Ideally, zshapev should capture only the shape variation of primitive v in its canonical pose, so that zshapev and z pose v do not interfere with each other. This can be enforced by limiting the expressiveness of zshapev . In experiments, we find that restricting zshapev to a one-dimensional scalar works reasonably well.
Another challenge arises during training. We have observed that RICH tends to split the digits into sub-parts at an early stage. Consequently, the strokes instead of the digits are learned as primitives, and the objects become composition of strokes, leading to an incorrect compositional hierarchy. To alleviate this problem, we take inspiration from SPACE (Anonymous, 2020) and introduce a colorfiltered boundary loss for each glimpse xv , where v is a primitive. The key observation is that if xv captures only part of a digit, then there must be some pixels on the boundary of xv that have the same color as the digit. Here, the thickness of boundary is a hyperparameter. We use h(zcolorv ) as a color filter to find such pixels. The boundary loss then penalizes the total number of those pixels. This drives zposev to produce a larger glimpse region that reduces splitting. We anneal the weight of the boundary loss as training proceeds.
A.3 EXPERIMENTAL RESULTS
Similar to Section 4, here we show both qualitative and quantitative results on the compositional MNIST dataset. Figure 8A shows qualitative results of scene decomposition. Again, the bounding boxes are fairly tight, demonstrating that the nodes in the probabilistic scene graph representation have been correctly associated with objects and parts in the images. We also visualize the learned part-level templates in Figure 8B. Here each row shows the templates decoded from one slot of the memory with varying degree of distortion. As can be seen, each slot captures visually similar digits, and all nine digits are captured. It is worth noting that the main purpose of memory is not to perfectly separate the different classes of digits, but to obtain the canonical pose for the digits. This
is essential for the scene graph representation to infer consistent orientation for the digits. Figure 8B shows that this purpose is indeed achieved, since the digits have almost the same pose within each memory slot.
Figure 9 shows the generated objects and scenes, which resemble the training images. Figure 10 shows qualitative generalization results. The learned compositional hierarchy generalizes well to unseen number of objects. We report quantitative results in Table 3 and Table 4. The counting error, precision, and recall are mainly to show that the representation is learned properly. We compare negative log-likelihood with a VAE baseline to demonstrate that the probabilistic scene graph representation can be obtained without impairing generation quality.
Finally, we consider a downstream task that requires reasoning of part-object relationships, and demonstrate the transferability of RICH representation. The task setup, model architecture, and training procedure are similar to those described in Section 4.5. The difference here is that we seek to predict the sum of max digit within each object, and we treat it as a 37-way classification task (possible output can be integers in [0, 36]). Experimental results in Figure 11 show that compared to SPAIR, the representation learned by RICH leads to approximately doubled data efficiency.
.

Review summaries:
Contributions: this submission proposes a generative framework which employs a hierarchical decomposition of scene, objects and parts. It modifies the SPAIR framework (Crawford & Pineau) and replaces the recurrent generation with parallel generation, by assuming the number of objects is known and fixed. Results are presented on two synthetic datasets with 2D or 3D shapes.