TL;DR
This paper introduces Bilateral Sharpness-Aware Minimization (BSAM), a novel optimization technique that improves upon existing Sharpness-Aware Minimization (SAM) by considering both the ascent and descent directions of the loss landscape. BSAM achieves better generalization performance and robustness across various tasks by finding flatter minima.
What Problem Does This Paper Address?
Deep neural networks often suffer from poor generalization, meaning they perform well on training data but poorly on unseen data. This is partly due to the complex, non-convex nature of their loss landscapes, which contain many local minima. Some minima are "flat," meaning small changes in model parameters don't drastically alter the loss, leading to better generalization. Sharpness-Aware Minimization (SAM) is a popular technique that aims to find these flat minima by minimizing the maximum loss within a small neighborhood around the current model parameters (Max-Sharpness or MaxS). However, the authors identify a "Flatness Indicator Problem" (FIP) with SAM: it only considers the "sharpness" in the direction of gradient ascent, potentially leading to a minimum that isn't as flat as it could be. They argue that a better indicator of flatness is needed to guide the optimizer towards truly flat minima.
Methods
The core innovation of this paper is the introduction of Min-Sharpness (MinS). While SAM's MaxS looks at the maximum loss in the gradient ascent direction, MinS measures how quickly the training loss decreases when moving from the current parameter point in the gradient descent direction.
The authors then propose Bilateral SAM (BSAM), which combines the original training loss, MaxS, and the newly defined MinS into a single optimization objective. This "bilateral" approach aims to balance the loss landscape from both sides, encouraging flatter minima. To address potential conflicts between the gradients of MaxS and MinS, especially in later stages of training, BSAM adaptively decreases the perturbation radius for MinS. They also introduce a gradient scaling mechanism to balance the contributions of MaxS and MinS. Theoretical analysis is provided to show that BSAM converges to local minima.
Datasets
The paper evaluates BSAM on several standard image classification datasets:
- CIFAR-10
- CIFAR-100
Additionally, BSAM is tested on transfer learning tasks using datasets like:
- Flowers102
- Stanford Cars
- OxfordIIITPet
And in applications like:
- Human Pose Estimation (MPII dataset)
- Quantization-Aware Training (CIFAR-10 dataset)
Key Insights and Ideas
- The "Flatness Indicator Problem" (FIP) in SAM: The paper convincingly argues that SAM's focus solely on the gradient ascent direction is a limitation, as it doesn't fully capture the flatness of the entire local neighborhood.
- Min-Sharpness (MinS) as a complementary metric: Introducing MinS, which considers the descent direction, provides a more comprehensive view of the loss landscape's geometry. This bilateral perspective is key to finding truly flatter minima.
- BSAM's balanced optimization: By jointly optimizing the loss, MaxS, and MinS, BSAM encourages a more stable and flatter descent, leading to improved generalization.
- Adaptive perturbation radius for MinS: The strategy of gradually decreasing the MinS perturbation radius is crucial for avoiding gradient conflicts and ensuring stable convergence, especially in later training stages.
- Broader applicability: BSAM demonstrates effectiveness not just in classification but also in transfer learning, human pose estimation, and quantization-aware training, suggesting its general utility.
Key Results
- Improved Generalization: BSAM consistently outperforms vanilla SAM and SGD across various tasks and architectures (ResNet-18, WideResNet-28-10, PyramidNet-110) on CIFAR-10 and CIFAR-100, achieving higher test accuracies. For example, on PyramidNet-110 for CIFAR-100, BSAM showed a 0.31% increase over SAM.
- Flatter Minima: Analysis of Hessian eigenvalues shows that BSAM finds minima with smaller maximum eigenvalues compared to SAM and SGD, indicating flatter landscapes. Visualizations of loss landscapes also support this finding.
- Robustness to Label Noise: BSAM demonstrates better robustness to label noise compared to SAM and SGD, maintaining higher accuracy even with significant noise rates.
- Effective in Transfer Learning: BSAM achieves state-of-the-art results in transfer learning tasks, outperforming SAM and SGD on multiple datasets and architectures.
- Competitive in other tasks: BSAM shows promising results in human pose estimation and quantization-aware training, often surpassing SAM.
- Computational Cost: BSAM requires approximately 1.5 times the computation of SAM per optimization step due to the additional forward/backward passes for MinS.
Limitations and Future Work
- Gradient Conflict: While BSAM addresses the gradient conflict problem with an adaptive radius, the paper acknowledges that it can still occur, especially with fixed, large perturbation radii.
- Computational Overhead: BSAM incurs a higher computational cost compared to SAM.
- Future Work: The authors suggest further exploring the impact of different perturbation directions on optimization and investigating methods to improve BSAM's computational efficiency to increase its practicality. They also aim to further understand the interplay between different optimization directions and the minimum of the loss landscape.
Summary updated