## 3 Materials and Methods
### Class Rebalanced Noise Logit Perturbation for DNNs
Take, for instance, the target class distribution illustrated on the left-hand side of Figure 1. It represents an imbalanced dataset comprising of \(C=10\) target classes where \(\{1,3,7\}\) are the minority classes with different levels of likelihood. We apply the relative likelihood approach first by selecting class 0 as the reference class. We then weight all the majority classes to be equally likely to occur compared to class 0. Further, for the minority, we weight classes 1, 3, and 7 to be, respectively, three, six, and two times as likely compared to class 0. The result is a logit weight vector \(\tilde{\mathbf{q}}\in\mathbb{R}^{C}\) represented in terms of a probability distribution over all the \(C\) classes, as illustrated on the right-hand side of Figure 1.  
2 Effective Number of Samples Approach: Following the proposed theoretical framework in [23], the effective number of samples per class is used in place of the usual class frequencies. The effective number of samples for some class \(i\) can be calculated by the formula \(E_{n_{i}}=\frac{(1-\tilde{\mathbf{q}}_{i}^{n_{i}})}{(1-\tilde{\mathbf{\beta}}_{i})}\) where \(\beta\in[0,1)\) is a hyperparameter and \(n_{i}\) is the number of samples in total for class \(i\). To help achieve a class-balanced loss, \(\mathbf{\alpha}\in\mathbb{R}^{C}\), a vector of weighting factors composed of \(C\) individual elements, each inversely proportional to the effective number of samples per class \(i:a_{i}\propto 1/E_{n_{i}}\) is used to perform rebalancing on the loss. We note that, in order to perform useful penalization of the loss function, the composition of \(\mathbf{\alpha}\) is such that minority classes are weighted higher compared to majority classes. This is the same type of blueprint we use to formulate an _ideal logit weights_ vector using the relative likelihood approach. We perform further normalization on the weight vector \(\mathbf{\alpha}\) to reduce the magnitude of individual elements, which otherwise have the potential to introduce incoherent perturbations to the logit layer. From this method, vector \(\mathbf{\alpha}\) is our _ideal logit weights_ vector \(\tilde{\mathbf{q}}\). Figure 1: (**a**) Target class distribution for an imbalanced dataset consisting of 10 classes where 1, 3, and 7 represent the minority classes. (**b**) Logit weight vector \(\tilde{\mathbf{q}}\), representing the ideal case scenario where minority classes are assigned larger probabilities compared to majority classes. \(\tilde{\mathbf{q}}\) is the ideal logit weight vector represented as a probability distribution. \(\tilde{\mathbf{q}}\) is generated using the relative likelihood approach, a technique from the method, subjective determination of logit weight vector. Applying either of the two approaches proposed above, we can generate the _ideal logit weights_ vector \(\mathbf{\tilde{q}}\) that is biased towards the minority classes and will be used as part of the inference drawing process in the DNN. Introducing weight vector \(\mathbf{\tilde{q}}\) as perturbation to the logit layer \(\mathbf{z}\) and using formula (4) results in a softmax of the following functional form:  
\[\mathbf{p}(y=i|\mathbf{x})=\frac{\exp(\mathbf{z}_{i}\odot\mathbf{\tilde{q}})}{\sum_{j=1}^{C} \exp\left(\mathbf{z}_{j}\odot\mathbf{\tilde{q}}\right)} \tag{5}\]  
The training set-up thus far enables us to achieve a model that predicts most of the positive samples correctly; in our case, these are the minority class samples. However, this is not the desired result as the model ends up performing unfavorably when it comes to majority class samples hence failing to generalize effectively on the entire dataset.