CellMix: A General Instance Relationship based Method for Data Augmentation Towards Pathology Image Analysis

Tianyi Zhang, Zhiling Yan, Chunhui Li, Nan Ying, Yanli Lei, Yunlu Feng, Yu Zhao, Guanglei Zhang

Abstract

Deep learning in pathology is often constrained by the scarcity of high-quality annotated data. While data augmentation is a common solution, standard mixing-based methods like Mixup and CutMix frequently disrupt critical biological spatial relationships. We present CellMix, a novel augmentation framework that utilizes an "in-place shuffle" strategy to preserve instance relationships and a loss-driven curriculum learning strategy to manage augmentation complexity. CellMix achieves state-of-the-art performance across seven diverse pathology datasets, demonstrating superior generalization and interpretability.

Introduction

The efficacy of deep learning models in pathology image analysis is heavily dependent on large-scale, accurately annotated datasets. However, the acquisition of such data is both expensive and labor-intensive. Data augmentation techniques, which generate synthetic training samples, are essential for improving model robustness. Traditional methods like Mixup or CutMix, while effective in natural image domains, often fail to account for the unique characteristics of pathology images: local specificity (e.g., nuclear-to-cytoplasmic ratios), global distribution (cell orientation and spacing), and complex instance relationships. Randomly pasting patches can create biologically implausible samples that hinder model learning. Furthermore, variability in staining and scanning hardware introduces significant noise, complicating the generalization of models.

Methodology

CellMix addresses these challenges through two core innovations: the In-place Shuffle Strategy and a Loss-driven Curriculum Learning framework.

In-place Shuffle Strategy

Unlike standard methods that randomly swap patches between images, CellMix divides images into a grid and categorizes patches as either "position tokens" (fixed) or "relation tokens." Relation tokens are shuffled across the batch but restricted to their original grid positions. This "in-place" mechanism ensures that global structural features and absolute spatial relationships remain stable, producing pseudo-samples that maintain biological plausibility.

Overview of the CellMix framework, illustrating the in-place shuffle strategy and the loss-driven curriculum learning components.

Loss-driven Curriculum Learning

To manage the increased complexity introduced by augmentation, CellMix employs a curriculum that adapts the difficulty of the training task based on model performance. Two primary schedulers are used:

  1. Patch-size Scheduler: Gradually reduces patch size to shift the model's focus from coarse to fine-grained features.
  2. Fix-position Ratio Scheduler: Progressively reduces the number of fixed patches, increasing the degree of mixing.

The system monitors training loss in real-time. If the loss is low, indicating successful learning, the difficulty is increased. Conversely, if the loss spikes, the system maintains or reduces the difficulty level to ensure stable convergence.

Experimental Evaluation

The proposed method was evaluated on seven distinct datasets spanning cytopathology and histopathology:

  • Cytopathology: ROSE (Pancreas) and WBC (White Blood Cells).
  • Histopathology: pRCC (Kidney), MARS (Stomach), GS (Stomach), Warwick (Colon/Rectum), and NCT (Colon/Rectum).

These datasets range in size from 165 images to 100,000 patches, providing a comprehensive test of the method's robustness across various data scales and clinical tasks.

Results and Discussion

CellMix consistently achieved state-of-the-art (SOTA) results across all evaluated benchmarks. On medium-sized datasets, the method improved accuracy by up to 4.59% and the F1-score by 6.14% compared to baseline models. It significantly outperformed established augmentation techniques such as CutMix, Mixup, and SaliencyMix.

Beyond quantitative metrics, CellMix enhances model interpretability. Grad-CAM visualizations demonstrate that models trained with CellMix focus more precisely on relevant cell boundaries and target instances, whereas models trained with other methods often exhibit scattered or irrelevant attention patterns.

Grad-CAM visualizations comparing CellMix with other augmentation methods across various pathology datasets. CellMix shows more precise localization of critical biological features.

Conclusion

CellMix introduces a biologically-aware approach to data augmentation in pathology. By preserving spatial context through in-place shuffling and employing an adaptive curriculum, it overcomes the limitations of generic augmentation methods. While the method shows high performance, future work will focus on optimizing hyperparameter sensitivity and exploring its application in other medical imaging tasks such as object detection and segmentation.

Summary updated

BibTeX
@article{zhang2025cellmix,
  author = {Tianyi Zhang and Zhiling Yan and Chunhui Li and Nan Ying and Yanli Lei and Yunlu Feng and Yu Zhao and Guanglei Zhang},
  title = {{CellMix: A General Instance Relationship based Method for Data Augmentation Towards Pathology Image Analysis}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2025},
  doi = {10.1109/tnnls.2025.3554752},
}
Figure