G ENERATIVE H IERARCHICAL M ODELS FOR P ARTS , O BJECTS , AND S CENES
Anonymous authors
Paper under double-blind review
A BSTRACT
Compositional structures between parts and objects are inherent in natural scenes.
Modeling such compositional hierarchies via unsupervised learning can bring various beneﬁts such as interpretability and transferability, which are important in many downstream tasks.
In this paper, we propose the ﬁrst 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 difﬁcult 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.
I NTRODUCTION
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 ﬂexibility 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., 
 ; Crawford & Pineau, 2019; Wu+} et al., 2017; Yao et al., 2018; Romaszko et al., 2017; Deng et al., 2019) has introduced domain-speciﬁc 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 speciﬁed 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 speciﬁc 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 difﬁcult 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 ﬁrst decompose it into high-level objects.
If we devote our attention to one of the objects, we can then ﬁgure 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 ﬁrst 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.
R ELATED WORK
Interpretable object-wise representation. AIR (Eslami et al., 2016) is the ﬁrst generative model that learns interpretable object-wise scene representation.
It is able to assign a latent vector ( z pres , z where , z what ) 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 efﬁcient hierarchical inference, we use mean-ﬁeld 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 classiﬁcation, parsing, and segmentation.
Two representative models 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.  T HE PROPOSED MODEL : RICH
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 compositional relationships among these entities.
Speciﬁcally, 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 speciﬁed by the relative pose of each child node with respect to the parent node, and this pose information is stored on the corresponding edges. 3. G ENERATIVE PROCESS
To make a generative model, we associate an appearance vector z appr v with each node v , and a pose vector z pose v with the edge between node v and its parent pa ( v ) , as shown in Figure 1A. The intuition is that z appr pa ( 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 z appr pa ( 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:
[Equation]
where we assume conditional independence among all latents z pose v and z appr v that have the same pa ( v ) . This gives disentangled and interpretable scene representation.
We design the decoder p ( x | z pose V \{ 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 )
{+= 
 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 afﬁne transformations level by level.+}
Speciﬁcally, 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:
[Equation] 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 z pose v . 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 , z pose v ) , namely for all pixel locations ( i, j ) , [Equation]
if (cid:88)
[Equation] [Equation]
The ﬁnal decoder output p ( x | z pose V \{ r } , z appr L ) =
N ( ˆ x r , σ 2 I ) , where σ is a hyperparameter. 3. I NFERENCE AND LEARNING 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:
[Equation]
Here x v is the region of input image x that corresponds to the entity that node v represents. This region is speciﬁed by all the predicted pose vectors along the path from root r to node v . More precisely, we deﬁne x r = x , and recursively extract x v = ST ( x pa ( v ) , z pose v ) , as shown in Figure 1B. Notice that the relative pose z pose v of v with respect to pa ( v ) needs to be inferred from x pa ( v ) . After applying spatial transformer ST , we assume the captured x v 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 efﬁcient inference.
In cases where entities are close or have occlusion, the higher-level appearance vector z appr pa ( 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 ﬂexibility 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): [Equation]
3. I MPLEMENTATION DETAILS
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 sufﬁces to specify the presence of each possible edge.
Hence, for an arbitrary edge between node v and its parent, we introduce a Bernoulli variable z pres v to indicate its presence.
If z pres v = 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 ( z pres v | z appr pa ( v ) ) and the posterior q ( z pres v | z appr pa ( v ) , x pa ( 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 difﬁculties 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 x u into a grid of N u cells, where N u 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 x u 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 z appr v
[Equation]
Here, z addr v 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 z appr pa ( v ) captures the identity but not the exact appearance of entity v , since z appr pa ( v ) is intended for summarization. Therefore, we factorize the prior and the posterior as follows:
[Equation]
where M is considered as model parameter, and M [ z addr v ] is the deterministically retrieved memory content. We implement M to be a stack of low-dimensional embeddings of templates. To decode from z appr v , we ﬁrst retrieve the embedding indexed by z addr v , and decode it into a single-channel image patch. This serves as both the template and the mask, namely ˆ m v = g ( M [ z addr v ]) .
We then apply multiplicative modiﬁcation controlled by z what v and obtain ˆ x v =
ˆ m v (cid:12) h ( z what v ) . 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 afﬁne 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 z ratio u to represent the aspect ratio of entity u .
This could give a tighter bounding box inside the square region.
We consider z ratio u as part of the appearance vector, namely z appr u =
[Equation]
z what u , z ratio u ) , and factorize the prior and the posterior as follows:
[Equation]
For simplicity, we introduce z ratio u only for intermediate nodes u ∈ V \ ( L ∪ { r } ) . To properly learn z ratio u , we feed it as an additional argument to the spatial transformer. This has two effects.
First, the region outside the bounding box given by z ratio u 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.
E XPERIMENTS 4. D ATASETS AND A THREE - LEVEL PROTOTYPE
We have implemented a prototype of RICH with part-, object-, and scene-level representation. We will refer to the latents as z P , z O , and z S 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 ﬁrst choose a set of primitive shapes to be the parts, and then construct the objects and scenes by recursively composing these parts.
Speciﬁcally, we have chosen three shapes as parts, and deﬁned 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 ﬁrst 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. [Table]
4. S CENE DECOMPOSITION
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 z pres = 1 .
Object bounding boxes are in white, are drawn in color
We ﬁnd 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 z appr O also helps scene decomposition, especially when there is ambiguity in part assignment and occlusion between objects.
For example, in Figure 2A ﬁrst column, the triangle and circle near the center are close to each other and may well constitute an object.
However, because this pose conﬁguration 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 predeﬁned 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 ﬁrst.
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. [Table]
4. O BJECT AND SCENE GENERATION
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 ﬁrst sample z appr S ∼ N ( 0 , I ) , and then sample other latents following the learned conditional prior distributions, and ﬁnally use the decoder to render the image.
The objects are generated similarly, except that we decode up to the object level and ignore z pres O and z pose O .
We ﬁnd that RICH has captured many predeﬁned 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.
4. G ENERALIZATION PERFORMANCE
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 difﬁculty predicting the precise object position, leading to unmatched predictions when we compute the recall. 4. D ATA EFFICIENCY IN DOWNSTREAM TASKS The compositional hierarchy learned by RICH can be useful in downstream tasks that require reasoning of part-object relationships. Here we consider a classiﬁcation task.
The input images are generated from the same distribution as described in Section 4.1 but with different random seeds.
[Figure] The label for each image is obtained by ﬁrst 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 efﬁciency 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 classiﬁer on top of the representation to predict the label.
Speciﬁcally, the unnormalized class probabilities y RICH for RICH are computed as follows:
[Equation]
[Equation]
where u and v are indices of objects and parts respectively, w u and w v are attention weights also computed by MLPs.
Because RICH provides the compositional hierarchy, the classiﬁer 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 classiﬁer to group parts into objects based on their positions.
The unnormalized class probabilities y SPAIR for SPAIR are computed as follows:
[Equation] 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 speciﬁc object. We train the two classiﬁers using varying number of training samples. We ensure that the classiﬁers 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 classiﬁers using a ﬁxed validation set of size 12800. We report classiﬁcation accuracy on a ﬁxed test set also of size 12800.
As shown in Figure 7, RICH representation approximately doubles the data efﬁciency on this downstream task compared to SPAIR representation.  C ONCLUSION We have proposed RICH, the ﬁrst 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 difﬁcult 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. A D EALING WITH DEFORMABLE PRIMITIVES 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 modiﬁcation, RICH can successfully deal with such deformable primitives.
A. C OMPOSITIONAL MNIST DATASET
We deﬁne 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 deﬁnition of primitives.
We then deﬁne 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 deﬁnition speciﬁes 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 deﬁnition, we ﬁrst 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. M ODIFICATIONS TO RICH
RICH decomposes the appearance vector of primitive v into z appr v =
( z addr v , z what v ) , and decodes the mask ˆ m v and the image patch ˆ x v as ˆ m v = g
( M [ z addr v ]) and ˆ x v =
ˆ m v (cid:12) h ( z what v ) .
Although in principle, such element-wise multiplication has the ability to model deformation, we empirically ﬁnd this to be hard.
In fact, h ( z what v ) tends to produce an image patch ﬁlled 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, z what v is further split into z shape v and z color v during the decoding process.
z shape v is designated to explain the shape variation, and is concatenated with the template embedding M [ z addr v ] to modify the shape of template as ˆ m v = g ( concat [ M [ z addr v ] ,
z shape v ]) .
As mentioned in Section 3.3, ˆ m v is in gray scale, so we then use z color v to colorize the modiﬁed template ˆ m v and produce ˆ x v =
ˆ m v (cid:12) h ( z color v ) .
One challenge here is to disentangle deformation from pose changes.
Ideally, z shape v should capture only the shape variation of primitive v in its canonical pose, so that z shape v and z pose v do not interfere with each other.
This can be enforced by limiting the expressiveness of z shape v .
In experiments, we ﬁnd that restricting z shape v 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 colorﬁltered boundary loss for each glimpse x v , where v is a primitive.
The key observation is that if x v captures only part of a digit, then there must be some pixels on the boundary of x v that have the same color as the digit.
Here, the thickness of boundary is a hyperparameter.
We use h ( z color v ) as a color ﬁlter to ﬁnd such pixels.
The boundary loss then penalizes the total number of those pixels.
This drives z pose v to produce a larger glimpse region that reduces splitting.
We anneal the weight of the boundary loss as training proceeds.
A. E XPERIMENTAL 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
[Table]
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.
Figureshows 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
[Table]
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
[Table]
and demonstrate the transferability of RICH representation.
The task setup, model architecture
[Table]
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
[Table]
and we treat it as a 37-way classiﬁcation 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 efﬁciency.
[Figure]
[Table]
Training
[Table]
[Figure]
RICH
SPAIR