We assume a Linear Discriminant Analysis (LDA) classifier is defined as: \(\mathbf {\phi }(\mathbf {x})\) , \(\mathbf {\mu }=\lbrace \mathbf {\mu }_y, y=1,2,\cdots ,C\rbrace \)  and \(\mathbf {\pi }=\lbrace \pi _y=\frac{1}{C}, y=1,2,\cdots ,C\rbrace \)  for \(C\) -class classification, where \(\mathbf {\phi }(\mathbf {x})\in \mathbb {R}^d\)  is the feature representation of \(\mathbf {x}\)  extracted by a CNN, parameterized by \(\mathbf {\phi }\)To avoid notational clutter in later derivations, we use \(\mathbf {\phi }\)  to denote a CNN feature extractor and its parameter. But the meaning of \(\mathbf {\phi }\)  is clear given the context., and \(\mathbf {\mu }_y\in \mathbb {R}^d\)  is the mean of a Gaussians distribution with a diagonal covariance matrix \(\gamma ^2\mathbf {I}\) , i.e., \(p_{\mathbf {\theta }}(\mathbf {\phi }(\mathbf {x})|y)=\mathcal {N}(\mathbf {\mu }_y, \gamma ^2\mathbf {I})\) . Therefore, we can parameterize LDA by \(\mathbf {\theta }=\lbrace \mathbf {\phi }, \mathbf {\mu }\rbrace \)We can treat \(\gamma \)  as a tunable hyperparameter or we can estimate it by post-processing. In this work, we take the latter approach as discussed in Sec. REF .. Instead of using this regular LDA classifier, in this paper the max-Mahalanobis classifier (MMC) [1]}, a special case of LDA, is considered. Different from the LDA modeling above, in MMC \(\mathbf {\mu }=\lbrace \mathbf {\mu }_y, y=1,2,\cdots ,C\rbrace \)  is pre-designed to induce compact feature representations for model robustness. We found that the MMC modeling fits our goal better than the regular LDA classifier due to its improved training stability and boosted adversarial robustness. Therefore, in the following we focus on the MMC modeling for image classification and generation. As such, the learnable parameters of MMC reduce to \(\mathbf {\theta }=\lbrace \mathbf {\phi }\rbrace \) , and the pseudo-code of calculating pre-designed \(\mathbf {\mu }\)  can be found in Algorithm 2 of the appendix .
Fig. REF  provides an overview of the training and test of our GMMC algorithm, with the details discussed below.
