Abstract
Despite being vital to the success of Support Vector Machines (SVMs), the principle of margin maximisation is rarely applied in deep learning. This paper demonstrates that for deep architectures, the minimisation of margin variance—rather than its maximisation—is a more effective strategy for improving generalisation. We introduce the Halfway loss function, which minimises the Normalised Margin Variance (NMV) at the output of deep models. Empirical evaluations on MNIST, smallNORB, and CIFAR-10 datasets show that the Halfway loss consistently outperforms standard Softmax Cross-Entropy in representationally rich models.
Introduction: The Scaling Trap
In classical machine learning, SVMs achieve robust generalisation by finding a decision boundary that maximises the margin to the nearest data points. However, this principle does not translate directly to deep learning. In deep neural networks, the feature space is dynamic and learned.
A network can trivially inflate its margin to an arbitrary size simply by scaling the weights of its penultimate layer by a large constant. This "cheating" does not change the classification logic or improve the model's ability to handle new data; it merely changes the numerical scale. Consequently, traditional margin maximisation is a meaningless objective for deep architectures. This research proposes shifting the focus from margin size to the distribution of the margin.
Methodology: Minimising Margin Variance
The authors propose two key concepts to address the scaling issue:
- Normalised Margin Variance (NMV): Instead of absolute distances, this metric looks at how much the distances of data points from the boundary vary, normalised by the maximum distance in the batch. This removes the effect of simple weight scaling.
- Halfway Loss Function: This novel objective acts like a Mean Squared Error (MSE) loss but targets a value "halfway" to the current maximum margin rather than a hard label. This forces the network to perform complex, non-linear squashing of the feature space to cluster data points tightly and consistently around the decision boundary.
For multi-class datasets, the researchers implement a "one-against-rest" scheme with cost-sensitive weighting to ensure the model maintains accuracy across all classes.
Results and Discussion
The Halfway loss was evaluated against standard Softmax Cross-Entropy across various architectures. In almost all representationally rich models (larger networks and CNNs), the Halfway loss achieved superior generalisation.
Quantitative Performance
On the smallNORB dataset, a CNN trained with Halfway loss reached a test error of 11.01%, compared to 12.51% for Softmax. Similar gains were observed on CIFAR-10, where the Halfway loss reduced error to 27.83% from the Softmax baseline of 30.06%. The gap between validation and test error was also consistently smaller, suggesting improved resistance to overfitting.
Visualising the Distribution
Visual analysis of the network outputs confirms the theoretical intuition. While Softmax produces broad, smeared distributions of data points, the Halfway loss produces extremely tight, "spiky" clusters. This indicates that the model is much more consistent in its feature extraction and certain in its classifications.
Conclusion
The core insight of this work is that while increasing the mean margin is trivial in deep nets, reducing margin variance requires the learning of robust, meaningful features. While the Halfway loss may be too restrictive for very small models with limited capacity, it offers a powerful alternative to Softmax for modern, deep architectures. Future work will explore non-symmetric loss functions and more rigorous theoretical links between margin variance and generalisation bounds.
Summary updated