cs.LGMar 9, 2026

An accurate flatness measure to estimate the generalization performance of CNN models

Authors: Rahman Taleghani, Maryam Mohammadi, Francesco Marchetti

Organizations: 1*Department of Mathematics ”Tullio Levi-Civita”, University of Padova, Via Trieste 63, Padova, 35121, Veneto, Italy. · Department of Computer Science, Ruhr University Bochum, University street 140, Bochum, 44801, North Rhine-Westphalia, Germany. · Department of Mathematical Sciences and Computer, Kharazmi University, Mofateh Avenue, Tehran, 15719-14911, Tehran, Iran.

Abstract

Flatness measures based on the spectrum or the trace of the Hessian of the loss are widely used as proxies for the generalization ability of deep networks. However, most existing definitions are either tailored to fully connected architectures, relying on stochastic estimators of the Hessian trace, or ignore the specific geometric structure of modern Convolutional Neural Networks (CNNs). In this work, we develop a flatness measure that is both exact and architecturally faithful for a broad and practically relevant class of CNNs. We first derive a closed-form expression for the trace of the Hessian of the cross-entropy loss with respect to convolutional kernels in networks that use global average pooling followed by a linear classifier. Building on this result, we then specialize the notion of relative flatness to convolutional layers and obtain a parameterization-aware flatness measure that properly accounts for the scaling symmetries and filter interactions induced by convolution and pooling. Finally, we empirically investigate the proposed measure on families of CNNs trained on standard image-classification benchmarks. The results obtained suggest that the proposed measure can serve as a robust tool to assess and compare the generalization performance of CNN models, and to guide the design of architecture and training choices in practice.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Are Flat Minima an Illusion?

    Mar 24, 2026Michael Timothy BennettNeural Network GeneralizationFlat Minima

  2. A Flatness-Generalization Relation in the Teacher-Student Tree-Committee Machine

    Sep 25, 2026Brandon Livio Annesi, Davide Straziota, Enrico Maria MalatestaFlat MinimaNeural Network Generalization