ChromaNest improves histopathology classification by modeling stain physics

ChromaNest: Stain-Conditioned Nested Graph Attention with Optical-Density Edge Priors for Leakage-Audited H&E Histopathology Classification

Computer Vision and Pattern RecognitionArtificial Intelligence

Summary

Medical images of tissues stained with special dyes can look very similar, making it hard for AI to tell them apart accurately. The researchers designed ChromaNest, a new AI method that understands how these stains affect images by using physics-based information inside the model. This helps the AI to better recognize tissue patterns, even when the staining varies, leading to more reliable results across different datasets. They tested it on many public datasets and found it outperformed other common AI models while also providing more trustworthy confidence estimates.

What this means in practice

  • For medical imaging developers: Create histopathology image classifiers that remain accurate despite variations in tissue staining using ChromaNest’s stain-aware graph transformer.
  • For digital pathology platform engineers: Implement reliability checks in pathology software by using ChromaNest’s approach to reduce test data leakage from near-duplicate images.

Authors

Touhid Alam, Sumaiya Sarkar Shimla, Md. Manzurul Hasan, Md. Rafiqul Islam

Abstract

Deep-learning classifiers for haematoxylin and eosin (H&E) tiles often report near-ceiling accuracy, yet public benchmarks are frequently split so that near-duplicates of test tiles appear in training, and stain chemistry is treated only as a nuisance. We present ChromaNest, a stain-aware nested graph transformer (5.33M parameters, 3.04 GFLOPs per tile) that uses stain physics inside the network. A non-learned, per-image front-end separates H&E optical densities; stain differences enter windowed attention among 784 patch nodes as learnable edge penalties, stain-conditioned keys softly assign the nodes to 16 compartments, and compartment context returns to every node through zero-initialised feature-wise modulation. We evaluate six public datasets (150,581 images), splitting each at the finest level its metadata allow: patient-grouped cross-validation on BreakHis, source-image grouping on lymphoma, a patient-disjoint external cohort, and otherwise Source-Separated Image Partitioning (SSIP), which groups perceptual-hash near-duplicates before splitting. Hyperparameters, checkpoints and calibration were chosen on validation data only. ChromaNest reached 91.84 +/- 2.37% accuracy under patient-grouped cross-validation on BreakHis and 96.84 +/- 0.14% on the external 50-patient CRC-VAL-HE-7K cohort without adaptation. Random tile splits leaked near-duplicates for 86.9% (LC25000), 100% (lymphoma) and 35.9% (oral cancer) of test images. Under SSIP, five-seed accuracies ranged from 94.66% to 99.88%, with calibration error at most 2.16%. Stain conditioning contributed at least as much macro-F1 as the whole compartment hierarchy, mainly through the optical-density input, and under +/-30% stain drift ChromaNest lost 34-38% less macro-F1 than Swin-Tiny and ConvNeXt-Tiny. Code: https://doi.org/10.5281/zenodo.24403413