Effects of the optimisation of the margin distribution on generalisation in deep architectures

Lech Szymanski, Brendan McCane, Wei Gao, Zhi-Hua ZhouarXiv 2017

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:

  1. 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.
  2. 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.

Empirical performance metrics vs. parameter δ, showing the relationship between test error and margin characteristics.

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.

Comparison of margin distributions: (a) standard margin maximisation leads to broad distributions, while (b) the proposed variance minimisation results in tight, consistent clusters.

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

Abstract

Despite being so vital to success of Support Vector Machines, the principle of separating margin maximisation is not used in deep learning. We show that minimisation of margin variance and not maximisation of the margin is more suitable for improving generalisation in deep architectures. We propose the Halfway loss function that minimises the Normalised Margin Variance (NMV) at the output of a deep learning models and evaluate its performance against the Softmax Cross-Entropy loss on the MNIST, smallNORB and CIFAR-10 datasets.
BibTeX
@misc{szymanski2017effects,
  author = {Lech Szymanski and Brendan McCane and Wei Gao and Zhi-Hua Zhou},
  title = {{Effects of the optimisation of the margin distribution on generalisation in deep architectures}},
  year = {2017},
  eprint = {1704.05646},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1704.05646},
}
Figure