eess.IVApr 15, 2026

Learning Class Difficulty via Dynamic Focal Attention for Histopathology Segmentation

Authors: Lakmali Nadeesha Kumari Rathukohe Mudiyanselage, Sen-Ching Samson Cheung

Organizations: University of Kentucky, Lexington, KY 40506, USA

Abstract

Frequency-based loss reweighting, the standard remedy for imbalanced histopathology segmentation, implicitly assumes that rare classes are difficult. Yet difficulty also arises from morphological variability, boundary ambiguity, and contextual similarity, all largely orthogonal to class frequency. We propose Dynamic Focal Attention (DFA), a simple, efficient mechanism that learns class-specific difficulty directly within the cross-attention of query-based mask decoders. DFA adds a learnable per-class bias to the attention logits, reweighting representations before prediction rather than gradients after it. Initialised from a centred log-frequency prior to prevent gradient starvation and then optimised end-to-end, the bias adapts to difficulty signals as they emerge during training, unifying frequency- and difficulty-aware reweighting in a single attention-bias framework. On three benchmarks (BCSS, BDSA, CRAG), DFA consistently improves Dice and IoU, matching or exceeding a two-stage difficulty-aware baseline without a separate estimator or extra training stage. This shows that encoding difficulty at the representation level is a principled alternative to conventional loss reweighting.

Figures & tables

Explore similar work

CardsList
  1. Difficulty-Aware Sample Allocation for Adaptive Data Augmentation in Semantic Segmentation

    Aug 26, 2026Olasimbo Ayodeji Arigbabu, Abimbola Ismail ArigbabuData AugmentationSemantic Segmentation

  2. Instance Awareness of Multi-class Semantic Segmentation Loss Functions

    Apr 27, 2026Soumya Snigdha Kundu, Florian Kofler, Marina Ivory +3Class-Imbalanced LearningImage Segmentation

  3. ProBAG: Prototype-Guided Boundary-Aware Graph Diffusion for Weakly Supervised Histopathology Segmentation

    Aug 12, 2026Duy-Dong Nguyen, Le-Van Thai, Hoai Nhan Pham +3Histopathology Image SegmentationWeakly Supervised Semantic Segmentation