# Adaptive Age Estimation towards Imbalanced Datasets
## 3 Method
### Data Density Smoothing Module  
The DDS module is shown in Figure 1. Before reweighting the loss function in this module, we applied a kernel function to smooth the data density. The steps of DDS are shown in Figure 3. DDS convolves the data density distribution with the Gaussian kernel \(k(y,y^{\prime})\) to extract the kernel smooth version of the density distribution. The smoothed density distribution makes reasonable use of the correlation between the data samples of adjacent labels, and overlaps the training information corresponding to adjacent labels. Gaussian kernel \(k(y,y^{\prime})\) describes the degree of similarity between the target \(y^{\prime}\) and any label \(y\). A symmetric kernel function is any one that satisfies \(k(y,y^{\prime})=k(y^{\prime},y)\) and \(\
abla_{y}k(y,y^{\prime})+\
abla_{y^{\prime}}k(y^{\prime},y)=0\), \(\forall y,y^{\prime}\in\mathcal{Y}\). Here, the \(\mathcal{Y}\) is on behalf of the label space. For example, Gaussian kernel and Laplacian kernel are symmetric kernel functions, and Gaussian kernel is used in all experiments. The effective label distribution formula calculated by DDS is:  
\[\tilde{n}(y^{\prime})=\int_{y}k(y,y^{\prime})n(y)dy \tag{2}\]  
where \(n(y)\) represents the number of occurrences of label \(y\) within the training data. \(\tilde{n}(y^{\prime})\) is the effective density of label \(y^{\prime}\). Modified data density through DDS is used for subsequent loss reweighting to form the loss reweighting module. This module is inserted into the adaptive soft label module in Section 3.1 to form the DIAAR, so as to deal with data imbalance more effectively. Unlike labels in classification tasks, which are discrete, the age labels in age regression tasks are continuous values. DIAAR divides the label space \(\mathcal{Y}\) into \(B\) groups in order to reasonably apply the loss function to the age regression task. It assumes that the training  
Figure 3: Data density smoothing strategy (DDS). Figure 2: The data-imbalance adaptive soft label. Take IMDB-WIKI-DIR dataset as an example. The data density distribution is represented by a shaded image, and the generated soft labels for different ages are represented by red Gaussian curves. dataset is \(\{(x_{i},y_{i})\}_{i=1}^{N}\), \(x_{i}\) represents input image, and \(y_{i}\) represents age labels. The target space is divided into \([y_{0},y_{1})\), \([y_{1},y_{2})\),...,\([y_{B-1},y_{B})\). In this paper, we set \(\delta_{y}\triangleq y_{b+1}-y_{b}=1\); namely, the resolution of the age group division is 1. After dividing the target space into age groups, DIAAR can simply insert some classic reweighting methods. This paper adopts square-root inverse variable weighting (SQINV) [16; 17] to reweight loss function, which is a simple and effective method to solve imbalanced classification problems. Therefore, the weights \(\alpha_{y_{i}}\) of age \(y_{i}\) are calculated as Equation (3):  
\[\alpha_{y_{i}}=\frac{1}{\sqrt{\hat{n}(y_{i})}} \tag{3}\]  
where \(\hat{n}(y_{i})\) represents the effective data density of label \(y_{i}\). Because of the missing of data, we need to interpolate and extrapolate age predictions. To achieve this, as shown in Figure 1, a \(softmax\) expected value \(E\) is calculated as the final age regression prediction value \(\hat{y_{i}}\). The computational process of the Distribution Regression (DR) operation is given as:  
\[\hat{y_{i}}=E(O)=\sum_{j=0}^{100}j*\hat{p_{j}}, \tag{4}\]  
where \(O=\{0,1,\ldots,100\}\) and \(O\) is the output layer with 101 dimensions. \(\hat{p_{j}}\) is the prediction distribution through the softmax layer. \(y_{i}\) is the discrete age corresponding to \(i\) class and symbol \(*\) means multiplication.