Robust Density Ratio Estimation: Trimming the Likelihood Ratio

Song Liu, Akiko Takeda, Taiji Suzuki, Kenji Fukumizu

Abstract

Density ratio estimation (DRE) is a fundamental technique in machine learning for comparing datasets, with applications ranging from covariate shift adaptation to anomaly detection. However, standard DRE methods are notoriously sensitive to outliers, which can cause estimated ratios to diverge toward infinity. This paper introduces Trimmed Density Ratio Estimation (TR-DRE), a robust estimator that automatically identifies and "trims" problematic data points. By employing a convex formulation, the authors provide a method that is both theoretically sound in high-dimensional settings and computationally efficient via subgradient descent.

Introduction

Estimating the ratio of two probability densities, $w(x) = p(x)/q(x)$, is a core task in modern machine learning. It underpins change detection, generative modeling (e.g., GANs), and importance sampling. Despite its utility, the ratio is inherently unbounded. When the test distribution $p(x)$ contains "corrupted" points or outliers located far from the support of the reference distribution $q(x)$, standard estimators like the Kullback-Leibler Importance Estimation Procedure (KLIEP) often fail. These methods attempt to maximize the likelihood of every sample, allowing a few extreme points to dominate the model and lead to catastrophic estimation errors.

The Sensitivity of Standard Density Ratio Estimation

The primary challenge in DRE is the presence of outliers that do not belong to the primary distribution of interest. The authors identify two main scenarios where this occurs: malicious cyber-attacks injecting data to trigger false alarms, and "volatile samples" in natural datasets that exhibit extreme reactions to environmental changes.

Figure 1: Standard density ratio estimation is highly sensitive to outliers, where the log-likelihood ratio diverges in regions with low support in the reference distribution Q.

As shown in Figure 1, the standard log-likelihood ratio $\log(p/q)$ tends toward infinity in regions where the reference distribution $Q$ has little to no mass. Even a single outlier in these regions can pull the entire estimate away from the true underlying ratio of the "bulk" data.

Trimmed Density Ratio Estimation (TR-DRE)

To address this instability, the authors propose a "trimmed" version of the Maximum Likelihood Estimator. The core intuition is to ignore samples that produce exceedingly large likelihood values, thereby preventing them from skewing the global estimate.

Convex Trimming Formulation

The TR-DRE method builds upon the log-linear KLIEP model but introduces a slack-variable approach—reminiscent of the Soft-Margin Support Vector Machine (SVM). This formulation allows the model to effectively "discard" a fraction of the samples. A hyperparameter $\nu$ is introduced to represent the proportion of samples to be kept (the "inliers").

Figure 2: The TR-DRE method introduces a trimming mechanism that ignores samples with excessively high likelihoods, resulting in a stable and robust density ratio estimate.

As illustrated in Figure 2, the trimming process identifies a region $\overline{X}(\delta)$ where the ratio exceeds a threshold $t_\nu(\delta)$. By ignoring these points, the estimator recovers a stable ratio that accurately reflects the relationship between the primary masses of $P$ and $Q$.

Optimization and Theoretical Guarantees

The resulting optimization problem is a max-min saddle-point problem, which remains convex. The authors propose a "Gradient Ascent and Trimming" algorithm:

  1. Sort: Rank samples by their current estimated ratio.
  2. Trim: Assign zero weights to the largest ratios (the outliers).
  3. Update: Perform a subgradient update on the model parameters using only the remaining "good" samples.

The paper provides theoretical proofs for estimation consistency in high-dimensional settings. It demonstrates that the estimation error remains bounded even as the number of features grows, provided the underlying true ratio is sparse.

Theoretical Insights: The SVM Connection

An intriguing theoretical contribution of the paper is the link between trimmed DRE and Support Vector Machines. The authors prove that an SVM can be interpreted as learning an unnormalized, trimmed density ratio as its decision function. This provides a new probabilistic perspective on the robustness of SVMs and suggests that TR-DRE is a natural extension of these principles to the density ratio framework.

Experimental Results

The method was evaluated across synthetic and real-world-inspired benchmarks:

  • Sparse Structural Changes: In Gaussian Markov Network experiments, TR-DRE successfully recovered the true sparse structure of changes even in the presence of outliers that completely broke standard KLIEP.
  • Image Novelty Detection: Using HOG features from images, TR-DRE outperformed one-class SVMs. While the one-class SVM flagged all salient objects as outliers, TR-DRE specifically identified relative novelties—objects present in the test set but absent from the reference set.
  • High-Dimensional Stability: Tests confirmed that the estimator remains stable when the number of features is large relative to the sample size, validating the theoretical consistency results.

Conclusion and Future Work

Trimmed Density Ratio Estimation offers a robust, convex, and theoretically grounded alternative to standard DRE methods. While it significantly improves performance in the presence of outliers, it currently requires the user to specify the trimming parameter $\nu$. Future research aims to develop methods for automatically tuning this parameter and extending the high-dimensional proofs to non-linear kernels and deep neural networks.

Summary updated

BibTeX
@inproceedings{liu2017robust,
  author = {Song Liu and Akiko Takeda and Taiji Suzuki and Kenji Fukumizu},
  title = {{Robust Density Ratio Estimation: Trimming the Likelihood Ratio}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=S1NsDwW_ZS},
}
Figure