CR-SAM: Curvature Regularized Sharpness-Aware Minimization

Tao Wu, Tie Luo, Donald C. Wunsch
12/21/2023
cs.LGcs.CV

Official code: TrustAIoT/CR-SAM (12 stars, last commit 2024-11-29).

Abstract

The capacity to generalize to future unseen data stands as one of the utmost crucial attributes of deep neural networks. Sharpness-Aware Minimization (SAM) aims to enhance the generalizability by minimizing worst-case loss using one-step gradient ascent as an approximation. However, as training progresses, the non-linearity of the loss landscape increases, rendering one-step gradient ascent less effective. On the other hand, multi-step gradient ascent will incur higher training cost. In this paper, we introduce a normalized Hessian trace to accurately measure the curvature of loss landscape on {\em both} training and test sets. In particular, to counter excessive non-linearity of loss landscape, we propose Curvature Regularized SAM (CR-SAM), integrating the normalized Hessian trace as a SAM regularizer. Additionally, we present an efficient way to compute the trace via finite differences with parallelism. Our theoretical analysis based on PAC-Bayes bounds establishes the regularizer's efficacy in reducing generalization error. Empirical evaluation on CIFAR and ImageNet datasets shows that CR-SAM consistently enhances classification performance for ResNet and Vision Transformer (ViT) models across various datasets. Our code is available at https://github.com/TrustAIoT/CR-SAM.

View on arXivView PDF

Code Implementations(1)

TrustAIoT/CR-SAMOfficial100%

Code for AAAI 2024 paper: CR-SAM: Curvature Regularized Sharpness-Aware Minimization

123Python1 years ago
deep-neural-networksoptimizationsharpness-aware-minimization

Similar Papers

Cite this paper

@article{wu2023crsam,
  title  = {CR-SAM: Curvature Regularized Sharpness-Aware Minimization},
  author = {Tao Wu and Tie Luo and Donald C. Wunsch},
  year   = {2023},
  eprint = {2312.13555},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.13555v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.13555.svg)](https://codeofpaper.com/paper/2312.13555)

Discussion