  Mixup is a well-known data-dependent augmentation technique for DNNs,
consisting of two sub-tasks: mixup generation and classification. However, the
recent dominant online training method confines mixup to supervised learning
(SL), and the objective of the generation sub-task is limited to selected
sample pairs instead of the whole data manifold, which might cause trivial
solutions. To overcome such limitations, we comprehensively study the objective
of mixup generation and propose \textbf{S}cenario-\textbf{A}gnostic
\textbf{Mix}up (SAMix) for both SL and Self-supervised Learning (SSL)
scenarios. Specifically, we hypothesize and verify the objective function of
mixup generation as optimizing local smoothness between two mixed classes
subject to global discrimination from other classes. Accordingly, we propose
$\eta$-balanced mixup loss for complementary learning of the two
sub-objectives. Meanwhile, a label-free generation sub-network is designed,
which effectively provides non-trivial mixup samples and improves transferable
abilities. Moreover, to reduce the computational cost of online training, we
further introduce a pre-trained version, SAMix$^\mathcal{P}$, achieving more
favorable efficiency and generalizability. Extensive experiments on nine SL and
SSL benchmarks demonstrate the consistent superiority and versatility of SAMix
compared with existing methods.
