TL;DR
SplineCam is the first provably exact method for computing the geometry and decision boundaries of deep networks with piecewise linear activations (like ReLU). By treating these networks as continuous piecewise linear splines, it allows researchers to visualize the intricate "linear regions" that define a model's behavior without relying on the inaccuracies of sampling or architectural simplifications.
What Problem Does This Paper Address?
Despite their success, deep networks (DNs) remain "black boxes." Most interpretability tools rely on heatmaps or feature visualizations that show what a network looks like, but not the underlying geometry of how it partitions the data space.
We know that networks using activations like ReLU are mathematically equivalent to Continuous Piece-Wise Linear (CPWL) splines. This means they divide the input space into a complex mosaic of convex "linear regions," where the network's mapping is simple and affine within each region. However, exactly computing this partition is computationally daunting—previous methods were either too slow (exponential complexity) or relied on approximations that missed the fine-grained geometric details. SplineCam fills this gap by providing a fast, exact way to map these regions and the decision boundaries that live on them.
Methods
The authors leverage spline theory to treat a DN as a composition of linear operators. Their key contribution is a scalable enumeration algorithm:
- Back-projection: They developed a framework to project the hyperplanes (the "edges" of neuron activations) from any layer in the network back into the input space.
- 2D Slicing: To keep the problem tractable and visualizable, SplineCam computes the partition on a 2D polytope (a flat slice) of the high-dimensional input space.
- Graph-based Enumeration: The algorithm treats the intersections of these hyperplanes as a graph problem. It identifies nodes (intersections) and edges to find the unique "cycles" that define each linear region.
- Scalability: Unlike previous exponential-time approaches, SplineCam's complexity is roughly $O(n^2)$ relative to the number of hyperplanes. This allows it to handle large-scale architectures like VGG16.
Datasets
The authors validated SplineCam across a variety of tasks and datasets:
- Image Classification: MNIST, Fashion-MNIST, CIFAR-10, and TinyImageNet.
- Implicit Neural Representations (INRs): 2D images from the MetFaces dataset and 3D geometry using the Stanford Bunny.
- Synthetic Tasks: Toy 2D regression and binary classification problems to illustrate the core theory.
Key Insights and Ideas
- Hierarchical Boundary Formation: In tasks like learning a Signed Distance Field (SDF), the decision boundary isn't just the work of the final layer. Neurons from multiple depths coordinate, placing their own boundaries near the target surface to refine the final shape (see Figure 1).
- CNNs vs. MLPs: For a similar number of parameters, Convolutional Neural Networks (CNNs) create a significantly denser partition with many more linear regions than Multi-Layer Perceptrons (MLPs). This is due to weight sharing, which causes the same neuron to "cut" the input space multiple times.
- The Impact of Data Augmentation (DA): SplineCam provides a quantitative look at DA. It reveals that DA significantly increases the density of linear regions around test samples, which is a strong geometric indicator of better generalization.
- Positional Encoding "Wraps" Space: In coordinate-based networks (INRs), periodic positional encoding causes neuron boundaries to repeat across the input domain. This effectively increases the number of regions and allows for better signal fitting through "weight sharing" across different parts of the space.
Key Results
- Exactness: SplineCam is the first method to provide the exact geometry (up to machine precision) of the decision boundary.
- Efficiency: It is remarkably fast. For a single-layer MLP with 1,000 neurons, it can identify over 132,000 regions in just 134 seconds. Even for a massive VGG16 model, it can characterize local regions in about 7 minutes.
- Boundary Sampling: The method allows for exact sampling of points directly on the decision boundary. This revealed that for some misclassified MNIST digits, the boundary was sub-optimal, as samples on the boundary clearly resembled the wrong class.
Limitations and Future Work
- 2D Constraint: The current implementation is limited to 2D slices of the input space. While these slices are highly informative, they don't capture the full high-dimensional complexity of the network's geometry.
- Activation Functions: The method is strictly for CPWL activations (ReLU, Leaky-ReLU, Maxout, etc.). It cannot be applied to networks using smooth activations like Sigmoid, Tanh, or GeLU.
- Future Directions: The authors suggest using SplineCam to quantify the quality of network initialization, improve training strategies for INRs, and visualize how partitions evolve dynamically during the training process.
Summary updated