Revive Re-weighting in Imbalanced Learning by Density Ratio Estimation

Authors: jiaan  luo
† feng hong
jiangchao  yao
bo  han
ya  zhang
yanfeng  wang
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-11 10:36:55

Abstract: In deep learning, model performance often deteriorates when trained on highly imbalanced datasets, especially when evaluation metrics require robust generalization across underrepresented classes. To address the challenges posed by imbalanced data distributions, this study introduces a novel method utilizing density ratio estimation for dynamic class weight adjustment, termed as Re-weighting with Density Ratio (RDR). Our method adaptively adjusts the importance of each class during training, mitigates overfitting on dominant classes and enhances model adaptability across diverse datasets. Extensive experiments conducted on various large scale benchmark datasets validate the effectiveness of our method. Results demonstrate substantial improvements in generalization capabilities, particularly under severely imbalanced conditions.

Main paper: 
 introduction: 
 In recent years, deep learning has made significant strides across various domains by utilizing complex architectures and large-scale datasets, setting new benchmarks for performance. However, these advancements often rely on well-curated datasets that ensure balanced class distributions [Russakovsky et al., 2015] . In contrast, real-world datasets typically exhibit a long-tailed distribution, where few classes dominate the majority of samples, while many others are underrepresented [Krizhevsky et al., 2009] . This imbalance leads to model biases favoring frequent classes, thereby reducing performance on the less common ones. Yet, in many applications-such as medical diagnostics and financial analysis-greater emphasis is placed on ensuring strong generalization for underrepresented classes. Addressing this challenge not only reduces data collection costs but also improves the robustness and fairness of the models.Many excellent methods, such as re-sampling [Bowyer et al., 2011] , re-weighting [Morik et al., 1999] , decoupled learning [Kang et al., 2020] , margin-based learning [Cao et al., 2019 , Menon et al., 2020] , transfer learning [Yin et al., 2019] and contrastive learning [Tian et al., 2021] , have been proposed to tackle the issue of imbalanced data. Despite the simplicity of re-weighting, it falls behind in performance significantly compared with other directions of methods due to the inappropriate weighting coefficients during training. Cui et al. [2019] proposes a method for re-weighting by effective number, which accounts for potential overlaps among data samples and adjusts the weights for each category based on the actual effective number of samples. Chen et al. [2023b] leverages the effective area to re-weight, considering the actual spanned space of each class. However, such subsequent improvements can alleviate but still cannot effectively push that forward. Wang et al. [2023] obtains a fine-grained generalization bound for re-weighting in imbalanced learning through the data-dependent contraction technique. Limited research has focused on the intrinsic limitations of the commonly employed re-weighting-based loss functions and the corresponding balancing mechanisms designed to enhance parity in class representation.This study rethinks the characteristics of re-weighted loss and explores the question "Why is reweighting necessary under conditions of sample imbalance?" Under conditions of sample imbalance, the variation in weights of samples arises due to discrepancies between the distribution of collected data and a balanced data distribution. In scenarios where class balance exists, such discrepancies are absent, thus obviating the need for re-weighting. Conversely, in imbalanced settings, re-weighting becomes essential to bridge the gap between these distributions. The weights must therefore represent a suitable compromise between balanced and imbalanced distributions and necessarily reflect accurately on each sample. Additionally, as model training progresses dynamically, optimizing the fit to feature distributions, the weights applied to each sample should be continuously updated to maintain robust performance.This research introduces a novel method, Reweighting with Density Ratio (RDR), designed to mitigate learning disparities in imbalanced distributions. In this method, a feature extractor is employed to discern the features from the training data. A more balanced feature distribution is approximated by continuously updating the momentum on the feature level. This enables real-time density ratio estimation with features learned under imbalanced distributions, thereby obtaining the sample-wise weights. Notably, as the learned features evolve, our method dynamically adjusts weights in response to observed shifts in class density throughout the training cycle, ensuring that the model remains adaptive and effective. This method significantly enhances the robustness and adaptability of the training process. By integrating density ratio estimation to evaluate the difference between the balanced and real data distributions, our approach more accurately reflects the underlying class distribution and improves the model's generalization capabilities across diverse datasets. The contributions are summarized as follows:• We explore the existing re-weighting techniques, and model the performance of various algorithms during training under different data distributions. This approach offers a novel perspective on understanding re-weighting methods in the scenarios of sample imbalance.• We introduce a novel methodology, Re-weighting with Density Ratio (RDR), which leverages the method of density ratio estimation to dynamically adjust class weights during model training. This approach not only addresses the limitations of prior re-weighting methods but also introduces a mechanism to continuously adapt to the changing importance of classes as learning progresses, thereby enhancing model robustness and adaptability.• We conduct extensive experiments to validate the effectiveness of our proposed RDR method. These experiments are conducted across various large-scale, long-tailed datasets, demonstrating substantial improvements in handling class imbalance. Our results illustrate significant enhancements in generalization capabilities, particularly under severely imbalanced scenarios.2 Related WorkQuestion: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?Answer: [Yes] Justification: The abstract and introduction have stated the claims.Guidelines:• The answer NA means that the abstract and introduction do not include the claims made in the paper. • The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers. • The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings. • It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper. 
re-weighting based methods: 
 Re-weighting methods for addressing class imbalance have evolved significantly over the years. Early techniques, such as [Zadrozny et al., 2003] , employed inverse frequency techniques to address class imbalances but failed to consider deeper data distribution traits, leading to sub-optimal outcomes. Addressing these shortcomings, Huang et al. [2016] introduced a cost-sensitive learning framework that, beyond simple frequency adjustments, incorporated misclassification costs to achieve a more nuanced balance. However, this approach still struggled with complexities like class overlap and label noise. To further refine this approach, Lin et al. [2017] developed Focal Loss, which employs a modulation factor based on the prediction probability to adjust the loss function, thereby amplifying the impact of hard-to-classify samples while reducing the loss contribution of easy-to-classify samples. Cui et al. [2019] introduced Class-Balanced Loss, which adjusts loss by data overlap, calculating the effective number of each class. Advancements continued with methods based on training gradients, such as [Ren et al., 2020b , Wang et al., 2021a] . Chen et al. [2023b] proposed Adaptive Re-weighting via effective area, which enhances model accuracy by considering the spatial distribution and density of data points within classes. Ma et al. [2023] introduced a re-weighting method that adjusts based on semantic richness and visual variability. However, no prior work has tackled the issue of sample imbalance by dynamically re-weighting based on the model's performance across training and test sets with differing distributions during the training process.In addition to re-weighting, many other methods are available to address the issue of sample imbalance. Re-sampling techniques [Kubat and Matwin, 1997 , Wallace et al., 2011 , Han et al., 2005 , Hong et al., 2024a] mitigate category imbalances by under-sampling dominant classes [Buda et al., 2018] or over-sampling minority classes [Bowyer et al., 2011] . However, under-sampling may degrade feature representation by discarding valuable majority class data, whereas over-sampling could cause overfitting by duplicating minority class samples. Decoupled training approaches, such as [Kang et al., 2020] , challenge the traditional joint training model by separating representation learning from classification. Margin-based methods such as, LADM [Cao et al., 2019] , LA [Menon et al., 2020] and VS [Kini et al., 2021] , adjust training processes to increase minority class margins, therefore to obtain a more balanced decision boundary. More flexible and robust methods are proposed, including Transfer Learning [Yin et al., 2019 , Liu et al., 2019] , Contrastive Learning [Li et al., 2022 , Chen et al., 2023a] , Ensemble Learning [Wang et al., 2021b , Cai et al., 2021] and Self-supervised Learning [Liu et al., 2022 , Zhou et al., 2023b] . Please refer to Appendix B for more discussions.Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes] Justification: See Section 3.5 and Appendix E.Guidelines:• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper. • The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be. • The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated. • The authors should reflect on the factors that influence the performance of the approach.For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon. • The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size. • If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness. • While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations. 
problem setup: 
 For a typical classification task in imbalanced learning, suppose given a training dataset S = n i=1 {(x i , y i )}, where n is the total number of samples. Denote {n 1 , n 2 , ..., n d }as the sample number of each class. We assume, without loss of generality, that n i < n j , when i < j, with n d typically much larger than n 1 , reflecting a pronounced imbalance in class distribution. We use a typical loss function like l : W × X × Y → R + . Denote {π 1 , π 2 , ..., π d } as the proportions of each class, such that d i=1 π i = 1. Define a family of deep learning models parameterized by ω ∈ W ⊆ R k . Typically, a model consists of a feature extractor f (x; ϕ) and a classifier h(z; θ), with ω = {ϕ, θ}. The notations used in this paper are summarized in Appendix A.Inspired by our review of prior methods, we observe a gap in the adaptation of dynamic class-weight adjustments during training phases. Building on the groundwork of static re-weighting strategies, we introduce a novel approach utilizing the method of density ratio estimation to dynamically recalibrate class weights. This innovation aims to provide a more refined adjustment by estimating real-time class density, thereby promoting an equitable influence of all classes throughout the training.In a typical training optimization problem, our objective is to minimize the empirical risk of the loss function, i.e., R = 1 n n i=1 l(x i , y i ; ω). However, in imbalanced datasets, where the frequency of samples across different classes varies, it is necessary to adjust for these gaps by applying different weights for the samples. We assume that the weight of each sample is denoted by α(x, y; ω), then the empirical risk can be formulated like R = 1 n n i=1 α(x i , y i ; ω)l(x i , y i ; ω). In naive re-weighting approaches, the weight α of class y is often set to 1 πy . This setting is based on the assumption that the distribution of the training set P and the distribution balanced data set P bal satisfy the equation P (x|y; ω) = P bal (x|y; ω). However, in practical training scenarios, both training and test sets are subsets drawn from the actual distribution, leading to potential missing of feature patterns. Furthermore, classes with more complex features and lower sample frequencies tend to exhibit more pronounced missing of patterns. Therefore, in the training process, there exists a discrepancy between P (x|y; ω) and P bal (x|y; ω). We measure the extent of this discrepancy using the ratio r(x|y; w) = P (x|y; ω)/P bal (x|y; ω), incorporating it as a correction term into our weighting scheme. Consequently, the empirical risk can be reformulated as followsR = 1 n n i=1 r(x i |y i ; ω) π yi l(x i , y i ; ω) (1)We can explain the rationality of this formula as follows. where ⟨•, •⟩ denotes the inner product. In practice, as for the real-world imbalanced data distribution P , we denote Φ P to dynamically reflect the knowledge learned from the distribution P , that is Φ P = (f (x 1 ; ϕ), . . . , f (x n ; ϕ)). Remember that the output of feature extractor is z, i.e., z = f (x; ϕ) is a Z-dimensional vector, then Φ P would be a [Z, n]-dimensional vector. Similarly, we denote Φ i P for class i, which is a [Z, n i ]-dimensional vector. As for the balanced data distribution P bal , we design a momentum mechanism to accumulatively estimate the expectation of features learned from balanced data distribution along with the training. Concretely, for each class, we maintain a prototype feature F for the entire training progress, using each batch's feature expectation for momentum updates. Therefore, we define F P bal as followsF P bal = (F 1 , . . . , F d ).Since the total number of classes is d, F P bal would be a [Z, d]-dimensional vector. For each batch, we can obtain z = (z 1 , . . . , z d ), where z i the mean of z of all samples in class i. Then, the momentum updates works as followsEQUATIONwhere m ∈ [0, 1) is a momentum coefficient. Back to Eq. ( 5), replace the expectations over P bal and P by Φ P and F P bal , respectively. Then, take the derivative of MM(r) with respect to r and set it to zero. Detailed derivations are provided in Appendix C.1. For each class i, we can obtain the estimation of density ratio in imbalanced learning as follows Substitute Eq. ( 7) into Eq. ( 1), we can obtain our object to optimizeEQUATIONEQUATIONIn our implementation, we introduced a warm-up phase to pre-adapt the feature distribution in F P bal , thereby mitigating excessive oscillations during the initial stages of training. Additionally, we employed a temperature coefficient γ to modulate the influence of weights, which is typically set to 1. When integrating with logit adjustment (LA) [Menon et al., 2020] , we adhere to the same procedures outlined in [Wang et al., 2023] to ensure the fisher consistency. The framework and pseudo-code of our method are shown in Appendix C.2 and Appendix C.3.Here, we use a formal generalization analysis to characterize the interesting point of our method.Theorem 1. Given a model m ∈ M and the loss function l, for any δ ∈ (0, 1), with probability at least 1 -δ over the training set S, according to [Wang et al., 2023] , the following generalization bound holds for the risk on the balanced distributionEQUATIONwhere Φ (l, δ) is positively correlated with the empirical re-weighting risk of the training set. C S (M) denotes the empirical complexity of the function set M. B y (f ) denotes the minimal prediction on the ground-truth class y in the training set. w y refers to the weight of class y of the re-weighting loss.Specifically, from the above generalization bound, we can find two inherent requirements for reweighting methods. 1) Why re-weighting is necessary: w y helps to re-balance the imbalanced term√ π y [1 -softmax (B y (m))] to get a sharper bound. 2) Why dynamic re-weighting is necessary:The term B y (m) changes dynamically with model training. Therefore, we need a w y that can adapt dynamically to the changes of B y (m). 3) Why RDR works: From Fig. 1 , we can observe that the dynamic trend of the RDR weight aligns well with √ π y [1 -softmax (B y (m))], denoted as B ′ y . This shows that our RDR can adapt to the dynamics in B ′ y , maintaining a sharp bound during training.At the end of each epoch, a global variable is maintained and updated using momentum, as described by Eq. ( 6). Within each minibatch, the weight of each sample is computed dynamically. Typical optimization procedures for deep neural networks entail both forward and backward passes per minibatch, characterized by a computational complexity of O(BΛ), where B represents the batch size and Λ denotes the overall parameter size. Within the RDR framework, suppose the feature dimension used as input to the classifier is K, and the sample weights are computed according to Eq. ( 8). This computation for all d classes aggregates to a complexity of O(d i=1 (n i × K 2 + K 3 ))where n i is the sample count of class i in a minibatch. Given that K generally exceeds n i , the complexity predominantly stems from the matrix inversion, approximating to O(dK 3 ). The complexity for momentum updates is O(BK). Notice that K and B are considerably minor relative to the scale of the model parameters, rendering the time overhead of this method manageable.On the storage front, the memory cost of the RDR primarily arises from the matrix inversion step in Eq. ( 8), resulting in a space complexity of O(K 2 ). Given the scales of K is much lower than Λ, the extra memory usage is negligible when compared with the memory utilization of the model parameters. To this end, RDR imposes a relatively small computational or space cost, enabling its integration with existing approaches at a reduced cost. An empirical evaluation of the computational expense is presented in Fig. 2 . For more discussions about limitations of RDR , please refer to Appendix E. Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?Answer: [NA]Answer: [NA] Justification: The code of this paper will be released after anonymized review. Guidelines:• The answer NA means that paper does not include experiments requiring code. Justification: See Section 3 and Section 4.Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 
experimental setup: 
 Datasets. We conduct experiments on four major long-tailed datasets, CIFAR-10-LT, CIFAR-100-LT, ImageNet-LT [Liu et al., 2019] and Places-LT [Liu et al., 2019] . CIFAR-10-LT and CIFAR-100-LT are two datasets sampled from the original CIFAR [Krizhevsky et al., 2009] dataset with a total of 10 and 100 classes, respectively. We conduct experiments with different imbalance factors IF = nmax nmin , where n max and n min denotes the number of the most and least frequent classes [Kang et al., 2020 , Hong et al., 2023 , 2024b] . Following the mainstream protocol [Wang et al., 2023] , we set the imbalance factor as 100 and 10 for evaluation. ImageNet-LT has 115.8K training images covering 1000 classes, with imbalance factor being 256. The number of samples per class ranges from 1280 to 5 images. Places-LT contains 62.5K training images covering 365 categories, with imbalance factor being 996. The number of samples per class ranges from 4980 to 5 images.Evaluation Protocol. In the task of long-tailed classification, all classes are treated equally during testing. Following [Rangwani et al., 2022 , Zhou et al., 2023c] , we also report accuracy on three splits of classes according to the number of training data. Since the number of samples per class increases by its class index, for CIFAR-10-LT dataset, class[0, 3), class[3, 7) and class[7, 10) are reported as Many, Medium and Few classes, respectively. Similarly, CIFAR-100-LT is splited as class [0, 35), class[35, 69) and class [69, 100) . ImageNet-LT is splited as class[0, 390), class [390, 835) and class[835, 1000), while Places-LT is splited as class [0, 131), class[131, 288) and class [288, 365) .Baselines. Our method is combined with existing long-tailed classification methods to demonstrate the efficacy, including the baseline trained by cross-entropy loss (CE), focal loss (Focal) [Lin et al., 2017] , class-balanced loss (CB) [Cui et al., 2019] and logit adjustment (LA) [Menon et al., 2020] . Recently, Sharpness-Aware minimization (SAM) [Foret et al., 2021] has been proved to be a powerful method in imbalanced learning, therefore we also adopt baseline including SAM [Foret et al., 2021] , Comparative analyses have been performed to evaluate the effectiveness of the proposed RDR. The results are presented in Table 1 , Table 2 and Table 4 . The metric employed to measure performance is the top-1 accuracy on the test sets.Results on CIFAR-10-LT and CIFAR-100-LT. We first evaluate RDR on CIFAR-10-LT and CIFAR-100-LT. We report the final accuracy of different methods with imbalance factor ratio {10, 100} in Table 1 and Table 2 . We can observe that RDR significantly outperforms all baselines under different imbalance factor ratios across the two datasets. Our observations highlight that RDR consistently outperforms baselines across various class distributions-Many, Medium, and Few-particularly under severe imbalance (IF=100).In CIFAR-10-LT, combined with CE and LA, our method shows substantial improvement in the categories with fewer samples, increasing the accuracy by 19.8% and 9.5% respectively in the Few category under IF=100. This improvement is notable as it effectively addresses the challenge of learning from scarce data. With the inclusion of SAM, the performance of RDR is further enhanced. Under a less severe imbalance (IF=10), where the results show less performance drop-off between categories, RDR combined methods still maintain high performance across all categories, suggesting scalability and reliability of our approach in different imbalance contexts.In CIFAR-100-LT, where the data distributions are more diverse and challenging, RDR also enhances the overall performance, particularly for the Medium and Few categories. Experiments conduct on the CIFAR-10-LT, under an imbalance factor of 100. Maximum eigenvalue λ max (↓) minimum eigenvalue λ min (↑) in the top right corner of each panel. A lower λ max indicates a smoother loss landscape, while a higher λ min suggests conditions more favorable for escaping from saddle points, thereby enhancing the model's generalization capabilities. with imbalanced data. λ min also serves as a significant indicator of the loss landscape characteristics. A preponderance of negative eigenvalues from the Hessian spectrum, resulting in smaller λ min values, empirically suggests convergence to saddle points. Saddle points typically represent regions in the loss landscape characterized by a plateau with some negative curvature. In non-convex settings, it has been shown that an exponential number of saddle points exist, and convergence to these points is indicative of poor generalization. Fig. 4 illustrates the Eigen Spectral Density under different loss function training regimes. It is evident that combining our method with the CE technique significantly improves the loss landscape. On one hand, λ max is substantially reduced, indicating a flatter loss landscape. On the other hand, there is an increase in λ min , suggesting our method's effectiveness in escaping from saddle points.Table 3 delves deeper into the changes in the loss landscape for all Few classes. It reveals that combining our method with CE and SAM results in average reductions in λ max by 58.5% and 66.1%, respectively, and increases in λ min by 49.2% and 7.6%, respectively. Furthermore, our method significantly reduces T r(H) for minority classes (class7, class8 and class9). The average value of T r(H) decreases by 55.7% and 66.0% when combined with CE and SAM, respectively. These findings underscore the efficacy of our method in improving the loss landscape and enhancing the generalization capability of the model [Dauphin et al., 2014] .Results on ImageNet-LT and Places-LT. Our experiments conducted on ImageNet-LT and Places-LT, two large-scale datasets characterized by irregular and complex data distributions, demonstrate notable accuracy improvements through the application of RDR, as shown in Table 1 and Table 4. Table 3 : Loss landscape metrics across different methods on CIFAR-10-LT, with imbalance factor 100. Average minimum eigenvalues λ min (↑), average maximum eigenvalues λ max (↓), and the trace T r (↓) of the Hessian matrix for classes with few samples. T r 6 , T r 7 , T r 8 , and T r 9 represent the traces of the Hessian matrix for class 6, 7, 8 and 9, respectively, with descending sample quantities. T r F ew denotes average trace of Hessian matrix over Few classes. Lower λ max and T r values indicate a flatter loss landscape, while a higher λ min suggests a landscape more conducive to escaping from saddle points, thereby potentially enhancing model generalization. In the Places-LT dataset, the performance of RDR is even more pronounced. Combinations of our method with CE and LA result in accuracy gains of 10.1% and 2% in overall classes, respectively. Additionally, integrating SAM with our method also yields incremental improvements of 10.3% and 0.5% under CE and LA conditions, respectively. Our approach not only enhances accuracy in Few classes but also surpasses other methods in Medium classes, indicating its comprehensive efficacy across different categories. This broad applicability is particularly crucial for addressing the challenges of imbalanced learning.Results on data with label noise. We further investigate the performance of our approach on datasets with label noise. Specifically, we evaluate two datasets: CIFAR-10-LT-NL and CIFAR-100-LT-NL, both of which exhibit class imbalance and label noise. Experiments are conducted with a noise ratio of 5%, and the results are presented in Fig. 5 . As shown, our method demonstrates consistent and significant improvements on more datasets with label noise.In our study, we perform an ablation experiment to validate the efficacy of the multiple components that comprise our method. The outcomes from experiments across four datasets are delineated in Table 5 . It is crucial to note that our weighting definition for each category i follows the formula w = r/n i . When r = 1, our method simplifies to the traditional inverse frequency weighting w = 1/n i . We explored the differences between our approach with and without the integration of SAM compared to this conventional weighting method. The results depicted in Table 5 reveal that our dynamic weighting approach consistently outperforms the classic method under various scenarios. Without SAM, when combined with CE and LA, our method achieves accuracy improvements ranging from 0.4% to 4.3% and 0.3% to 2.3%, respectively. When integrated with SAM, the improvement in accuracy is particularly notable on large datasets. Specifically, the accuracy enhancements on ImageNet-LT and Places-LT reach 7.1% and 1.9% respectively when combined with LA. These results underscore the tangible benefits of our dynamic weighting strategy in enhancing model performance. The impact of momentum coefficient m in RDR is shown in Fig. 3 . For more experimental details, please refer to Appendix D.3. 
conclusion: 
 In this work, we have introduced RDR, a novel approach for mitigating model degradation in imbalanced learning scenarios by dynamically adjusting class weights using density ratio estimation.Our method dynamically adjusts class weights during training based on density ratio estimation, enhancing both model robustness and adaptability. Extensive experiments on diverse large-scale datasets demonstrate the effectiveness of RDR, particularly in severely imbalanced settings. Future work will focus on refining the dynamic adjustment mechanisms and exploring broader applicability across various domains and dataset complexities. 
code of ethics: 
 Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines?Answer: [Yes] Justification: This paper is conducted with the NeurIPS Code of Ethics.Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction). 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes] Justification: Our proposed method can enhance the efficiency and robustness of imbalance learning, thereby increasing productivity.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.• The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: This paper poses no such risks.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?Answer: [NA] Justification: This paper does not use such assets.Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided. • If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. 
 
 Appendix: In Table 6 , we summarize the notations used in this paper. Beyond imbalanced classification that has discretized label space, an noteworthy area, imbalanced regression that has a continuous label space is also very common in real applications [Yang et al., 2021 , Gong et al., 2022] . In this direction, the empirical label distribution often does not accurately reflect the true label density in regression tasks, which limits the effectiveness of traditional re-weighting techniques [Yang et al., 2021, Wang and Wang, 2023] . Label Distribution Smoothing (LDS) [Yang et al., 2021] and Variational Imbalanced Regression (VIR) [Wang and Wang, 2023] propose using kernel smoothing and other techniques to estimate an accurate label density distribution. Ranking Similarity (Ranksim) [Gong et al., 2022] leverages local and global dependencies by encouraging the correspondence between the similarity order of labels and features. Balanced Mean Squared Error (Balanced MSE) [Ren et al., 2022] extends the concept of Balanced Softmax [Ren et al., 2020a] to regression tasks to achieve a balanced predictive distribution. Contrastive Regularizer (ConR) [Keramati et al., 2024] improves contrastive learning techniques to translate label similarities into the feature space.C.1 Detailed Derivations of Eq. ( 7)Back to Eq. ( 5), replace the expectations over P bal and P by Φ P and F P bal , respectively. For each class i, We can obtain r i = MM(r), where MM(r) = 1 n 2 i r i ⊤ Φ i P ⊤ Φ i P r i - 2 n i r ⊤ i Φ i P ⊤ F i (10)2 n 2 i Φ i P ⊤ Φ i P r i - 2 n i Φ i P ⊤ F i = 0 (11)Solving equation above with respect to r i , we can obtain the solution asEQUATIONWe provide the framework of RDR, which is shown in Fig. 6 .We provide the pseudo-code of RDR to demonstrate the process of implementing our method in detail, as shown in Algorithm 1. In addition, we also provide pseudo-code that combines our method with the SAM method, as shown in Algorithm 2.We conduct experiments on the more imbalanced CIFAR-10-LT and CIFAR-100-LT datasets, specifically with imbalance factors of 200 and 500. As shown in Table 7 , our method consistently achieves significant improvements.Our approach dynamically adjusts the weights assigned to each category throughout the training process. To gain more insights into RDR, we sampled the weights of each category during training. Fig. 7 presents the results of four samplings during the training processes at imbalance factors of 10 and 100, respectively.The analysis of these results reveals a consistent trend in weight changes across different imbalance factors. For the Many classes, the weights of the categories consistently decrease during training. Specifically, under the IF of 10, the weights of class0, class1, and class2 (the three classes with the highest sample counts, in descending order) decrease by 5.6%, 6.7%, and 8.0%, respectively. Under the IF of 100, these decreases are more pronounced, with reductions of 10.3%, 15.4%, and 14.7%, respectively. For the Medium classes, the weight changes are less marked, with an average decrease for class i to d do 13:Φ i P ← (z j )where y j = i 14:compute w i via Eq. ( 8) and γ 15:end for 16:w ← normalize(w γ ) 17:end if 18: L(ω t , B) ← 1 b B w • l(output, y)19:ω t = ω t -α t [∇L(ω t , B) + λω t ] 20: F P bal ← mF P bal + (1 -m)z 21:Optional: anneal the learning rate α t 22: end for w ← normalize(w γ ) 17:end if 18: L 1 (ω t , B) ← 1 b B w • l(output, y) 19: ϵ t ← ρ ∇L1(ωt,B) |∇L1(ωt,B)| 20: L 2 (ω t + ϵ t , B) ← 1 b B w • l(f ωt+ϵt (•), y) 21: ω t = ω t -α t [∇L 2 (ω t + ϵ t , B) + λω t ]22:F P bal ← mF P bal + (1 -m)z 23:Optional: anneal the learning rate α t 24: end for of 3.7% at IF=10 and 0.3% at IF=100. For the Few classes, there exits a notable increase in weights during training; at IF=10, the weights of class7, class8, and class9 increase by 2.3%, 6.3%, and 9.4%, respectively, while at IF=100, they increase by 6.2%, 6.5%, and 3.2%.These results suggest that our method increasingly focuses on minority classes as training progresses. Initially, our method effectively learns common features across all categories, while later in training, increasing the weights helps to target learning towards minority samples, thereby enhancing the model's generalizability. Wang et al. [2023] also corroborate these findings.We provide more detailed experimental results for each category in ablation study, as illustrated in Fig. 8 and Fig. 9 . From these figures, we can find that across various datasets and different imbalance factors, our method significantly enhances the generalizability of both Few classes and Medium classes. Moreover, our method maintains superior performance when combined with the SAM method. While our approach demonstrates promising results, there are potential challenges that warrant further attention. In particular, as the number of classes increases to a very large scale, especially in certain tasks such as face recognition, retail product recommendation, or landmark detection, there could be concerns regarding computational efficiency. It is important to consider lightweight techniques to ensure that scalability does not compromise practical applicability. Additionally, in addressing imbalanced learning, care must be taken to avoid excessive rebalancing toward minority groups, as this could unintentionally affect the learning performance of the majority class, which would not align with the broader goals of fairness. Rebalancing should be conducted within a reasonable framework, mindful of avoiding misuse or overcompensation that could arise from improper manipulation by any group. Ensuring fairness for all remains a critical consideration.NeurIPS Paper Checklist 


Decision: The authors address the critical and challenging problem of class imbalance in machine learning. They propose a method that adaptively weighs the importance of classes throughout training. The main idea is to use an estimate of the density ratios (existing vs. balanced) to re-weight the samples in the loss. The advantage of the method is demonstrated using several real datasets with imbalance ratios ranging from 10 to 256. Overall, the reviewers are positive about the paper, with the main criticism being the presentation. This work provides an interesting solution to the problem that seems to work well. For these reasons, I recommend acceptance of this paper, and I highly encourage the authors to implement the reviewers' suggestions and work towards improving the writing and presentation.

Reviews: review: paper_summary: paper_summary: The paper presents a weighting strategy in order to handle class imbalance. Contrary to existing method, they propose to adapt the weight throughout the training procedure. 

Their method estimates the discrepancy between the sample distribution and the balanced sample distribution for parameterization w and updates the estimate through the training.

The authors use two resnet architectures to evaluate their contribution on multiple datasets. They also compare to other baselines and show significant gain.
strength_weakness: strength_weakness: * The paper is sometimes difficult to read:
  * Row 125, the authors refer to the distribution of training set, which get parameterized by w. Thus, my understanding is that the authors refer to the distribution of the training set "captured by the model". 
  * row 134, P_bal = pi P.. P_bal is the distribution of y in the balanced case ? But should therefore be 1/number classes... and P, should just be the class proportion and we should have P = pi P_bal ?
  * LDAM and LA terms are not defined at first. First definition of LA is at row 208
  * row 212 "trategies" => strategies
questions: questions: * Could you clarify the term, P, etc. You often refer to it as "real world data distribution", but the distribution of x does not depends on any other classes (imbalanced or not) ?
limitations: limitations: The paper would benefit from a clarification in notification (what is the true data distribution, what is the feature distribution, what is an estimate of what quantity, etc.). I believe the contribution is novel and worth it.
paper_summary: paper_summary: The paper introduces a novel approach called Re-weighting with Density Ratio (RDR) to address the challenges posed by imbalanced data distributions in machine learning.  The RDR approach aims to mitigate overfitting on majority classes and enhance adaptability across diverse datasets by continuously updating the weights in response to observed shifts in class density.  Extensive experiments on various large-scale, long-tailed datasets demonstrate that the RDR method significantly improves the model's generalization capabilities, particularly under severely imbalanced conditions.  The analysis of the weight changes during training reveals that the method increasingly focuses on minority classes as training progresses, initially learning common features across all categories and then targeting learning towards minority samples to enhance generalizability.  The paper also provides an ablation study to further validate the effectiveness of the proposed approach.
strength_weakness: strength_weakness: - The paper does not provide a detailed theoretical analysis or justification for the proposed Re-weighting with Density Ratio (RDR) method, beyond the intuition that it can mitigate overfitting on majority classes and enhance adaptability across diverse datasets.

- I am interested in how RDR might perform in the presence of extreme imbalance, noisy data, or other challenging scenarios. The current experiment is well-established but dataset itself is relatively simple.

- The paper discusses reweighting/non-reweighting for classification problems. I suggest the authors also briefly discuss reweighting methods in imbalanced regression problems, e.g., VIR [1] for reweighting problems and ConR [2] for non-reweighting problems.

[1] Variational Imbalanced Regression: Fair Uncertainty Quantification via Probabilistic Smoothing, NeurIPS 2023

[2] ConR: Contrastive Regularizer for Deep Imbalanced Regression, ICLR 2024

**Summary** I think the theoretical analysis or at least insights is needed for acceptance, so my suggest score is 5, as the experiment part is excellent in this paper.
questions: questions: see above
limitations: limitations: authors discussed in sec 3.4
paper_summary: paper_summary: This paper presents a dynamic re-weighting method for imbalanced learning. The author defines the ratio of the balanced data set distribution to the training set distribution, and tries to estimate it with an iterative update method. The effectiveness of this method is proved by experiments.
strength_weakness: strength_weakness: 1.	The formula derivation in Sec. 3.3 can be more detailed. It is suggested to explain how formula (7) is obtained in the appendix.
2.	The introduction may have overlooked some key articles. For example, the article mentions Wang et al. 's article at the end of Sec.3.3, but does not discuss this paper in the introduction section.
3.	Does the new method enjoy the same theoretical boundaries as the general reweighting method? It is recommended to provide more analysis.
4.	Besides, there are some typos in the details:
  - In the experimental section, 'class[390,385] 'may be a typo.
  - In table 3, the interpretation of Tr_{Few} is supposed to be there.
questions: questions: Please refer to Weaknesses.

Besides, I am also curious about some experimental details. Do the authors use other techniques such as RandAug or mixup?
limitations: limitations: No. Although the authors say they clarify the limitations in Sec.3.4, I find they mainly highlight the efficiency of the proposed method. More discussion about limitations and potential negative societal impact is recommended.

Comments: title: Answer
score update
reviewer update
comment: Dear Reviewer 24eD,

We greatly appreciate your time and effort in reviewing our responses and contributing to the enhancement of this paper. We will carefully follow your suggestions to incorporate all the points of our rebuttal in the revised version.

Best,

The authors of Submission 4464
Thanks for your rebuttal! My concerns have been clarified. Hence, I will increase my rating accordingly.
Dear Reviewer xrua,

We sincerely appreciate you taking the time to review our responses and contributing to improve this paper. We will carefully follow your advice to incorporate all the points of our rebuttal in the updated version.

Best,

The authors of Submission 4464
Dear authors,

I thank you for your answers. After considering your propositions and mostly the enhanced readability (e.g. symbol table), I have decided to raise my note.

Regards
Dear Reviewer MG5X,

We sincerely appreciate you taking the time to review our responses and contributing to improve this paper. We will carefully follow reviewer's advice to incorporate all the addressed points with additional experiments in the updated version. 

We promise not to use your improved score as evidence to persuade other reviewers, but focus on truly addressing their concerns.

Thank you once again for your dedicated and valuable contribution in reviewing our paper!

Best,

The authors of Submission 4464
It seems that the other reviewers have not responded yet. After reviewing the authors' responses to the other reviewers, I have decided to raise my score. However, I **cannot** promise that the authors' responses address the concerns of the other reviewers, so the authors **should not use my improved score as a reference or evidence**. 

In summary, I appreciate the authors' responses to all of us. Specifically, I feel that the authors have addressed my questions, so I have decided to increase my score.
Dear Reviewer 24eD,

We genuinely appreciate your detailed feedback and the insightful comments you've provided on our manuscript. 

We have provided more clarifications and explanations as suggested. Additionally, we have discussed limitations and potential negative societal impact.

Please let us know if anything is unclear. We truly appreciate this opportunity to improve our work and shall be grateful for any feedback you could give to us.


Best Regards,

The authors of Submission 4464
Dear Reviewer xrua,

We sincerely appreciate your constructive feedback and positive evaluation of our submission. 

We have provided more clarifications and explanations, made necessary corrections, and improved definitions as suggested.

Please let us know if anything is unclear. We truly appreciate this opportunity to improve our work and shall be most grateful for any feedback you could give to us.

Best Regards,

The authors of Submission 4464
I would like to thank the authors for their detailed response. I will take all the reviews and responses into consideration.