Papers
Topics
Authors
Recent
Search
2000 character limit reached

Class-Aware Adaptive Sample Weighting

Updated 6 July 2026
  • CA-ASW is a design pattern that uses dynamic, class-specific signals to weight samples during training, effectively addressing issues like class imbalance and fairness.
  • It integrates historical loss, gradient alignment, and uncertainty measures to adapt weights across tasks, with examples in robust classification, continual learning, and segmentation.
  • Implementations such as FSW, HD-DinoMoE, and CMW-Net demonstrate that CA-ASW can optimize trade-offs between accuracy and fairness while mitigating catastrophic forgetting.

Searching arXiv for the cited CA-ASW-related papers and close neighbors to ground the article. arXiv search: "Class-Aware Adaptive Sample Weighting" Across the cited literature, Class-Aware Adaptive Sample Weighting (CA-ASW) is used to describe training schemes in which the contribution of each sample is modulated by class-aware signals and updated during training rather than fixed a priori. The term is stated explicitly in HD-DinoMoE for multi-label scleral anomaly segmentation, where weights are assigned per sample and per class (Yu et al., 3 Jun 2026). A closely related formalization appears in robust classification through CMW-Net, which learns a weighting function from sample loss and task/class features (Shu et al., 2022). In fair class-incremental learning, Fairness-aware Sample Weighting (FSW) becomes a direct instance of CA-ASW when sensitive groups are defined as classes, so that per-sample weights are chosen to reduce class-wise disparity and catastrophic forgetting (Park et al., 2024). Across these settings, the common goal is to reshape the effective training distribution so that rare, underperforming, drifting, ambiguous, or unfairly forgotten classes do not receive the same optimization treatment as already dominant classes.

1. Conceptual scope and motivating conditions

CA-ASW arises in settings where uniform per-sample weighting is empirically or theoretically inadequate. In fair class-incremental learning, naive training on all current-task samples with equal weight can produce unfair catastrophic forgetting, because some groups or classes experience much larger performance loss than others when the current-task average gradient points in an “opposite direction” to the gradient of an underperforming group (Park et al., 2024). In multi-label scleral anomaly segmentation, the motivating conditions are severe pixel-level class imbalance, sample-level difficulty heterogeneity, and multi-source distribution shifts between Clinical and Wild data, so that naive averaging of per-image loss across classes overweights abundant or easy classes and underweights rare or difficult ones (Yu et al., 3 Jun 2026). In robust classification, the central motivation is inter-class variation in data bias situations, including class imbalance and corrupted labels, which makes a single class-agnostic weighting rule insufficient (Shu et al., 2022).

A recurrent misconception in this literature is that “class-aware” weighting simply means increasing the weight of high-loss or minority-class samples. Several papers explicitly reject that simplification. PAD argues that hard mining is not appropriate for knowledge distillation, because prime samples are those that are easy for the student to distill reliably from the teacher rather than the hardest samples (Zhang et al., 2020). HD-DinoMoE likewise finds that a Balanced strategy, which suppresses extreme deviations from the class-wise median historical loss, performs better than Hard or Focal variants for its segmentation setting (Yu et al., 3 Jun 2026). In fair class-incremental learning, the relevant signal is not raw difficulty alone but the alignment or conflict between class-level and sample-level gradients (Park et al., 2024).

The phrase “class-aware” is therefore used at different granularities. It can mean weighting by class-defined sensitive groups GyG_y in continual learning (Park et al., 2024), by task/class feature NiN_i in robust classification (Shu et al., 2022), by a full sample-class loss matrix Li,cL_{i,c} in segmentation (Yu et al., 3 Jun 2026), or by time-varying class age ttct-t_c in exemplar-free class-incremental learning (Xu et al., 4 Jun 2026). A plausible implication is that CA-ASW is better understood as a design pattern than as a single canonical algorithm.

2. Formal patterns of class-aware weighting

Despite the diversity of application domains, the main CA-ASW formulations share a common structure: a base loss is retained, but each sample or sample-class term is multiplied by a weight that depends on class-aware statistics.

Formulation Class-aware signal Weight definition
FSW in fair CIL Group/class losses and gradients GyG_y or Gy,zG_{y,z} wl\mathbf{w}_l solves minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l) (Park et al., 2024)
CMW-Net Sample loss LitrL_i^{tr} and class/task feature NiN_i NiN_i0 (Shu et al., 2022)
HD-DinoMoE CA-ASW Historical loss NiN_i1 and routing entropy NiN_i2 NiN_i3 (Yu et al., 3 Jun 2026)
Adaptive Class-Balanced loss in EFCIL Class age through NiN_i4 NiN_i5 (Xu et al., 4 Jun 2026)

In fair class-incremental learning, the object being weighted is the current-task sample set. If NiN_i6, then the weighted average gradient is

NiN_i7

and the approximated post-update loss for a group NiN_i8 becomes linear in NiN_i9 through the Taylor expansion used in the paper (Park et al., 2024). In CMW-Net, the object being weighted is each training example’s loss, but the mapping from loss to weight is conditioned on a task family obtained from class size clustering, so different class families can have different learned loss-to-weight curves (Shu et al., 2022). In HD-DinoMoE, the object being weighted is explicitly the per-sample-per-class loss Li,cL_{i,c}0, so the weighting space is a matrix rather than a vector: Li,cL_{i,c}1 That paper identifies the extension from vector loss space Li,cL_{i,c}2 to matrix loss space Li,cL_{i,c}3 as one of the novel aspects of its CA-ASW design (Yu et al., 3 Jun 2026).

A further variant appears in exemplar-free continual learning, where the weight is attached at class level rather than sample level. There the Adaptive Class-Balanced loss uses a virtual sample count

Li,cL_{i,c}4

followed by class-balanced weighting Li,cL_{i,c}5, so class age acts as the adaptation signal (Xu et al., 4 Jun 2026). This is still CA-ASW in effect, because every sample of class Li,cL_{i,c}6 inherits the time-adaptive class weight.

3. Fair class-incremental learning as CA-ASW

The most explicit theoretical derivation of class-aware adaptive weighting in the provided literature is the FSW framework for fair class-incremental learning (Park et al., 2024). The setting is replay-based class-incremental learning with tasks Li,cL_{i,c}7, disjoint class sets Li,cL_{i,c}8, and a fixed-size replay memory Li,cL_{i,c}9. Sensitive groups can be standard attributes such as gender or race, classes themselves, or joint class-attribute groups. For class fairness, the paper defines

ttct-t_c0

The central analysis is first-order and gradient-based. If one SGD step is taken on a current-task sample ttct-t_c1,

ttct-t_c2

then the approximated updated group loss satisfies

ttct-t_c3

A positive inner product indicates aligned gradients and decreased group loss, whereas a negative inner product indicates the update moves in an opposite direction for that group and increases its loss. The theorem in the paper shows that if an overperforming group ttct-t_c4 has positive alignment with the current-task sample while an underperforming group ttct-t_c5 has negative alignment, then the disparity ttct-t_c6 becomes larger than before the step, which formalizes unfair forgetting (Park et al., 2024).

FSW then turns this analysis into a weighting problem. For current task ttct-t_c7, it assigns one weight per sample, ttct-t_c8, and optimizes

ttct-t_c9

where GyG_y0 can instantiate Equal Error Rate, Equalized Odds, or Demographic Parity, and GyG_y1 is a mean loss over current-task groups. When groups are classes and the EER objective is used,

GyG_y2

the paper states the conceptual mapping directly: CA-ASW = FSW with groups defined as classes, objective GyG_y3, and weights GyG_y4 computed per epoch, per task (Park et al., 2024).

Because each approximated group loss is linear in GyG_y5, the fairness objectives become sums of absolute values of affine functions plus linear terms, which are transformed into linear programs and solved with CPLEX. The algorithm recomputes weights at each epoch and for each task using current group losses, group gradients, and sample gradients. The paper reports empirically about GyG_y6–quadratic complexity per LP solve, with only a few seconds per solve for about GyG_y7K samples and total training time remaining in minutes for datasets like MNIST (Park et al., 2024).

The reported results are framed as accuracy–fairness trade-offs. On MNIST under EER, iCaRL gives Acc .934 and EER .037, whereas FSW gives Acc .924 and EER .032. On Biased MNIST under EO, CLAD gives Acc .872 and EO .195, whereas FSW gives Acc .909 and EO .060. The paper also reports that weight-distribution analysis shows higher weights for underperforming groups and zero weights for many samples, effectively selecting a fairness-promoting subset for training (Park et al., 2024).

4. Per-sample-per-class CA-ASW in HD-DinoMoE

HD-DinoMoE uses the term CA-ASW explicitly for multi-label segmentation of scleral surface anomalies, with classes Vessels, Yellow and Black Spots, and Blood Spots (Yu et al., 3 Jun 2026). The problem formulation is shaped by three stated challenges: severe pixel-level class imbalance, sample-level difficulty heterogeneity, and multi-source distribution shifts. The model couples CA-ASW with two DINOv3-L backbones, a Class-Aware Dual-Stream Gated Fusion encoder, a Class-Specific Multi-Expert Decoder, and Progressive Confidence Penalty loss.

The key design move is to weight loss at the level of sample GyG_y8 and class GyG_y9. For each image and class, the framework computes a class-specific inner loss Gy,zG_{y,z}0, defined as Gy,zG_{y,z}1 when PCP is off or Gy,zG_{y,z}2 when PCP is on. It then maintains a global historical loss matrix Gy,zG_{y,z}3 with exponential moving average

Gy,zG_{y,z}4

using default momentum Gy,zG_{y,z}5. For each class Gy,zG_{y,z}6, a class-wise anchor is defined as the median

Gy,zG_{y,z}7

followed by the deviation

Gy,zG_{y,z}8

The paper adopts a Balanced weighting strategy: Gy,zG_{y,z}9 with wl\mathbf{w}_l0 in the default configuration. This weight is then modulated by class-specific MoE routing uncertainty. If wl\mathbf{w}_l1 denotes the gating probability over wl\mathbf{w}_l2 experts, the routing entropy is

wl\mathbf{w}_l3

and the entropy-boosted weight is

wl\mathbf{w}_l4

with default wl\mathbf{w}_l5. Final weights are clamped: wl\mathbf{w}_l6 The training loss is then

wl\mathbf{w}_l7

This construction makes the method simultaneously class-aware, history-aware, and MoE-aware. It is class-aware because difficulty is tracked per class; adaptive because weights depend on historical loss and current routing entropy; and sample-specific because wl\mathbf{w}_l8 changes across both wl\mathbf{w}_l9 and minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)0. The paper reports that Balanced CA-ASW with minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)1 improves over the baseline without CA-ASW from mDice minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)2 and mIoU minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)3 to mDice minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)4 and mIoU minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)5. Stage-wise ablations show the strongest effect when CA-ASW is applied in Stage 1 and Stage 2, reaching mDice minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)6 and mIoU minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)7. In the full model on ML-SASD-Mix, HD-DinoMoE achieves mean Dice minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)8 and mean Intersection-over-Union minwlLfair(wl)+λLacc(wl)\min_{\mathbf{w}_l} L_{fair}(\mathbf{w}_l)+\lambda L_{acc}(\mathbf{w}_l)9 (Yu et al., 3 Jun 2026).

A notable feature of this formulation is that it does not assume that high-loss cases should dominate. The Balanced strategy down-weights extreme outliers on either side of the class-wise median while still increasing emphasis through routing entropy when expert assignment is uncertain. That separation between difficulty anchoring and uncertainty modulation distinguishes this CA-ASW design from simple hard-example mining (Yu et al., 3 Jun 2026).

5. Meta-learned class-aware mappings and adjacent adaptive weighting methods

CMW-Net provides the clearest explicit loss-to-weight mapping for CA-ASW in robust classification (Shu et al., 2022). It treats each training class as a separate learning task and uses class size LitrL_i^{tr}0 as the task/class feature. Offline, K-means on class sizes yields LitrL_i^{tr}1 task families, encoded by a one-hot selector LitrL_i^{tr}2. A one-hidden-layer MLP maps the sample loss LitrL_i^{tr}3 to LitrL_i^{tr}4 candidate weights LitrL_i^{tr}5, and the final scalar weight is

LitrL_i^{tr}6

This yields one loss-to-weight curve per task family while sharing a hidden representation. When LitrL_i^{tr}7, the construction reduces to MW-Net, the earlier class-agnostic meta-weighting model that uses only the sample loss as input (Shu et al., 2019).

CMW-Net is trained by bi-level optimization with a meta set that approximates an unbiased distribution. The inner problem minimizes weighted training loss, while the outer problem minimizes meta loss after a one-step classifier update. The paper emphasizes that MW-Net assumes all classes share the same bias characteristics, whereas CMW-Net relaxes that assumption and is designed for inter-class variations of data bias situations. The reported experiments show that CMW-Net consistently improves over ERM, Focal loss, CB loss, MW-Net, and L2RW on long-tailed CIFAR-10 and CIFAR-100, and also improves over MW-Net under asymmetric and feature-dependent label noise. The paper further reports transfer of the learned weighting scheme from CIFAR-10 to full WebVision without additional hyper-parameter tuning and meta gradient descent step (Shu et al., 2022).

Several adjacent methods contribute mechanisms that are not explicitly class-aware in their base form but are repeatedly connected to CA-ASW in the supplied literature. PAD introduces uncertainty-driven adaptive weighting for knowledge distillation, with effective per-sample weight approximately LitrL_i^{tr}8, and argues that prime samples are low-uncertainty, easy-to-distill cases rather than hardest cases (Zhang et al., 2020). The object-detection Sample Weighting Network predicts separate classification and regression weights from classification loss, regression loss, IoU, and probability score; it is task-aware and data-driven but does not explicitly include class labels, though the paper identifies class embeddings and class-wise heads as natural extensions (Cai et al., 2020). SWL-Adapt learns per-sample weights for domain alignment from classification and domain discrimination losses by meta-optimization and is described as instance-level and label-agnostic, with explicit class-aware extensions proposed through conditioning on true or pseudo labels and class-wise statistics (Hu et al., 2022). LiLAW uses only three global learnable parameters LitrL_i^{tr}9 for easy, moderate, and hard samples; it is explicitly class-agnostic in its base form, but the paper outlines direct CA-ASW extensions via per-class parameters NiN_i0 or class-level scaling (Moturu et al., 25 Sep 2025).

Taken together, these methods show that CA-ASW can be implemented through several adaptation signals: meta-gradients from a clean or self-generated meta set, heteroscedastic uncertainty, multi-task uncertainty proxies, domain-alignment utility, or lightweight difficulty parameters. What distinguishes the explicitly class-aware variants from adjacent adaptive weighting methods is not the presence of weights per se, but the direct use of class-conditioned inputs, class families, class histories, or sample-class matrices in the weighting function.

6. Limitations, controversies, and open technical directions

The literature also makes clear that CA-ASW is not a universally simple remedy. In fair class-incremental learning, FSW requires known group labels, incurs LP solving cost roughly quadratic in the number of current-task samples, and relies on a first-order loss approximation whose error can be larger at the beginning of each task (Park et al., 2024). In HD-DinoMoE, the method requires a stable sample index for each training image, maintenance of an NiN_i1 historical loss matrix, and class-wise medians over a reference set; if MoE is absent, the routing-entropy term must be omitted (Yu et al., 3 Jun 2026). In CMW-Net and MW-Net, a meta-learning loop and meta-data are required, although CMW-Net proposes self-generated meta sets using low-loss samples plus mixup for noisy-data settings (Shu et al., 2022, Shu et al., 2019).

Another recurring issue is the interpretation of “hardness.” PAD explicitly argues that up-weighting hard samples hurts distillation and that prime, low-uncertainty samples should be emphasized instead (Zhang et al., 2020). HD-DinoMoE reports smaller gains or drops for Hard and Focal strategies relative to Balanced weighting (Yu et al., 3 Jun 2026). By contrast, LiLAW learns to adjust emphasis among easy, moderate, and hard samples over time through validation-driven meta-updates, and its behavior changes with the noise level (Moturu et al., 25 Sep 2025). This indicates that there is no single correct monotone rule such as “higher loss implies higher weight” or “higher loss implies lower weight.” The appropriate direction depends on whether high loss is signaling minority status, noise, domain shift, routing ambiguity, or gradient conflict.

Open questions in the supplied sources are correspondingly heterogeneous. FSW identifies scalability to many groups, stronger handling of distribution shift, and online or mini-batch variants as open issues (Park et al., 2024). HD-DinoMoE suggests broader application to other multi-label or multi-class segmentation tasks, especially where per-image difficulty differs by class and expert routing uncertainty is available (Yu et al., 3 Jun 2026). The exemplar-free continual learning work on manifold-aware prototype rehearsal suggests uncertainty- and drift-aware prototype weighting as a next step beyond purely time-based class weighting (Xu et al., 4 Jun 2026). A plausible implication is that future CA-ASW systems will combine several signals simultaneously: class age, class frequency, class-conditioned uncertainty, gradient alignment, and sample-class historical loss.

In that sense, CA-ASW has become a unifying technical motif across robust learning, continual learning, segmentation, knowledge distillation, and domain adaptation. The shared idea is not merely to reweight samples, but to encode class structure directly into the weighting mechanism so that optimization can respond to inter-class heterogeneity, temporal imbalance, and class-specific failure modes rather than treating the training set as a homogeneous pool.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Class-Aware Adaptive Sample Weighting (CA-ASW).