Learning Class Difficulty in Imbalanced Histopathology Segmentation via Dynamic Focal Attention

Lakmali Nadeesha Kumari, Sen-Ching Samson Cheung
4/15/2026
eess.IVcs.CV

No confident code implementation found for this paper.

Abstract

Semantic segmentation of histopathology images under class imbalance is typically addressed through frequency-based loss reweighting, which implicitly assumes that rare classes are difficult. However, true difficulty also arises from morphological variability, boundary ambiguity, and contextual similarity-factors that frequency cannot capture.

Show full abstract

We propose Dynamic Focal Attention (DFA), a simple and efficient mechanism that learns class-specific difficulty directly within the cross-attention of query-based mask decoders. DFA introduces a learnable per-class bias to attention logits, enabling representation-level reweighting prior to prediction rather than gradient-level reweighting after prediction. Initialised from a log-frequency prior to prevent gradient starvation, the bias is optimised end-to-end, allowing the model to adaptively capture difficulty signals through training, effectively unifying frequency-based and difficulty-aware approaches under a common attention-bias framework. On three histopathology benchmarks (BDSA, BCSS, CRAG), DFA consistently improves Dice and IoU, matching or exceeding a difficulty-aware baseline without a separate estimator or additional training stage. These results demonstrate that encoding class difficulty at the representation level provides a principled alternative to conventional loss reweighting for imbalanced segmentation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kumari2026learning,
  title  = {Learning Class Difficulty in Imbalanced Histopathology Segmentation via Dynamic Focal Attention},
  author = {Lakmali Nadeesha Kumari and Sen-Ching Samson Cheung},
  year   = {2026},
  eprint = {2604.13479},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.13479v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.13479.svg)](https://codeofpaper.com/paper/2604.13479)

Discussion