Title: SCAN: LEARNING HIERARCHICAL COMPOSITIONAL VISUAL CONCEPTS

Abstract: The seemingly infinite diversity of the natural world arises from a relatively small set of coherent rules, such as the laws of physics or chemistry. We conjecture that these rules give rise to regularities that can be discovered through primarily unsupervised experiences and represented as abstract concepts. If such representations are compositional and hierarchical, they can be recombined into an exponentially large set of new concepts. This paper describes SCAN (Symbol-Concept Association Network), a new framework for learning such abstractions in the visual domain. SCAN learns concepts through fast symbol association, grounding them in disentangled visual primitives that are discovered in an unsupervised manner. Unlike state of the art multimodal generative model baselines, our approach requires very few pairings between symbols and images and makes no assumptions about the form of symbol representations. Once trained, SCAN is capable of multimodal bi-directional inference, generating a diverse set of image samples from symbolic descriptions and vice versa. It also allows for traversal and manipulation of the implicit hierarchy of visual concepts through symbolic instructions and learnt logical recombination operations. Such manipulations enable SCAN to break away from its training data distribution and imagine novel visual concepts through symbolically instructed recombination of previously learnt concepts.

1. INTRODUCTION:

State of the art deep learning approaches to machine learning have achieved impressive results in many problem domains, including classification (He et al., 2016; Szegedy et al., 2015) , density modelling (Gregor et al., 2015; Oord et al., 2016a; b) , and reinforcement learning (Mnih et al., 2015; 2016; Jaderberg et al., 2017; Silver et al., 2016) . They are still, however, far from possessing many traits characteristic of human intelligence. Such deep learning techniques tend to be overly data hungry, often rely on significant human supervision and tend to overfit to the training data distribution (Lake et al., 2016; Garnelo et al., 2016) . An important step towards bridging the gap between human and artificial intelligence is endowing algorithms with compositional concepts (Lake et al., 2016; Garnelo et al., 2016) . Compositionality allows for reuse of a finite set of primitives (addressing the data efficiency and human supervision issues) across many scenarios by recombining them to produce an exponentially large number of novel yet coherent and potentially useful concepts (addressing the overfitting problem). Compositionality is at the core of such human abilities as creativity, imagination and language-based communication.

We propose that concepts are abstractions over a set of primitives. For example, consider a toy hierarchy of visual concepts shown in Fig. 1 . Each node in this hierarchy is defined as a subset of visual primitives that make up the scene in the input image. These visual primitives might include factors like object identity, object colour, floor colour and wall colour. As one traverses the hierarchy from the subordinate over basic to superordinate levels of abstraction (Rosch, 1978) (i.e. from the more specific to the more general concepts corresponding to the same visual scene), the number of concept-defining visual primitives decreases. Hence, each parent concept in such a hierarchy is an Figure 1 : Schematic of an implicit concept hierarchy built upon a subset of four visual primitives: object identity (I), object colour (O), floor colour (F ) and wall colour (W ) (other visual primitives necessary to generate the scene are ignored in this example). Concepts form an implicit hierarchy, where each parent is an abstraction over its children and over the original set of visual primitives (the values of the concept-defining sets of visual primitives are indicated by the bold capital letters). In order to generate an image that corresponds to a concept, one has to fill in values for the factors that got abstracted away (represented as "_"), e.g. by sampling from their respective priors. Given certain nodes in the concept hierarchy, one can traverse the other nodes using logical operations. See Sec.3 for our formal definition of concepts. abstraction (i.e. a subset) over its children and over the original set of visual primitives. A more formal definition of concepts is provided in Sec. 3.

Intelligent agents are able to discover and learn abstract compositional concepts using little supervision (Baillargeon, 1987; Spelke, 1990; Baillargeon, 2004; Smith & Vul, 2013) . Think of human word learning -we acquire the meaning of words through a combination of a continual stream of unsupervised visual data occasionally paired with a corresponding word label. This paper describes SCAN (Symbol-Concept Association Network, see Fig. 2A ), a neural network model capable of learning grounded visual concepts in a largely unsupervised manner through fast symbol association. First, we use the β-VAE (Higgins et al., 2017a) to learn a set of independent representational primitives through unsupervised exposure to the visual data. This is equivalent to learning a disentangled (factorised and interpretable) representation of the independent ground truth "generative factors" of the data (Bengio et al., 2013) . Next, we allow SCAN to discover meaningful abstractions over these disentangled primitives by exposing it to a small number of symbol-image pairs that apply to a particular concept (e.g. a few example images of an apple paired with the symbol "apple"). SCAN learns the meaning of the concept by identifying the set of visual primitives that all the visual examples have in common (e.g. all observed apples are small, round and red). The corresponding symbol ("apple") then becomes a "pointer" to the newly acquired concept {small, round, red} -a way to access and manipulate the concept without having to know its exact representational form. Our approach does not make any assumptions about how these symbols are encoded, which also allows SCAN to learn multiple referents to the same concept, i.e. synonyms.

Once a concept is acquired, it should be possible to use it for bi-directional inference: the model should be able to generate diverse visual samples that correspond to a particular concept (sym2img) and vice versa (img2sym). Since the projection from the space of visual primitives to the space of concepts (img2sym, red dash arrow in Fig. 1 ) involves abstraction and hence a loss of information, one then needs to add compatible information back in when moving from the space of concepts to that of visual primitives (sym2img, blue dot arrow in Fig. 1 ). In our setup, concepts are defined in terms of a set of relevant visual primitives (e.g. colour, shape and size for "apple"). This leaves a set of irrelevant visual attributes (e.g. lighting, position, background) to be "filled in". We do so by defaulting them to their respective priors, which ensures high diversity of samples (in both image or symbol space) for each concept during img2sym and sym2img inferences.

The structured nature of learnt concepts acquired by SCAN allows for sample efficient learning of logical recombination operators: AND (corresponding to a set union of relevant primitives), IN COMMON (corresponding to set intersection) and IGNORE (corresponding to set difference), by pairing a small number of valid visual examples of recombined concepts with the respective operator names. Once the meaning of the operators has been successfully learned, SCAN can exploit the compositionality of the acquired concepts, and traverse previously unexplored parts of the implicit underlying concept hierarchy by manipulating and recombining existing concepts in novel ways. For example, a new node corresponding to the concept {blue, small} can be reached through the following instructions: "blue" AND "small" (going down the hierarchy from more general to more DAE -VAE specific), "blueberry" IN COMMON "bluebell" (going up the hierarchy from more specific to more general) or "blueberry" IGNORE "round" (also going up the hierarchy).

x x θ x φ x J β q φx (z x |x; µ x , σ x ) J(x) -J(x) 2 2 x -VAE x x θ x

To summarise, our paper 1) presents SCAN, a neural network model capable of learning compositional and hierarchical representations of visual concepts; 2) demonstrates that SCAN can be successfully trained with very little supervised data; 3) shows that after training, SCAN can perform multimodal (visual and symbolic) bi-directional inference and generation with high accuracy and diversity, outperforming all baselines; 4) shows that the addition of logical recombination operations allows SCAN to break out of its limited training data distribution and reach new nodes within the implicit hierarchy of concepts.

2. RELATED WORK:

To the best of our knowledge no framework currently exists that is directly equivalent to SCAN. Past relevant literature can broadly be split into three categories: 1) Bayesian models that try to mimic fast human concept learning (Tennenbaum, 1999; Lake et al., 2015) ; 2) conditional generative models that aim to generate faithful images conditioned on a list of attributes or other labels (Reed et al., 2016b; a; Kingma et al., 2014; Yan et al., 2016; Sohn et al., 2015; Pandey & Dukkipati, 2017) ; and 3) multimodal generative models that aim to embed visual and symbolic inputs in a joint latent space in order to be able to run bi-directional inferences (Vedantam et al., 2017; Suzuki et al., 2017; Pu et al., 2016; Wang et al., 2016; Srivastava & Salakhutdinov, 2014) . Bayesian models by Tennenbaum (1999) and Lake et al. (2015) can learn from few examples, but, unlike SCAN, they are not fully grounded in visual data. Conditional and joint multimodal models are fully grounded in visual data, however, unlike SCAN, they require a large number of image-symbol pairs for training. An exception to this is the model by Srivastava & Salakhutdinov (2014) , which, however, cannot generate images, instead relying on feature-guided nearest-neighbour lookup within existing data, and also requires slow MCMC sampling. Multimodal generative models are capable of bi-directional inference, however they tend to learn a flat unstructured latent space unlike the hierarchical compositional latent space of SCAN. Hence these baselines underperform SCAN in terms of sample diversity and the ability to break out of their training data distribution through symbolically instructed logical operations.

3. FORMALISING CONCEPTS:

In Sec. 1 we informally proposed that concepts are abstractions over visual representational primitives. Hence, in order to formally define concepts we first define the visual representations used to ground them. These are defined as tuples of the form (Z 1 , ..., Z K ), where {1, ..., K} is the set of indices of the independent latent factors sufficient to generate the visual input x, and Z k is a random variable.

The set R K of all such tuples is a K-dimensional visual representation space.

We define a concept C i in such a K-dimensional representation space as a set of assignments of probability distributions to the random variables Z k , with the following form:

C i = {(k, p i k (Z k )) | k ∈ S i } (1)

where S i ⊆ {1, ..., K} is the set of visual latent primitives that are relevant to concept C i and p i k (Z k ) is a probability distribution specified for the visual latent factor represented by the random variable Z k . Since S i are subsets of {1, ..., K}, concepts are abstractions over the K-dimensional visual representation space. To generate a visual sample corresponding to a concept C i , it is necessary to fill in details for latents that got abstracted away during concept learning. This corresponds to the probability distributions {p k (Z k )|k ∈ S i }, where S i = {1, ..., K} \ S i is the set of visual latent primitives that are irrelevant to the concept C i . In SCAN we set these to the unit Gaussian prior:

p k (Z k ) = N (0, 1), ∀k ∈ S i .

In order to improve readability, we will use a simplified notation for concepts throughout the rest of the paper. For example, { (size, p(Z size = small)), (colour, p(Z colour = blue)) } will become either {small, blue} or {small, blue, _, _}, depending on whether we signify the irrelevant primitives k ∈ S i as placeholder symbols "_". Note that unlike the formal notation, the ordering of attributes within the simplified notation is fixed and meaningful.

Since we define concepts as sets, we can also define binary relations and operators on these sets. If C 1 and C 2 are concepts, and C 1 ⊂ C 2 , we say that C 1 is superordinate to C 2 , and C 2 is subordinate to C 1 . Two concepts C 1 and C 2 are orthogonal if S 1 ∩ S 2 = ∅. The conjunction of two orthogonal concepts C 1 and C 2 is the concept C 1 ∪ C 2 (e.g. {small, _, _} AND {_, round, _} = {small, round, _}). The overlap of two non-orthogonal concepts C 1 and C 2 is the concept

C 1 ∩ C 2 (e.g. {small, round, _} IN COMMON {_, round, red} = {_, round, _}). The difference between two concepts C 1 and C 2 , where C 1 ⊂ C 2 is the concept C 2 \ C 1 (e.g. {small,

round, _} IGNORE {_, round, _} = {small, _, _}). These operators allow for a traversal over a broader set of concepts within the implicit hierarchy given knowledge of a limited training subset of concepts.

4. MODEL ARCHITECTURE:



Learning visual representational primitives:

The discovery of the generative structure of the visual world is the goal of disentangled factor learning research (Bengio et al., 2013) . In this work we build SCAN on top of β-VAE, a state of the art model for unsupervised visual disentangled factor learning. β-VAE is a modification of the variational autoencoder (VAE) framework (Kingma & Welling, 2014; Rezende et al., 2014) that introduces an adjustable hyperparameter β to the original VAE objective:

EQUATION

where φ, θ parametrise the distributions of the encoder and the decoder respectively. Well chosen values of β (usually β > 1) result in more disentangled latent representations z x by setting the right balance between reconstruction accuracy, latent channel capacity and independence constraints to encourage disentangling. For some datasets, however, this balance is tipped too far away from reconstruction accuracy. In these scenarios, disentangled latent representations z x may be learnt at the cost of losing crucial information about the scene, particularly if that information takes up a small proportion of the observations x in pixel space. Hence, we adopt the solution used in Higgins et al. (2017b) that replaces the pixel log-likelihood term in Eq. 2 with an L2 loss in the high-level feature space of a denoising autoencoder (DAE) (Vincent et al., 2010) trained on the same data (see Fig. 2C for model architecture). The resulting β-VAE DAE architecture optimises the following objective function:

EQUATION

where x ∼ p θ (x|z x ) and J : R W ×H×C → R N is the function that maps images from pixel space with dimensionality Width × Height × Channels to a high-level feature space with dimensionality N given by a stack of DAE layers up to a certain layer depth (a hyperparameter). Note that this adjustment means that we are no longer optimising the variational lower bound, and β-VAE DAE with β = 1 loses its equivalence to the original VAE framework.

Learning visual concepts This section describes how our proposed SCAN framework (Fig. 2A ) exploits the particular parametrisation of the visual building blocks acquired by β-VAE1 to learn an implicit hierarchy of visual concepts formalised in Sec. 3. SCAN is based on a modified VAE framework. In order to encourage the model to learn visually grounded abstractions, we initialise the space of concepts (the latent space z y of SCAN) to be structurally identical to the space of visual primitives (the latent space z x of β-VAE). Both spaces are parametrised as multivariate Gaussian distributions with diagonal covariance matrices, and dim(z y ) = dim(z x ) = K. The grounding is performed by aiming to minimise the KL divergence between the two distributions.

The abstraction step corresponds to setting SCAN latents z k y corresponding to the relevant factors to narrow distributions, while defaulting those corresponding to the irrelevant factors to the wider unit Gaussian prior. This is done by minimising the forward KL divergence D KL q(z x ) q(z y ) , rather than the mode picking reverse KL divergence D KL q(z y ) q(z x ) . Fig. 2B demonstrates the differences. Each blue mode corresponds to an inferred visual latent distribution q(z k

x |x i ) given an image x i . The yellow distribution corresponds to the learnt conceptual latent distribution q(z k y ). When presented with visual examples that have high variability for a particular generative factor, e.g. various lighting conditions when viewing examples of apples, the forward KL allows SCAN to learn a broad distribution for the corresponding conceptual latent q(z k y ) that is close to the prior p(z k y ) = N (0, 1). Hence, SCAN is trained by minimising: L y (θ y , φ y ; y, x, z y , β, λ) =E q φy (zy|y) [log p θy (y|z y )]β D KL q φy (z y |y) p(z y )

-λ D KL q φx (z x |x) q φy (z y |y) (4)

where y is symbol inputs, z y is the latent space of concepts, z x is the latent space of the pre-trained β-VAE containing the visual primitives which ground the abstract concepts z y , and x are example images that correspond to the concepts z y activated by symbols y. It is important to up-weight the forward KL term relative to the other terms in the cost function (e.g. λ = 1, β = 10).

The SCAN architecture does not make any assumptions on the nature of the symbols y. In this paper we use a commonly used k-hot encoding (Vedantam et al., 2017; Suzuki et al., 2017) , where each concept is described in terms of the k ≤ K visual attributes it refers to (e.g. an apple could be referred to by a 3-hot symbol "round, small, red"). In principle, other possible encoding schemes for y can also be used, including word embeddings (Mikolov et al., 2013) , or even entirely random vectors. We leave the empirical demonstration of this to future work.

Once trained, SCAN allows for bi-directional inference and generation (img2sym and sym2img).

In order to generate visual samples that correspond to a particular concept (sym2img), we infer the concept z y by presenting an appropriate symbol y to the inference network of SCAN. One can then sample from the inferred concept q φy (z y |y) and use the generative part of β-VAE to visualise the corresponding image samples p θx (x|z y ). SCAN can also be used to infer a description of an image in terms of the different learnt concepts via their respective symbols. To do so, an image x is presented to the inference network of the β-VAE to obtain its description in terms of the visual primitives z x . One then uses the generative part of the SCAN to sample descriptions p θy (y|z x ) in terms of symbols that correspond to the previously inferred visual building blocks q φx (z x |x).

Learning concept recombination operators The compositional and hierarchical structure of the concept latent space z y learnt by SCAN can be exploited to break away from the training data distribution and imagine new concepts. This can be done by using logical concept manipulation operators AND, IN COMMON and IGNORE formally defined in Sec. 3. These operators are implemented within a conditional convolutional module parametrised by ψ (Fig. 3A ) that accepts two multivariate Gaussian distributions z y1 and z y2 corresponding to the two concepts that are to be recombined, and a conditioning vector r specifying the recombination operator. The input distributions z y1 and z y2 are inferred from the two corresponding input symbols y 1 and y 2 , respectively, using a pre-trained SCAN. The convolutional module strides over the parameters of each matching component z k y1 and z k y2 one at a time and outputs the corresponding parametrised component z k r of a recombined multivariate Gaussian distribution z r with a diagonal covariance matrix. 2 We used 1-hot encoding -VAE for the conditioning vector r, where [ 1 0 0 ], [ 0 1 0 ] and [ 0 0 1 ] stood for AND, IN COMMON and IGNORE respectively. The conditioning was implemented as a tensor product that takes in z y1 and z y2 and outputs z r , where r effectively selects the appropriate trainable transformation matrix parametrised by ψ. The conditional convolutional module is trained through the same visual grounding process as SCAN-each recombination instruction is paired with a small number of appropriate example images (e.g. "blue,suitcase" IGNORE "suitcase" might be paired with various example images containing a blue object). The recombination module is trained by minimising: L r (ψ; z x , z r ) = D KL q φx (z x |x i ) q ψ z r | q φy (z y1 |y 1 ), q φy (z y2 |y 2 ), r

where q φx (z x |x i ) is the inferred latent distribution of the β-VAE given a seed image x i that matches the specified symbolic description. The resulting z r lives in the same space as z y and corresponds to a node within the implicit hierarchy of visual concepts. Hence, all the properties of concepts z y discussed in the previous section also hold for z r .

5. EXPERIMENTS:



5.1. DEEPMIND LAB EXPERIMENTS:

Environment We evaluate the performance of SCAN on a dataset of visual frames and corresponding symbolic descriptions collected within the DeepMind Lab environment (Beattie et al., 2016) . DeepMind Lab was chosen, because it gave us good control of the ground truth generative process. The visual frames were collected from a static viewpoint situated in a room containing a single object.

The generative process was specified by four factors of variation: wall colour, floor colour, object colour with 16 possible values each, and object identity with 3 possible values: hat, ice lolly and suitcase. Other factors of variation were also added to the dataset by the DeepMind Lab engine, such as the spawn animation, horizontal camera rotation and the rotation of objects around the vertical axis. We split the dataset into two subsets. One was used for training the models, while the other one contained a held out set of 300 four-gram concepts that were never seen during training, either visually or symbolically. We used the held out set to evaluate the model's ability to imagine new concepts.

better, achieving 0.79 vs 0.54 accuracy (higher is better) and 1.05 vs 2.03 diversity (lower is better) scores compared to the closed form implementations. See Sec. 5.1 for the description of the accuracy and diversity metrics. Learning grounded concepts In this section we demonstrate that SCAN is capable of learning the meaning of new concepts from very few image-symbol pairs. We evaluate the model's concept understanding through qualitative analysis of sym2img and img2sym samples. First we pre-trained a β-VAE to learn a disentangled representation of the DeepMind Lab dataset (see Sec. A.3 in Supplemenrary Materials for details). Then we trained SCAN on a random subset of 133 out of 18,883 possible concepts sampled from all levels of the implicit hierarchy (these concepts specify between one and four visual primitives, and are associated with 1-to 4-hot symbols respectively).

The set of symbols also included a number of 1-hot synonyms (e.g. a blue wall may be described by symbols "blue wall", "bright blue wall" or "blue wall synonym"). Each concept was associated with ten visual examples during training.

Fig. 4A shows samples drawn from SCAN when asked to imagine a bigram concept {white, suitcase}, a trigram concept {white, suitcase, blue wall}, or a four-gram {white, suitcase, blue wall, magenta floor}. Note that the latter is a concept drawn from the held-out test set that neither β-VAE nor SCAN have ever seen during training, and the first two concepts are novel to SCAN, but have been experienced by β-VAE. It is evident that the model demonstrates a good understanding of all three concepts, producing visual samples that match the meaning of the concept, and showing good variability over the irrelevant factors. Confusions do sometimes arise due to the sampling process (e.g. one of the suitcase samples is actually an ice lolly). Fig. 4B demonstrates that the same model can also correctly describe an image. The labels are mostly consistent with the image and display good diversity (SCAN is able to describe the same image using different symbols including synonyms). The few confusions that SCAN does make are between concepts that are easily confusable for human too (e.g. red, orange and yellow colours).

Evolution of concept understanding:

In this section we take a closer look inside SCAN as it learns a new concept. In Sec. 3 we suggested that concepts should be grounded in terms of specified factors (the corresponding latent units z k y ∀k ∈ S should have low inferred standard deviations σ k y ), while the unspecified visual primitives should be sampled from the unit Gaussian prior (the corresponding latent units z k y ∀k ∈ S show have σ k y ≈ 1). We visualise this process by teaching SCAN the meaning of the concept {cyan wall} using a curriculum of fifteen progressively more diverse visual examples (see Fig. 5 , bottom row). After training SCAN on each set of five visual examples, we test the model's understanding of the concept through sym2img sampling using the symbol "cyan wall" (Fig. 5 , top four rows). We also plot the average inferred specificity of all 32 latent units z k y during training Quantitative comparison to baselines In this section we quantitatively compare the accuracy and diversity of the sym2img samples produced by the SCAN to those of the baselines -a SCAN like architecture trained with a reverse KL used for grounding conceptual representations in vision (SCAN R ), another modification of SCAN that tries to ground conceptual representations in unstructured (entangled) visual representations (SCAN U , with various levels of visual entanglement), and two of the latest multimodal joint density models, the JMVAE (Suzuki et al., 2017) and the triple ELBO (TrELBO) (Vedantam et al., 2017) . The two metrics, accuracy and diversity, measure different aspects of the models' performance. High accuracy means that the models understand the meaning of a symbol (e.g. samples of a "blue suitcase" should contain blue suitcases). High diversity means that the models were able to learn an abstraction. It quantifies the variety of samples in terms of the unspecified visual attributes (e.g. samples of blue suitcases should include a high diversity of wall colours and floor colours). There is a correlation between the two metrics, since samples with low accuracy often result in higher diversity scores.

We use a pre-trained classifier achieving 99% average accuracy over all data generative factors to evaluate the accuracy of img2sym samples. Since some colours in the dataset are hard to differentiate even to humans (e.g. yellow and orange), we use top-3 accuracy for colour related factors. We evaluate the diversity of visual samples by estimating the KL divergence of the inferred factor distribution with the flat prior: D KL u(y i ) p(y i ) , where p(y i ) is the joint distribution over the factors irrelevant to the ith concept i ∈ S i (inferred by the classifier) and u(y i ) is the equivalent flat distribution (i.e., with each factor value having equal probability). See Sec. A.1 in Supplementary Materials for more details.

All models were trained on a random subset of 133 out of 18,883 possible concepts sampled from all levels of the implicit hierarchy with ten visual examples each. The accuracy and diversity metrics were calculated on two sets of sym2img samples: 1) train, corresponding to the 133 symbols used to train the models; and 2) test (symbols), corresponding to a held out set of 50 symbols. Tbl. 1 demonstrates that SCAN outperforms all baselines in terms of both metrics. SCAN R learns very accurate representations, however it overfits to a single mode of each of the irrelevant visual factors and hence lacks diversity. SCAN U experiments show that as the level of disentanglement within the visual representation is increased (the higher the β, the more disentangled the representation), the accuracy and the diversity of the sym2img samples also get better. Note that baselines with poor sample accuracy inadvertently have good diversity scores because samples that are hard to classify produce a relatively flat classifier distribution p(y i ) close to the uniform prior u(y i ). in terms of performance. It manages to exploit the structure of the symbolic inputs to learn a representation of the joint posterior that is almost as disentangled as that of SCAN. Similarly to SCAN, it also uses a forward KL term to match unimodal posteriors to the joint posterior. Hence, given that there is enough supervision within the symbols to help JMVAE learn a disentangled joint posterior, it should become equivalent to SCAN, whereby the joint q(z|x, y) and unimodal q(z|y) posteriors of JMVAE become equivalent to the visual q(z x |x) and symbolic q(z y |y) posteriors of SCAN respectively. Yet in practice we found that JMVAE training is much more sensitive to various architectural and hyperparameter choices compared to SCAN, which often results in mode collapse leading to the reasonable accuracy yet poor diversity of the JMVAE sym2img samples. See Sec. A.3 for more details of the baselines' performance. Finally, SCAN is the only model that was able to exploit the k-hot structure of the symbols and the compositional nature of its representations to generalise well to the test set (test symbols results), while all of the other baselines lost a lot of their sample accuracy.

Learning recombination operators In Sec. 4 we suggested a way to traverse the implicit hierarchy of concepts towards novel nodes without any knowledge of how to point to these nodes through a symbolic reference. We suggested doing so by instructing a recombination of known concepts in the latent space. To test this, we trained a recombination module using 10 recombination instructions per each of the three operators, with 20 visual examples each. Tbl. 1 (test operators) demonstrates that we were able to reach the nodes corresponding to the 50 novel test concepts using such a pre-trained recombination operator module. This, however, only worked for SCAN, since the successful training of the recombination module relies on a structured latent space that all the other baselines lacked. SCAN with the recombination module preserved the accuracy and the diversity of samples, as shown quantitatively in Tbl. 1 and qualitatively in Fig. 3B . JMVAE, the closest baseline to SCAN in terms of the recombination module performance, produced samples with low accuracy (the drop in accuracy resulted in an increase in the diversity score). It is interesting to note that the recombination operator training relies on the same kind of visual grounding as SCAN, hence it can often improve the diversity of the original model.

5.2. CELEBA EXPERIMENTS:

We ran additional experiments on a more realistic dataset CelebA (Liu et al., 2015) after performing minimal dataset pre-processing of cropping the frames to 64x64. Unlike other approaches (Vedantam et al., 2017; Perarnau et al., 2016) which only use 18 best attributes for training their models, we used all 40 attributes. Many of these 40 attributes are not useful, since they are either: 1) subjective (e.g. "attractiveness"); 2) refer to parts of the image that have been cropped out (e.g. "wearing necktie"); 3) refer to visual features that have not been discovered by β-VAE (e.g. "sideburns", see Higgins et al. (2017a) for a discussion of the types of factors that β-VAE tends to learn on this dataset); 4) are confusing due to mislabelling (e.g. "bald female" as reported by Vedantam et al. (2017) ). Hence, our experiments test the robustness of SCAN to learning concepts in an adversarial setting, where the model is taught concepts that do not necessarily relate well to their corresponding visual examples.

For these experiments we used the controlled capacity schedule (Burgess et al., 2017) for β-VAE training to increase the quality of the generative process of the model.

We found that SCAN trained on CelebA was able to outperform its baselines of JMVAE and TrELBO. First, we checked which of the 40 attributes SCAN was able to understand after training. To do so, we inferred q(z y |y i ) for all y i ∈ R 40 , where y i is a 1-hot encoding of the ith attribute. We then approximated the number of specified latents for each posterior q(z y |y i ). If an attribute i did not correspond to anything meaningful in the corresponding visual examples seen during training, it would have no specified latents and D KL (q(z y |y i )||p(z y )) ≈ 0. We found that SCAN did indeed learn the meaning of a large number of attributes. Fig. 6 shows sym2img samples for some of them compared to the equivalent samples for the baseline models: JMVAE and TrELBO. It can be seen that SCAN samples tend to be more faithful than those of JMVAE, and both models produce much better diversity of samples than TrELBO.

A notable difference between SCAN and the two baselines is that despite being trained on binary k-hot attribute vectors (where k varies for each sample), SCAN learnt meaningful directions of continuous variability in its conceptual latent space z y . For example, if we vary the value of an individual symbolic attribute, we will get meaningful sym2img samples that range between extreme positive and extreme negative examples of that attribute (e.g. by changing the values of the "pale skin" symbol y, we can generate samples with various skin tones as shown in Fig. 7 ). This is in contrast to JMVAE and TrELBO, which only produce meaningful sym2img samples if the value of the attribute is set to 1 (attribute is present) or 0 (attribute is not enforced). This means that unlike SCAN, it is impossible to enforce JMVAE or TrELBO to generate samples with darker skin colours despite the models knowing the meaning of the "pale skin" attribute.

Note that sometimes SCAN picks up implicit biases in the dataset. For example, after training SCAN interprets "attractive" as a term that refers to young white females and less so to males, especially if these males are also older and have darker skin tones (Fig. 7 ). Similarly, SCAN learns to use the term "big lips" to describe younger ethnic individuals, and less so older white males; while "arched eyebrows" is deemed appropriate to use when describing young white females, but not when describing people wearing sunglasses or hats, presumably because one cannot see how arched their eyebrows are.

6. CONCLUSION:

This paper introduced a new approach to learning grounded visual concepts. We defined concepts as abstractions over independent (and often interpretable) visual primitives, where each concept is given by learned distributions over a set of relevant visual factors. We proposed that all other (irrelevant) visual factors should default to their prior in order to produce a diverse set of samples corresponding to a concept. We then proposed SCAN, a neural network implementation of such an approach, which was able to discover and learn an implicit hierarchy of abstract concepts from as few as five symbolimage pairs per concept and no assumptions on the nature of symbolic representations. SCAN was then capable of bi-directional inference, generating diverse and accurate image samples from symbolic instructions, and vice versa, qualitatively and quantitatively outperforming all baselines, including on a realistic CelebA dataset with noisy attribute labels. The structure of the learnt concepts allowed us to train an extension to SCAN that could perform logical recombination operators. We demonstrated how such operators could be used to traverse the implicit concept hierarchy, including imagining completely new concepts. Due to the sample efficiency and the limited number of assumptions in our approach, the representations learnt by SCAN should be immediately applicable within a large set of broader problem domains, including reinforcement learning, classification, control and planning.

The visual decoder p θx was simply the reverse of the visual encoder using transposed convolutions. Similarly, the symbol decoder p θx was again a single layer MLP with 100 hidden units. The output distributions of both decoders were parameterised as Bernoullis. The model was trained using the Adam optimiser with a learning rate of 1e-4 and a batch size of 16.

Triple ELBO (TrELBO) The Triple ELBO (TrELBO) model was trained using the loss as described in (Vedantam et al., 2017) :

L trelbo (θx, θy, φy, φ; x, y, λ yx y , λ y y ) = E q φ (z|x,y) [log p θx (x|z)] + E q φx (z|x) [log p θx (x|z)] + λ yx y E q φ (z|x,y) log p θy (y|z) + λ y y E q φy (z|y) log p θy (y|z) -DKL q φ (z|x, y) p(z) -DKL q φx (z|x) p(z) -DKL q φy (z|y) p(z)

Where λ yx y and λ y y were hyperparameters. We set these to 10 and 100 respectively, following the reported best values from (Vedantam et al., 2017) . JMVAE is unable to learn a hierarchical compositional latent representation of concepts like SCAN does. Instead, it learns a flat representation of visual primitives like the representation learnt by β-VAE. Such a flat representation is problematic, as evidenced by the accuracy/diversity metrics shown in Tbl. 1. Further evidence comes from examining the sym2img samples produced by JMVAE (see Fig. 13 ). It can be seen that JMVAE fails to learn the abstract concepts as defined in Sec. 3. While the samples in Fig. 13 mostly include correct wall colours that match their respective input symbols, the samples have limited diversity. Many samples are exact copies of each other -a sign of mode collapse.

TrELBO analysis:

This section examines the nature of representations learnt by TrELBO (Vedantam et al., 2017) . Fig. 14 demonstrates that after training TrELBO is capable of reconstructing the data, however it produces poor samples. This is due to the highly entangled nature of its learnt representation, as also evidenced by the traversal plots. Since TrELBO is not able to learn a compositional latent representation of concept like that acquired by SCAN, it also struggles to produce diverse sym2img samples when instructed with symbols from the training set (see Fig. 15 ). Furthermore, this lack of structure in the learnt concept representations precludes successful recombination operator training. Hence, sym2img samples of test symbols instructed through recombination operators lack accuracy (Fig. 16 ).

Data efficiency analysis:

We evaluate the effect of the training set size on the performance of SCAN, JMVAE and TrELBO by comparing their accuracy and diversity scores after training on {5, 10, 15, 20, 25, 50, 75} concepts. Fig. 17 shows that SCAN consistently outperforms its baselines in terms of the absolute scores, while also displaying less variance when trained on datasets of various sizes. For this set of experiments we also halved the number of training iterations for all models, which affected the baselines but not SCAN. The diversity of JMVAE and TrELBO is better in this plot compared to the results reported in Tbl. 1 because sym2img samples used for this plot were blurrier than those describe in the main text. We quantised the values of each chosen factor into halves (top/bottom, left/right, big/small) and assigned one-hot encoded symbols to each of the K k=1 K k N k = 26 possible concepts to be learnt (since K = 3 is the number of factors to be learnt and N = 2 is the number of values each factor can take). We compared the performance of SCAN grounded in disentangled visual representations (β-VAE with β = 12) to that of grounded in entangled visual representations (β-VAE with β = 0). We trained both models on a random subset of image-symbol pairs (xi, yi) making up < 0.01% of the full dataset.

We quantified how well the models understood the meaning of the positional and scale concepts after training by running sym2img inference and counting the number of white pixels within each of the four quadrants of the canvas (for position) or in total in the whole image (for scale). This can be compared to similar values calculated Figure 15 : Visualisation of sym2img visual samples produced TrELBO in response to train symbols: "magenta object", "ice lolly", "purple floor" and "blue wall". It is evident that the model has good accuracy but very low diversity.

Figure 16 : Visualisation of sym2img visual samples produced TrELBO in response to test symbols instructed using recombination operators: "yellow object", "hat", "orange floor" and "cyan wall". It is evident that the model has very low accuracy but decent diversity. 

:

For the rest of the paper we use the term β-VAE to refer to β-VAEDAE.

We also tried a closed form implementation of recombination operators (weighted sum or mean of the corresponding Gaussian components z k y 1 and z k y 2 ). We found that the learnt recombination operators worked

Figure 19: Large version of Fig. 6

Published as a conference paper at ICLR 2018 Figure 20: Large version of Fig. 7

Figures and Tables:

Figure 2: A: SCAN model architecture. The capital letters correspond to four disentangled visual primitives: object identity (I), object colour (O), floor colour (F ) and wall colour (W ). B: Mode coverage of the extra KL term of the SCAN loss function. Forward KL divergence DKL zx zy allows SCAN to learn abstractions (wide yellow distribution zy) over the visual primitives that are irrelevant to the meaning of a concept (blue modes corresponds to the inferred values of zx for different visual examples matching symbol y). C: β-VAEDAE model architecture.

Figure 3: A: Learning AND, IN COMMON or IGNORE recombination operators with a SCAN model architecture. Inset demonstrates the convolutional recombination operator that takes in {µ k y 1 , σ k y 1 ; µ k y 2 , σ k y 2 } and outputs {µ k r , σ k r }. The capital letters correspond to four disentangled visual primitives: object identity (I), object colour (O), floor colour (F ) and wall colour (W ). B: Visual samples produced by SCAN and JMVAE when instructed with a novel concept recombination. SCAN samples consistently match the expected ground truth recombined concept, while maintaining high variability in the irrelevant visual primitives. JMVAE samples lack accuracy. Recombination instructions are used to imagine concepts that have never been seen during model training. Top: samples for IGNORE; Middle: samples for IN COMMON; Bottom: samples for AND.

Figure4: A: sym2img inferences with "white suitcase", "white suitcase, blue wall", and "white suitcase, blue wall, magenta floor" as input. The latter one points to a concept that the model has never seen during training, either visually or symbolically. All samples are consistently accurate, while showing good diversity in terms of the irrelevant visual attributes. B: when presented with an image, SCAN is able to describe it in terms of all concepts it has learnt, including synonyms (e.g. "dub", which corresponds to {ice lolly, white wall}). The histograms show the distributions of unique concepts the model used to describe each image, most probable of which are printed in descending order next to the corresponding image. The few confusions SCAN makes are intuitive to humans too (e.g. confusing orange and yellow colours).

Figure 5: Evolution of understanding of the meaning of concept {cyan wall} as SCAN is exposed to progressively more diverse visual examples. Left: top row contains three sets of visual samples (sym2img) generated by SCAN after seeing each set of five visual examples presented in the bottom row. Right: average inferred specificity of concept latents z k y during training. Vertical dashed lines correspond to the vertical dashed lines in the left plot and indicate a switch to the next set of five more diverse visual examples. 6/32 latents z k y

Figure 6: Comparison of sym2img samples of SCAN, JMVAE and TrELBO trained on CelebA. See Fig. 19 in Supplementary Materials for larger samples.

Figure 7: Example sym2img samples of SCAN trained on CelebA. We run inference using four different values for each attribute. We found that the model was more sensitive to changes in values in the positive rather than negative direction, hence we use the following values: {-6, -3, 1, 2}. See Fig. 20 in Supplementary Materials for larger samples.

Figure 9: Reconstructions, samples and latent traversals of β-VAE (β = 53) trained to disentangle the data generative factors of variation within the DeepMind Lab dataset. For the latent traversal plots we sampled the posterior, then visualised β-VAE reconstructions while resampling each latent unit one at a time in the [-3, 3] range while keeping all other latents fixed to their originally sampled values. This process helps visualise which data generative factor each latent unit has learnt to represent.

Figure 10: Samples, reconstructions and latent traversals of β-VAE that did not learn a structured disentangled representation (β = 0.1). It is evident that the model learnt to reconstruct the data despite learning an entangled latent space.

Figure 11: Visual samples (sym2img) of SCAN grounded in unstructured vision when presented with symbols "hat" and "ice lolly". It is evident that the model struggled to learn a good understanding of the meaning of these concepts. A.4 DSPRITES EXPERIMENTS In this section we describe additional experiments testing SCAN on the dSprites (Matthey et al., 2017) dataset. The dataset consists of binary sprites fully specified by five ground truth factors: position x (32 values), position y (32 values), scale (6 values), rotation (40 values) and sprite identity (3 values). For our experiments we defined a conceptual space spanned by three of the data generative factors -horizontal and vertical positions, and scale. We quantised the values of each chosen factor into halves (top/bottom, left/right, big/small) and assigned one-hot encoded symbols to each of the K

Figure 12: Samples, reconstructions and latent traversals of JMVAE. The model learns good disentangled latents, making use of the supervised symbolic information available.

Figure 13: Visualisation of sym2img visual samples produced JMVAE in response to symbols specifying wall colour names. It is evident that the model suffers from mode collapse, since a significant number of samples are copies of each other.

Figure 17: Accuracy and diversity scores of SCAN, JMVAE and TrELBO after being trained on {5, 10, 15, 20, 25, 50, 75} concepts with 10 visual examples each. The size of the circle corresponds to the training set size. We used symbols from the train set to generate sym2img samples used to calculate the scores. SCAN outperforms both baselines and shows less susceptibility to the training set size.

Quantitative results comparing the accuracy and diversity of visual samples produced through sym2img inference by SCAN and three baselines: a SCAN with unstructured vision (SCANU, lower β means more visual entanglement), a SCAN with a reverse grounding KL term for both the model itself and its recombination operator (SCANR) and two recent joint multimodal embedding models, JMVAE and TrELBO. Higher accuracy and lower diversity indicate better performance. Test values can be computed either by directly feeding the ground truth symbols (test symbols), or by applying trained recombination operators to make the model recombine in the latent space (test operators).

Table content: <table><tr><td/><td/><td>ACCURACY</td><td/><td/><td>DIVERSITY</td><td/></tr><tr><td>MODEL</td><td colspan="3">TRAIN TEST (SYMBOLS) TEST (OPERATORS)</td><td colspan="3">TRAIN TEST (SYMBOLS) TEST (OPERATORS)</td></tr><tr><td>TRELBO</td><td>0.81</td><td>0.69</td><td>0.37</td><td>9.41</td><td>6.86</td><td>0.63</td></tr><tr><td>JMVAE</td><td>0.75</td><td>0.68</td><td>0.61</td><td>4.32</td><td>2.87</td><td>0.86</td></tr><tr><td>SCANR</td><td>0.86</td><td>0.81</td><td>0.67</td><td>13.17</td><td>9.2</td><td>9.94</td></tr><tr><td>SCANU (β = 0.1)</td><td>0.27</td><td>0.26</td><td>0.25</td><td>5.51</td><td>1.23</td><td>1.66</td></tr><tr><td>SCANU (β = 1)</td><td>0.58</td><td>0.36</td><td>0.33</td><td>2.07</td><td>1.22</td><td>1.34</td></tr><tr><td>SCANU (β = 20)</td><td>0.65</td><td>0.42</td><td>0.32</td><td>1.41</td><td>3.98</td><td>4.57</td></tr><tr><td>SCAN (β = 53)</td><td>0.82</td><td>0.79</td><td>0.79</td><td>1.46</td><td>1.08</td><td>1.05</td></tr></table>

Peer review (iclr2018):
 Summary --- This paper proposes a new model called SCAN (Symbol-Concept Association Network) for hierarchical concept learning. It trains one VAE on images then another one on symbols and aligns their latent spaces. This allows for symbol2image and image2symbol inference. But it also allows for generalization to new concepts composed from existing concepts using logical operators. Experiments show that SCAN generates images which correspond to provided concept labels and span the space of concepts which match these labels. The model starts with a beta-VAE trained on images (x) from the relevant domain (in this case, simple scenes generated from DeepMind Lab which vary across a few known dimensions). This is complemented by the SCAN model, which is a beta-VAE trained to reconstruct symbols (y; k-hot encoded concepts like {red, suitcase}) with a slightly modified objective. SCAN optimizes the ELBO plus a KL term which pushes the latent distribution of the y VAE toward the latent distribution of the x (image) VAE. This aligns the latent representations so now a symbol can be encoded into a latent distribution z and decoded as an image. One nice property of the learned latent representation is that more specific concepts have more specific latent representations. Consider latent distributions z1 and z2 for a more general symbol {red} and a more specific symbol {red, suitcase}. Fewer dimensions of z2 have high variance than dimensions of z1. For example, the latent space could encode red and suitcase in two dimensions (as binary attributes). z1 would have high variance on all dimensions but the one which encodes red and z2 would have high variance on all dimensions but red and suitcase. In the reported experiments some of the dimensions do seem to be interpretable attributes (figure 5 right). SCAN also pays particular attention to hierarchical concepts. Another very simple model (1d convolution layer) is learned to mimic logical operators. Normally a SCAN encoder takes {red} as input and the decoder reconstructs {red}. Now another model is trained that takes "{red} AND {suitcase}" as input and reconstructs {red, suitcase}. The two input concepts {red} and {suitcase} are each encoded by a pre-trained SCAN encoder and then those two distributions are combined into one by a simple 1d convolution module trained to implement the AND operator (or IGNORE/IN COMMON). This allows images of concepts like {small, red, suitcase} to be generated even if small red suitcases are not in the training data. Experiments provide some basic verification and analysis of the method: 1) Qualitatively, concept samples are correct and diverse, generating images with all configurations of attributes not specified by the input concept. 2) As SCAN sees more diverse examples of a concept (e.g. suitcases of all colors instead of just red ones) it starts to generate more diverse image samples of that concept. 3) SCAN samples/representations are more accurate (generate images of the right concept) and more diverse (far from a uniform prior in a KL sense) than JMVAE and TELBO baselines. 4) SCAN is also compared to SCAN_U, which uses an image beta-VAE that learned an entangled (Unstructured) representation. SCAN_U performed worse than SCAN and baselines. 5) Concepts expressed as logical combinations of other concepts generalize well for both the SCAN representation and the baseline representations. Strengths --- The idea of concept learning considered here is novel and satisfying. It imposing logical, hierarchical structure on latent representations in a general way. This suggests opportunities for inserting prior information and adds interpretability to the latent space. Weaknesses --- I think this paper is missing some important evaluation. Role/Nature of Disentangled Features not Clear (major): * Disentangled features seem to be very important for SCAN to work well (SCAN vs SCAN_U). It seems that the only difference between the unstructured (entangled) and the structured (disentangled) visual VAE is the color space of the input (RGB vs HSV). If so, this should be stated more clearly in the main paper. What role did beta-VAE (tuning beta) as opposed to plain VAE play in learning disentangled features? * What color space was used for the JMVAE and TELBO baselines? Training these with HSV seems especially important for establishing a good comparison, but it would be good to report results for HSV and RGB for all models. * How specific is the HSV trick to this domain? Would it matter for natural images? * How would a latent representation learned via supervision perform? (Maybe explicitly align dimensions of z to red/suitcase/small with supervision through some mechanism. c.f. "Discovering Hidden Factors of Variation in Deep Networks" by Cheung et al.) Evaluation of sample complexity (major): * One of the main benefits of SCAN is that it works with less training data. There should be a more systematic evaluation of this claim. In particular, I would like to see a Number of Examples vs Performance (Accuracy/Diversity) plot for both SCAN and the baselines. Minor questions/comments/concerns: * What do the logical operators learn that the hand-specified versions do not? * Does training SCAN with the structure provided by the logical operators lead to improved performance? * There seems to be a mistake in figure 5 unless I interpreted it incorrectly. The right side doesn*t match the left side. During the middle stage of training object hues vary on the left, but floor color becomes less specific on the right. Shouldn*t object color become less specific? Prelimary Evaluation --- This clear and well written paper describes an interesting and novel way of learning a model of hierarchical concepts. It*s missing some evaluation that would help establish the sample complexity benefit more precisely (a claimed contribution) and add important details about unsupervised disentangled representations. I would happy to increase my rating if these are addressed.