Large labeled datasets are a key component for building state-of-the-art systems in many applications of machine learning, including image recognition, machine translation, and speech recognition. Collecting such datasets can be expensive, which has driven significant research interest in unsupervised, semi-supervised, and weakly supervised learning approaches[Radford et al.2015, Kingma et al.2014, Papandreou et al.2015, Ratner et al.2016].
Constraint-based learning is a recently proposed form of weak supervision which aims to reduce the need for labeled inputs by having users supervise algorithms through general properties that hold over the label space [Shcherbatyi and Andres2016, Stewart and Ermon2017]. Examples of such properties include logical rules [Richardson and Domingos2006, Chang et al.2007, Choi et al.2015, Xu et al.2017] or physical laws [Stewart and Ermon2017, Ermon et al.2015].
Unlike labels — which only apply to their corresponding inputs — properties used in a constraint-based learning approach are specified once for the entire dataset, providing an opportunity for more cost-efficient supervision. Algorithms supervised with explicit constraints have shown promising results in object detection [Stewart and Ermon2017], preference learning [Choi et al.2015], materials science [Ermon et al.2012], and semantic segmentation [Pathak et al.2015].
However, describing the high level invariants of a dataset may also require a non-trivial amount of effort. First, designing constraints requires strong domain expertise. Second, in the case of high dimensional labels, it is difficult to encode the constraints using simple formulas. For example, suppose we want to constrain a pedestrian joint detector to produce skeletons that “look like a walking person”; in this case, it is difficult to capture invariants over human poses with simple logical or algebraic formulas that an annotator could specify. Third, constraints may change over time and across tasks; designing new constraints for new tasks may not scale in many practical applications.
In this paper, we propose an implicit approach to constraint learning, in which invariants are automatically learned from a small set of representative label samples (see Figure 1).111Please find source code in https://github.com/hyren/acl These samples do not need to be tied to corresponding inputs (as in supervised learning) and may come from a black-box simulator that abstracts away physics-based formulas or produces examples of labels collected by humans. Such simulators include physics engines, humanoid simulators from robotics, or driving simulators [Li et al.2017].
Inspired by recent advances in implicit (likelihood-free) generative modeling, we capture the distribution of outputs using an approach based on adversarial learning [Goodfellow et al.2014]. Specifically, we train two distinct learners: a primary model for the task at hand and an auxiliary classification algorithm called discriminator. During training, we constrain the main model such that its outputs cannot be distinguished by the discriminator from representative (true) label samples, thus forcing it to capture the structure of the label space. This approach forms a novel adversarial framework for performing weak supervision with learned constraints, which we call adversarial constraint learning.
Although constraint learning does not require input-label pairs, providing such pairs can improve performance and turns our problem into an instance of semi-supervised learning. In this setting, our approach combines supervised learning on a small labeled dataset with constraint learning on a large unlabeled set, where constraint learning enforces that the structure of predictions on unlabeled data matches the structure observed in the labeled data. Experimental results demonstrate that this method performs better than state-of-the-art semi-supervised learning methods on a variety of structured prediction problems.
In this section, we introduce structured prediction and constraint-based learning. The next section will expand upon these subjects to introduce the proposed adversarial constraint learning framework.
2.1 Structured Prediction
Our work focuses on structured prediction, a form of supervised learning, in which the outputs
can be a complex object such as a vector, a tree, or a graph[Koller and Friedman2009]. We capture the distribution of using a conditional probabilistic model parameterized by . A model maps each input to the corresponding output distribution , where
denotes all the probability distributions over. For example, we may take
to be a Gaussian distributionwith mean
A standard approach to learning (or as an abbreviation) is to solve an optimization problem of the form
over a labeled dataset
. A typical supervised learning objective is comprised of a loss functionand a regularization term that encourages non-degenerate solutions or solutions that incorporate prior knowledge [Stewart and Ermon2017].
2.2 Constraint-Based Learning
Collecting a large labeled dataset for supervised learning can often be tedious. Constraint-based learning is a form of weak supervision which instead asks users to specify high-level constraints over the output space, such as logical rules or physical laws [Shcherbatyi and Andres2016, Stewart and Ermon2017, Richardson and Domingos2006, Xu et al.2017]. For example, in an object tracking task where corresponds to the space of joint positions over time, we expect correct outputs to be consistent with the laws of physical mechanics.
Let be an unlabeled dataset of inputs. Formally, constraints can be specified via a function , which penalizes conditional probabilistic models that are inconsistent with known high-level structure of the label space. Learning from constraints proceeds by optimizing the following objective:
over . By solving this optimization problem, we look for a probabilistic model parameterized by that satisfies known constraints when applied to the unlabeled dataset (through the term), and is likely a priori (through the term). Note that although the constraint is data-dependent, it does not require explicit labels. For example, in object tracking we could ask that when making predictions on , joint positions over time are consistent with known kinematic equations, with measuring how the output distribution from deviates from those equations. The regularization term can be used to avoid overly complex and/or degenerate solutions, and may include , , or entropy regularization terms. Stewart and Ermon [Stewart and Ermon2017] have shown that a model learned with the objective described in Eq. 2 can learn to track objects.
3 Adversarial Constraint Learning
The process of manually specifying high level constraints, , can be time-consuming and may require significant domain expertise. Such is the case in pose estimation, where it is difficult to describe high dimensional rules for joints movements precisely; but the large availability of unpaired videos and motion capture data makes constraint learning attractive in spite of the difficulty of providing high dimensional constraints.
In the sciences, discovering general invariants is often a data-driven approach; for example, the laws of physics are often discovered by validating hypotheses with experimental results. Motivated by this, we propose in this section a novel framework for learning constraints from data.
3.1 Learning Constraints from Data
Suppose we have a dataset of inputs , a dataset of labels , and a set that describes correspondence between some elements of and . We denote the empirical distributions of , and as , and respectively. Note that can come from either a simulator (such as one based on physical rules), or from some other source of data (such as motion captures of people for which we have no corresponding videos).
Let us first consider the setting where ; i.e. there are inputs and labels but no correspondence between them. In spite of the lack of correspondences, we will see that constraints can be learned from the prior knowledge that the same underlying distribution generates both the empirical labels and the structured predictions obtained from applying our model to . These learned constraints can then be used for supervision. Let structured predictions be given by the following implicit sampling procedure:
where is a (parameterized) conditional distribution of outputs given inputs. Discarding , the above procedure corresponds to sampling from the marginal distribution over , .
Labels drawn from should have high likelihood values in , but optimizing this objective directly is computationally infeasible; evaluating the marginal likelihood exactly is expensive due to the integration over . Instead, we formulate the task of learning a constraint loss from through a likelihood-free approach using the framework of generative adversarial learning [Goodfellow et al.2014], which only requires samples from and .
We introduce an auxiliary classifier (parametrized by ) called discriminator which scores outputs in the label space . It is trained to assign high scores to representative output labels from , while assigning low scores to samples from . It learns to effectively extract latent constraints that hold over the output space and that are implicitly encoded in the samples from . The goal of is to produce outputs result in higher scores in the discriminator, satisfying the constraints imposed by in the process.
For practical reasons, we consider to be a Dirac-delta distribution , and thus we refer to the conditional probabilistic model as the mapping in the experiment section for simplicity. We train and for the following objective [Arjovsky et al.2017]
Assuming infinite capacity, Theorem 1 of [Goodfellow et al.2014] shows that at the optimal solution of Eq. 4, cannot distinguish between the given set of labels and those predicted by the model , suggesting that the latter satisfy the set of constraints defined by . Unlike in constraint-based learning where a (possibly incomplete) set of constraints is manually specified, convergence in the adversarial setting implies that the label and output distributions match on all possible discriminator projections. Figure 2(a) shows an overview of the adversarial constraint learning framework in the context of trajectory estimation.
3.2 Constraint Learning via Matching Distributions
Generative Adversarial Networks (GANs) are a prominent example of implicit probabilistic models [Mohamed and Lakshminarayanan2016] which are defined through a stochastic sampling procedure instead of an explicitly defined likelihood function. One advantage of implicit generative models is that they can be trained with methods that do not require likelihood evaluations.
Hence, our approach to learning constraints for structured prediction can also be interpreted as learning an implicit generative model that matches the empirical label distribution . Specifically, our adversarial constraint learning approach optimizes over an approximation to the optimal transport from to [Arjovsky et al.2017]; thus our constraint can be implicitly defined as “ minimizes the optimal transport from to ”.
3.3 Semi-Supervised Structured Prediction
Although our framework does not require datasets containing input-label pairs , providing it with such data gives rise to a new semi-supervised structured prediction method.
When given a set of labeled examples, we may extend our constraint learning objective (over both labeled and unlabeled data) with a standard classification loss term (over labeled data):
where is the adversarial constraint learning objective defined in Eq. 4, and
is a hyperparameter that balances between fitting to the general (implicit) label distribution (first term) and fitting to the explicit labeled dataset (second term).
Our semi-supervised constraint learning framework is different from traditional semi-supervised learning approaches, as listed in Table 1. In particular, traditional semi-supervised learning methods assume there is a large source of inputs and tend to impose regularization over , such as through latent variables [Kingma et al.2014], through outputs [Miyato et al.2017], or through another network [Salimans et al.2016]. We consider the case where there exists a source, e.g., a simulator that can provide abundant samples from the label space that are not matched to particular inputs, and impose regularization over by exploiting a discriminator that provides an implicit constraint over the predicted values. Therefore, we can also utilize sample labels that are not associated with particular inputs, instead of merely restricting to standard labeled pairs. Moreover, our method can be easily combined with existing semi-supervised learning approaches [Kingma et al.2014, Li et al.2016, Miyato et al.2017] to further boost performance.
4 Experimental Results
We evaluate the proposed framework on three structured prediction problems. First, we aim to track the angle of a pendulum in a video without labels using supervision provided by a physics-based simulator. Next, we extend the output space to higher dimensions and perform human pose estimation in a semi-supervised setting. Lastly, we evaluate our approach on multivariate time series prediction, where the goal is to predict future temperature and humidity.
A label simulator is provided for each experiment in place of hand-written constraints. Although explicit constraints for the pendulum case can be written down analytically, we demonstrate that our adversarial framework is capable of learning the constraint from data. In the other two experiments, we consider structured prediction settings where the outputs are high dimensional; in these settings, the correct constraints are very complex and hand-engineering them would be difficult. Instead, our model learns these constraints from a small number of samples provided by the simulator.
4.1 Pendulum Tracking
For this task, we aim to predict the angle of the pendulum from images in a YouTube video 222https://www.youtube.com/watch?v=02w9lSii_Hs, i.e., learn a regression mapping , where and are the height and width of the input image. Since the outputs of over consecutive frames are constrained by temporal structure (a sine wave in this case), we concatenate consecutive outputs of and form a high dimensional trajectory, thus defining . Critically, must make a separate prediction for each image, preventing from simply memorizing the output structure. Unlike previous methods [Stewart and Ermon2017], no explicit formulas are provided for supervision, and the (implicit) constraints are learned through the discriminator using samples provided by the physics simulator.
The video contains a total of 170 images, and we hold out images for evaluation. We manually observe that the pendulum completes one full oscillation approximately every 12 frames. Based on this observation, we write a simulator of these dynamics with a simple harmonic oscillator having a fixed amplitude and random sample period of 10 to 14 frames. is trained to distinguish between the output of across continuous images and a random trajectory sampled from the simulator. We implementas a 5-cell LSTM. We use in Eq. 5, and the same training procedure and hyperparameters as [Gulrajani et al.2017] across our experiments.
We manually label the horizontal position of the ball of the pendulum for each frame in the test set, and measure the correlation between the predicted positions and the ground truth labels. Since the same is applied to each input frame independently, cannot just memorize valid (i.e. simple harmonic) trajectory sequences and produce them while ignoring inputs. The model must learn to track the pendulum in order to fool the discriminator and subsequently achieve a high correlation on the test set.
Our adversarial constraint learning approach achieves a correlation of , whereas training with hand-crafted constraints achieves a marginally higher correlation of . Both approaches are trained without labels. Example predictions on the test data are shown in Figure 2. This real-world experiment demonstrates the effectiveness of constraint-based learning in the absence of labels, and suggests that using learned constraints from data is almost as effective as using ideal hand-crafted constraints.
4.2 Pose Estimation
In this experiment, we evaluate the proposed model on pose estimation, which has a significantly larger output space. We aim to learn a regression network , where denotes the number of joints to detect, and each joint has coordinates. As in the pendulum tracking experiment, is mapped across several frames to produce a trajectory that is indistinguishable from samples provided by the simulator.
We evaluate the model with videos and joint trajectories from the CMU multi-modal action database (MAD) [Huang et al.2014]. MAD contains videos of 20 subjects performing a sequence of actions in each video. We extract frames from subjects performing the “Jump and Side-Kick” action and train to detect the location of the left/right hip/knee/foot () in each frame. The processed dataset contains 35 groups (549 valid frames in total).
We divide the 35 groups of motion data into training and testing sets of 28 groups and 7 groups, respectively, where direct labels will be provided for a subset of the 28 training groups. Each group contains 14 to 17 frames, and we train on randomly selected contiguous intervals of length . Using the metric of PCK@0.1 [Yang and Ramanan2013] for evaluation, a prediction is considered correct if it lies within pixels from the true location, where and denote the height and width of the subject’s body. We evaluate with .
We first design a simulator of valid labels (joint positions) based on known kinematics of skeletons. Specifically, the anatomical shape of the subject’s legs approximately forms an expanding isosceles trapezoid when they jump and side kick. We simulate a large range of trapezoidal motions capturing these trajectories, which requires much less effort than hand engineering precise mathematical formulas to express explicit constraints. takes a single image as input and produces a dimensional vector, representing the location of joints. Critically, as in the pendulum experiment, is applied to each frame independently, and has no knowledge of the neighboring frames. The outputs of are concatenated and passed to the discriminator for training.
We construct 50 random train/test splits of the dataset and report the averaged PCK@0.1 scores for evaluation. The results are summarized in Table 2 and Figure 3, where we compare three forms of learning when labels are only available for of the training groups:
“L(i)”: vanilla supervised learning on labeled groups
“L(i)+VAT”: a baseline form of semi-supervised learning leveraging virtual adversarial training on unlabeled groups (VAT, [Miyato et al.2017])
“L(i)+ADV”: semi-supervised learning with adversarial constraint learning (Eq. 5)
When no labels are provided (“L(0)+ADV”; i.e., optimizing just ), is able to find the correct “shape” of the joints for each frame, but the predictions are biased. Since the subjects are not strictly acting in the center of the image, a constant minor shift () for all predicted joint locations still meets the requirements imposed by , which encodes the structure of the label space. This problem is addressed when providing even a very small (“i=1”) number of labeled training groups and using the semi-supervised objective . Availability of labels fixes the constant bias and we note that using adversarial training produces a massive (25-30%) boost over both the supervised and “VAT” baselines when only 1 group of labeled data is available.
With only 3 groups of labeled data (“L(3)+ADV”), adversarial constraint learning achieves a comparable performance to standard supervised learning with 7 groups of labeled inputs (“L(7)”). Adversarial constraint learning “L(i)+ADV” consistently outperforms the virtual adversarial training “L(i)+VAT” baseline for different values of . When further combined with VAT regularization in the objective, our method achieves slightly better performance.
The strong performance of our model over baselines on the pose estimation task with a few or no labels demonstrates that constraint learning can work well over high-dimensional outputs when using our proposed adversarial framework. Designing precise constraints in high-dimensional spaces is often tedious, error-prone, and restricted to one particular domain. Our method avoids these downsides by learning these constraints implicitly through data generated from a simulator, even though the simulator can be a noisy (or even slightly biased) description of the true label distribution.
|PCK@0.1(%)||Left Hip||Left Knee||Left Foot||Right Hip||Right Knee||Right Foot|
4.3 Time Series Prediction
Lastly, we validate our model on another structured prediction problem: multi-step multivariate time series prediction. In this task, we aim to learn a mapping . Given consecutive values of a series, , we aim to predict the following values, , where each has variables. In this task, learns the constraint that both holds across variables and time by distinguishing the output of from real label samples.
We conduct experiments on the SML2010 Dataset [Zamora-Martínez et al.2014], which contains humidity and temperature data of indoor and outdoor environments over 40 days at 15 minute intervals.
We hold out 8 consecutive days for testing and leave the rest for training. From the train and test set, we sample 480 and 120 groups of time series data respectively, each having length of 28 hours, and smooth each group into 7 data points at 4-hour intervals. Each group uses the first data points as input, and leaves the final values as targets for prediction, with each data point having variables representing the indoor/outdoor temperature/humidity. We measure the mean absolute error (MAE) on the test set.
We further explore the setting when not all groups in the training set are “complete”; for example, in some groups we may only have temperature information. This is reasonable in real-world scenarios where sensors fail to work properly from time to time. Hence, we use “complete groups” to denote groups with full information, and “incomplete groups” to denote groups with only temperature information. Without humidity records, we could not perform supervised learning on these “incomplete groups”, since the input requires all values. Under the context of adversarial constraint learning, however, such data can facilitate learning constraints over the temperature series. In this task, the simulator is designed to produce humidity samples from only the “complete groups” and temperature samples from all the groups in the training set. Both and
are 4-layer MLPs with 64 neurons per layer.
We display quantitative results in Figure 4. The supervised baseline (trained only with labels) achieves lower training error but results in higher test error. Our model effectively avoids overfitting to the small portion of labeled data and consistently outperforms the baseline, achieving a MAE of 1.933 and 3.042 on the predictions of temperature and humidity when all groups are “completely” labeled.
We have proposed adversarial constraint learning, a new framework for structured prediction that replaces hand-crafted, domain specific constraints with implicit, domain agnostic ones learned through adversarial methods. Experimental results on multiple structured prediction tasks demonstrate that adversarial constraint learning works across many real-world applications with limited data, and fits naturally into semi-supervised structured prediction problems. Our success with matching distributions of labeled and unlabeled model outputs motivates future work exploring analogous opportunities for adversarially matching labeled and unlabeled distributions of learned intermediate representations.
This work was supported by a grant from the SAIL-Toyota Center for AI Research, TRI, Siemens, ONR, NSF grants #1651565, #1522054, #1733686, and a Hellman Faculty Fellowship.
- [Arjovsky et al.2017] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
- [Chang et al.2007] Ming-Wei Chang, Lev Ratinov, and Dan Roth. Guiding semi-supervision with constraint-driven learning. In ACL, pages 280–287, 2007.
[Choi et al.2015]
Arthur Choi, Guy Van den Broeck, and Adnan Darwiche.
Tractable learning for structured probability spaces: A case study in
learning preference distributions.
Proceedings of 24th International Joint Conference on Artificial Intelligence (IJCAI), 2015.
- [Ermon et al.2012] Stefano Ermon, Ronan Le Bras, Carla P Gomes, Bart Selman, and R Bruce Van Dover. Smt-aided combinatorial materials discovery. In International Conference on Theory and Applications of Satisfiability Testing, pages 172–185. Springer, 2012.
- [Ermon et al.2015] Stefano Ermon, Ronan Le Bras, Santosh K Suram, John M Gregoire, Carla P Gomes, Bart Selman, and Robert Bruce van Dover. Pattern decomposition with complex combinatorial constraints: Application to materials discovery. In AAAI, pages 636–643, 2015.
- [Goodfellow et al.2014] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014.
- [Gulrajani et al.2017] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
[Huang et al.2014]
Dong Huang, Shitong Yao, Yi Wang, and Fernando De La Torre.
Sequential max-margin event detectors.
European conference on computer vision, pages 410–424. Springer, 2014.
- [Kingma et al.2014] Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in Neural Information Processing Systems, pages 3581–3589, 2014.
- [Koller and Friedman2009] Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009.
- [Li et al.2016] Chongxuan Li, Jun Zhu, and Bo Zhang. Max-margin deep generative models for (semi-) supervised learning. arXiv preprint arXiv:1611.07119, 2016.
[Li et al.2017]
Yunzhu Li, Jiaming Song, and Stefano Ermon.
Infogail: Interpretable imitation learning from visual demonstrations.In Advances in Neural Information Processing Systems, pages 3815–3825, 2017.
- [Miyato et al.2017] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. arXiv preprint arXiv:1704.03976, 2017.
- [Mohamed and Lakshminarayanan2016] Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. arXiv preprint arXiv:1610.03483, 2016.
- [Papandreou et al.2015] George Papandreou, Liang-Chieh Chen, Kevin Murphy, and Alan L Yuille. Weakly-and semi-supervised learning of a dcnn for semantic image segmentation. arXiv preprint arXiv:1502.02734, 2015.
- [Pathak et al.2015] Deepak Pathak, Philipp Krahenbuhl, and Trevor Darrell. Constrained convolutional neural networks for weakly supervised segmentation. In Proceedings of the IEEE international conference on computer vision, pages 1796–1804, 2015.
- [Radford et al.2015] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
- [Ratner et al.2016] Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Ré. Data programming: Creating large training sets, quickly. In Advances in Neural Information Processing Systems, pages 3567–3575, 2016.
- [Richardson and Domingos2006] Matthew Richardson and Pedro Domingos. Markov logic networks. Machine learning, 62(1):107–136, 2006.
- [Salimans et al.2016] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pages 2234–2242, 2016.
Iaroslav Shcherbatyi and Bjoern Andres.
Convexification of learning from constraints.
German Conference on Pattern Recognition, pages 79–90. Springer, 2016.
- [Stewart and Ermon2017] Russell Stewart and Stefano Ermon. Label-free supervision of neural networks with physics and domain knowledge. In AAAI, pages 2576–2582, 2017.
- [Xu et al.2017] Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. arXiv preprint arXiv:1711.11157, 2017.
- [Yang and Ramanan2013] Yi Yang and Deva Ramanan. Articulated human detection with flexible mixtures of parts. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(12):2878–2890, 2013.
- [Zamora-Martínez et al.2014] F Zamora-Martínez, P Romeu, P Botella-Rocamora, and J Pardo. On-line learning of indoor temperature forecasting models towards energy efficiency. Energy and Buildings, 83:162–172, 2014.