DISCO Nets: DISsimilarity COefficient Networks
Diane Bouchacourt, M. Pawan Kumar, Sebastian Nowozin
Introduction
Related Work
Deep neural networks, and in particular, Convolutional Neural Networks (CNNs) are comprised of several convolutional layers, followed by one or more fully connected (dense) layers, interleaved by non-linear function(s) and (optionally) pooling. Recent probabilistic models use CNNs to represent non-linear functions of the data. We observe that such models separate into two types. The first type of model does not explicitly compute the probability distribution of interest. Rather, these models allow the user to sample from this distribution by feeding the CNN with some noise . Among such models, Generative Adversarial Networks (GAN) presented in Goodfellow et al. are very popular and have been used in several computer vision applications, for example in Denton et al. , Springenberg , Radford et al. and Yan et al. . A GAN model consists of two networks, simultaneously trained in an adversarial manner. A generative model, referred as the Generator G, is trained to replicate the data from noise, while an adversarial discriminative model, referred as the Discriminator D, is trained to identify whether a sample comes from the true data or from G. The GAN training objective is based on a minimax game between the two networks and approximately optimizes a Jensen-Shannon divergence. However, as mentioned in Goodfellow et al. and Radford et al. , GAN models require very careful design of the networks’ architecture. Their training procedure is tedious and tends to oscillate. GAN models have been generalized to conditional GAN (cGAN) in Mirza and Osindero , where some additional input information can be fed to the Generator and the Discriminator. For example in Mirza and Osindero a cGAN model generates tags corresponding to an image. Gauthier applies cGAN to face generation. Reed et al. propose to generate images of flowers with a cGAN model, where the conditional information is a word description of the flower to generateAt the time writing, we do not have access to the full paper of Reed et al. and therefore cannot take advantage of this work in our experimental comparison.. While the application of cGAN is very promising, little quantitative evaluation has been done. Furthermore, cGAN models suffer from the same difficulties we mentioned for GAN. Another line of work has developed towards the use of statistical hypothesis testing to learn probabilistic models. In Dziugaite et al. and Li et al. , the authors propose to train generative deep networks with an objective function based on the Maximum Mean Discrepancy (MMD) criterion. The MMD method (see Gretton et al. ) is a statistical hypothesis test assessing if two probabilistic distributions are similar. As mentioned in Dziugaite et al. , the MMD test can been seen as playing the role of an adversary. The second type of model approximates intractable posterior distributions with use of variational inference. The Variational Auto-Encoders (VAE) presented in Kingma and Welling is composed of a probabilistic encoder and a probabilistic decoder. The probabilistic encoder is fed with the input and produces a posterior distribution over the possible values of noise that could have generated . The probabilistic decoder learns to map the noise back to the data space . The training of VAE uses an objective function based on a Kullback-Leibler Divergence. VAE and GAN models have been combined in Makhzani et al. , where the authors propose to regularise autoencoders with an adversarial network. The adversarial network ensures that the posterior distribution matches an arbitrary prior . In hand pose estimation, imagine the user wants to obtain accurate positions of the thumb and the index finger but does not need accurate locations of the other fingers. The task loss might be based on a weighted L2-norm between the predicted and the ground-truth poses, with high weights on the thumb and the index. Existing probabilistic models cannot be tailored to task-specific losses and we propose the DISsimilarity COefficient Networks (DISCO Nets) to alleviate this deficiency.
DISCO Nets
We begin the description of our model by specifying how it can be used to generate samples from the posterior distribution, and how the samples can in turn be employed to provide a pointwise estimate. In the subsequent subsection, we describe how to estimate the parameters of the model.
A DISCO Net consists of several convolutional and dense layers (interleaved by non-linear function(s) and possibly pooling) and takes as input a pair , where is input data and is some random noise. Given one pair , the DISCO Net produces a value for the output . In the example of hand pose estimation, the input depth image is fed to the convolutional layers. The output of the last convolutional layer is flattened and concatenated with a noise sample . The resulting vector is fed to several dense layers, and the last dense layer outputs a pose . From a single depth image , by using different noise samples, the DISCO Net produces different pose candidates for the depth image. This process is illustrated in Figure 2. Importantly, DISCO Nets are flexible in the choice of the architecture. For example, the noise could be concatenated at any stage of the network, including at the start.
Pointwise Prediction.
In order to obtain a single prediction for a given input , DISCO Nets use the principle of Maximum Expected Utility (MEU), similarly to Premachandran et al. . The prediction maximises the expected utility, or rather minimises the expected task-specific loss , estimated using the sampled candidates. Formally, the prediction is made as follows:
where are the candidate outputs sampled for the single input . Details on the MEU method are in the supplementary material.
2 Learning DISCO Nets
We want DISCO Nets to accurately model the true probability via . In other words, should be as similar as possible to . This similarity is evaluated with respect to the loss specific to the task at hand. Given any non-negative symmetric loss function between two outputs with , we employ a diversity coefficient that is the expected loss between two samples drawn randomly from the two distributions. Formally, the diversity coefficient is defined as:
Intuitively, we should minimise so that is as similar as possible to . However there is uncertainty on the output to predict for a given . In other words, is diverse and should be diverse as well. Thus we encourage to provide sample outputs, for a given , that are diverse by minimising the following dissimilarity coefficient:
with . The dissimilarity is the difference between the diversity between and , and an affine combination of the diversity of each distribution, given . These coefficients were introduced by Rao with and used for latent variable models by Kumar et al. . We do not need to consider the term as it is a constant in our problem, and thus the DISCO Nets objective function is defined as follows:
When minimising , the term encourages to be diverse. The value of balances between the two goals of that are providing accurate outputs while being diverse.
Optimisation.
Let us consider a training dataset composed of examples input-output pairs . In order to train DISCO Nets, we need to compute the objective function of equation (4). We do not have knowledge of the true probability distributions and . To overcome this deficiency, we construct estimators of each diversity term and . First, we take an empirical distribution of the data, that is, taking ground-truth pairs . We then estimate each distribution by sampling outputs from our model for each . This gives us an unbiased estimate of each diversity term, defined as:
We have an unbiased estimate of the DISCO Nets’ objective function of equation (4):
where is a candidate output sampled from DISCO Nets for (,), and are the parameters of DISCO Nets. It is important to note that the second term of equation is summing over and to have an unbiased estimate, therefore we compute the loss between pairs of different samples and . The parameters are learned by Gradient Descent. Algorithm 1 shows the training of DISCO Nets. In steps 4 and 5 of Algorithm 1, we draw random noise vectors per input example , and generate candidate outputs per input. This allow us to compute an unbiased estimate of the gradient in step 7. For clarity, in the remainder of the paper we do not explicitely write the parameters and write .
3 Strictly Proper Scoring Rules.
A scoring rule , as defined in Gneiting and Raftery , evaluates the quality of a predictive distribution with respect to a true distribution . When using a scoring rule one should ensure that it is proper, which means it is maximised when . A scoring rule is said to be strictly proper if is the unique maximiser of . Hence maximising a proper scoring rule ensures that the model aims at predicting relevant forecast. Gneiting and Raftery define score divergences corresponding to a proper scoring rule S:
If is proper, is a valid non-negative divergence function, with value 0 if (and only if, in the case of strictly proper) . For example the MMD criterion (see Gretton et al. ) mentioned in Section 2 is an example of this type of divergence. In our case, any loss expressed with an universal kernel will define the DISCO Nets’ objective function as such divergence (see Zawadzki and Lahaie ). For example, by Theorem 5 of Gneiting and Raftery , if we take as loss function with excluding 0 and 2, our training objective is (the negative of) a strictly proper scoring rule, that is:
This score has been referred in the litterature as the Energy Score in Gneiting et al. , Pinson and Tastu , Gneiting and Raftery . By employing a (strictly) proper scoring rule we ensure that our objective function is (only) minimised at the true distribution , and expect DISCO Nets to generalise better on unseen data. We show below that strictly proper scoring rules are also relevant to assess the quality of the distribution captured by the model.
Discriminative power of proper scoring rules.
As observed in Fukumizu et al. , kernel density estimation (KDE) fails in high dimensional output spaces. Our goal is to compare the quality of the distribution captured between two models, and . In our setting better models than according to the scoring rule and its associated divergence if . As noted in Pinson and Tastu , being proper does not ensure for all observations drawn from . However if the scoring rule is strictly proper scoring rule, this property should be ensured in the neighbourhood of the true distribution.
Experiments : Hand Pose Estimation
Given a depth image , which often contains occlusions and missing values, we wish to predict the hand pose . We use the NYU Hand Pose dataset of Tompson et al. to estimate the efficiency of DISCO Nets for this task.
The NYU Hand Pose dataset of Tompson et al. contains 8252 testing and 72,757 training frames of captured RGBD data with ground-truth hand pose information. The training set is composed of images of one person whereas the testing set gathers samples from two persons. For each frame, the RGBD data from 3 Kinects is provided: a frontal view and 2 side views. In our experiments we use only the depth data from the frontal view. While the ground truth contains J = 36 annotated joints, we follow the evaluation protocol of Oberweger et al. and use the same subset of J = 14 joints. We also perform the same data preprocessing as in Oberweger et al. , and extract a fixed-size metric cube around the hand from the depth image. We resize the depth values within the cube to a patch and normalized them in $$. Pixels deeper than the back of the cube and missing depth values are both set to a depth of 1.
Methods.
We employ loss functions between two outputs of the form of the Energy score (8), that is, . Our first goal is to assess the advantages of DISCO Nets with respect to non-probabilistic deep networks. One model, referred as , is a DISCO Nets probabilistic model, with in the dissimilarity coefficient of equation (6). When taking , noise is injected and the model capacity is the same as . The model , is a non-probabilistic model, by taking in the objective function of equation (6) and no noise is concatenated. This corresponds to a classic deep network which for a given input generates a single output . Note that we write and not since no noise is concatenated.
Evaluation Metrics.
We report classic non-probabilistic metrics for hand pose estimation employed in Oberweger et al. and Taylor et al. , that are, the Mean Joint Euclidean Error (MeJEE), the Max Joint Euclidean Error (MaJEE) and the Fraction of Frames within distance (FF). We refer the reader to the supplementary material for detailed expression of these metrics. These metrics use the Euclidean distance between the prediction and the ground-truth and require a single pointwise prediction. This pointwise prediction is chosen with the MEU method among candidates. We added the probabilistic metric ProbLoss. ProbLoss is defined as in Equation 8 with the Euclidean norm and is the divergence associated with a strictly proper scoring rule. Thus, ProbLoss ranks the ability of the models to represent the true distribution. ProbLoss is computed using candidate poses for a given depth image. For the non-probabilistic model , only a single pointwise predicted output is available. We construct the candidates by adding some Gaussian random noise of mean and diagonal covariance , with and refer to the model as . We also evaluate the non-probabilistic model using its pointwise prediction rather than the MEU method. Results are consistent and detailed in the supplementary material.
Loss functions.
As we employ standard evaluation metrics based on the Euclidean norm, we train with the Euclidean norm (that is, with ). When our objective function coincides with ProbLoss.
Architecture.
Training.
We use 10,000 examples from the 72,757 training frames to construct a validation dataset and train only on 62,757 examples. Back-propagation is used with Stochastic Gradient Descent with a batchsize of . The learning rate is fixed to and we use a momentum of (see Polyak ). We also add L2-regularisation controlled by the parameter . We use which is a relevant range as the comparative model is best performing for . Note that DISCO Nets report consistent performances across the different values , contrarily to . We use 3 different random seeds to initialize each model network parameters. We report the performance of each model with its best cross-validated seed and . We train all models for 400 epochs as it results in a change of less than in the value of the loss on the validation dataset for . We refer the reader to the supplementary material for details on the setting.
2 Results.
Table LABEL:tab1 reports performances on the test dataset, with parameters cross-validated on the validation set. All versions of the DISCO Net model outperform the model. Among the different values of , we see that better captures the true distribution (lower ProbLoss) while retaining accurate performance on the standard pointwise metrics. Interestingly, using an all-zero noise at test-time gives similar performances on pointwise metrics. We link this to the observation that both the MEAN and the MEU method perform equivalently on these metrics (see supplementary material).
Qualitative Evaluation.
In Figure 3 we show candidate poses generated by for 3 testing examples. The left image shows the input depth image, and the right image shows the ground-truth pose (in grey) with 100 candidate outputs (superimposed in transparent red). The model predict the joint locations and we interpolate the joints with edges. If an edge is thinner and more opaque, it means the different predictions overlap and that the uncertainty on the location of the edge’s joints is low. We can see that captures relevant information on the structure of the hand.
Figure 4 shows the matrices of Pearson product-moment correlation coefficients between joints. We note that DISCO Net with better captures the correlation between the joints of a finger and between the fingers.
3 Comparison with existing probabilistic models.
To the best of our knowledge the conditional Generative Adversarial Networks (cGAN) from Mirza and Osindero has not been applied to pose estimation. In order to compare cGAN to DISCO Nets, several issues must be overcome. First, we must design a network architecture for the Discriminator. This is a first disadvantage of cGAN compared to DISCO Nets which require no adversary. Second, as mentioned in Goodfellow et al. and Radford et al. , GAN (and thus cGAN) require very careful design of the networks’ architecture and training procedure. In order to do a fair comparison, we followed the work in Mirza and Osindero and practical advice for GAN presented in Larsen and Sønderby . We try (i) cGAN, initialising all layers of D and G randomly, and (ii) initialising the convolutional layers of G and D with the trained best-performing of Section 4.2, and keeping these layers fixed. That is, the convolutional parts of G and D are fixed feature extractors for the depth image. This is a setting similar to the one employed for tag-annotation of images in Mirza and Osindero . Details on the setting can be found in the supplementary material. Table LABEL:cgantab shows that the cGAN model obtains relevant results only when the convolutional layers of G and D are initialised with our trained model and kept fixed, that is . These results are still worse than DISCO Nets performances. While there may be a better architecture for cGAN, our experiments demonstrate the difficulty of training cGAN over DISCO Nets.
4 Reference state-of-the-art values.
We train the best-performing of Section 4.2 on the entire dataset, and compare performances with state-of-the-art methods in Table 4 and Figure 5. These state-of-the-art methods are specifically designed for hand pose estimation. In Oberweger et al. a constrained prior hand model, referred as NYU-Prior, is refined on each hand joint position to increase accuracy, referred as NYU-Prior-Refined. In Oberweger et al. , the input depth image is fed to a first network NYU-Init, that outputs a pose used to synthesize an image with a second network. The synthesized image is used with the input depth image to derive a pose update. We refer to the whole model as NYU-Feedback. On the contrary, DISCO Nets uses a single network whose architecture is similar to NYU-Prior (without constraining on a pose prior). By accurately modeling the distribution of the pose given the depth image, DISCO Nets obtain comparable performances to NYU-Prior and NYU-Prior-Refined. Without any extra effort, DISCO Nets could be embedded in the presented refinement and feedback methods, possibly boosting state-of-the-art performances. Table 4: DISCO Nets compared to state-of-the-art performances SEM. Model MeJEE (mm) MaJEE (mm) FF (80mm) NYU-Prior 20.70.150 44.80.289 91.190 NYU-Prior-Refined 19.70.157 44.70.327 88.148 NYU-Init 27.40.152 55.40.265 86.537 NYU-Feedback 16.00.096 36.10.208 97.334 20.70.121 45.10.246 93.250 Figure 5: Fractions of frames within distance (by 5 mm). Best viewed in color.
Discussion.
We presented DISCO Nets, a new family of probabilistic model based on deep networks. DISCO Nets employ a prediction and training procedure based on the minimisation of a dissimilarity coefficient. Theoretically, this ensures that DISCO Nets accurately capture uncertainty on the correct output to predict given an input. Experimental results on the task of hand pose estimation consistently support our theoretical hypothesis as DISCO Nets outperform non-probabilistic equivalent models, and existing probabilistic models. Furthermore, DISCO Nets can be tailored to the task to perform. This allows a possible user to train them to tackle different problems of interest. As their novelty resides mainly in their objective function, DISCO Nets do not require any specific architecture and can be easily applied to new problems. We contemplate several directions for future work. First, we will apply DISCO Nets to other prediction problems where there is uncertainty on the output. Second, we would like to extend DISCO Nets to latent variables models, allowing us to apply DISCO Nets to diverse dataset where ground-truth annotations are missing or incomplete.
Acknowlegements.
This work is funded by the Microsoft Research PhD Scholarship Programme. We would like to thank Pankaj Pansari, Leonard Berrada and Ondra Miksik for their useful discussions and insights.