# MorphGen: Morphology-Guided Representation Learning for Robust Single-Domain Generalization in Histopathological Cancer Classification

**Authors:** Hikmat Khan, Syed Farhan Alam Zaidi, Pir Masoom Shah, Kiruthika Balakrishnan, Rabia Khan, Muhammad Waqas, and Jia Wu

arXiv: 2509.00311 · 2025-09-03

## TL;DR

MorphGen leverages morphology-guided contrastive learning and stochastic weight averaging to improve domain robustness and interpretability in histopathological cancer classification, addressing heterogeneity and artifacts.

## Contribution

This work introduces MorphGen, a novel framework that explicitly models nuclear morphology and spatial organization to enhance domain generalization in histopathology.

## Key findings

- MorphGen outperforms baseline models on out-of-distribution data.
- The model primarily relies on nuclear and morphological features for classification.
- MorphGen demonstrates robustness to image corruptions and adversarial attacks.

## Abstract

Domain generalization in computational histopathology is hindered by heterogeneity in whole slide images (WSIs), caused by variations in tissue preparation, staining, and imaging conditions across institutions. Unlike machine learning systems, pathologists rely on domain-invariant morphological cues such as nuclear atypia (enlargement, irregular contours, hyperchromasia, chromatin texture, spatial disorganization), structural atypia (abnormal architecture and gland formation), and overall morphological atypia that remain diagnostic across diverse settings. Motivated by this, we hypothesize that explicitly modeling biologically robust nuclear morphology and spatial organization will enable the learning of cancer representations that are resilient to domain shifts. We propose MorphGen (Morphology-Guided Generalization), a method that integrates histopathology images, augmentations, and nuclear segmentation masks within a supervised contrastive learning framework. By aligning latent representations of images and nuclear masks, MorphGen prioritizes diagnostic features such as nuclear and morphological atypia and spatial organization over staining artifacts and domain-specific features. To further enhance out-of-distribution robustness, we incorporate stochastic weight averaging (SWA), steering optimization toward flatter minima. Attention map analyses revealed that MorphGen primarily relies on nuclear morphology, cellular composition, and spatial cell organization within tumors or normal regions for final classification. Finally, we demonstrate resilience of the learned representations to image corruptions (such as staining artifacts) and adversarial attacks, showcasing not only OOD generalization but also addressing critical vulnerabilities in current deep learning systems for digital pathology. Code, datasets, and trained models are available at: https://github.com/hikmatkhan/MorphGen

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/2509.00311/full.md

## Figures

10 figures with captions in the complete paper: https://tomesphere.com/paper/2509.00311/full.md

## References

118 references — full list in the complete paper: https://tomesphere.com/paper/2509.00311/full.md

---
Source: https://tomesphere.com/paper/2509.00311