summaries: This paper proposes a novel method for image similarity models explanation, introducing Salient Attributes for Network Explanation (SANE). The method identifies attributes that contribute positively to the similarity score, thus explaining the important image properties, and pair them with a generated saliency map unveiling the important regions of the image. The method combines three major components:

summaries: This paper introduces SANE, a new approach for explaining image similarity models by combining a saliency map generator and an attribute predictor. In this way, the method is not only able to highlight what regions contribute the most to the similarity between a query image and a reference image, but also predict an attribute that explains this match. During training, SANE jointly optimizes the attribute prediction of the query image and maximizes the overlap of the saliency map of the image similarity and the attribute activations.

abstractText: Explaining a deep learning model can help users understand its behavior and allow researchers to discern its shortcomings. Recent work has primarily focused on explaining models for tasks like image classification or visual question answering. In this paper, we introduce an explanation approach for image similarity models, where a model’s output is a score measuring the similarity of two inputs rather than a classification. In this task, an explanation depends on both of the input images, so standard methods do not apply. We propose an explanation method that pairs a saliency map identifying important image regions with an attribute that best explains the match. We find that our explanations provide additional information not typically captured by saliency maps alone, and can also improve performance on the classic task of attribute recognition. Our approach’s ability to generalize is demonstrated on two datasets from diverse domains, Polyvore Outfits and Animals with Attributes 2.

authors:
REFERENCES Kenan E. Ak
Ashraf A. Kassim
Joo Hwee Lim
Jo Yew Tham

title: Learning attribute representations with localization for flexible fashion search

authors:
Lisa Anne Hendricks
Ronghang Hu
Trevor Darrell
Zeynep Akata

title: Grounding visual explanations

venue: In ECCV,

authors:
Ankan Bansal
Karan Sikka
Gaurav Sharma
Rama Chellappa
Ajay Divakaran

title: Zero-shot object detection

authors:
David Bau
Bolei Zhou
Aditya Khosla
Aude Oliva
Antonio Torralba

title: Network dissection: Quantifying interpretability of deep visual representations

authors:
Chunshui Cao
Xianming Liu
Yi Yang
Yinan Yu
Jiang Wang
Zilei Wang
Yongzhen Huang
Liang Wang
Chang Huang
Wei Xu
Deva Ramanan
Thomas S. Huang

title: Look and think twice: Capturing top-down visual attention with feedback convolutional neural networks

venue: In ICCV,

authors:
Chun-Hao Chang
Elliot Creager
Anna Goldenberg
David Duvenaud

title: Explaining image classifiers by counterfactual generation

venue: In ICLR,

authors:
Ruth Fong
Andrea Vedaldi

title: Net2vec: Quantifying and explaining how concepts are encoded by filters in deep neural networks

authors:
Ruth C Fong
Andrea Vedaldi

title: Interpretable explanations of black boxes by meaningful perturbation

authors:
Albert Gordo
Diane Larlus

title: Beyond instance-level image retrieval: Leveraging captions to learn a global visual representation for semantic retrieval

authors:
Xintong Han
Zuxuan Wu
Phoenix X. Huang
Xiao Zhang
Menglong Zhu
Yuan Li
Yang Zhao
Larry S. Davis

title: Automatic spatially-aware fashion concept discovery

authors:
Xintong Han
Zuxuan Wu
Yu-Gang Jiang
Larry S. Davis

title: Learning fashion compatibility with bidirectional lstms

venue: In ACM MM,

authors:
Kaiming He
Xiangyu Zhang
Shaoqing Ren
Jian Sun

title: Deep residual learning for image recognition

authors:
Lisa Anne Hendricks
Zeynep Akata
Marcus Rohrbach
Jeff Donahue
Bernt Schiele
Trevor Darrell

title: Generating visual explanations

authors:
Wei-Lin Hsiao
Kristen Grauman

title: Creating capsule wardrobes from fashion images

venue: In CVPR,

title: Robust estimation of a location parameter

venue: Annals of Statistics,

authors:
Dong Huk Park
Lisa Anne Hendricks
Zeynep Akata
Anna Rohrbach
Bernt Schiele
Trevor Darrell
Marcus Rohrbach

title: Multimodal explanations: Justifying decisions and pointing to the evidence

authors:
M. Hadi Kiapour
Xufeng Han
Svetlana Lazebnik
Alexander C. Berg
Tamara L. Berg

title: Where to buy it: Matching street clothing photos to online shops

authors:
Been Kim
Martin Wattenberg
Justin Gilmer
Carrie Cai
James Wexler
Fernanda Viegas
Rory Sayres

title: Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav)

venue: In ICML,

authors:
Jinkyu Kim
Anna Rohrbach
Trevor Darrell
John Canny
Zeynep Akata

title: Textual explanations for self-driving vehicles

authors:
Diederik P. Kingma
Jimmy Ba

title: Adam: A method for stochastic optimization

authors:
Shrenik Lad
Devi Parikh

title: Interactively Guiding Semi-Supervised Clustering via Attribute-based Explanations

authors:
Qing Li
Qingyi Tao
Shafiq Joty
Jianfei Cai
Jiebo Luo

title: Vqa-e: Explaining, elaborating, and enhancing your answers for visual questions

authors:
Yan Li
Junge Zhang
Jianguo Zhang
Kaiqi Huang

title: Discriminative learning of latent features for zero-shot recognition

authors:
Anh Nguyen
Alexey Dosovitskiy
Jason Yosinski
Thomas Brox
Jeff Clune

title: Synthesizing the preferred inputs for neurons in neural networks via deep generator networks

authors:
Vitali Petsiuk
Abir Das
Kate Saenko

title: Rise: Randomized input sampling for explanation of black-box models

venue: In BMVC,

authors:
Filip Radenovi
Ahmet Iscen
Giorgos Tolias
Yannis Avrithis
Ondej Chum

title: Revisiting oxford and paris: Large-scale image retrieval benchmarking

authors:
Marco Tulio Ribeiro
Sameer Singh
Carlos Guestrin

title: why should i trust you?”: Explaining the predictions of any classifier

authors:
Ramprasaath R. Selvaraju
Michael Cogswell
Abhishek Das
Ramakrishna Vedantam
Devi Parikh
Dhruv Batra

authors:
Karen Simonyan
Andrea Vedaldi
Andrew Zisserman

title: Deep inside convolutional networks: Visualising image classification models and saliency maps

venue: In ICLR Workshop,

authors:
Randy L. Teach
Edward H. Shortliffe

title: An analysis of physician attitudes regarding computerbased clinical consultation systems

venue: Computers and Biomedical Research,

authors:
Mariya I. Vasileva
Bryan A. Plummer
Krishna Dusad
Shreya Rajpal
Ranjitha Kumar
David Forsyth

title: Learning type-aware embeddings for fashion compatibility

authors:
Sirion Vittayakorn
Takayuki Umeda
Kazuhiko Murasaki
Kyoko Sudo
Takayuki Okatani
Kota Yamaguchi

title: Automatic attribute discovery with neural activations

authors:
Xiaolong Wang
Yufei Ye
Abhinav Gupta

title: Zero-shot recognition via semantic embeddings and knowledge graphs

authors:
Yongqin Xian
Christoph H. Lampert
Bernt Schiele
Zeynep Akata

title: Zero-shot learning - a comprehensive evaluation of the good, the bad and the ugly

authors:
Sasi Kiran Yelamarthi
Shiva Krishna Reddy
Ashish Mishra
Anurag Mittal

title: A zero-shot framework for sketch based image retrieval

authors:
Jason Yosinski
Jeff Clune
Anh Nguyen
Thomas Fuchs
Hod Lipson

title: Understanding neural networks through deep visualization

venue: In Deep Learning Workshop, International Conference on Machine Learning (ICML),

authors:
Matthew D. Zeiler
Rob Fergus

title: Visualizing and understanding convolutional networks

authors:
Jianming Zhang
Zhe Lin
Shen Xiaohui Brandt
Jonathan
Stan Sclaroff

title: Top-down neural attention by excitation backprop

authors:
B. Zhou
A. Khosla
Lapedriza. A
A. Oliva
A. Torralba

title: Learning Deep Features for Discriminative Localization

heading: 1 INTRODUCTION

text:
Many problems in artificial intelligence that require reasoning about complex relationships can be solved by learning some feature embedding to measure similarity between images and/or other modalities such as text. Examples of these tasks include scoring fashion compatibility (Han et al., 2017b; Hsiao & Grauman, 2018; Vasileva et al., 2018), image retrieval (Kiapour et al., 2015; Radenovi et al., 2018; Yelamarthi et al., 2018), or zero-shot recognition (Bansal et al., 2018; Li et al., 2018b; Wang et al., 2018). Reasoning about the behavior of similarity models can aid researchers in identifying potential improvements, show where two images differ for anomaly detection, promote diversity in fashion recommendation by ensuring different traits are most prominent in the top results, or simply help users understand the model’s predictions which can build trust (Teach & Shortliffe, 1981). However, prior work on producing explanations for neural networks has primarily focused on explaining classification models (e.g. (Fong & Vedaldi, 2017; Nguyen et al., 2016; Petsiuk et al., 2018; Ribeiro et al., 2016; Selvaraju et al., 2017; Zeiler & Fergus, 2014)) and does not directly apply to similarity models. Given a single input image, such methods produce a saliency map which identifies pixels that played a significant role towards a particular class prediction (see Figure 1a for an example). On the other hand, a similarity model requires at least two images to produce a score. The interaction between both images defines which features are more important, so replacing just one of the images can result in identifying different salient traits.
Another limitation of existing work is that the saliency alone may be insufficient as an explanation of (dis)similarity. For image pairs where similarity is determined by the presence or absence of an object, a saliency map may be enough to understand model behavior. However, when we consider the image pair in Figure 1b, highlighting the necklace as the region that contributes most to the similarity score is reasonable, but uninformative given that there are no other objects in the image. Instead, what is important is the fact that the necklace shares a similar color with the ring. Whether these attributes or salient parts are a better fit as an explanation is not determined by the image domain (i.e. attributes for e-commerce imagery vs. saliency for natural imagery), but instead by the images themselves. For example, an image can be matched as formal-wear because of a shirt’s collar (salient part), while two images of animals can match because both have stripes (attribute).
Guided by this intuition, we introduce Salient Attributes for Network Explanation (SANE). Our approach generates a saliency map to explain a model’s similarity score, paired with an attribute explanation that identifies important image properties. SANE is a “black box” method, meaning it
can explain any network architecture and only needs to measure changes to a similarity score when provided with different inputs. Unlike a standard classifier, which simply predicts the most likely attributes for a given image, our explanation method predicts which attributes are important for the similarity score predicted by a model. Predictions are made for each image in a pair, and allowed to be non-symmetric, e.g., the explanation for why the ring in Figure 1b matches the necklace may be that it contains “black”, even though the explanation for why the necklace matches the ring could be that it is “golden.” A different similarity model may also result in different attributes being deemed important for the same pair of images.
SANE combines three major components: an attribute predictor, a prior on the suitability of each attribute as an explanation, and a saliency map generator. Our underlying assumption is that at least one of the attributes present in each image should be able to explain the similarity score assigned to the pair. Given an input image, the attribute predictor outputs a confidence score and activation map for each attribute, while the saliency map generator produces regions important for the match. During training, SANE encourages overlap between the similarity saliency and attribute activation. At test time, we rank attributes as explanations for an image pair based on a weighted sum of this attribute-saliency map matching score, the explanation suitability prior of the attribute, and the likelihood that the attribute is present in the image. Although we evaluate only the top-ranked attribute in our experiments, in practice more than one attribute could be used to explain a similarity score. We find that using saliency maps as supervision for the attribute activation maps during training not only improves the attribute-saliency matching, resulting in better attribute explanations, but also boosts attribute recognition performance using standard metrics like average precision.
We evaluate several candidate saliency map generation methods which are primarily adaptations of “black box” approaches that do not rely on a particular model architecture or require access to network parameters to produce a saliency map (Fong & Vedaldi, 2017; Petsiuk et al., 2018; Ribeiro et al., 2016; Zeiler & Fergus, 2014). These methods generally identify important regions by measuring a change in the output class score resulting from some perturbation of the input image. Similarity models, however, typically rely on a learned embedding space to reason about relationships between images, where proximity between points or the lack thereof indicates some degree of correspondence. An explanation system for embedding models must, therefore, consider how distances between embedded points, and thus their similarity, change based on perturbing one or both of the input images. We explore two strategies for adapting these approaches to our task. First, we manipulate just a single image (the one we wish to produce an explanation for) while keeping the other image fixed. Second, we manipulate both images to allow for more complex interactions between the pair. See Section 3.2 for additional details and discussion on the ramifications of this choice.
Our paper makes the following contributions: 1) we provide the the first quantitative study of explaining the behavior of image similarity models; 2) we propose a novel explanation approach that combines saliency maps and attributes; 3) we validate our method with metrics designed to link our explanations to model performance, and find that it produces more informative explanations than adaptations of prior work to this task and also improves attribute recognition performance.

heading: 2 RELATED WORK

text:
Saliency-based Explanations. Saliency methods can generally be split into “white box” and “black box” approaches. “White box” methods assume access to internal components of a neural network,
either in the form of gradients or activations of specific layers (e.g. (Cao et al., 2015; Chang et al., 2019; Nguyen et al., 2016; Selvaraju et al., 2017; Simonyan et al., 2014; Yosinski et al., 2015; Zhang et al., 2016; Zhou et al., 2016)). Most of them produce a saliency map by using some version of backpropagation from class probability to an input image. In contrast, “black box” approaches require no knowledge of the internals (e.g. weights, gradients) of the models. These methods obtain saliency maps by perturbing the input in a predefined way and measuring the effect of it on the model output, such as class score. We adapt and compare three “black box” and one “white box” methods for our saliency map generator in Figure 2. “Black box” approaches include a Sliding Window (Zeiler & Fergus, 2014), which masks image regions sequentially, and Randomized Input Sampling for Explanations (RISE) (Petsiuk et al., 2018), which masks random sets of regions. Both measure the effect removing these regions have on the class score. LIME (Ribeiro et al., 2016) first obtains a super-pixel representation of an image. Super-pixel regions are randomly deleted, and their importance is estimated using Lasso. “White box” Mask (Fong & Vedaldi, 2017) learns a saliency map directly by using different perturbation operators and propagating the error to a low resolution mask. Although there is some limited work which adapts some saliency methods to the image similarity setting (e.g., Gordo & Larlus (2017)), they present qualitative results only, i.e., these methods are not evaluated quantitatively on their explanation accuracy as done in our work.
Natural Language and Attribute-based Explanations. Instead of producing saliency maps, which can sometimes be difficult to interpret, researchers have explored methods of producing text-based explanations. These include methods which justify a model’s answer in the visual question answering task (Huk Park et al., 2018; Li et al., 2018a), rationalize the behavior of a self-driving vehicle (Kim et al., 2018b), or describe why a category was selected in fine-grained object classification (Hendricks et al., 2016). Lad & Parikh (2014) used human-generated attribute explanations describing why two images are similar or dissimilar as guidance for image clustering. Our approach could be used to automatically generate these explanations rather than relying on human feedback. Several works exist which learn attribute explanations either to identify important concepts (Kim et al., 2018a; Bau et al., 2017; Fong & Vedaldi, 2018) or to justify a model’s decision by pointing to evidence (Anne Hendricks et al., 2018). Kim et al. (2018a) learns a concept activation vector that separates examples with an attribute against examples without it, and then scores the sensitivity of attributes based on how often a directional derivative changes the inputs towards the concept. However, all these methods were designed to explain categorical predictions rather than similarity models. To the best of our knowledge, ours is the first work which uses attribute explanations in the image similarity setting.

heading: 3 SALIENT ATTRIBUTES FOR NETWORK EXPLANATIONS (SANE)

text:
We are given a fixed model that predicts the similarity between two images, and must explain why a query image is similar to a reference image. While typical models for predicting similarity are learned from data, using an embedding method and a triplet loss, our approach is agnostic as to how the model being explained is built. Our method consists of three components: the attribute explanation model (Section 3.1), the saliency map generator (Section 3.2), and an attribute explanation suitability prior (Section 3.3). Although we train a CNN to produce attribute predictions, the image
similarity model we wish to explain is kept fixed. At test time, one recovers a saliency map for the match from the query image in a pair, then uses the attribute explanation model and attribute suitability prior to rank each attribute’s ability to explain the image similarity model.

heading: 3.1 ATTRIBUTE EXPLANATION MODEL

text:
Suppose we have access to pairs of images (Ir, Iq). Here, Ir denotes a reference image and Iq a query image. We wish to obtain an explanation for the match between Ir and Iq . Associated with each pair is a saliency map mq produced by a saliency map generator (described in Section 3.2). We need simply to swap the query and reference images to compute a saliency map for mr, which would also likely result in a different saliency map than mq . Finally, assume we have access to binary attribute annotations ai, i = 1, . . . , A, and let agt ∈ {0, 1}A be the set of ground truth attribute annotations for a given query image. If no attribute annotations are provided, an attribute discovery method could be employed (e.g., (Han et al., 2017a; Vittayakorn et al., 2016)). We explore using an attribute discovery method in the appendix.
Our attribute explanation model produces confidence scores â ∈ RA for Iq . Unlike a standard attribute classifier, however, our goal is not just to predict the most likely attributes in Iq , but rather to identify which attributes contribute the most to the similarity score s(Ir, Iq) produced by the similarity model we wish to obtain explanations for. To accomplish this, the layer activations for attribute ai before the global average pooling layer is defined as an attribute activation map ni. This attribute activation map represents a downsampled mask of an image that identifies prominent regions in Iq for that attribute. We encourage at least one ground truth attribute’s activation map for image Iq to match saliency map mq as a form of regularization (see Figure 2 for an overview). Our underlying assumption is that at least one of the ground truth attributes of Iq should be able to explain why Iq is similar to Ir. Thus, at least one of the attribute activation maps ni should closely resemble the saliency map for the match, mq .
Each attribute confidence score is obtained using a global average pooling layer on its attribute activation map followed by a softmax. The attribute explanation network is trained using a Huber loss (Huber, 1964), sometimes referred to as a smooth `1 loss, which helps encourage sparsity in the predictions. More formally, given a set of confidence scores â and attribute labels agt, our loss is,
LHuber(â,agt) =
{ 1 2 (agt − â)
2 for |agt − â| ≤ 1 agt − â otherwise.
(1)
Note that multiple attributes can be present in the image; and that this loss operates on attributes, not attribute activation maps. Since the confidence scores sum to one (due to the softmax), we scale a binary label vector by the number of ground truth attributes Agt (e.g., if there are four attributes for an image, its label would be 0.25 for each ground truth attribute, and zero for all others).
Leveraging saliency maps during training. We explicitly encourage our model to identify attributes which are useful in explaining the predictions of an image similarity model by finding which attributes best describe the regions of high importance to similarity predictions. To accomplish this, we first find a set of regions that may be important to the decisions of an image similarity model by generating a set of K saliency mapsMq for up to K reference images that are similar. For the image under consideration, we also construct a set of attribute activation maps Ngt corresponding to each ground truth attribute. Then, for each saliency map we find its best match inNgt. We match saliency maps to attributes rather than the other way around since not all annotated attributes are necessarily relevant to the explanation of s(Ir, Iq). We use an `2 loss between the selected attribute activation map and saliency map, i.e.,
Lhm = 1
K ∑ ∀m∈Mq min ∀n∈Ngt ‖m− n‖2 . (2)
Combined with the attribute classification loss, our model’s complete loss function is:
Ltotal = LHuber + λLhm, (3)
where λ is a scalar parameter. See appendix for implementation details and parameter values.

heading: 3.2 SALIENCY MAP GENERATOR

text:
A straightforward method of producing a saliency map with a “black box” method is to manipulate the input image by removing image regions and measuring its effect on the similarity score. If a large drop in similarity is measured, then the region must be significant. If almost no change was measured, then the model considers the image region irrelevant. A saliency map is generated from this approach by averaging the similarity scores for each pixel over all instances where it was removed from the input. The challenge is determining the best way of manipulating the input image to discover these important regions. These “black box” methods assume you don’t have access to the underlying model’s parameters to compute gradients, and as our experiments will show, can also produce saliency maps that are often comparable or better than some “white box” methods which leverage these gradients. We compare four saliency methods: Sliding Window (Zeiler & Fergus, 2014), LIME (Ribeiro et al., 2016), “white box” Mask (Fong & Vedaldi, 2017), and RISE (Petsiuk et al., 2018). We now describe how we adapt these models for our task; additional details on each method are in the appendix.
Computing similarity scores. Each saliency method we compare was designed to operate on a single image and measures the effect manipulating the image has on the prediction of a specific object class. However, an image similarity models predictions are made for two or more images. Let us consider the case where we are just comparing two images, a query image (i.e. the image we want to produce an explanation for), and a reference image, although our approach extends to consider multiple reference images. Even though we do not have access to a class label, we can measure the effect manipulating an image has on the similarity score between the query and reference images. Two approaches are possible: manipulate both images, or manipulate only the query image.
Manipulating both images would result inNM forward passes through the image similarity model (for N,M the number of query and reference image manipulations, respectively), which is prohibitively expensive unless M << N . But we only need an accurate saliency map for the query image, so we set M << N in our experiments. There is another danger: for example, consider two images of clothing items that are similar if either they both contain or do not contain a special button. Masking out the button in one image and not the other would cause a drop in similarity score, but masking out the button in both images would result in high image similarity. These conflicting results could make accurately identifying the correct image regions contributing to a score difficult.
The alternative is to manipulate the query image alone, i.e. keep a fixed reference image. We evaluate the saliency maps produced by both methods in Section 4.1.

heading: 3.3 SELECTING INFORMATIVE ATTRIBUTES

text:
At test time, given a similarity model and a pair of inputs, SANE generates a saliency map and selects an attribute to show to the user. We suspect that not all attributes annotated for a dataset may prove to be useful in explaining every image similarity model. Thus, we take into account each attribute’s usefulness in explaining predictions made by a similarity model by learning concept activation vectors (CAVs) (Kim et al., 2018a) over the image similarity embedding. These CAVs identify which attributes are useful in explaining a layer’s activations by looking at whether an attribute positively affects the model’s predictions. CAVs are defined as the vectors that are orthogonal to the classification boundary of a linear classifier trained to recognize an attribute over a layer’s activations (i.e. the image similarity model’s embedding). Then, the sensitivity of each concept to an image similarity model’s predictions (i.e., the TCAV score) is obtained by finding the fraction of features that were positively influenced by the concept using directional derivatives computed using a triplet loss with a margin of machine epsilon. Note that this creates a single attribute ranking over the entire image similarity embedding (i.e., it is agnostic to the image pair being explained) which we use as an attribute explanation suitability prior. Finally, attributes are ranked as explanations using a weighted combination of the TCAV scores, the attribute confidence score â, and how well the attribute activation map n matches the generated saliency map mq . I.e.,
e(mq, â,n,TCAV) = φ1â+ φ2 dcos(mq,n) + φ3TCAV, (4)
where dcos denotes cosine similarity, and φ1−3 are scalars estimated via grid search on held out data.

heading: 4 EXPERIMENTS

text:
Datasets. We evaluate our approach using two datasets from different domains to demonstrate its ability to generalize. The Polyvore Outfits dataset (Vasileva et al., 2018) consists of 365,054 fashion product images annotated with 205 attributes and composed into 53,306/10,000/5,000 train/test/validation outfits. Animals with Attributes 2 (AwA) (Xian et al., 2018) consists of 37,322 natural images of 50 animal classes annotated with 85 attributes, and is split into 40 animal classes for training, and 10 used at test time. To evaluate our explanations we randomly sample 10,000 ground-truth (query, reference) pairs of similar images for each dataset from the test set.
Image Similarity Models. For the Polyvore Outfits dataset we use the type-aware embedding model released by Vasileva et al. (2018). This model captures item compatibility (i.e. how well two pieces of clothing go together) using a set of learned projections on top of a general embedding, each of which compares a specific pair of item types (i.e. a different projection is used when comparing a top-bottom pair than when comparing a top-shoe pair). For AwA we train a feature representation using a 18-layer ResNet (He et al., 2016) with a triplet loss function that encourages animals of the same type to embed nearby each other.1 For each dataset/model, cosine similarity is used to compare an image pair’s feature representations.

heading: 4.1 SALIENCY MAP EVALUATION

text:
Metrics. Following Petsiuk et al. (2018), we evaluate the generated saliency maps using insertion and deletion metrics which measure the change in performance of the model being explained as pixels are inserted into a blank image, or deleted from the original image. For our task, we generate saliency maps for all query images, and insert or delete pixels in that image only. If a saliency map correctly captures the most important image regions, we should expect a sharp drop in performance as pixels are deleted (or a sharp increase as they are inserted). We report the area under the curve (AUC) created as we insert/delete pixels at a rate of 1% per step for both metrics. We normalize the similarity scores for each image pair across these thresholds so they fall in a [0-1] interval.
Results. Table 1 compares the different saliency map generation methods on the insertion and deletion tasks. RISE performed best on most metrics, with the exception of and LIME doing better on the deletion metric on AwA. This is not surprising, since LIME learns which super-pixels contribute to a similarity score. For AwA this means that parts of the animals could be segmented out and deleted or inserted in their entirety before moving onto the next super-pixel. On Polyvore Outfits, however, the important components may be along the boundaries of objects (e.g. the cut of a dress), something not well represented by super-pixel segmentation. Although Mask does not perform as well as other approaches, it tends to produce the most compact regions of salient pixels as it searches for a saliency map with minimal support (see the appendix for examples). Notably, we generally obtained better performance when the reference image was kept fixed and only the query image was manipulated. This may be due to the issues from noisy similarity scores as discussed in Section 3.2 and suggests extra care must be taken when manipulating both images.

heading: 4.2 ATTRIBUTE PREDICTION EVALUATION

text:
Metrics. To begin, we report the overall performance of SANE using mean average precision (mAP) on the standard task of attribute recognition computed over all images in the test set. Two additional metrics are used to evaluate our attribute explanations using the (query, reference) image pairs used in the saliency map experiments which are similar to the evaluation of saliency maps. Given the set of attributes we know exist in the image, we select which attribute among them best explains the similarity score using Eq. (4), and then see the effect of deleting that attribute from the image has on the similarity score. Similarly, we select the attribute which best explains the similarity score from those which aren’t present in the image and measure the effect of inserting the attribute has on the similarity score. Intuitively, if an attribute was critical for an explanation, then the similarity score should shift more than if a different attribute was selected. Scores for these metrics are expressed in terms of relative difference, so higher numbers are always better regardless of whether we are inserting or deleting an attribute. Scores are also normalized so the upper bound is 1.
1Upon acceptance, we will make our embedding model for the AwA dataset publically available.
To insert or remove an attribute, we find a representative image in the test set which is most similar to the query image in all other attributes. For example, let us consider a case where we want to remove the attribute “striped” from a query image. We would search through the database for the image which is most similar in terms of non-striped attributes, but which hasn’t been labeled as being “striped.” These attribute comparisons are based on the average confidence for each attribute computed over the three attribute models we compare in Table 2. On the Polyvore Outfits dataset we restrict the images considered to be of the same type as the query image (i.e., if the query image is a shoe, then only a shoe can be retrieved). After retrieving this new image, we compute its similarity with the reference image to compare with the original (query, reference) image pair. Examples of this process can be found in the appendix.
Compared methods. We provide three baseline approaches: a random baseline, a sample attribute classifier (i.e. no attribute activation maps), and a modified version of FashionSearchNet (Ak et al., 2018), an attribute recognition model which also creates a weakly-supervised attribute activation map for comparison. Additional details on these models can be found in the appendix.
Results. Table 2 compares the performance of the compared attribute models for our metrics. Our attribute explanation metrics demonstrate the effectiveness of our attribute explanations, with our model which matches saliency maps and includes TCAV scores getting the best performance on both datasets. This shows that when we “insert” or “delete” the attribute predicted by SANE from the image, it affects the similarity model’s score more than the baselines. Notably, our approach outperforms FashionSearchNet + Map Matching, which can be considered a weakly-supervised version of SANE trained for attribute recognition. The second line of Table 2 reports that TCAV does well on the insertion task, but poorly on the deletion task. This is due, in part, to the fact that other models, including SANE, are trained to reason about attributes that actually exist in an image, whereas for insertion the goal is to predict which attribute that isn’t present in the image would affect the similarity score most significantly. Thus, using a bias towards globally informative attributes (i.e., TCAV scores) is more useful for insertion. Finally, training SANE to produce explanations leads to a 2% improvement on the standard attribute recognition task measured in mAP over a simple attribute classifier while using the same number of parameters. SANE also outperforms FashionSearchNet, which treats localizing important image regions as a latent variable rather than using saliency maps for supervision.
We conducted a small scale user study to verify humans found our explanations useful. We showed the users the saliency map explanations for image pairs or the attribute explanations, and asked if they felt the explanations helped them understand the model’s behavior. We obtained at least 25 responses for each question, where 56% of subjects found the saliency maps useful and 72% found the attributes useful on the AwA dataset, while on Polyvore Outfits these are 87% and 79%, respectively. This verifies that most users thought our explanations were useful, which could help build trust, while also showing how the different explanations are ideal in different circumstances.
We provide qualitative examples of our explanations in Figure 3. Examples demonstrate that our explanations pass important sanity checks. The explanation attribute is well-correlated with the localization of important pixels in the saliency map for each pair. Notice that “golden”, “striped” and “printed” in the first two columns of Figure 3 are sensibly localized, and are also reasonable explanations for the match, while a more abstract explanation like “fashionable” is linked to the high heel, the curve of the sole, and the straps of the shoe. Note further that the explanations are non-trivial: they more often than not differ from the most likely attribute in the query image,
as predicted by a standard attribute classifier. In other words, our explanation model is utilizing information from each pair of images and the saliency map characterizing the match to produce a sensible, interpretable explanation.
Figure 4 shows an example of how directly removing the attribute predicted as the explanation can affect similarity (possible here because the attribute is a color.) Here we see that when we modify the white dress to be a different color, the similarity score drops significantly. The only exception is when we make the dress the same color (black) as the attribute explanation of the pants it is being compared to. This demonstrates in a causal way how our predicted attributes can play a significant role in the similarity scores.

heading: 5 CONCLUSION

text: In this paper we introduced SANE, a method of explaining an image similarity model’s behavior by identifying attributes that were important to the similarity score paired with saliency maps indicating import image regions. We confirmed humans believe our explanations are useful for explaining a model’s behavior, which could help build trust, to supplement automatic metrics. In future work we believe closely integrating the saliency generator and attribute explanation model, enabling each component to take advantage of the predictions of the other, would help improve performance.

heading: A CANDIDATE SALIENCE MAP GENERATOR DESCRIPTIONS

text:
In this section we provide additional details about each of the candidate saliency map generation methods used in our paper. We split these approaches into two groups: methods which analyze behavior solely through input manipulation (described in Section A.1) and those which use an optimization procedure to learn some parameters in combination with input manipulation (described in Section A.2). Please see Section 3.2 of our paper for a description of how these methods are adapted to our task. We also provide a runtime comparison of each approach in Table 3. A qualitative comparison between saliency map generators on the Polyvore Outfits and AwA datasets is provided in Figures 5 and 6.
A.1 SALIENCY MAPS BY INPUT MANIPULATION
A straightforward approach to producing a saliency map is to manipulate the input image by removing image regions and measuring the effect this has on the similarity score. If a large drop in similarity is measured, then the region must be important to this decision. If almost no change was measured, then the model considers the image region irrelevant. The saliency map is generated from this approach by averaging the similarity scores for each pixel location over all instances where it was removed from the input. The challenge then is to determine how to manipulate the input image to discover these important regions.
Sliding Window (Zeiler & Fergus, 2014). The first approach to removing regions of an image we shall discuss is a sliding window, where regions are sampled regularly across an image. There is a direct tradeoff, however, with how densely frames are sampled and the computational time it takes to do a forward pass through the network for each manipulated image. If frames are not densely sampled to enable an efficient solution, then it wouldn’t be able to localize important regions accurately. If regions are too densely sampled then removing them might not make enough of a difference in the similarity score to take measurements accurately.
RISE (Petsiuk et al., 2018). This method uses Monte Carlo approach to generate saliency maps. A set of N random binary masks of size h×w is sampled where each element is independently set to 1 with probably p, and all other elements are set to 0. Typically these masks are much smaller than the input image, so they are upsampled using bilinear interpolation. This produces small continuous regions within the upsampled mask that can be used to manipulate the input image. To remove the fixed grid structure the masks are upsampled to larger than image size and then cropped randomly. Although this approach does require a significant number of random masks (we found 2,000 to be sufficient in our experiments), we found this approach significantly outperforms using a sliding window that samples a similar number of masks on our task.
A.2 LEARNED SALIENCY MAPS
We shall now discuss methods which combine input manipulation with an optimization procedure used to directly learn a saliency map. As in Section A.1, we compare generating saliency maps for a single query image at a time using a fixed reference image as well as generating a saliency map by manipulating both the query and reference images.
LIME (Ribeiro et al., 2016). Rather than masking regions without any concern over the continuity of a region, this approach to generating saliency maps operates over a superpixel segmentation of an image. Images are manipulated by randomly deleting superpixels in the image. After sampling N manipulated inputs, the importance of each superpixel is estimated using Lasso. Finally, important regions are selected using submodular optimization.
Mask (Fong & Vedaldi, 2017). In this approach a low resolution saliency map is directly learned using stochastic gradient decent and upsampled to the image size. Instead of manipulating an image by just deleting regions as in other methods, two additional perturbation operators are defined: adding Gaussian noise and image blurring. To help avoid artifacts when learning the mask a total-variation norm is used in addition to an L1 regularization to promote sparsity. This approach removes the reliance on superpixels and tends to converge in fewer iterations than LIME, although it is considerably slower in practice than other approaches (see Table 3). That said - one advantage it does have over other approaches is the ability to learn the salience map for both the query and reference image jointly (which we take advantage of when we are not using a fixed reference image).

heading: B ADDITIONAL EXPERIMENTAL OR IMPLEMENTATION DETAILS

text:
B.1 SALIENCY MAP GENERATOR DETAILS
Sliding Window. When manipulating the inputs of the reference image, we apply 625 occlusion windows each covering a square region of about 12% of image area. When manipulating both images we apply 36 occlusion windows to the reference image.
RISE. For both datasets we randomly sample 2,000 random masks upsampled from 8×8 mask with the probability of preserving a region of 0.5. When manipulating the inputs of the reference image, we generate 30 random masks.
LIME. We generate LIME saliency maps using 1000 samples.
Mask. We learn a 14× 14 perturbation mask for both datasets. We train the mask for 500 iterations using Adam Kingma & Ba (2015) with a learning rate of 0.1.
B.2 COMPARED ATTRIBUTE METHODS
In addition to a random baseline, we provide two for comparison to our model for our attribute experiments in Section 4.2. First, we train a simple attribute classifier using the same architecture as SANE, but where the attribute activation maps are not regularized with saliency maps. Second, we use a modified version of FashionSearchNet (Ak et al., 2018), which was designed for fashion search using attribute information. This network uses an attribute activation map to identify and extract a region of interest for each attribute. These extracted regions are fed into two branches consisting of three fully connected layers which is trained for both attribute classification and image retrieval. We remove the image retrieval components For all attribute models, we use a 50-layer ResNet base image encoder He et al. (2016) and the last convoluntional layer of the network the same number of channels as the number of classes. This provides a simple baseline and a model with a generic weakly-supervised attribute activation map for comparison.
B.3 SANE DETAILS
Due to its efficient (see Table 3) and overall good performance (see Table 1) we selected the fixedreference RISE as our saliency map generator. For each training image, we sample up to five similar images using the ground truth annotations of each dataset and generate saliency maps using each sampled image as the reference image. We train our attribute model for 300 epochs using Adam (Kingma & Ba, 2015) with a learning rate of 5e−4 and set λ = 5e−3 in Eq. 3 from the paper. After each epoch, we computed mAP on the validation set and kept the best performing model according to this metric. Additional qualitative examples for explanations produced by our SANE model on the Polyvore Outfits and AwA datasets are provided in Figures 7 and 8.
We provide an example of the attribute deletion process in Figure 9. After identifying an attribute to remove in an image, we search for the most similar image to the input from a database that doesn’t contain the input attribute. Image similarity is computed over the attribute space, i.e., we want to keep the predictions of each attribute the same, and only vary the target attribute. For Polyvore Outfits, we only consider images of the same type (i.e., so tops can only be replaced with other tops). To ensure we don’t bias towards a single attribute model, average the predictions made by each attribute model in our experiments (Attribute Classifier, FashionSearchNet, and SANE). We see on the left side of Figure 9 that some attributes like colors are largely retained when the attribute has to do with a non-color based attribute. On the returned AwA images on the right side of Figure 9 we see how some attributes can lead to significant changes in the images or almost none at all depending on the attribute selected to remove.
In Section 3.3 we discuss how we estimate how likely each attribute is a “good” explanation in heldout data. This is used as a prior to bias our attribute selections towards attributes that are known to
be good attribute explanations. In Figure 10 we show the ground truth bias for the attribute detection task according to our metrics for the AwA dataset. Note, however, that this prior would change for a different image similarity model. For example, if the image similarity model was more biased towards colors, then we would expect to see the likelihood for “black,” “brown,” and “gray” to increase.

heading: C DISCOVERING USEFUL ATTRIBUTES

text:
For datasets without attribute annotations, or those where the annotated attributes doesn’t cover the extent of the visual attributes present in the dataset (i.e. there are many unannotated attributes) we propose a method of discovering attributes that are useful for providing model explanations. An attribute that is useful for explantions would commonly appear in the high importance regions of saliency maps. When generating saliency maps for a query image, if many reference images attend to the same region of the query image then it is likely they are all matching to it for similar reasons (i.e. there may be some attribute that they share which matches the query). Given this observation, we discover attributes using the following saliency-based procedure:
1. Obtain K similar images for query image q using k-NN. 2. Generate a saliency map over q for each of the similar (reference) images. 3. Keep only those reference images which have their saliency peaks in the most common
location (such as a unit square in a 7× 7 grid) and pick top N of them that have the highest similarity.
4. For each reference image, generate its saliency map with q and crop a 30×30 patch around the peak saliency region in the reference image.
5. Upsample all the generated patches to full image resolution and get their embeddings. 6. Cluster the patches produced for multiple queries q. Each cluster represents an attribute. If
multiple patches were extracted from an image and they got assigned to different clusters, this image would be labeled with multiple attributes.
Figure 11a illustrates the clustering produced by this procedure for a set of queries from Polyvore Outfits dataset.
To evaluate this approach we compare it to randomly assigning images to clusters and to clustering based on their own embeddings, disregarding the saliency of image regions (Figure 11b). Saliencybased attribute discovery works best among the three unsupervised methods for Polyvore Outfits data, but full-frame clustering outperforms it for the AwA dataset (Table 4). We suspect the full frame clustering works better for AwA since it considers the background more than the patch-based method (Polyvore Outfits image’s typically have white backgrounds). In addition, our discovered attributes would likely be noisier due to the similarity model focusing on the background patches in some images as well. Although our initial results are promising, attempting to discover attributes useful for explanations warrants additional investigation.


summaries: This submission belongs to the field of text-to-speech synthesis. In particular it looks at a novel way of formulating a normalising flow using 2D rather than conventional 1D representation. Such reformulation enables to provide interpretations to several existing approaches as well as formulate a new one with quite interesting properties. This submission would benefit from a discussion of limitations of your approach.

summaries: This paper re-organized the high dimensional 1-D raw waveform as 2-D matrix. This method simulated the autoregressive flow. Log-likelihood could be calculated in parallel. Autoregressive flow was only run on row dimension. The number of required parameters was desirable to synthesize high-fidelity speech with the speed faster than real time. Although this method could not achieve top one in ranking in every measurements, the resulting performance was still obtained with the best average results.

abstractText: In this work, we present WaveFlow, a small-footprint generative flow for raw audio, which is trained with maximum likelihood without density distillation and auxiliary losses as used in Parallel WaveNet. It provides a unified view of flowbased models for raw audio, including autoregressive flow (e.g., WaveNet) and bipartite flow (e.g., WaveGlow) as special cases. We systematically study these likelihood-based generative models for raw waveforms in terms of test likelihood and speech fidelity. We demonstrate that WaveFlow can synthesize high-fidelity speech and obtain comparable likelihood as WaveNet, while only requiring a few sequential steps to generate very long waveforms. In particular, our small-footprint WaveFlow has 5.91M parameters and can generate 22.05kHz high-fidelity speech 42.6× faster than real-time on a GPU without engineered inference kernels. 1

authors:
S.O. Arık
M. Chrzanowski
A. Coates
G. Diamos
A. Gibiansky
Y. Kang
X. Li
J. Miller
J. Raiman
S. Sengupta
M. Shoeybi

title: Deep Voice: Real-time neural text-to-speech

authors:
S.O. Arık
G. Diamos
A. Gibiansky
J. Miller
K. Peng
W. Ping
J. Raiman
Y. Zhou

title: Deep Voice 2: Multi-speaker neural text-to-speech

venue: In NIPS,

authors:
R. v. d. Berg
L. Hasenclever
J.M. Tomczak
M. Welling

title: Sylvester normalizing flows for variational inference

venue: arXiv preprint arXiv:1803.05649,

authors:
S. Dieleman
A. van den Oord
K. Simonyan

title: The challenge of realistic music generation: modelling raw audio at scale

venue: NeurIPS,

authors:
L. Dinh
D. Krueger
Y. Bengio

title: NICE: Non-linear independent components estimation

venue: arXiv preprint arXiv:1410.8516,

authors:
L. Dinh
J. Sohl-Dickstein
S. Bengio

title: Density estimation using Real NVP

authors:
W. Grathwohl
R.T. Chen
J. Betterncourt
I. Sutskever
D. Duvenaud

title: Ffjord: Free-form continuous dynamics for scalable reversible generative models

venue: arXiv preprint arXiv:1810.01367,

authors:
E. Hoogeboom
R. v. d. Berg
M. Welling

title: Emerging convolutions for generative normalizing flows

venue: arXiv preprint arXiv:1901.11137,

authors:
C.-W. Huang
D. Krueger
A. Lacoste
A. Courville

title: Neural autoregressive flows

venue: arXiv preprint arXiv:1804.00779,

title: The LJ speech dataset. 2017

authors:
N. Kalchbrenner
E. Elsen
K. Simonyan
S. Noury
N. Casagrande
E. Lockhart
F. Stimberg
A. v. d. Oord
S. Dieleman
K. Kavukcuoglu

title: Efficient neural audio synthesis

authors:
S. Kim
S.-g. Lee
J. Song
S. Yoon

title: FloWaveNet: A generative flow for raw audio

authors:
D.P. Kingma
J. Ba

title: Adam: A method for stochastic optimization

authors:
D.P. Kingma
P. Dhariwal

title: Glow: Generative flow with invertible 1x1 convolutions

venue: In Advances in Neural Information Processing Systems,

authors:
D.P. Kingma
T. Salimans
R. Jozefowicz
X. Chen
I. Sutskever
M. Welling

title: Improving variational inference with inverse autoregressive flow

authors:
N. Li
S. Liu
Y. Liu
S. Zhao
M. Liu
M. Zhou

title: Neural speech synthesis with transformer network

authors:
S. Mehri
K. Kumar
I. Gulrajani
R. Kumar
S. Jain
J. Sotelo
A. Courville
Y. Bengio

title: SampleRNN: An unconditional end-to-end neural audio generation model

authors:
T.L. Paine
P. Khorrami
S. Chang
Y. Zhang
P. Ramachandran
M.A. Hasegawa-Johnson
T.S. Huang

title: Fast wavenet generation algorithm

venue: arXiv preprint arXiv:1611.09482,

authors:
G. Papamakarios
T. Pavlakou
I. Murray

title: Masked autoregressive flow for density estimation

authors:
K. Peng
W. Ping
Z. Song
K. Zhao

title: Parallel neural text-to-speech

venue: arXiv preprint arXiv:1905.08459,

title: NV-WaveNet: Better speech synthesis using gpu-enabled WaveNet inference

venue: In NVIDIA Developer Blog,

authors:
W. Ping
K. Peng
A. Gibiansky
S.O. Arik
A. Kannan
S. Narang
J. Raiman
J. Miller

title: Deep Voice 3: Scaling text-to-speech with convolutional sequence learning

authors:
W. Ping
K. Peng
J. Chen

title: ClariNet: Parallel wave generation in end-to-end text-to-speech

authors:
R. Prenger
R. Valle
B. Catanzaro

title: WaveGlow: A flow-based generative network for speech synthesis

venue: In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP),

authors:
Y. Ren
Y. Ruan
X. Tan
T. Qin
S. Zhao
Z. Zhao
T.-Y. Liu

title: Fastspeech: Fast, robust and controllable text to speech

authors:
D.J. Rezende
S. Mohamed

title: Variational inference with normalizing flows

authors:
F. Ribeiro
D. Florêncio
C. Zhang
M. Seltzer

title: CrowdMOS: An approach for crowdsourcing mean opinion score studies

venue: In ICASSP,

authors:
T. Salimans
D.P. Kingma

title: Weight normalization: A simple reparameterization to accelerate training of deep neural networks

authors:
J. Serrà
S. Pascual
C. Segura

title: Blow: a single-scale hyperconditioned flow for non-parallel raw-audio voice conversion

venue: arXiv preprint arXiv:1906.00794,

authors:
J. Shen
R. Pang
R.J. Weiss
M. Schuster
N. Jaitly
Z. Yang
Z. Chen
Y. Zhang
Y. Wang
R. SkerryRyan

title: Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions

authors:
J. Sotelo
S. Mehri
K. Kumar
J.F. Santos
K. Kastner
A. Courville
Y. Bengio

title: Char2wav: End-to-end speech synthesis

venue: ICLR workshop,

authors:
Y. Taigman
L. Wolf
A. Polyak
E. Nachmani

title: VoiceLoop: Voice fitting and synthesis via a phonological loop

authors:
A. van den Oord
S. Dieleman
H. Zen
K. Simonyan
O. Vinyals
A. Graves
N. Kalchbrenner
A. Senior
K. Kavukcuoglu

title: WaveNet: A generative model for raw audio

venue: arXiv preprint arXiv:1609.03499,

authors:
A. van den Oord
Y. Li
I. Babuschkin
K. Simonyan
O. Vinyals
K. Kavukcuoglu
G. v. d. Driessche
E. Lockhart
L.C. Cobo
F. Stimberg

title: Parallel WaveNet: Fast high-fidelity speech synthesis

authors:
Y. Wang
R. Skerry-Ryan
D. Stanton
Y. Wu
R.J. Weiss
N. Jaitly
Z. Yang
Y. Xiao
Z. Chen
S. Bengio
Q. Le
Y. Agiomyrgiannakis
R. Clark
R.A. Saurous

title: Tacotron: Towards end-to-end speech synthesis

authors:
R. Yamamoto
E. Song
J.-M. Kim

title: Probability density distillation with generative adversarial networks for high-quality parallel waveform generation

authors:
F. Yu
V. Koltun

title: Multi-scale context aggregation by dilated convolutions

venue: arXiv preprint arXiv:1511.07122,

heading: 1 INTRODUCTION

text:
Deep generative models have obtained noticeable successes for modeling raw audio in high-fidelity speech synthesis and music generation (e.g., van den Oord et al., 2016; Dieleman et al., 2018). Autoregressive models are among the best performing generative models for raw audio waveforms, providing the highest likelihood scores and generating high quality samples (e.g., van den Oord et al., 2016; Kalchbrenner et al., 2018). One of the most successful examples is WaveNet (van den Oord et al., 2016), an autoregressive model for waveform synthesis. It operates at the high temporal resolution of raw audio (e.g., 24kHz) and sequentially generates waveform samples at inference. As a result, WaveNet is prohibitively slow for speech synthesis and one has to develop highly engineered kernels for real-time inference (Arık et al., 2017a; Pharris, 2018). 2
Flow-based models (Dinh et al., 2014; Rezende and Mohamed, 2015) are a family of generative models, in which a simple initial density is transformed into a complex one by applying a series of invertible transformations. One group of models are based on autoregressive transformation, including autoregressive flow (AF) and inverse autoregressive flow (IAF) as the “dual” of each other (Kingma et al., 2016; Papamakarios et al., 2017; Huang et al., 2018). AF is analogous to autoregressive models, which performs parallel density evaluation and sequential synthesis. In contrast, IAF performs parallel synthesis but sequential density evaluation, making likelihood-based training very slow. Parallel WaveNet (van den Oord et al., 2018) distills an IAF from a pretrained autoregressive WaveNet, which gets the best of both worlds. However, it requires the density distillation with Monte Carlo approximation and a set of auxiliary losses for good performance, which complicates the training pipeline and increases the cost of development. Instead, ClariNet (Ping et al., 2019) simplifies the density distillation by computing a regularized KL divergence in closed-form.
Another group of flow-based models are based on bipartite transformation (Dinh et al., 2017; Kingma and Dhariwal, 2018), which provide parallel density evaluation and parallel synthesis. Most recently, WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) successfully applies Glow (Kingma and Dhariwal, 2018) and RealNVP (Dinh et al., 2017) for waveform synthesis, respectively. However, the bipartite transformations are less expressive than the autoregressive transformations (see Section 2.3 for detailed discussion). In general, these bipartite flows require
1Audio samples are located at: https://waveflow-demo.github.io/. 2Real-time inference is a requirement for most production text-to-speech systems. For example, if the system
can synthesize 1 second of speech in 0.5 seconds, it is 2× faster than real-time.
deeper layers, larger hidden size, and huge number of parameters to reach comparable capacities as autoregressive models. For example, WaveGlow and FloWaveNet have 87.88M and 182.64M parameters with 96 layers and 256 residual channels, respectively. In contrast, a 30-layer WaveNet has only 4.57M parameters with 128 residual channels.
In this work, we present WaveFlow, a compact flow-based model for raw audio. Specifically, we make the following contributions:
1. WaveFlow is trained with maximum likelihood without density distillation and auxiliary losses used in Parallel WaveNet (van den Oord et al., 2018) and ClariNet (Ping et al., 2019), which simplifies the training pipeline and reduces the cost of development.
2. WaveFlow squeezes the 1-D raw waveforms into a 2-D matrix and produces the whole audio within a fixed sequential steps. It also provides a unified view of flow-based models for raw audio and allows us to explicitly trade inference efficiency for model capacity. We implement WaveFlow with a dilated 2-D convolutional architecture (Yu and Koltun, 2015), and it includes both Gaussian WaveNet (Ping et al., 2019) and WaveGlow (Prenger et al., 2019) as special cases.
3. We systematically study the likelihood-based generative models for raw audios in terms of test likelihood and speech quality. We demonstrate that WaveFlow can obtain comparable likelihood and synthesize high-fidelity speech as WaveNet (van den Oord et al., 2016), while only requiring a few sequential steps to generate very long waveforms.
4. Our small-footprint WaveFlow has only 5.91M parameters and synthesizes 22.05 kHz highfidelity speech (MOS: 4.32) more than 40× faster than real-time on a Nvidia V100 GPU. In contrast, WaveGlow (Prenger et al., 2019) requires 87.8M parameters for generating high-fidelity speech. The small memory footprint is preferred in production TTS systems, especially for on-device deployment.
We organize the rest of the paper as follows. Section 2 reviews the flow-based models with autoregressive and bipartite transformations. We present WaveFlow in Section 3 and discuss related work in Section 4. We report experimental results in Section 5 and conclude the paper in Section 6.

heading: 2 FLOW-BASED GENERATIVE MODELS

text:
Flow-based models (Dinh et al., 2014; 2017; Rezende and Mohamed, 2015) transform a simple density of latent variables p(z) (e.g., isotropic Gaussian) into a complex data distribution p(x) by applying a bijection x = f(z), where x and z are both n-dimensional. The probability density of x can be obtained through the change of variables formula:
p(x) = p(z) ∣∣∣∣det(∂f−1(x)∂x )∣∣∣∣ , (1)
where z = f−1(x) is the inverse transformation, and det (∂f−1(x)
∂x
) is the determinant of its Jacobian.
In general, it takes O(n3) to compute the determinant, which is not scalable to high-dimensional data. There are two notable groups of flow-based models with triangular Jacobians and tractable determinants. They are based on autoregressive and bipartite transformations, respectively.

heading: 2.1 AUTOREGRESSIVE TRANSFORMATION

text:
The autoregressive flow (AF) and inverse autoregressive flow (IAF) (Kingma et al., 2016; Papamakarios et al., 2017) use autoregressive transformations. Specifically, AF defines the inverse transformation z = f−1(x;ϑ) as:
zt = xt · σt(x<t;ϑ) + µt(x<t;ϑ), (2)
where the shifting variables µt(x<t;ϑ) and scaling variables σt(x<t;ϑ) are modeled by an autoregressive architecture parameterized by ϑ (e.g., WaveNet). Note that, the t-th variable zt only depends on x≤t, thus the Jacobian is a triangular matrix as illustrated in Figure 1(a) and its determinant
is the product of the diagonal entries: det ( ∂f−1(x) ∂x ) = ∏ t σt(x<t;ϑ). The density p(x) can be
easily evaluated by change of variables formula, because z = f−1(x) can be computed in parallel from Eq. (2) (i.e., the required O(n) operations can be done in O(1) time on modern GPU hardware). However, AF has to do sequential synthesis, because the forward transformation x = f(z) is autoregressive: xt =
zt−µt(x<t;ϑ) σt(x<t;ϑ)
. In contrast, IAF uses an autoregressive transformation for z = f−1(x):
zt = xt − µt(z<t;ϑ) σt(z<t;ϑ) , (3)
making density evaluation impractically slow for training, but it can do parallel synthesis by xt = zt · σt(z<t;ϑ) + µt(z<t;ϑ). Parallel WaveNet (van den Oord et al., 2018) and ClariNet (Ping et al., 2019) are based on IAF, which lacks efficient density evaluation and relies on distillation from a pretrained autoregressive WaveNet.

heading: 2.2 BIPARTITE TRANSFORMATION

text:
RealNVP (Dinh et al., 2017) and Glow (Kingma and Dhariwal, 2018) use bipartite transformation by partitioning the data x into two groups xa and xb, where the indices sets a ∪ b = {1, · · · , n} and a ∩ b = φ. Then, the inverse transformation z = f−1(x,θ) is defined as:
za = xa, zb = xb · σb(xa;θ) + µb(xa;θ). (4)
where the shifting variables µb(xa;θ) and scaling variables σb(xa;θ) are modeled by a feed-forward neural network. The Jacobian ∂f
−1(x) ∂x is a special triangular matrix as illustrated in Figure 1 (b). By
definition, the forward transformation x = f(z,θ) is,
xa = za, xb = zb − µb(xa;θ) σb(xa;θ) , (5)
and can also be done in parallel. As a result, the bipartite transformation provides both parallel density evaluation and parallel synthesis. In previous work, WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) both squeeze the adjacent audio samples on the channel dimension, and apply the bipartite transformation on the partitioned channel dimension.

heading: 2.3 CONNECTIONS

text:
It is worthwhile to mention that the autoregressive transformation is more expressive than bipartite transformation in general. As illustrated in Figure 1(a) and (b), the autoregressive transformation introduces n×(n−1)2 complex non-linear dependencies (dark-blue cells) and n linear dependencies between data x and latents z. In contrast, bipartite transformation introduces only n 2
4 non-linear
dependencies and n2 linear dependencies. Indeed, one can reduce an autoregressive transformation z = f−1(x;ϑ) to a bipartite transformation z = f−1(x;θ) by: (i) picking an autoregressive order o such that all of the indices in set a rank early than the indices in b, and (ii) setting the shifting and scaling variables as,
µt(x<t;ϑ) = { 0 for t ∈ a µt(xa;θ) for t ∈ b , σt(x<t;ϑ) = { 1 for t ∈ a σt(xa;θ) for t ∈ b .
Given the less expressive building block, the bipartite transformation-based flows generally require many more layers and larger hidden size to match the capacity of a compact autoregressive models (e.g., as measured by test likelihood) (Kingma and Dhariwal, 2018; Prenger et al., 2019).

heading: 3 WAVEFLOW

text: In this section, we present WaveFlow and its implementation with dilated 2-D convolutions.

heading: 3.1 DEFINITION

text:
We denote the high dimensional 1-D waveform as x = {x1, · · · , xn}. We first squeeze x into a h-row 2-D matrix X ∈ Rh×w by column-major order, where w = nh and adjacent samples are in the same column. We assume Z ∈ Rh×w are sampled from an isotropic Gaussian, and define the inverse transformation Z = f−1(X; Θ) as,
Zi,j = σi,j(X<i,•; Θ) ·Xi,j + µi,j(X<i,•; Θ), (6)
where X<i,• represents all elements above i-th row (see Figure 2 for an illustration). Note that, i) the receptive fields over the squeezed inputs X for computing Zi,j in WaveFlow is strictly larger than that of WaveGlow when h > 2. ii) WaveNet is equivalent to an autoregressive flow with column-major order on the squeezed inputs X . iii) Both WaveFlow and WaveGlow look at future waveform samples in original x for computing Zi,j , whereas WaveNet can not. iv) The autoregressive flow with row-major order has larger receptive fields than WaveFlow and WaveGlow.
The shifting variables µi,j(X<i,•; Θ) and scaling variables σi,j(X<i,•; Θ) in Eq. (6) are modeled by a 2-D convolutional neural network detailed in Section 3.2. By definition, the variable Zi,j only depends on the current Xi,j and previous X<i,• in raw-major order, thus the Jacobian is a triangular matrix and its determinant is:
det
( ∂f−1(X)
∂X
) = h∏ i=1 w∏ j=1 σi,j(X<i,•; Θ). (7)
As a result, the log-likelihood can be calculated in parallel by change of variable formula in Eq. (1),
log p(X) = − h∑ i=1 w∑ j=1 ( Z2i,j + 1 2 log(2π) ) + h∑ i=1 w∑ j=1 log σi,j(X<i,•; Θ), (8)
and one can do maximum likelihood training efficiently. At synthesis, one may first sample Z from the isotropic Gaussian and apply the forward transformation X = f(Z; Θ):
Xi,j = Zi,j − µi,j(X<i,•; Θ)
σi,j(X<i,•; Θ) , (9)
which is only autoregressive on height dimension. Thus, it requires h sequential steps to generate the whole waveform X . In practice, a small h (e.g., 8 or 16) works well, thus we can generate very long waveforms within a few sequential steps.

heading: 3.2 IMPLEMENTATION WITH DILATED 2-D CONVOLUTIONS

text:
In this work, we implement WaveFlow with a dilated 2-D convolutional architecture. Specifically, we use a stack of 2-D convolution layers (e.g., 8 layers in all experiments) to model the shifting variables µi,j(X<i,•; Θ) and scaling variables σi,j(X<i,•; Θ) in Eq. (6). We use the similar architecture as
WaveNet (van den Oord et al., 2016) by replacing the dilated 1-D convolution to 2-D convolution (Yu and Koltun, 2015), while still keeping the gated-tanh nonlinearities, residual connections and skip connections.
We set the filter sizes as 3 for both height and width dimensions. We use non-causal convolutions on width dimension and set the dilation cycle as [1, 2, 4, · · · , 27]. The convolutions on height dimension are causal with an autoregressive constraint, and their dilation cycle needs to be designed carefully. In practice, we find the following rules of thumb are important to obtain good results:
• As motivated by the dilation cycle of WaveNet (van den Oord et al., 2016), the dilations of 8 layers should be set as d = [1, 2, · · · , 2s, 1, 2, · · · , 2s, · · · ], where s ≤ 7. 3
• The receptive field r over the height dimension should be larger than the squeezed height h. Otherwise, it explicitly introduces unnecessary conditional independence and leads to lower likelihood (see Table 1 for an example). Note that, the receptive field of a stack of dilated convolutional layers is: r = (k−1)× ∑ i di+1, where k is the filter size and di is the dilation
at i-th layer. Thus, the sum of dilations should satisfy: ∑ i di ≥ h−1 k−1 . However, when h is
larger than or equal to 28 = 512, we simply set the dilation cycle as [1, 2, 4, · · · , 27]. • When the receptive field r has already been larger than h, we find that convolutions with
smaller dilation and fewer holes provide larger likelihood.
We summarize the heights and preferred dilations in our experiments in Table 2. Note that, WaveFlow becomes fully autoregressive when we squeeze x by its length (i.e. h = n) and set its filter size as 1 over the width dimension, which is equivalent to a Gaussian WaveNet learned by MLE (Ping et al., 2019). If we squeeze x by h = 2 and set the filter size as 1 on the height dimension, WaveFlow becomes a bipartite flow and is equivalent to WaveGlow with squeezed channels 2.

heading: 3.3 CONDITIONAL GENERATION

text:
In neural speech synthesis, a neural vocoder (e.g., WaveNet) synthesizes the time-domain waveforms. It can be conditioned on linguistic features (van den Oord et al., 2016; Arık et al., 2017a), the mel-spectrograms from a text-to-spectrogram model (Ping et al., 2018; Shen et al., 2018), or the
3We did try different setups, but they all lead to worse likelihood scores.
learned hidden representation within a text-to-wave architecture (Ping et al., 2019). In this work, we test WaveFlow by conditioning it on ground truth mel-spectrograms as in previous work (Prenger et al., 2019; Kim et al., 2019). The mel-spectrogram is upsampled to the same resolution as waveform samples by transposed 2-D convolutions (Ping et al., 2019). To aligned with the squeezed waveform, they are squeezed to the shape c × h × w, where c is the feature dimension (e.g, bands of the spectrogram). After a 1× 1 convolution mapping the features to residual channels, they are added as the bias term at each layer (van den Oord et al., 2016).

heading: 3.4 STACKING MULTIPLE FLOWS WITH PERMUTATIONS OVER HEIGHT DIMENSION

text:
Flow-based models require a series of transformations until the distribution p(X) reaches a desired level of complexity (e.g., Rezende and Mohamed, 2015). We let X = Z(n) and repeatedly apply the transformation Z(i−1) = f−1(Z(i); Θ(i)) defined in Eq. (6) from Z(n) → . . . Z(i) → . . . Z(0). We assume Z(0) is from the isotropic Gaussian distribution. The likelihood p(X) can be evaluated by iteratively applying the chain rule:
p(X) = p(Z(0)) n∏ i=1 ∣∣∣∣det(∂f−1(Z(i); Θ(i))∂Z(i) )∣∣∣∣ .
We find that permuting each Z(i) over the height dimension after each transformation can significantly improve the likelihood scores. In particular, we test two permutation strategies for WaveFlow models stacked with 8 flows (i.e., X = Z(8)) in Table 3: (i) we reverse each Z(i) over the height dimension after each transformation, and (ii) we reverse Z(7), Z(6), Z(5), Z(4) over the height dimension as before, but split Z(3), Z(2), Z(1), Z(0) in the middle of the height dimension then reverse each part respectively. 4 Note that, one also needs to permute the conditioner on the height dimension accordingly, which is aligned with Z(i). From Table 3, both (i) and (ii) significantly outperform the model without permutations mainly because of bidirectional modeling. Strategy (ii) outperforms (i) because of its diverse autoregressive orders.

heading: 4 RELATED WORK

text:
Deep neural networks for speech synthesis (a.k.a. text-to-speech) have received a lot of attention. Over the past few years, several neural text-to-speech (TTS) systems have been introduced, including WaveNet (van den Oord et al., 2016), Deep Voice (Arık et al., 2017a), Deep Voice 2 (Arık et al., 2017b), Deep Voice 3 (Ping et al., 2018), Tacotron (Wang et al., 2017), Tacotron 2 (Shen et al., 2018), Char2Wav (Sotelo et al., 2017), VoiceLoop (Taigman et al., 2018), WaveRNN (Kalchbrenner et al., 2018), ClariNet (Ping et al., 2019), Transformer TTS (Li et al., 2019), ParaNet (Peng et al., 2019) and FastSpeech (Ren et al., 2019).
Neural vocoders, such as WaveNet, play the most important role in recent advances of speech synthesis. In previous work, the state-of-the-art neural vocoders are autoregressive models (van den Oord et al., 2016; Mehri et al., 2017; Kalchbrenner et al., 2018). Several engineering endeavors have been advocated for speeding up their sequential generation process (Arık et al., 2017a; Kalchbrenner et al., 2018). In particular, Subscale WaveRNN (Kalchbrenner et al., 2018) folds a long waveform sequence x1:n into a batch of shorter sequences and can produces up to 16 samples per step, thus it requires at least n16 steps to generate the whole audio. Note that, this is different from the proposed WaveFlow, which can generate x1:n within a fixed number of steps (e.g., 16). Most recently, flowbased models have been successfully applied for parallel waveform synthesis with comparable fidelity
4After split & reverse operations, the height dimension [0, · · · , h 2 − 1, h 2 , · · · , h− 1] becomes [h 2 − 1, · · · ,
0, h− 1, · · · , h 2 ].
as autoregressive models (van den Oord et al., 2018; Ping et al., 2019; Prenger et al., 2019; Kim et al., 2019; Yamamoto et al., 2019; Serrà et al., 2019). Among these models, WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) have a simple training pipeline as they solely use the maximum likelihood objective. However, both of them are less expressive than autoregressive models as indicated by their lower likelihood scores.
Flow-based models can either represent the approximate posteriors for variational inference (Rezende and Mohamed, 2015; Kingma et al., 2016; Berg et al., 2018), or can be trained directly on data using the change of variables formula (Dinh et al., 2014; 2017; Kingma and Dhariwal, 2018; Grathwohl et al., 2018). In previous work, Glow (Kingma and Dhariwal, 2018) extends RealNVP (Dinh et al., 2017) with invertible 1× 1 convolution, and can generate high quality images. Later on, Hoogeboom et al. (2019) generalizes the 1× 1 convolution to invertible d× d convolutions which operate both channel and spatial axes.

heading: 5 EXPERIMENT

text:
In this section, we compare likelihood-based generative models for raw audio in term of test likelihood, speech quality and synthesis speed.
Data: We use the LJ speech dataset (Ito, 2017) containing about 24 hours of audio with a sampling rate of 22.05kHz recorded on a MacBook Pro in a home enviroment. It consists of 13, 100 audio clips of a single female speaker reading passages from 7 non-fiction books.
Models: We evaluate several likelihood-based generative models, including Gaussian WaveNet, WaveGlow, WaveFlow and autoregressive flow (AF). As in Section 3.2, we implement autoregressive flow from WaveFlow by squeezing the waveforms by its length and setting the filter size as 1 for width dimension. Both WaveNet and AF have 30 layers with dilation cycle [1, 2, · · · , 512] and filter size 3. For WaveGlow and WaveFlow, we investigate different setups, including the number of flows, size of residual channels, and squeezed height h.
Conditioner: We use the 80-band mel-spectrogram of the original audio as the conditioner for WaveNet, WaveGlow, and WaveFlow. We use FFT size 1024, hop size 256, and window size 1024. For WaveNet and WaveFlow, we upsample the mel conditioner 256 times by applying two layers of transposed 2-D convolution (in time and frequency) interleaved with leaky ReLU (α = 0.4). The upsampling strides in time are 16 and the 2-D convolution filter sizes are [32, 3] for both layers. For WaveGlow, we directly use the open source implementation. 5
Training: We train all models on 8 Nvidia 1080Ti GPUs using randomly chosen short clips of 16, 000 samples from each utterance. For WaveFlow and WaveNet, we use the Adam optimizer (Kingma and Ba, 2015) with a batch size of 8 and a constant learning rate of 2× 10−4. For WaveGlow, we use the Adam optimizer with a batch size of 16 and a learning rate of 1× 10−4. We applied weight normalization (Salimans and Kingma, 2016) whenever possible.

heading: 5.1 LIKELIHOOD

text:
The test log-likelihoods (LLs) of all models are evaluate at 1M training steps. Note that, i) all of the LLs decrease slowly after 1M steps and ii) it took one month to train the largest WaveGlow (residual channels = 512) for 1M steps. Thus, we chose 1M as the cut-off to compare these models. We summarize the results in Table 4 with models from row (a) to (t). We draw the following observations:
• Stacking a large number of flows improves LLs for WaveFlow, autoregressive flow, and WaveGlow. For example, (m) WaveFlow with 8 flows provide larger LL than (l) WaveFlow with 6 flows. The (b) autoregressive flow obtains the highest likelihood and even outperforms (a) WaveNet with the same amount of parameters. Indeed, AF provides bidirectional modeling by stacking 3 flows interleaved with reverse operations.
• WaveFlow has much larger likelihood than WaveGlow with comparable number of parameters. In particular, a small-footprint (k) WaveFlow has only 5.91M parameters but can provide comparable likelihood (5.023 vs. 5.026) as the largest (g) WaveGlow with 268.29M parameters.
5https://github.com/NVIDIA/waveglow

heading: 5.2 SPEECH FIDELITY AND SYNTHESIS SPEED

text:
We train WaveNet for 1M steps. We train WaveGlow and WaveFlow for 2M steps with small residual channels (64, 96 and 128). We train larger models (res. channels 256 and 512) for 1M steps due to the practical time constraint. At synthesis, we sampled Z from an isotropic Gaussian with standard deviation 1.0 and 0.6 (default) for WaveFlow and WaveGlow, respectively. For WaveFlow and WaveGlow, we run synthesis under NVIDIA Apex with 16-bit floating point (FP16) arithmetic, which does not introduce any degradation of audio fidelity and brings about 2× speedup. We use the crowdMOS tookit (Ribeiro et al., 2011) for naturalness evaluation, where test utterances from these models were presented to workers on Mechanical Turk. We also test the synthesis speed on a Nvidia V100 GPU without using any customized inference kernels. We only implement convolution queues (Paine et al., 2016) in Python to cache the intermediate hidden states within WaveFlow for autoregressive inference over the height dimension, which brings about 4× speedup. We use the permutation strategy (ii) described in Section 3.4 for WaveFlow.
We report the 5-scale Mean Opinion Score (MOS), synthesis speed and model footprint in Table 5. We draw the following observations:
• The small WaveFlow (res. channels 64) has 5.91M parameters and can synthesize 22.05 kHz high-fidelity speech (MOS: 4.32) 42.60× faster than real-time. In contrast, the speech quality of small WaveGlow (res. channels 64) is significantly worse (MOS: 2.17). Indeed, WaveGlow (res. channels 256) requires 87.88M parameters for generating high-fidelity speech.
• The large WaveFlow (res. channels 256) outperforms the same size WaveGlow in terms of speech fidelity (MOS: 4.43 vs. 4.34). It also matches the state-of-the-art WaveNet while gener-

heading: 6 CONCLUSION

text: We propose WaveFlow, a compact flow-based model for raw audio, which can be directly trained with maximum likelihood estimation. It provides a unified view of flow-based models for time-domain waveforms, and includes WaveNet and WaveGlow as special cases. WaveFlow requires a small number of sequential steps to generate high-fidelity speech and obtains likelihood comparable to WaveNet. In the end, our small-footprint WaveFlow can generate 22.05kHz high-fidelity speech more than 40× faster than real-time on a GPU without engineered inference kernels.

title: WAVEFLOW: A COMPACT FLOW-BASED MODEL