Controlling Neural Level Sets

Matan Atzmon, Niv Haim, Lior Yariv, Ofer Israelov, Haggai Maron, Yaron Lipman

In the world of deep learning, we often care more about the "edges" of a model than its specific output values. For a classifier, that edge is the decision boundary—the invisible line where the model flips from predicting "cat" to "dog." For 3D modeling, that edge is the surface of the object itself. Mathematically, these edges are known as level sets.

Traditionally, we control these boundaries indirectly through loss functions like cross-entropy. A paper from researchers at the Weizmann Institute of Science, titled "Controlling Neural Level Sets," introduces a method to grab these boundaries directly and move them around during training.

The Challenge of Implicit Boundaries

Deep Neural Networks (DNNs) are essentially complex functions that map inputs to outputs. A level set is the set of all inputs that produce a specific output (usually zero).

The challenge is that these level sets are "implicit"—you cannot simply look at the network weights and see where the boundary is. If you want to move the boundary (e.g., to push it further away from your data points for better safety and robustness), you usually have to rely on proxies like hinge loss or temperature scaling. Unfortunately, these proxies do not always reflect the true geometry of the input space.

Furthermore, in 3D vision, representing surfaces as level sets is popular, but training them usually requires "ground truth" data like Signed Distance Functions (SDFs), which are notoriously hard to compute from raw, noisy point clouds.

A Direct Approach: The Sample Network

The authors propose a two-step framework to make the points on a neural network's level set differentiable with respect to the network's parameters:

  1. Level Set Sampling: They use a "generalized Newton method" to find points that lie exactly on the level set. Essentially, they take a random point and "project" it onto the boundary.
Projection of a point onto the decision boundary
  1. The Sample Network: This is the clever part. Using the Implicit Function Theorem, they show that the position of a point on the level set can be expressed as a function of the network parameters. They construct a "sample network" by adding a single fixed linear layer to the original network.

This allows the boundary points to become part of the computation graph. When you calculate a loss based on where the boundary is, you can backpropagate through the "sample network" to update the original model's weights. You can literally tell the network: "Move this part of your decision boundary 5 units to the left."

Key Insights and Results

Most deep learning losses operate in "output space" (the logits). This paper argues that for tasks like robustness and generalization, we should care about the "input space margin"—the physical distance in pixels or coordinates between a data point and the decision boundary.

By making the boundary points differentiable, the authors turn a geometric problem into a standard optimization problem. They evaluated their method across three distinct tasks:

  • Classification Generalization (Geometric SVM): Their "Geometric SVM" loss outperformed standard cross-entropy and hinge losses when training on very small amounts of data (e.g., only 0.1% of MNIST). By enforcing geometric constraints, they prevent overfitting in low-data regimes.
  • Adversarial Robustness: On MNIST, their method achieved a robust accuracy of 99.23% against PGD attacks. This is comparable to or better than state-of-the-art methods like TRADES, but it comes with a much more direct geometric interpretation.
Different geometric margin constraints applied to decision boundaries
  • Surface Reconstruction: For 3D reconstruction, they show you can learn a surface directly from raw point clouds (like the FAUST dataset of human bodies) without needing to pre-calculate if a point is "inside" or "outside" the object. The network learns the surface by trying to make its zero-level set pass through the points. It outperformed AtlasNet, producing high-fidelity surfaces and showing a unique ability to gracefully complete curves where data was missing.

Limitations and Future Work

While powerful, the method has a few hurdles. First, the current approach struggles with Batch-Norm layers because the "sample network" requires gradients that are somewhat incompatible with how Batch-Norm calculates statistics across a batch. Second, the quality of the control depends heavily on how well you sample the level set; if you don't sample enough points, parts of the boundary might remain uncontrolled.

The authors suggest that future work could involve penalizing the curvature of the level sets to ensure they are smooth, which could further improve 3D reconstruction and model interpretability.

Reference: Atzmon, M., Haim, N., Yariv, L., Israelov, O., Maron, H., & Lipman, Y. (2019). Controlling Neural Level Sets. 33rd Conference on Neural Information Processing Systems (NeurIPS 2019).

Summary updated

BibTeX
@inproceedings{atzmon2019controlling,
  author = {Matan Atzmon and Niv Haim and Lior Yariv and Ofer Israelov and Haggai Maron and Yaron Lipman},
  title = {{Controlling Neural Level Sets}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=M7oArKKBmHt},
}
Figure