Abstract
Intra-class compactness and inter-class separability are crucial indicators to measure the effectiveness of a model to produce discriminative features. In this work, we investigate these properties in features learned by convolutional networks and propose a Gaussian-based softmax ($\mathcal{G}$-softmax) function. The proposed function is simple to implement and can easily replace the standard softmax function. We evaluate $\mathcal{G}$-softmax on several classification datasets (CIFAR-10, CIFAR-100, and Tiny ImageNet) and multi-label classification datasets (MS COCO and NUS-WIDE). Experimental results show that $\mathcal{G}$-softmax improves state-of-the-art models across all evaluated datasets. Furthermore, analysis demonstrates that high intra-class compactness and inter-class separability are linearly correlated to average precision on MS COCO and NUS-WIDE, implying that improving these metrics leads directly to better predictive performance.
Introduction
In the field of deep learning, the quality of learned representations is often defined by how well they discriminate between classes. Ideally, features belonging to the same class should be tightly clustered (intra-class compactness), while clusters of different classes should be well-separated (inter-class separability). Most modern Convolutional Neural Networks (ConvNets) rely on the standard softmax function paired with cross-entropy loss. However, standard softmax often lacks an explicit mechanism to consider the global distribution of features, focusing instead on per-sample confidence.
As illustrated in Figure 1, standard softmax can lead to overlapping distributions with high variance. In contrast, $\mathcal{G}$-softmax encourages the model to learn more compact and distinct feature representations, effectively "pushing" different classes further apart in the feature space.
Methodology: The G-softmax Function
The core innovation of $\mathcal{G}$-softmax is the integration of a distribution term into the standard softmax calculation. This approach is grounded in the Central Limit Theorem, which suggests that learned features often follow a Gaussian distribution. Unlike standard softmax, which has a "short memory," $\mathcal{G}$-softmax explicitly models the global distribution of previously seen samples.
Mathematical Formulation
The modified probability for class $i$ is defined as: $$p_i = \frac{\exp(x_i + \lambda \Phi(x_i; \mu_i, \sigma_i))}{\sum \exp(x_j + \lambda \Phi(x_j; \mu_j, \sigma_j))}$$ where $\Phi$ is the Gaussian Cumulative Distribution Function (CDF), $\mu_i$ and $\sigma_i$ are learnable parameters representing the mean and standard deviation for class $i$, and $\lambda$ is a hyperparameter controlling the influence of the distribution term.
As shown in Figure 2, the $\mathcal{G}$-softmax predictor incorporates these learnable Gaussian distributions directly into the network's final layers. By learning $\mu$ and $\sigma$ through backpropagation, the model can dynamically adjust the center and tightness of each class cluster during training, providing an analytically quantifiable measure of learning progress.
Experimental Results
The proposed function was evaluated on several standard benchmarks using various backbone architectures, including VGG, ResNet, and DenseNet.
Single-label Classification
On the CIFAR-10 dataset, a Wide ResNet model using $\mathcal{G}$-softmax achieved a top-1 error of 3.14%, compared to 3.49% for the standard softmax. On Tiny ImageNet, ResNet-101 with $\mathcal{G}$-softmax reached a top-1 error of 16.86%, a significant improvement over the 18.36% baseline.
Multi-label Classification and Correlation
In multi-label scenarios like MS COCO, $\mathcal{G}$-softmax improved the Mean Average Precision (mAP) to 81.3%, outperforming the state-of-the-art baseline of 80.7%. A critical insight from this work is the observed linear correlation between feature compactness/separability and Average Precision (AP). This confirms that optimizing the geometric properties of feature clusters directly enhances the model's predictive accuracy.
Conclusion
$\mathcal{G}$-softmax offers a robust and easy-to-implement alternative to the standard softmax function. By explicitly modeling class distributions and optimizing for intra-class compactness and inter-class separability, it consistently improves the performance of deep learning models across a variety of tasks and architectures. Its ability to produce "neater" feature clusters translates directly into higher precision, making it a valuable tool for robust representation learning.
Summary updated