acceptodds
Under review as a conference paper at ICLR 2027

StainFlash: Deep-Compression Linear-Attention Flow Matching with Pathological Representation Fusion for H&E-to-IHC Virtual Staining

Abstract

Immunohistochemical (IHC) staining reveals molecular information essential for accurate pathological diagnosis, yet it requires costly and time-consuming chemical procedures. Virtual staining computationally synthesizes IHC images from hematoxylin-eosin (H&E) images stained with low chemical cost, offering a cost-effective alternative. Despite remarkable progress in virtual staining based on recent diffusion models, achieving high-quality, high-resolution H&E-to-IHC staining with low inference latency and computational cost remains a challenge. This paper presents \ours_name, an efficient framework that leverages a flow-matching network with a deep compression autoencoder and linear attention to overcome the latency and memory constraints of high-resolution virtual staining. To enhance pathological fidelity, we propose a timestep-aware lightweight pathology encoder that adaptively modulates the layout embedding extracted from H&E images, along with a novel **k**nowledge-**i**ntensive **i**mplicit representations **f**usion (KIIF) module that effectively fuses knowledge-intensive implicit representations from multiple pathology foundation models into the flow matching network. Extensive experiments on four datasets stained with various biomarkers demonstrate that \ours_name outperforms existing approaches in high-quality, high-resolution H&E-to-IHC staining, with substantially reduced latency and computational cost. Ablation studies also validate \ours_name's novel designs. Our code and trained models will be released.

Primary area:
applications to computer vision, audio, language, and other modalities
Keywords:
H&E-to-IHC Translation, Reinforcement Learning Post-training, Flow Matching Models

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_i4yMOpenReview ↗
Rating
2
Confidence
4
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper introduces StainFlash, a framework for efficient, high-resolution H&E-to-IHC virtual staining. It combines a deep compression autoencoder with a linear-attention flow-matching network, a timestep-aware pathology encoder, and a fusion module incorporating global and patch-level features from two pathology foundation models. Experiments across multiple datasets and biomarkers report favorable image quality and reduced inference latency relative to evaluated diffusion and flow-matching baselines, supported by ablations, external validation, and downstream HER2 classification.

Critical strengths
  1. StainFlash achieves substantially lower inference latency than the evaluated diffusion and flow-matching baselines, with increasingly pronounced advantages at higher resolutions.
  2. Combining global and patch-level representations from pathology foundation models provides a sensible way to incorporate both holistic tissue information and local morphological cues
  3. The evaluation extends beyond standard image-quality metrics to include CONCH-based metrics, downstream HER2 classification, a small-scale blinded pathologist assessment, and failure-case analysis. These complementary assessments help characterize both the method’s utility and its limitations.
Critical weaknesses
  1. Based on the measurements in Table 2, the reduction in memory usage primarily comes from the 32x DC-AE, whereas linear attention mainly contributes to inference acceleration. However, when elaborating on “To address both inference latency and memory constraints,” the Introduction does not clearly connect each bottleneck to the corresponding design choice.
  2. The third paragraph of the Introduction lists numerous references and directly concludes that “these methods suffer from high inference latency and may even fail to produce results due to memory constraints.” The discussion remains at the level of categorizing methods and lacks sufficient technical reasoning to explain why the architectural characteristics of existing virtual staining approaches lead to severe computational bottlenecks at high resolutions.
  3. In Equation (1) in the Preliminaries, z0 denotes noise, z1 denotes the image latent, and t∈[0,1]t\in[0,1]. However, the descriptions “larger timesteps (early stage)” and “smaller timesteps (late stage),” together with the decreasing inference timesteps described for Figure S2, appear inconsistent with the noise-to-data direction defined in Equation (1). The authors should clarify the mapping between these timestep conventions and the corresponding velocity sign.
  4. The variations in the norms of the modulation coefficients in Equation (3) alone do not convincingly support the interpretation that early stages reconstruct structures while later stages refine details. Stage-specific intervention experiments are needed to validate this interpretation.
  5. The ablation study in Table 4 lacks an appropriate backbone baseline, making it difficult to determine how much of the improvement comes from the proposed method and how much comes from the stronger pretrained backbone.
  6. Table 2 shows that most of the acceleration comes from 32× compression. Linear attention provides an additional latency reduction of approximately 13%, with almost no change in memory usage. Its benefits at higher resolutions are not sufficiently established: supplementary Table S3 compares the full StainFlash model with competing methods but does not isolate the contribution of linear attention. A linear-attention ablation at these higher resolutions would strengthen the evidence.
  7. The downstream task trains a ResNet-50 classifier on virtual IHC images and evaluates it on real IHC images to assess the pathological utility of the generated images. However, favorable classification performance does not directly establish that the generated images accurately reproduce true protein expression at the cellular level.
  8. The paper’s methodological novelty is limited. The DC-AE and linear attention are largely inherited from the existing backbone, while KIIF employs relatively conventional fusion mechanisms.
Questions for authors
  1. Can the authors clarify the mapping between training time, scheduler time, and sampling direction, and explain how this affects the interpretation of Figure S2?
  2. Table 4 shows that removing either foundation model degrades performance. How do the authors distinguish complementary pathological information from the benefits of additional tokens and conditioning capacity?
6 comments
AuthorsOpenReview ↗

Response to Reviewer i4yM

We thank Reviewer i4yM for the exceptionally detailed technical review. We answer each point with the requested analyses or concrete revisions.

W1: "Based on the measurements in Table 2, the reduction in memory usage primarily comes from the 32x DC-AE, whereas linear attention mainly contributes to inference acceleration. However, when elaborating on “To address both inference latency and memory constraints,” the Introduction does not clearly connect each bottleneck to the corresponding design choice."

A1: Agreed. The revised introduction (Sec. 1, second paragraph) now pairs each bottleneck with the design choice that targets it: the image-token count drives memory and is reduced by the 32× DC-AE, and the O(N²) attention paid at every block of every denoising step drives latency and is reduced by linear attention. The measurements in Table 2 refine this mapping:

  • 32× DC-AE reduces the number of image tokens by 16× relative to an 8× latent (N ∝ HW/f²). Activations and attention all scale with N, so at 1024² DC-AE is the main source of both savings. From StainFlash-8-SM to StainFlash-32-SM (Table 2), latency drops by 89% and memory by 13% (27% at batch size 8).
  • Linear attention reduces the per-layer attention compute from O(N²) to O(N). Its memory effect is small, which is consistent with softmax attention being computed by memory-efficient kernels that never materialize the N×N matrix. Its latency benefit grows with N: 13%, 39%, and 68% at 1024², 2048², and 4096² (see W6).

Thus, DC-AE addresses memory and the constant factor of latency, whereas linear attention addresses how latency grows with resolution. This refinement has been added to the introduction.

W2: "The third paragraph of the Introduction lists numerous references and directly concludes that “these methods suffer from high inference latency and may even fail to produce results due to memory constraints.” The discussion remains at the level of categorizing methods and lacks sufficient technical reasoning to explain why the architectural characteristics of existing virtual staining approaches lead to severe computational bottlenecks at high resolutions."

A2: We accept this criticism. The revised paragraph (Sec. 1) now explains the architectural cause from the token budget. Diffusion/flow-matching virtual-staining models run 20–200 denoising steps (the baselines' defaults; Sec. 4). In every step, each attention layer processes N = (H/f)² spatial positions, where f is the total downsampling before attention. Self-attention costs O(N²) per layer, so doubling the image side multiplies its cost by 16. This is why pixel-space methods are typically restricted to 256² (Sec. 2). Latent-space models (f = 8 for StainFuser; effectively 16 for PixCell) reduce N, but the quadratic growth remains. The measured latencies from 1024² to 2048² to 4096² (Tables 2 and S3) confirm this reasoning:

  • StainFuser: 3.7 s → 38.6 s → 537.5 s;
  • PixCell: 4.5 s → 20.4 s → 218.1 s;
  • StainFlash: 1.15 s → 4.18 s → 15.9 s, i.e., ≈4× per doubling, as expected when the cost is linear in N.

DC-AE reduces N, and linear attention removes the quadratic dependence on N. These measurements are now cited in the paragraph.

AuthorsOpenReview ↗

Response to Reviewer i4yM

W3 / Q1: "In Equation (1) in the Preliminaries, z0 denotes noise, z1 denotes the image latent [...] However, the descriptions “larger timesteps (early stage)” and “smaller timesteps (late stage),” together with the decreasing inference timesteps described for Figure S2, appear inconsistent with the noise-to-data direction defined in Equation (1). The authors should clarify the mapping between these timestep conventions and the corresponding velocity sign." "Can the authors clarify the mapping between training time, scheduler time, and sampling direction, and explain how this affects the interpretation of Figure S2?"

A3: We apologize for the confusion. This is a notational inconsistency in the text, not a modeling issue. The mapping is:

  • Training time t ∈ [0, 1] (Eq. 1) is the data weight: t = 0 is pure noise and t = 1 is data. The target velocity is v = dz_t/dt = z₁ − z₀ (data minus noise).
  • Scheduler time T = 1000·(1 − t) ∈ [0, 1000] is the input to the time embedders: T = 1000 is pure noise and T = 0 is data. The original method section wrote T = t×1000, which was incorrect.
  • Sampling integrates from noise to data: t increases from 0 to 1, so T decreases from 1000 to 0. Each Euler step is z ← z + Δt·u(z, c, t) with Δt = (T_k − T_{k+1})/1000 > 0. The only sign flip is dz/dT = −v/1000.

Consequently, the interpretation of Fig. S2 is unchanged: large T corresponds to the early, high-noise stage of sampling. The decrease of ‖α‖ with decreasing T means that the modulation weakens as sampling approaches the data. The revision defines this mapping in the Preliminaries (Sec. 3.0.1), refers the pathology encoder to the scheduler timestep T, and states the direction of T in the caption of Fig. S2. No reported value is affected.

W4: "The variations in the norms of the modulation coefficients in Equation (3) alone do not convincingly support the interpretation that early stages reconstruct structures while later stages refine details. Stage-specific intervention experiments are needed to validate this interpretation."

A4: We agree that the norm analysis alone is insufficient, and we tested the interpretation in two ways (Sec. D.10, Fig. S4).

Stage-specific intervention (RegH2I test set). We split the 20 sampling steps into early (1–6), middle (7–13), and late (14–20) segments. We then zero the Eq. (3) modulation in one segment at a time. Besides DISTS, we measure two consistency scores with the real IHC. Structure is the Pearson correlation of 32×32-downsampled grayscale images, which captures tissue layout. Texture is the Pearson correlation of Sobel gradient maps at scale 128, which captures nuclear/membrane detail.

Modulation zeroed inStructure r ↑Texture r ↑DISTS ↓
None (StainFlash)0.820.320.173
Early (steps 1–6)0.670.300.181
Middle (steps 7–13)0.750.250.176
Late (steps 14–20)0.800.180.178

Early zeroing mainly damages layout (structure −0.15, texture −0.02). Late zeroing mainly damages detail (structure −0.02, texture −0.14). Middle zeroing is intermediate on both. Texture loss is small under early zeroing for two reasons: the Sobel score is largely insensitive to low-frequency layout errors, and the middle and late steps remain modulated and can still refine detail.

Trajectory illustration (row 3 of Fig. 2, single image; Fig. S4). We record all 20 intermediate states and compute the same two scores at every step. The flow-matching schedule spends more steps at high noise. At step 14 (T ≈ 617), the structure correlation has already reached 0.53 (65% of its final 0.81), while the texture correlation is still near zero. Over the final steps, the structure gains decelerate (+0.043, +0.024, +0.010), whereas texture keeps rising (0.12 → 0.33 over the last five steps; +0.026 at the last step).

Both analyses are consistent with the interpretation suggested by the norm analysis: strong early modulation injects structural priors, and late steps refine nuclear and membrane details. The trajectory result comes from a single image, so we regard the intervention on the full test set as the primary evidence.

AuthorsOpenReview ↗

Response to Reviewer i4yM

W5: "The ablation study in Table 4 lacks an appropriate backbone baseline, making it difficult to determine how much of the improvement comes from the proposed method and how much comes from the stronger pretrained backbone."

A5: First, all Table 4 variants share the same SANA-0.6B initialization and training settings. The table therefore isolates our modules with the backbone held fixed. Second, Table S12 reports the backbone's own contribution (DISTS / FID / KID): training from scratch gives 0.188 / 44.66 / 0.0185, and freezing the pretrained weights gives 0.183 / 37.32 / 0.0099, vs. 0.173 / 31.66 / 0.0033 for full fine-tuning. Two comparisons with existing results bound the role of the backbone from both sides:

  • Without any SANA pretraining, StainFlash still outperforms PixCell on DISTS (0.188 vs. 0.220) and FID (44.66 vs. 47.77), but not on KID (0.0185 vs. 0.0138). PixCell is a flow-matching model of comparable size (608 M), pretrained on large-scale pathology data and conditioned on UNI2-h.
  • With the pretrained backbone and the pathology encoder but without KIIF (w/o Implicit: 0.188 / 36.39 / 0.0098), StainFlash falls behind Peng et al. (0.174 / 33.92 / 0.0058) on all three metrics.

Pretraining alone therefore does not account for the gains. We note that we did not train a bare-backbone configuration (pretrained SANA with plain H&E latent concatenation); w/o Implicit is the closest available proxy. This is now stated in Sec. D.8.

W6: "Table 2 shows that most of the acceleration comes from 32× compression. Linear attention provides an additional latency reduction of approximately 13%, with almost no change in memory usage. Its benefits at higher resolutions are not sufficiently established: supplementary Table S3 compares the full StainFlash model with competing methods but does not isolate the contribution of linear attention. A linear-attention ablation at these higher resolutions would strengthen the evidence."

A6: We ran the isolated ablation: only the attention type is switched from linear back to softmax, with all other configurations and the sampling pipeline unchanged. We measured end-to-end latency and peak memory as in Table 2 (80-GB GPU) at 1024², 2048², and 4096²; at 1024², the softmax variant is StainFlash-32-SM in Table 2. The image-token count grows 4× per doubling of the side length, so the softmax attention cost grows 16× while the linear attention cost grows 4×. The measured latencies (softmax vs. linear) are 1.325 vs. 1.149 s (1024²), 6.83 vs. 4.18 s (2048²), and 49.9 vs. 15.9 s (4096²). The saving of linear attention thus widens from 13% to 39% and then 68%, i.e., its benefit compounds with resolution. As the reviewer notes, the memory difference is limited (about 10% even at 4096²). As explained in A1, memory is addressed mainly by the 32× DC-AE. This table has been added to Sec. D.3 (Table S5).

Linear vs. softmax attention across resolutions

ResolutionImage tokensSoftmax latencyLinear latencyLinear savingSoftmax memoryLinear memory
1024²1,0241.325 s1.149 s13.3%8.782 G8.781 G
2048²4,0966.83 s4.18 s38.8%9.17 G8.84 G
4096²16,38449.9 s15.9 s68.2%10.07 G9.05 G

Image tokens: number of image-latent tokens after the 32× DC-AE, (H/32)².

Reviewer_Xdo2OpenReview ↗
Rating
3
Confidence
3
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper proposes StainFlash, a flow matching framework for high-resolution H&E-to-IHC virtual staining. It builds on the pretrained SANA, using a 32× deep-compression autoencoder and linear attention to reduce latency and memory usage. H&E features enter through two paths: a lightweight CNN encoder with timestep-dependent modulation, and a KIIF module that injects global and patch tokens from pathology foundation models. Experiments on multiple HER2/ER datasets report better DISTS, FID, and KID scores, lower latency than diffusion baselines, and also achieve better results in downstream HER2 classification tasks.

Critical strengths
  1. Efficient high-resolution virtual staining is a real need in computational pathology. Bringing SANA-style efficient generation to this task is somehow a reasonable direction.
  2. The benchmark experiments cover lots of datasets and include a wide range of baseline models for comparison and ablation studies.
Critical weaknesses
  1. All training and quality evaluation are performed only at 1024×1024 resolution. What are the performance and computational efficiency at different resolution settings? Also, note that pathology foundation models like UNI-h almost always perform inference at 224/256 pixels; how does the model perform forward propagation at 1024 resolution?

  2. The parameters listed in Table 2 do not appear to include those for the pathology foundation model. Please clarify whether the latency and memory usage figures include the forward pass for these components, and provide end-to-end computational efficiency metrics that encompass all components.

  3. Zero embeddings are one of the ablation studies for pathology encoders. However, the study may not be able to separate pathology-specific knowledge from simply adding an extra conditioning pathway. Can you compare with natural-image encoders such as DINOv2 or an ImageNet-supervised ViT?

Questions for authors

Please see the weakness above.

2 comments
AuthorsOpenReview ↗

Response to Reviewer Xdo2

We thank Reviewer Xdo2 for the accurate summary and for recognizing the breadth of our benchmark. We answer the three technical questions in turn.

W1: "All training and quality evaluation are performed only at 1024×1024 resolution. What are the performance and computational efficiency at different resolution settings? Also, note that pathology foundation models like UNI-h almost always perform inference at 224/256 pixels; how does the model perform forward propagation at 1024 resolution?"

A1: Efficiency across resolutions. Table 2 (1024²) and Table S3 (2048², 4096²) report end-to-end latency and memory. StainFlash's advantage over the diffusion/flow-matching baselines grows with resolution: at 4096², its latency is 15.9 s, vs. 218.1 s for PixCell and 537.5 s for StainFuser. To isolate how much of this scaling comes from linear attention, we ran an additional ablation on StainFlash. Only the attention type is switched from linear back to softmax, with all other configurations and the sampling pipeline unchanged. We measured end-to-end latency and peak memory as in Table 2 (80-GB GPU) at 1024², 2048², and 4096². The image-token count grows 4× per doubling of the side length, so the softmax attention cost grows 16× while the linear attention cost grows 4×. At 1024², the softmax variant is StainFlash-32-SM in Table 2, and its quality is comparable to that of StainFlash (Table 4, w/o Linear: DISTS/FID/KID 0.171/31.83/0.0036 vs. 0.173/31.66/0.0033). As shown below, the latency saving of linear attention widens from 13% at 1024² to 39% at 2048² and 68% at 4096², whereas peak memory changes by at most about 10%. Even the softmax variant remains faster than the baselines at 4096² (49.9 s vs. 218.1 s and 537.5 s), so the 32× DC-AE and linear attention both contribute to the scaling. This table has been added to Sec. D.3 (Table S5).

Linear vs. softmax attention across resolutions (end-to-end)

ResolutionImage tokensSoftmax latencyLinear latencyLinear savingSoftmax memoryLinear memory
1024²1,0241.325 s1.149 s13.3%8.782 G8.781 G
2048²4,0966.83 s4.18 s38.8%9.17 G8.84 G
4096²16,38449.9 s15.9 s68.2%10.07 G9.05 G

Image tokens: number of image-latent tokens after the 32× DC-AE, (H/32)². Quality at 2048² and 4096² was not measured for either variant, since paired references exist only at 1024² (see below).

Quality across resolutions. We acknowledge this limitation. Training and all reference-based evaluation are at 1024², the size of the registered paired patches in the benchmarks (Appendix B). We have not measured generation quality at other native resolutions. In the paper, higher-resolution outputs are produced by tiling. The three HER2 WSIs (up to 38144×29984 pixels; Sec. D.16, Figs. S12–S14) are inferred as overlapping 1024² patches and stitched. Two board-certified pathologists ranked StainFlash first among four methods (mean rank 1.0). This shows that StainFlash scales to slide-level outputs at its training resolution. It does not show generalization to other native resolutions, and this is now stated in Sec. E.

Foundation-model forward pass. UNI2-h and Phikonv2 always run at their native 224×224 input: the 1024² H&E condition is resized to 224² and ImageNet-normalized before the ViTs (now stated in Sec. 3.0.3). They therefore yield a fixed number of tokens regardless of the generation resolution: 256 (UNI2-h, ViT-H/14) + 196 (Phikonv2, ViT-L/16) patch tokens, plus the global tokens. This has two consequences. First, the foundation-model cost is constant (0.054 s in total; Table S4). Second, the foundation models see the 1024² field of view at a coarser effective magnification than their pretraining tiles. Their patch tokens thus act as a coarse (16×16 / 14×14) semantic map, while the pathology encoder supplies fine-grained layout at full resolution.

AuthorsOpenReview ↗

Response to Reviewer Xdo2

W2: "The parameters listed in Table 2 do not appear to include those for the pathology foundation model. Please clarify whether the latency and memory usage figures include the forward pass for these components, and provide end-to-end computational efficiency metrics that encompass all components."

A2: We apologize for the unclear presentation: the parameter column listed only the generative network. The latency and memory in Table 2 are, however, end-to-end values covering all components. These are the forward passes of both pathology foundation models, the pathology encoder, the 20-step flow-matching network, and DC-AE decoding. The per-component breakdown is below (new Table S4), totaling 1,756.6 M parameters and 1.149 s. The 8.78 GB memory in Table 2 is the peak GPU memory of this full pipeline. The revised Complexity Analysis (Sec. 4) states this accounting explicitly and reports the system-level parameter count alongside the network-level one.

End-to-end efficiency breakdown at 1024² (Table S4)

ComponentParametersLatency
UNI2-h681.4 M0.031 s
Phikonv2303.4 M0.023 s
Pathology encoder4.8 M0.011 s
Flow-matching network (20 steps)607.8 M1.064 s
DC-AE decoder159.2 M0.020 s
End-to-end total1,756.6 M1.149 s

The 32× DC-AE consists of a 159.2 M decoder, the only part executed at inference, and a 153.1 M encoder used only in training. Including the encoder, the system has 1,909.7 M parameters in total.

W3: "Zero embeddings are one of the ablation studies for pathology encoders. However, the study may not be able to separate pathology-specific knowledge from simply adding an extra conditioning pathway. Can you compare with natural-image encoders such as DINOv2 or an ImageNet-supervised ViT?"

A3: This is a fair criticism, and we ran the requested control (Sec. D.6, Table S10). We keep a near-identical token budget and the identical fusion pathway, and replace UNI2-h + Phikonv2 with natural-image encoders at two capacity tiers. Natural-B uses DINOv2-B and a supervised ImageNet ViT-B/16; Natural-L uses DINOv2-L and an ImageNet ViT-L/16. The natural encoders' tokens are rescaled per batch to the mean token norm of the pathology encoders, so the conditioning pathway sees consistent input statistics. Results are below.

  • The extra pathway itself brings no consistent gain. With natural-image tokens, FID degrades from 31.66 to 38.54. This is worse than removing either pathology model (w/o UNI: 33.83; w/o Phi: 33.75; Table 4), and also worse than zero embeddings (w/o Implicit: FID 36.39, KID 0.0098). Only DISTS is lower than with zero embeddings (0.179 vs. 0.188).
  • The degradation is largest on pathology-semantic metrics. C-FID nearly doubles (17.53 → 32.72/31.60), and C-SIM drops (0.928 → 0.910/0.913). The relative gap is far larger than for Inception-FID (+87% vs. +22%). DAB expression correlation also degrades (0.983 → 0.954/0.951). This is the expected signature if what is lost is pathology-specific knowledge rather than generic conditioning capacity.
  • Capacity does not close the gap. Scaling the natural encoders from ViT-B to ViT-L (3.5× parameters per encoder) barely moves FID (38.54 → 38.47), and C-SIM and DAB correlation are essentially unchanged.

Together, these results indicate that the benefit comes from pathology-domain knowledge rather than from the additional pathway or conditioning capacity. The ablation section of the main text now summarizes this control.

Pathology vs. natural-image encoder control (RegH2I; Table S10)

ConfigurationEncodersDISTS ↓FID ↓KID ↓C-FID ↓C-SIM ↑DAB-R ↑
StainFlash (pathology)ViT-H 681M + ViT-L 303M0.17331.660.003317.530.92810.9832
Natural-BViT-B 86M + ViT-B 86M0.178838.540.0116332.720.91010.9544
Natural-LViT-L 304M + ViT-L 304M0.176638.470.0110031.600.91320.9506

C-FID: CONCH-based FID; C-SIM: mean cosine similarity of CONCH embeddings (as in Table S2); DAB-R: Pearson correlation of per-image DAB optical density with the real IHC (as in Table S15). Row 1 is the full configuration (Tables 1, S2, and S15). Rows 2–3 replace only the two pathology encoders, under the identical training protocol, fusion pathway, CFG, and evaluation pipeline.

Reviewer_GzbSOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
1
Soundness
2
Read review
Paper summary

The authors introduce a novel amalgamate of style transfer recipes based on (a) flow-matching, an umbrella framework covering diffusion modelling, (b) linear-attention and DC-AE borrowed from SANA, (c) foundation model priors through the KIIF module, and (d) a pathology encoder with timestep dependant modulation following observations in Patrick Esser et al. Scaling rectified flow transformers for high-resolution image synthesis. In ICML, 2024. Thorough ablation confirms improvements. Clarity on novelty is needed, and commentary on the use of qualitative assessments is provided.

Critical strengths

The authors have gone to incredible lengths in the expression of their approach. The resulting paper is dense with information, and is complete.

  • a comprehensive introduction to relevant literature, extending well into the methodology section where the approach is defined granularly;
  • incorporation of several comparison baselines, including CycleGAN, USIGAN, AI-FFPE, pix-2-pix (incl. the HD variant), ControlNet, StainFuser, PixCell, HistDist, and others.
  • a comprehensive assessment using publicly available datasets: RegH2I, BCI, MIST-HER2, MIST-ER.
  • extensive ablation, showing that the KIIF module is an essential component of the method.
Critical weaknesses

•⁠ ⁠While the architectural amalgamate is novel, a ‘domain-transfer’ alone is by itself not a novelty worthy of ICLR. The reviewer says this with respect to the use of the linear-attention and DC-AE, both being contributions from published sources. I suggest that KIIF and time-step modulated pathology encoder could be the main contributing element, with efficiency gains presented as more application focused engineering. With regards to this, the methods section could be shortened. •⁠ ⁠Figure 2: There is an inherent bias in the reporting of erroneous regions. The use of ellipses generously in competing methods, while leaving out the same for the method proposed by the authors, makes it difficult to assess the limitations. Granted, figure S4 provides one such case, but this needs to be in the main text so as to avoid commentary suggesting cherry-picking. The use of qualitative figures is unintuitive because it can be misleading. For example, the cell-poor un-stained stroll region of StainFlash results in row 3 of figure 2 does, when compared with IHC, shows a greater cellular density. Had this been quantified overall in the slide, this would not be an issue. One preferable quantitative means is an approach that utilises nuclei detection or segmentation on the generated sample. A quick search using AI agents recommends the work of Kataria et al. 2025, “Building Trust in Virtual Immunohistochemistry: Automated Assessment of Image Quality” (arXiv 2511.04615). Pertaining to this, I believe the comments on comparison metrics also extend to the quantitative metrics such as FID, as have been argued about in arXiv 2511.04615, arXiv 2511.18946, and, arXiv 2507.12624. Works, such as that by Khan et al. 2023, Patterns 4(5), “The effect of neural network architecture on virtual H&E staining”, are already taking this into account.

Questions for authors

Are you able to deliver quantified results in Figure 2 as I don't know if you can make claims based on the qualitative presentation.

4 comments
AuthorsOpenReview ↗

Response to Reviewer GzbS

W2: "Figure 2: There is an inherent bias in the reporting of erroneous regions. The use of ellipses generously in competing methods, while leaving out the same for the method proposed by the authors, makes it difficult to assess the limitations. Granted, figure S4 provides one such case, but this needs to be in the main text so as to avoid commentary suggesting cherry-picking. The use of qualitative figures is unintuitive because it can be misleading. For example, the cell-poor un-stained stroll region of StainFlash results in row 3 of figure 2 does, when compared with IHC, shows a greater cellular density. Had this been quantified overall in the slide, this would not be an issue. One preferable quantitative means is an approach that utilises nuclei detection or segmentation on the generated sample. A quick search using AI agents recommends the work of Kataria et al. 2025, “Building Trust in Virtual Immunohistochemistry: Automated Assessment of Image Quality” (arXiv 2511.04615). Pertaining to this, I believe the comments on comparison metrics also extend to the quantitative metrics such as FID, as have been argued about in arXiv 2511.04615, arXiv 2511.18946, and, arXiv 2507.12624. Works, such as that by Khan et al. 2023, Patterns 4(5), “The effect of neural network architecture on virtual H&E staining”, are already taking this into account."

A2: We apologize for the asymmetric annotation; the reviewer is right that it hinders assessing limitations. In the revision: (i) the failure case (formerly Fig. S4) is moved into the main text as Fig. 3; (ii) Fig. 2 is re-annotated with the same red-ellipse standard for all methods, including ours: the cell-poor stromal region the reviewer identified in our row-3 result is now circled with a red ellipse. The caption no longer states that our results are correct wherever the baselines err.

On the cell-poor un-stained stroll region, we quantified nuclei density on the full RegH2I test set (Sec. D.12, Table S14). We applied the same Cellpose nuclei model to real and generated IHC images, comparing StainFlash with Peng et al. and PixCell. The reviewer's observation is correct, and the over-densification is shared by all three methods. In cell-poor regions, StainFlash over-densifies by a similar factor to Peng et al. (2.46 vs. 2.39; Peng et al. is slightly better) and by a smaller factor than PixCell (2.86). On the row-3 image, the stromal density ratio is 3.37 for StainFlash vs. 3.58 for Peng et al. and 4.51 for PixCell. Our total nuclei count on this image (614) is the closest of the three methods to the real IHC (586). One plausible contributing factor is that stromal nuclei in real IHC are often only weakly counterstained. The detector may therefore under-count them in the reference, whereas generative models tend to render every nucleus visible in the H&E input. The current data cannot separate these two factors. The revision reports this behavior as a limitation shared by current methods (Sec. E).

On FID: we agree that Inception-feature metrics are insensitive to pathological fidelity. The revision adds a paragraph on the limitations of reference-based metrics (Sec. 4), citing Kataria et al. (2025a), Khan et al. (2023), and related work. Our evaluation now spans five complementary levels: perceptual (DISTS/FID/KID), pathology-semantic (CONCH-based C-FID/C-SIM), cellular (Cellpose nuclei quantification), protein expression (DAB optical density and DAB-positive lesions), and clinical utility with expert judgment (downstream HER2 classification; blinded pathologist ranking).

AuthorsOpenReview ↗

Response to Reviewer GzbS

Q1: "Are you able to deliver quantified results in Figure 2 as I don't know if you can make claims based on the qualitative presentation."

A3: Yes. We quantify Fig. 2 at two levels, both on the RegH2I test set.

Nuclei level (Sec. D.12). On the row-3 image, the nuclei counts are 586 (real IHC), 614 (StainFlash), 640 (Peng et al.), and 695 (PixCell). Within the cell-poor stromal region the reviewer pointed out, the real IHC has 0.60 nuclei per 64×64-pixel tile, vs. 2.02 (StainFlash), 2.15 (Peng et al.), and 2.71 (PixCell). Full-test-set statistics are shown below. Among the three methods, StainFlash has the highest per-image count correlation with the real IHC (Pearson r = 0.936) and the lowest mean absolute count error (85.7). Peng et al. is marginally better on tile-level density correlation and on the cell-poor ratio.

Nuclei-level quantification (RegH2I test set; Table S14)

MethodMean countMAE ↓Count r ↑Tile r ↑Cell-poor ratio (→1)
Real IHC832.8———1.00
StainFlash (ours)846.185.70.9360.2482.46
Peng et al. 2024831.495.80.9110.2532.39
PixCell923.8158.10.8460.1712.86

MAE: mean absolute per-image nuclei-count error vs. real IHC. Count r: per-image count correlation. Tile r: correlation of nuclei density over a 16×16 grid of 64×64-pixel tiles. Cell-poor ratio: generated/real density within the lowest-quartile tiles of the real IHC (closer to 1 is better).

DAB level (Sec. D.13). We follow the deconvolution-based masking protocol of Kataria et al. (2025a). Each IHC image is unmixed by Beer–Lambert color deconvolution, and the DAB channel is binarized at a fixed optical-density threshold of 0.15, applied uniformly to all methods. We then compare real and virtual DAB-positive masks. Localization metrics: pixel-level IoU; Dice with a 3-pixel boundary tolerance; and lesion-level precision/recall/F1, where lesions are 8-connected DAB-positive components, matched when their IoU with a real lesion is ≥ 0.25. Quantity metrics: per-image error and correlation of the lesion count, and the error of the DAB-positive area fraction. The ranking of the three methods is unchanged for every threshold in 0.10–0.30. StainFlash is best on seven of the eight metrics and tied with Peng et al. on lesion recall (0.639).

DAB-positive lesion quantification (RegH2I test set; Table S16)

MethodIoU ↑tol-Dice (3px) ↑Lesion F1 ↑Lesion P ↑Lesion R ↑Count MAE ↓Count r ↑Area-ratio err ↓
StainFlash (ours)0.1710.4480.6280.7280.6398.10.9560.0028
Peng et al. 20240.0170.1750.5970.7000.6399.00.9430.0033
PixCell0.1170.3320.5550.6440.63719.50.7480.0077

Count MAE / Count r: per-image DAB-positive lesion count error and correlation vs. real IHC. Area-ratio err: mean absolute error of the DAB-positive pixel fraction. Since serial-section pairs are not pixel-aligned (Appendix C), boundary-tolerant Dice and lesion-level F1 are the more appropriate localization measures. On these, StainFlash leads the next-best method by 35% (relative) and 5%, respectively.

Reviewer_GzbSOpenReview ↗

Much Improved Presentation

Re-reading the manuscript with edits, the framing of the contribution is much improved and additional analyses in rebuttal help to address most of my major concerns. I no longer object to acceptance of this manuscript but it remain borderline.

AuthorsOpenReview ↗

Response to Reviewer GzbS

Thank you very much for re-reading our manuscript and for raising your assessment to borderline acceptance. We sincerely appreciate your constructive feedback throughout the review process, and we hope the final rating will have a chance to reflect this updated view.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.