Breast cancer remains the leading cause of oncological mortality in the female population, making treatment response prediction critical in advanced stages. Tumor-infiltrating lymphocytes (TILs) are a critical prognostic biomarker. However, standard v...
Breast cancer remains the leading cause of oncological mortality in the female population, making treatment response prediction critical in advanced stages. Tumor-infiltrating lymphocytes (TILs) are a critical prognostic biomarker. However, standard visual quantification of TILs on hematoxylin and eosin (H&E) slides in clinical practice suffers from substantial interobserver variability. While immunohistochemistry (IHC) provides an objective ground truth, it is labor-intensive and costly; H&E- to-IHC virtual stain translation offers a promising solution. In this study, we developed a deep generative framework to synthesize virtual IHC patches from H&E patches and create an automated pipeline for accurate TIL quantification, leveraging IHC as a robust ground truth. To ensure precise H&E–IHC image alignment, H&E slides were destained and subsequently restained with IHC on the same slide, followed by a coarse to fine registration process. To enhance the model for accurate synthesis of TIL-specific chromogen, our framework incorporated two key components: (1) a spatial attention mechanism guided by a cell segmentation map, leveraging the characteristic small size of TILs to direct synthesis specifically toward them, and (2) a chromogen loss function based on color separation to guide accurate diaminobenzidine (DAB) or alkaline phosphatase (AP) synthesis. Furthermore, we developed a novel TIL quantification pipeline capable of accurately counting cells even in overlapping regions. Experimental results demonstrate that integrating the spatial attention mechanism and chromogen loss significantly reduced the Mean Absolute Error (MAE) of TIL quantification per patch. Specifically, the MAE decreased from 12.793 to 9.480 for DAB and from 21.113 to 17.755 for AP (p < 0.001 for both) in the best-performing model. In our reader study, no statistically significant difference was observed between the automated pipeline’s quantification and manual assessments (p = 0.314). Moreover, visual scoring confirmed that the synthesized TIL-specific chromogens were comparable to those of ground truth IHC patches (p = 0.640).