Abstract
Frozen section (Frozen) analysis is essential for intraoperative margin assessment in skin cancer surgery, but assessment is limited by freezing artifacts that obscure cellular detail. Formalin-fixed paraffin-embedded (FFPE) histopathology, the gold standard, provides higher quality but requires >24 h for processing. Herein, we developed and validated generative AI models to translate Frozen images into AI-generated FFPE images (GenFFPE) using 2594 slides from 283 cases across five major skin cancer types. Four unpaired image-to-image models (CycleGAN, CUT, AIFFPE, and SANTA) were trained and compared using quantitative metrics and expert rankings; CUT demonstrated the best overall fidelity. External validation and a visual Turing test (accuracy 60.2%) confirmed image realism. Among 55 discrepant cases, GenFFPE-based reassessment increased diagnostic concordance by 53.3%. AI-based Frozen-to-FFPE translation is, thus, feasible and clinically meaningful, offering a potential tool to improve intraoperative diagnostic reliability and support decision-making for challenging tumor types such as extramammary Paget’s disease.
Subject terms: Cancer, Computational biology and bioinformatics, Medical research, Oncology
Introduction
Skin cancer is one of the most common malignancies worldwide, and its known incidence continues to rise owing to aging populations and heightened public awareness1–3. Surgical excision with histopathological confirmation of clear margins remains the cornerstone of curative treatment4, while intraoperative frozen section (Frozen) analysis enables rapid margin assessment and can guide immediate surgical decisions5. However, Frozens are often compromised by freezing artifacts, including ice crystal formation, folding, and tissue distortion, which can hinder the reliable identification of tumor cells6,7. These limitations are particularly pronounced in conditions such as extramammary Paget’s disease (EMPD), in which tumor cells may closely resemble normal keratinocytes with ice crystal formation8.
By contrast, formalin-fixed paraffin-embedded (FFPE) histopathology is considered the gold standard for tissue diagnosis, providing superior structural preservation and staining quality9. However, FFPE processing requires at least 24 h, rendering it impractical for intraoperative use. The discordance between Frozen and FFPE diagnoses is clinically significant, with reported discrepancy rates for skin cancer resection margins ranging from 3% to 15%10–13. Major discrepancies, such as false-negative margins on Frozens that later prove positive on FFPE histopathology, can result in incomplete excisions requiring reoperation, whereas false positives may lead to unnecessary tissue sacrifice, longer operation times, and increased morbidity12. These challenges highlight the urgent need for approaches that enhance diagnostic reliability during surgery.
Recent advances in artificial intelligence (AI) and generative adversarial networks (GANs) have enabled image–image translation across histopathologic domains14,15. Several studies have demonstrated the feasibility of translating Frozen images into FFPE images (Frozen–FFPE translation) in brain, lung, and other cancers9,16–20. Although these approaches have shown promise, their application in skin cancers, particularly in the context of resection margin assessment, has not yet been systematically explored. Given the complex architecture of the epidermis, dermis, and adnexal structures21, as well as the diagnostic challenges unique to skin cancer subtypes, specialized validation is required22.
Based on these considerations, the aims of this study were threefold: to establish a curated digital pathology dataset of Frozen and FFPE slides from five major skin cancer types (with a particular focus on EMPD); to develop and compare multiple generative AI models for Frozen–FFPE translation; and to evaluate their performance through quantitative, qualitative, and clinical validation, including diagnostic reassessment of discrepant cases.
Results
Dataset characteristics and diagnostic variability
A total of 2594 slides were collected between January 2010 and December 2023, including 1192 paired Frozen and FFPE slides, with 210 additional FFPE slides from the main tumor masses, derived from 283 patients across five major skin cancer subtypes [EMPD, Bowen’s disease (squamous cell carcinoma (SCC) in situ; BOWEN), invasive SCC, basal cell carcinoma (BCC), and malignant melanoma]. The overall clinical and pathologic characteristics are summarized in Table 1, detailing the number of pathology slides, extension, and Frozen–FFPE diagnosis discrepancy, as well as the mean age and sex distribution. In total, 54,243 Frozen and 245,078 FFPE patches were included for model development (Supplementary Table 1). The overall tumor extension rate was 5.5% for Frozen specimens and 7.6% for FFPE specimens, with EMPD showing the highest extension rates (Frozen 23.8%, FFPE 34.2%). The overall diagnostic discrepancy rate between Frozen and FFPE specimens was 5.0%, including 1.3% major discrepancies, which were most commonly observed in EMPD (Supplementary Fig. 1).
Table 1.
Clinical characteristics and diagnostic discrepancies between Frozen and FFPE samples by skin cancer type
| EMPD (n = 60) | BOWEN (n = 50) | SCC (n = 43) | BCC (n = 58) | Melanoma (n = 72) | Total (n = 283) | |
|---|---|---|---|---|---|---|
| Age, years | 68.0 (11.0); 53–94 | 73.1(10.9); 40–90 | 82.8 (6.5); 67–98 | 73.1 (9.1); 47–88 | 68.2 (12.3); 24–98 | 71.9 (10.7); 24–98 |
| Sex | ||||||
| Male | 40 (66.7%) | 17 (34.0%) | 15 (34.9%) | 17 (29.3%) | 27 (37.5%) | 116 (41.0%) |
| Female | 20 (33.3%) | 33 (66.0%) | 28 (65.1%) | 41 (70.7%) | 45 (62.5%) | 167 (59.0%) |
| Pathology slide | ||||||
| Main mass | 24 | 38 | 38 | 49 | 61 | 210 |
| Frozen | 202 | 212 | 206 | 256 | 316 | 1192 |
| FFPE | 202 | 212 | 206 | 256 | 316 | 1192 |
| Total | 428 | 462 | 450 | 561 | 693 | 2594 |
| Extension | ||||||
| Frozen | 48 (23.8%) | 4 (1.9%) | 6 (2.9%) | 6 (2.3%) | 1 (0.3%) | 65 (5.5%) |
| FFPE | 69 (34.2%) | 3 (1.4%) | 6 (2.9%) | 8 (3.1%) | 5 (1.6%) | 91 (7.6%) |
| Frozen-FFPE discrepancy | ||||||
| Minimal | 12 (5.9%) | 9 (4.2%) | 5 (2.4%) | 1 (0.4%) | 3 (0.9%) | 30 (2.5%) |
| Minor | 6 (3.0%) | 7 (3.3%) | 1 (0.5%) | 0 (0.0%) | 0 (0.0%) | 14 (1.2%) |
| Major | 10 (5.0%) | 1 (0.5%) | 0 (0.0%) | 4 (1.6%) | 1 (0.3%) | 16 (1.3%) |
| Total | 28 (13.9%) | 17 (8.0%) | 6 (2.9%) | 5 (2.0%) | 4 (1.3%) | 60 (5.0%) |
Data are presented as n (%) or mean (SD); range. Age range was defined using whole numbers. Extension was defined as the presence of residual tumor cells at the resection margins. Discrepancy grades were defined as minimal, minor, or major, according to their potential clinical impact.
BCC basal cell carcinoma, BOWEN Bowen’s disease, EMPD extramammary Paget’s disease, FFPE formalin-fixed paraffin-embedded, Frozen frozen section, SCC squamous cell carcinoma, SD standard deviation.
Model performance in quantitative evaluation
All four unpaired translation models (CycleGAN23, contrastive unpaired translation [CUT]24, SANTA25, and AIFFPE9) successfully generated FFPE images from the Frozen inputs (Fig. 1). Table 2 summarizes the results of quantitative evaluation of the four models. The outputs of all models showed improved similarity to the ground-truth FFPE images compared with the Frozen inputs, with CUT achieving the lowest Fréchet inception distance (FID)26 across both the internal and external datasets. In the downstream tumor classification task, the diagnostic accuracy and area under the receiver operating characteristic curve (AUROC) both increased markedly with all AI-generated FFPE image (GenFFPE) inputs relative to Frozen images, with CUT again showing the highest overall performance. External validation confirmed the consistent superiority of CUT in terms of both visual fidelity and diagnostic relevance. Representative examples from the external validation dataset are presented in Supplementary Fig. 2. Additional representative examples illustrating attenuation of freezing-related artifacts—including blurring, drying, and tissue folding—as well as enhanced tumor cell visibility in GenFFPE outputs are presented in Supplementary Fig. 3.
Fig. 1. Representative examples of AI-generated FFPE patches using the CycleGAN, AIFFPE, SANTA, and CUT models.

Representative GenFFPE patches were generated from Frozen inputs using four unpaired image–image translation models. The CUT model achieved the best balance between structural preservation and staining fidelity, while the SANTA model more frequently exhibited hallucination artifacts. BCC basal cell carcinoma, BOWEN Bowen’s disease, EMPD extramammary Paget’s disease, FFPE formalin-fixed paraffin-embedded, Frozen frozen section, SCC squamous cell carcinoma.
Table 2.
Quantitative comparison of model performance across internal and external test datasets
| Internal validation dataset | External validation dataset | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FID ↓ | KID ↓ | ResNet-50 classification 5137 patches (2575 tumor-positive and 2562 tumor-negative) | FID ↓ | KID ↓ | ResNet-50 classification 4772 patches (2186 tumor-positive; 2586 tumor-negative) | |||||||
| Accuracy ↑ | Balanced accuracy ↑ | MacroF1-score ↑ | AUROC ↑ | Accuracy ↑ | Balanced accuracy ↑ | MacroF1-score ↑ | AUROC ↑ | |||||
| Frozen (Input) | 51.29 | 72.49 | 40.7% | 44.4% | 31.0% | 0.378 | 59.62 | 52.64 | 50.6% | 55.8% | 43.0% | 0.744 |
| CycleGAN | 37.74 | 25.04 | 69.5% | 71.4% | 68.6% | 0.875 | 29.58 | 20.1 | 52.1% | 57.1% | 45.6% | 0.838 |
| AIFFPE | 32.85 | 20.37 | 63.4% | 65.7% | 61.6% | 0.792 | 23.42 | 15.08 | 66.0% | 69.1% | 65.0% | 0.890 |
| SANTA | 30.64 | 17.94 | 62.1% | 64.9% | 59.3% | 0.842 | 23.38 | 12.12 | 59.4% | 63.5% | 56.3% | 0.900 |
| CUT | 28.54 | 14.97 | 75.7% | 77.1% | 75.5% | 0.892 | 22.91 | 12.91 | 79.9% | 81.4% | 79.9% | 0.918 |
| FFPE(Ground truth) | .. | .. | 82.7% | 83.3% | 82.7% | 0.924 | .. | .. | 84.2% | 84.2% | 84.0% | 0.919 |
Lower FID and KID scores indicate a closer similarity between the AI-generated and ground-truth FFPE images. KID values are presented as ×10³ for readability. All models outperformed Frozen images in patch-level tumor classification, showing higher diagnostic accuracy, balanced accuracy, macro F1-score, and AUROC. CUT achieved the lowest FID and KID scores and the highest accuracy and AUROC across both the internal and external test datasets. Bold values indicate the best performance, and underlined values indicate the second-best results for each metric.
AUROC area under the receiver operating characteristic curve, FFPE formalin-fixed paraffin-embedded, FID Fréchet inception distance, Frozen frozen section, KID kernel inception distance.
Qualitative expert evaluation of generated images
Qualitative evaluation further supported the superior performance of CUT. In the ranking test involving 16 evaluators, CUT received the highest overall scores for staining quality, contrast, structural preservation, and tumor cell visibility, whereas SANTA exhibited the most frequent hallucination artifacts (Fig. 2). Moreover, CUT achieved the highest overall similarity to the reference FFPE images, indicating that the evaluators consistently perceived its outputs as the most visually and histopathologically faithful representations of the target domain.
Fig. 2. Expert ranking results for the visual quality of AI-generated FFPE patches.

Sixteen experts participated in an independent reader study evaluating 60 GenFFPE patches per model across eight visual domains (hallucinations, blurring, staining quality, contrast, structural preservation, tumor cell visibility, tumor-specific patterns, and overall similarity to FFPE images). The bars indicate the proportion of evaluators ranking each model the highest for each question. Higher percentages (except for hallucinations) reflect a stronger preference for the model’s output. CUT achieved the highest overall preference across most domains. FFPE formalin-fixed, paraffin-embedded, GenFFPE AI-generated FFPE image.
Visual Turing test
In the visual Turing test, evaluators were presented with 100 randomly selected patches (50 real FFPE and 50 GenFFPE patches). The overall classification accuracy was 60.2 ± 3.3%, while interobserver agreement was minimal (Fleiss’ κ < 0.2). Board-certified pathologists showed the lowest variability across all response categories, with standard deviations of 5.8%–6.2%, indicating high internal consistency (Table 3). For improved readability, the same results are additionally summarized as a confusion matrix in Supplementary Fig. 4.
Table 3.
Results of visual Turing test comparing real and GenFFPE patches
| Board-certified pathologist (n = 4) | Board-certified dermatologist (n = 5) | Pathology resident (n = 3) | Dermatology resident (n = 4) | Total (n = 16) | |
|---|---|---|---|---|---|
| FFPE as FFPE | 65.5 ± 5.8% | 61.2 ± 17.8% | 60.7 ± 18.6% | 81.0 ± 16.0% | 67.1 ± 16.6% |
| FFPE as GenFFPE | 34.5 ± 5.8% | 38.8 ± 17.8% | 39.3 ± 18.6% | 19.0 ± 16.0% | 32.9 ± 16.6% |
| GenFFPE as FFPE | 41.0 ± 6.2% | 40.8 ± 17.5% | 34.0 ± 14.4% | 69.5 ± 14.4% | 46.7 ± 18.2% |
| GenFFPE as GenFFPE | 59.0 ± 6.2% | 59.2 ± 17.5% | 66.0 ± 14.4% | 30.5 ± 14.4% | 53.3 ± 18.2% |
| Fleiss’ Kappa | 0.046 | 0.052 | -0.070 | 0.011 | 0.065 |
| Accuracy | 62.3 ± 1.5% | 60.2 ± 2.9% | 55.8 ± 2.1% | 55.8 ± 3.3% | 60.2 ± 3.3% |
Sixteen clinicians were asked to classify 50 FFPE and 50 GenFFPE patches as “real” or “AI-generated.” The overall classification accuracy was 60.2%, indicating that GenFFPE patches were frequently mistaken for true FFPE patches. Low interobserver agreement among evaluators (Fleiss’ κ = 0.065) indicates that AI-generated images were visually indistinguishable from true FFPE slides. Values are mean ± SD.
FFPE formalin-fixed paraffin-embedded, GenFFPE AI-generated FFPE image, SD standard deviation.
Clinical impact of GenFFPE on discrepant diagnoses
In the clinical validation stage, 55 discrepant cases were reassessed. GenFFPE-based reassessment improved diagnostic concordance across all tumor types (Fig. 3), increasing the proportion of concordant cases by 53.3% (Fig. 4). Although the overall rate of major discrepancies decreased from 29.1% to 20.0%, this decrease was not significant (p = 0.27). Nevertheless, a qualitative review indicated clinically meaningful improvements in diagnostic clarity. In representative EMPD cases, Paget cells became more distinctly visible in the GenFFPE images, converting several cases with major discrepancies into concordant diagnoses (Fig. 5). Similar improvements were also observed in GenFFPE images for BOWEN, SCC, BCC, and melanoma, in which the tumor boundaries and cytologic features were more clearly defined. However, several diagnostic discrepancies remained unresolved, despite GenFFPE-based reassessment (Fig. 6). To further illustrate these patterns beyond EMPD, additional representative cases across other tumor subtypes are provided in Supplementary Figs. 5 and 6. Supplementary Fig. 5 presents two cases (BCC and melanoma) in which GenFFPE translation reduced diagnostic discrepancy, whereas Supplementary Fig. 6 presents two cases (BOWEN and melanoma) in which diagnostic discrepancy persisted despite GenFFPE translation.
Fig. 3. Subgroup analysis of diagnostic concordance after GenFFPE-based reassessment by tumor subtype and evaluator.

The figure shows the changes in diagnostic concordance following GenFFPE-based reassessment of 55 discrepant Frozen–FFPE cases. Each (A–E) represents a tumor type (EMPD, BOWEN, SCC, BCC, or melanoma), and (F) shows the overall results. Bars indicate the proportions of concordant (green), minimal (yellow), minor (orange), and major (red) discrepancies before and after GenFFPE reassessment. Reassessments were conducted independently by two pathologists (Path A, Path B) and one dermatologist (Derm). Overall, GenFFPE-based reassessment increased diagnostic concordance across all tumor types. No significant differences in the rate of major discrepancies were observed across tumor subtypes (p > 0.05). BCC basal cell carcinoma, BOWEN Bowen’s disease, EMPD extramammary Paget’s disease, FFPE formalin-fixed paraffin-embedded, Frozen frozen section, GenFFPE AI-generated FFPE image, SCC squamous cell carcinoma.
Fig. 4. Overall improvements in diagnostic concordance after GenFFPE-based reassessment.

A Frozen–FFPE diagnostic discrepancies across five major skin cancer types. B GenFFPE–FFPE discrepancies following GenFFPE-based reassessment by expert readers. Bars indicate the proportions of concordant (green), minimal (yellow), minor (orange), and major (red) discrepancies. Reassessment of discrepant Frozen–FFPE cases by two pathologists and one dermatologist demonstrated a 53.3% increase in concordant diagnoses, and a marked reduction in major discrepancies. BCC basal cell carcinoma, BOWEN Bowen’s disease, EMPD extramammary Paget’s disease, FFPE formalin-fixed paraffin-embedded, Frozen frozen section, GenFFPE AI-generated FFPE image, SCC squamous cell carcinoma.
Fig. 5. Representative case of reduced diagnostic discrepancy using GenFFPE in EMPD.

This figure shows a representative EMPD case in which GenFFPE reduced the diagnostic discrepancy obtained from Frozen and FFPE slides. The upper panel summarizes the diagnostic grades assigned by each reviewer (Frozen–FFPE vs GenFFPE–FFPE), where 0 = tumor-free and 3 = extension. Green shading indicates concordant diagnoses, while red shading denotes major discrepancies. The lower images show the original Frozen image (left), AI-generated FFPE output (middle), and corresponding ground-truth FFPE slide (right). The GenFFPE output exhibits improved nuclear detail and architectural preservation, enabling correct tumor recognition consistent with FFPE diagnosis. EMPD extramammary Paget’s disease, FFPE formalin-fixed paraffin-embedded, Frozen frozen section, GenFFPE AI-generated FFPE image.
Fig. 6. Case showing persistent diagnostic discrepancy due to a sectioning difference despite realistic GenFFPE generation.

The figure format is identical to that of Fig. 5. This EMPD case shows that despite realistic GenFFPE generation, diagnostic discrepancy persisted owing to the sectioning difference between Frozen and FFPE slides. In this case, numerous Paget cells were visible in the FFPE section, whereas only one or two suspicious cells were present on the Frozen slide. This residual discrepancy was attributed not to model limitation but to the difference in cutting plane, as the FFPE section corresponded to a relatively deeper tissue level than the Frozen. The magnified regions were selected from spatially corresponding areas to the extent possible; however, exact structural alignment is inherently limited by differences in cutting planes between the Frozen and FFPE sections. EMPD extramammary Paget’s disease, FFPE formalin-fixed paraffin-embedded, Frozen frozen section, GenFFPE AI-generated FFPE image.
Among the 55 cases that underwent GenFFPE-based reassessment, single-evaluator discrepancy escalation was observed in 8 cases; however, no case demonstrated simultaneous escalation in two or more evaluators (Supplementary Fig. 7), indicating the absence of systematic worsening following translation. To assess the potential risk of false-positive tumor generation, GenFFPE images were additionally generated for a representative subset of 11 concordant cases (3 EMPD and 2 cases each of BOWEN, SCC, BCC, and melanoma) and independently reassessed by the same three expert evaluators under blinded conditions. No concordance-to-discordance conversion was observed, and representative examples are provided in Supplementary Fig. 8.
Workflow feasibility in intraoperative settings
Finally, a workflow assessment confirmed the feasibility of integrating GenFFPE into intraoperative settings. At our institution, preparation times were measured based on five slides per case: Frozen preparation required approximately 8 min while GenFFPE translation was completed within 30 min after Frozen diagnosis, whereas standard FFPE processing required more than 24 h (Fig. 7).
Fig. 7. Intraoperative workflow of GenFFPE-assisted assessment.

Diagram summarizing the integration of the proposed GenFFPE-assisted intraoperative workflow into the routine intraoperative pathology process for skin cancer surgery. Surgically excised specimens are first processed as Frozen slides for rapid margin assessment (taking approximately 8 min). These slides are then digitized, cropped into multiple patches, and processed through a contrastive unpaired translation that translates the Frozen images into GenFFPE histopathologic images. The generator attenuates freezing-related image quality degradation, thereby restoring staining contrast and structural clarity in the translated images through unpaired image–image translation guided by multilayer and patch-wise contrastive losses. The generated patches are subsequently stitched to form GenFFPE whole-slide images for review by pathologists (taking approximately ~30 min in total). In parallel, conventional FFPE processing requires 2–3 days, but provides the diagnostic gold standard. By incorporating GenFFPE into intraoperative workflows, diagnostic discrepancies and surgical invasiveness can be reduced, and workflow efficiency and patient outcomes improved. FFPE formalin-fixed paraffin-embedded, Frozen frozen section, GenFFPE AI-generated FFPE image.
Discussion
In the present study, we developed and validated an AI-based approach that translates Frozen images of skin cancer resection margins into GenFFPE images. Using four unpaired image–image translation models, CycleGAN, AIFFPE, SANTA, and CUT, we demonstrated that GenFFPE slides were able to reproduce the morphological quality of conventional FFPE slides, while maintaining the efficiency of intraoperative Frozen analysis. The CUT model achieved the best overall performance, and GenFFPE-based reassessment substantially improved diagnostic concordance, supporting its clinical utility in surgical pathology.
We established a well-curated digital pathology database encompassing 2594 Frozen and FFPE slides across five major skin cancer types collected over a 13-year period. The overall extension rate was higher in FFPE histopathologic findings than in Frozen findings, while diagnostic discrepancies were observed in approximately 5% of cases, including 1.3% major discrepancies. Notably, EMPD exhibited the highest extension and discrepancy rates, reflecting its known diagnostic complexity of Frozen due to freezing artifacts and subtle cytologic features. These findings underscore the unmet need for supportive tools that can improve intraoperative diagnostic reliability for such challenging entities. AI-based image translation may address this gap by generating high-fidelity FFPE images in which freezing artifacts are attenuated, thereby restoring histopathologic clarity and contrast—particularly in diagnostically challenging settings such as EMPD, where improved cellular visibility may support more reliable margin assessment (Supplementary Fig. 3).
To rigorously evaluate the model performance, we conducted both quantitative and qualitative assessments. Quantitatively, all models improved image similarity compared to Frozen slides, but the CUT model achieved the lowest FID and KID scores as well as the highest classification accuracy in downstream tasks. Qualitatively, CUT also ranked the highest in terms of staining quality, structural preservation, and tumor cell visibility, whereas SANTA showed more frequent hallucinations.
Previous studies have demonstrated that deep learning–based translation from Frozen to FFPE images can achieve high visual fidelity across multiple organs, including the brain, lungs, and kidneys, using GAN-based or latent diffusion approaches9,16,17,20. Diffusion-based models are widely recognized for producing highly realistic images; however, their outputs may exhibit reduced nuclear sharpness or subtle loss of cellular definition, which can affect detailed histopathologic interpretation. In contrast, the CUT framework provided stable structural preservation in skin tissue, which presents unique histopathologic challenges owing to its layered epidermal architecture and adnexal structures. In our experiments, CUT demonstrated consistent preservation of structural organization and nuclear detail compared with the other evaluated models, including CycleGAN, AIFFPE, and SANTA. Based on these observations, CUT was selected for subsequent clinical evaluation of translational and diagnostic applicability. A diffusion-based Frozen-to-FFPE model was also evaluated during the pilot phase of this study, and representative outputs are provided for qualitative comparison (Supplementary Fig. 9). Although the diffusion outputs were visually plausible, they did not consistently preserve fine nuclear detail in certain tumor subtypes and occasionally demonstrated reduced sharpness, which may limit interpretability in contexts such as margin assessment where subtle single-cell features are diagnostically critical.
Clinical validation demonstrated that GenFFPE translation has practical diagnostic utility. Reassessment of discrepant Frozen and FFPE cases using GenFFPE slides increased concordant diagnoses by 53.3%, indicating a reduction in false-negative and false-positive margin interpretations. Representative cases further illustrated that tumor cells, such as Paget cells in EMPD, became more readily identifiable following AI-based translation. Importantly, persistent discrepant cases (Supplementary Fig. 6) highlight an inherent limitation of intraoperative Frozen evaluation—namely, spatial non-correspondence between adjacent tissue levels. Even with high-fidelity GenFFPE translation, diagnostic discrepancies may persist when tumor involvement differs across sectioning planes. Moreover, when tumor involvement was not represented in the Frozen input itself, GenFFPE translation reflected the morphologic features present in the source image and did not introduce additional diagnostic features, underscoring that image translation cannot compensate for absent sampling information. In line with this observation, blinded reassessment of 11 concordant cases using GenFFPE images revealed no false-positive tumor interpretations across tumor subtypes and evaluators (Supplementary Fig. 8).
Collectively, these findings suggest that GenFFPE translation enhances morphologic interpretability while remaining constrained by biological and sampling variability. Workflow analysis further indicates that the GenFFPE process may be adaptable to intraoperative settings, although prospective optimization will be required to determine feasibility within routine clinical workflows.
This study has some limitations. First, the dataset was retrospective and collected from a limited number of institutions. Although external validation confirmed generalizability, broader multicentre and prospective validation is required to support the regulatory and clinical adoption. Second, because of the imperfect spatial correspondence between Frozen and FFPE sections—which are derived from adjacent rather than identical tissue planes—true one-to-one pairing was not feasible. Accordingly, unpaired image-to-image translation was employed as a practical alternative. This spatial non-correspondence also contributed to persistent diagnostic discrepancies in a subset of cases following GenFFPE reassessment, as tumor involvement may vary across sectioning planes regardless of translation quality. These residual discrepancies reflect inherent constraints of histopathologic sectioning rather than model limitations and underscore the continued importance of accurate Frozen diagnosis for reliable intraoperative decision-making. In future work, weakly paired learning approaches that leverage partial spatial alignment may further enhance structural correspondence. Third, although the training dataset predominantly consisted of margin-negative specimens and no tumor-conditioned supervision was used, subtle generative bias cannot be entirely excluded. The present study did not include region-level tumor annotations for quantitative cell-level fidelity assessment. Future studies incorporating tumor-annotated datasets and high-resolution region-based analyses will enable more rigorous evaluation of potential residual generative effects. Fourth, patches were extracted at level 2 to ensure computational feasibility for large-scale training and whole-slide inference. Although this resolution preserved diagnostically relevant morphologic features, including Paget cells in EMPD cases, it may attenuate very fine cytologic details that could be critical in challenging cases where subtle tumor cells closely resemble surrounding keratinocytes and are further obscured by freezing artifacts. Future work should evaluate multi-scale or magnification-adaptive pipelines, such as coarse-to-fine translation with targeted high-resolution refinement in regions of interest, to determine whether higher-resolution processing yields additional diagnostic benefit. Finally, although GenFFPE translation currently requires approximately 30 min after Frozen diagnosis, this duration may exceed the typical intraoperative decision window in many institutions. A detailed time analysis indicated that the primary bottlenecks were related to slide preparation and digitization—including drying, coverslipping, and whole-slide scanning—rather than model inference itself. Workflow-level optimizations, such as automated coverslipping systems and high-speed or coverslip-free scanning platforms, together with improvements in computational hardware and infrastructure, could substantially shorten these delays. With such refinements, the overall turnaround time may approach the 15–20 min intraoperative decision window; however, prospective workflow optimization studies will be required to determine whether this target can be reliably achieved in routine clinical practice.
In summary, the present study shows that AI-based Frozen–FFPE translation represents a feasible and clinically meaningful advancement in intraoperative pathology. By bridging the gap between rapid but artifact-prone Frozen analysis and high-quality FFPE histopathologic analysis, this technology has the potential to reduce diagnostic discrepancies, improve surgical precision, optimize workflow efficiency, and ultimately enhance patient outcomes. Future studies incorporating real-time Mohs micrographic surgery and larger multicenter datasets could further expand its clinical applicability and accelerate its translation into practice.
Methods
Study design
This retrospective, single-center model development and validation study aimed to develop and evaluate generative AI models to translate Frozen images of skin cancer resection margins into GenFFPE. This study was conducted at Yonsei University Wonju Severance Christian Hospital, Wonju-si, Republic of Korea, and external validation was conducted using an independent dataset from Uijeongbu St. Mary’s Hospital, Uijeongbu-si, Republic of Korea. The study protocol was approved by the institutional review boards of both participating institutions (approval nos. CR324004 and UC24RIDI0045). This study was conducted in accordance with the Declaration of Helsinki. The requirement for informed consent was waived as de-identified archival pathology data were used. This study included the construction of a digital pathology database, model development, and multistage validation to evaluate both technical performance and clinical diagnostic impact.
Construction of the digital pathology database
Frozen slides and their corresponding FFPE slides (permanent sections prepared from the same specimen following Frozen diagnosis) were retrospectively collected between Jan 1, 2010, and Dec 31, 2023. Five major skin cancer entities were included: EMPD, BOWEN, SCC, BCC, and malignant melanoma. EMPD is uncommon and poses substantial diagnostic challenges when Frozen slides are used. Hence, to enable a balanced comparison across tumor types, all available Frozen and FFPE slides of EMPD during this period were collected, and additional cases of BOWEN, SCC, BCC, and melanoma were selectively included in comparable numbers. Cases were excluded if the corresponding FFPE slide was unavailable or if the slide quality was inadequate owing to staining failure, tissue damage, or image distortion. In addition to these corresponding post-frozen FFPE slides, one representative FFPE slide from the main tumor mass of each case (not subjected to the Frozen process) was included for model training to enhance morphological diversity within the FFPE domain.
For each case, the final pathology report was integrated to determine tumor extension and evaluate the diagnostic consistency between Frozen and FFPE histopathologic findings. Tumor extension was defined as the presence of residual tumor cells at the resection margin on histopathologic examination. Diagnostic discrepancies between Frozen and FFPE histopathologic findings were categorized as concordant, minimal, minor, or major according to their potential clinical impact (Supplementary Fig. 10). A concordant diagnosis indicated identical findings for both the Frozen and FFPE slides, whereas minimal or minor discrepancies represented interpretive differences without substantial clinical consequences. Major discrepancies were defined as clinically meaningful discordance affecting patient management, for example, when Frozen analysis indicated a tumor-free margin but FFPE histopathologic analysis revealed extension, necessitating re-excision, or when Frozen findings suggested tumor extension but FFPE histopathologic diagnosis was negative, leading to unnecessary resection. Extension and discrepancy rates were calculated for each tumor type to characterize dataset variability and identify the diagnostic challenges unique to specific histopathologic entities.
All slides were digitized at ×40 magnification using a whole-slide scanner (PANNORAMIC 250 Flash III, 3DHistech Ltd, Budapest, Hungary)27. Regions of interest encompassing the tumor and resection margins were manually annotated by board-certified dermatologists. The resulting digital pathology database served as the foundation for both AI model development and subsequent clinical evaluation.
Generative AI model development
Whole-slide images were processed at level 2 using OpenSlide28. Although level 0 (highest resolution) provides superior cytologic detail, processing at this level substantially increases computational load and storage requirements, rendering large-scale training and whole-slide inference impractical within the current framework. Level 2 was therefore selected as it offered a favorable balance between computational feasibility and diagnostic resolution. Internal assessment confirmed that this resolution preserved sufficient morphologic detail for identification of diagnostically relevant tumor cells, including Paget cells in EMPD cases. Each slide was divided into non-overlapping 512 × 512-pixel patches after quality control based on tissue coverage (α = 255 across the entire patch) and the exclusion of patches with >50% white background (grayscale intensity > 240).
Datasets were partitioned on a per-patient basis to prevent data leakage. Ninety percent of patients were allocated to model training, and the remaining 10% were reserved as an internal validation subset. Frozen and corresponding FFPE slides from the same patient were assigned to the same subset to ensure complete case-level separation. The internal validation subset was used for model selection and internal performance assessment. The training dataset predominantly consisted of margin-negative specimens, with overall extension rates of 5.5% in Frozen and 7.6% in corresponding FFPE slides (Table 1). Accordingly, the majority of extracted patches represented non-tumor tissue. No tumor labels, segmentation masks, or class-conditioning were incorporated into the training objective; all models were optimized to perform domain-level appearance translation without explicit guidance toward cancer-specific features.
Because the Frozen and corresponding FFPE slides were derived from adjacent, non-identical tissue sections and could not be perfectly spatially paired, four unpaired image-to-image translation models— CycleGAN, CUT, AIFFPE, and SANTA—were trained to generate FFPE images from Frozen slides. All models were implemented in PyTorch and trained using the least-squares generative adversarial network objective. Optimization was performed with the Adam optimizer (β1 = 0.5, β2 = 0.999) using an initial learning rate of 2 × 10−4 for both generator and discriminator, followed by linear learning-rate decay. Network weights were initialized according to the default settings of each original implementation, and instance normalization was used within convolutional blocks. The generator and discriminator architectures followed the respective original published implementations, which were based on ResNet-style generators and PatchGAN-type discriminators. In addition to the shared adversarial objective, model-specific constraints were applied as originally proposed: CycleGAN used cycle-consistency and identity losses, CUT and AIFFPE used PatchNCE-based contrastive losses, and SANTA used shortest-path regularization. Each model was trained for 100,000 iterations on a single NVIDIA RTX A6000 GPU, with batch sizes selected according to the original implementation and available GPU memory.
Model performance evaluation, selection, and external validation
Model-wise quality assessment was conducted to comprehensively evaluate the performance of the four generative models using both quantitative and qualitative analyses. Quantitative similarities between GenFFPE and ground-truth FFPE patches were measured using the FID and kernel inception distance (KID)29. These metrics quantify the distributional similarity in a high-dimensional feature space extracted by an inception network and provide an objective measure of how closely the generated patches approximate the target FFPE image domain.
To further evaluate whether the generated patches retain diagnostically relevant information beyond low-level similarity, we performed a downstream tumor classification task using an ImageNet-pretrained ResNet-5030. Separate classifiers were trained on patches from each domain (Frozen, FFPE, and GenFFPE generated by each translation model: CycleGAN, CUT, AIFFPE, and SANTA). All classifiers were evaluated on the same held-out FFPE test set to quantify how well GenFFPE patches, compared with Frozen patches, support FFPE-referenced tumor classification. Performance was reported using accuracy, balanced accuracy, macro F1-score, and AUROC.
In addition to the quantitative evaluation, a qualitative assessment was performed using a structured ranking test to examine the visual realism and histopathologic fidelity of the generated images. For each comparison set, experts were presented with the original Frozen patch, the corresponding GenFFPE patches generated by each model, and a reference FFPE patch. Sixty sets were independently evaluated by 16 experts (five board-certified pathologists, four board-certified dermatologists, three pathology residents, and four medical-AI specialists). Each evaluator scored hallucinations, blurring, staining quality, contrast, structural preservation, tumor cell visibility, and overall similarity to the FFPE patch. In most cases, the evaluators ranked all four models from best to worst for each criterion; however, when a full ranking was deemed difficult, only the most preferred (top-1) model was selected. The proportion of top-1 selections for each model and criterion was further calculated to summarize the distribution of model preferences.
The best-performing model was selected based on an integrated assessment of internal validation metrics (FID/KID, downstream classification performance, and qualitative expert ranking). To evaluate generalizability to unseen data, an independent external validation cohort of Frozen and FFPE slides was collected from Uijeongbu St. Mary’s Hospital. This external dataset was not used during model training or selection. FID and KID analyses, as well as the downstream classification task, were repeated using the external dataset to assess cross-institutional performance. The selected model was subsequently subjected to visual Turing testing and multi-reader clinical reassessment.
Visual Turing test
A visual Turing test was performed using 100 randomly selected patches (50 real FFPE and 50 GenFFPE). Sixteen evaluators participated in the assessment, including four board-certified pathologists, five board-certified dermatologists, three pathology residents, and four dermatology residents. In this test, evaluators classified each image as “real” or “AI-generated.” Interobserver agreement was calculated using Fleiss’ κ statistics.
Clinical validation through expert reader assessment
A multi-reader GenFFPE-based diagnostic reassessment was conducted to evaluate the clinical utility of GenFFPE. Three experienced clinicians (two board-certified pathologists and one board-certified dermatologist) independently reviewed the GenFFPE slides for cases with discrepant Frozen and FFPE findings. All reviewers were blinded to prior diagnoses and were informed only of the cancer subtype.
Diagnostic outcomes were classified as concordant, minimal discrepancy, minor discrepancy, or major discrepancy relative to the FFPE ground truth. The mean of the diagnostic results of the three evaluators was reported as the final outcome, which was used to calculate the overall concordance rate and reduction in discrepancies compared with the original Frozen diagnoses. To further assess the feasibility of integrating GenFFPE into intraoperative workflows, the preparation times for Frozen, GenFFPE, and FFPE slides were compared.
Statistical analysis
Continuous variables were summarized as mean (SD) and categorical variables as numbers (percentages). Changes in major discrepancy rates before and after GenFFPE reassessment were evaluated using the χ² test, and Fisher’s exact test was applied for small subgroups. Inter-rater agreement in the reader study was quantified using Fleiss’ κ and interpreted according to Landis–Koch criteria.
All analyses were conducted using R (version 4.5.0; R Foundation for Statistical Computing, Vienna, Austria) and Python (version 3.9; Python Software Foundation, Wilmington, DE, USA). A two-sided significance level of 5% was used for all tests.
Supplementary information
Acknowledgements
The authors thank Hyeong Ju Kwon, Tsandmaa Byambadorj, Joon-Goon Kim, Jin-Woong Jung, Jong Won Lee, Ju Yeong Lee, Won Seok Roh, Ji-Hwan Moon, Seungjoo Oh, Hansol Kim, Hyun Kang, Seung Won Jeong, Yeon-Woo Heo, and Yeon Woo Jung for their dedicated participation in the expert evaluation process and valuable contributions to this study. We also express our gratitude to all pathologists and dermatologists who provided critical insights and support throughout the validation phases. This research was supported by the Bio&Medical Technology Development Program of the National Research Foundation (NRF) funded by the Korean government (MSIT) (No. RS-2024-00440802), and by the Regional Innovation System & Education (RISE) program through the Gangwon RISE Center, funded by the Ministry of Education (MOE) and the Gangwon State (G.S.), Republic of Korea (2026-RISE-10-006).
Author contributions
S.-H.L. and Y.C. conceptualized the study. S.-H.L. and M.E. coordinated internal data acquisition. S.-H.L., Y.-S.C., Y.C., S.M.H., and M.E. handled data acquisition and quality control. S.-H.L., Y.C., and M.E. organized the external and reader studies. S.-H.L., Y.C., and S.M.H. managed data collection and quality control for the external study. S.-H.L. and Y.-S.C. drafted and revised the manuscript. E.H.C., S.-P.H., T.K., S.Y., and M.E. critically reviewed it. S.-H.L. and Y.-S.C. performed data analysis and interpreted the data. Y.-S.C. and S.Y. contributed to model development and validation. All authors had access to the raw datasets. The corresponding authors (S.Y. and M.E.) verified the data and made the final decision to submit the manuscript for publication. All authors reviewed and approved the final manuscript.
Data availability
A preview dataset (one Frozen–FFPE WSI pair per tumor subtype) is available on Zenodo (DOI: https://doi.org/10.5281/zenodo.18780726). The datasets generated and/or analyzed during the current study are not publicly available due to institutional data governance and patient privacy regulations, but are available from the corresponding author on reasonable request.
Code availability
The codes used for model training, inference, and evaluation in this study are publicly available at https://github.com/wormschu/Translation-of-frozen-sections-into-FFPE-like-images-for-skin-cancer-.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
These authors contributed equally: Sang-Hoon Lee, Yu-Sung Chu.
Contributor Information
Sejung Yang, Email: syang@yonsei.ac.kr.
Minseob Eom, Email: eomm@yonsei.ac.kr.
Supplementary information
The online version contains supplementary material available at https://doi.org/10.1038/s41746-026-02939-1.
References
- 1.Zhou, L., Zhong, Y., Han, L., Xie, Y. & Wan, M. Global, regional, and national trends in the burden of melanoma and non-melanoma skin cancer: insights from the global burden of disease study 1990–2021. Sci. Rep.15, 5996 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Urban, K., Mehrmal, S., Uppal, P., Giesey, R. L. & Delost, G. R. The global burden of skin cancer: a longitudinal analysis from the Global Burden of Disease Study, 1990–2017. JAAD Int.2, 98–108 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Kwon, S. H. et al. Incidence and survival rates of primary cutaneous malignancies in Korea, 1999–2019: a nationwide population-based study. J. Dermatol.51, 532–538 (2024). [DOI] [PubMed] [Google Scholar]
- 4.Stratigos, A. J. et al. European consensus-based interdisciplinary guideline for invasive cutaneous squamous cell carcinoma: Part 2. Treatment-update 2023. Eur. J. Cancer193, 113252 (2023). [DOI] [PubMed] [Google Scholar]
- 5.Garcia, M. T. et al. Accuracy of frozen section in intraoperative margin assessment for breast-conserving surgery: a systematic review and meta-analysis. PLoS ONE16, e0248768 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Jaafar, H. Intra-operative frozen section consultation: concepts, applications and limitations. Malays. J. Med. Sci.13, 4–12 (2006). [PMC free article] [PubMed] [Google Scholar]
- 7.Desciak, E. B. & Maloney, M. E. Artifacts in frozen section preparation. Dermatol. Surg.26, 500–504 (2000). [DOI] [PubMed] [Google Scholar]
- 8.Petrie, M. S., Hess, S. & Benedetto, A. V. Automated 15-minute cytokeratin 7 immunostaining protocol for extramammary Paget’s disease in Mohs micrographic surgery. Dermatol. Surg.37, 1811–1815 (2011). [DOI] [PubMed] [Google Scholar]
- 9.Ozyoruk, K. B. et al. A deep-learning model for transforming the style of tissue images from cryosectioned to formalin-fixed and paraffin-embedded. Nat. Biomed. Eng.6, 1407–1419 (2022). [DOI] [PubMed] [Google Scholar]
- 10.Ghauri, R. R., Gunter, A. A. & Weber, R. A. Frozen section analysis in the management of skin cancers. Ann. Plast. Surg.43, 156–160 (1999). [PubMed] [Google Scholar]
- 11.Manstein, M. E., Manstein, C. H. & Smith, R. How accurate is frozen section for skin cancers? Ann. Plast. Surg.50, 607–609 (2003). [DOI] [PubMed] [Google Scholar]
- 12.Bilden, T. T., Benedict, K. C., Lamb, P. W. & McMullin, J. Intraoperative frozen section analysis for the excision of nonmelanoma skin cancer: a single-center experience. Am. Surg.85, 1397–1401 (2019). [PubMed] [Google Scholar]
- 13.Petitjean, C. et al. Interest of frozen section procedure in skin tumors other than melanoma. J. Plast. Reconstr. Aesthet. Surg.84, 377–384 (2023). [DOI] [PubMed] [Google Scholar]
- 14.Jose, L., Liu, S., Russo, C., Nadort, A. & Di Ieva, A. Generative adversarial networks in digital pathology and histopathological image processing: a review. J. Pathol. Inform.12, 43 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Berijanian, M. et al. Unsupervised many-to-many stain translation for histological image augmentation to improve classification accuracy. J. Pathol. Inform.14, 100195 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Falahkheirkhah, K. et al. A generative adversarial approach to facilitate archival-quality histopathologic diagnoses from frozen tissue sections. Lab. Investig.102, 554–559 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Kassab, M. et al. FFPE++: Improving the quality of formalin-fixed paraffin-embedded tissue imaging via contrastive unpaired image-to-image translation. Med. Image Anal.91, 102992 (2024). [DOI] [PubMed] [Google Scholar]
- 18.Zhang, Q. et al. Leveraging pre-trained models for FF-to-FFPE histopathological image translation. In Proc. IEEE International Conference on Bioinformatics and Biomedicine (BIBM), 3993–3996 (IEEE, 2024).
- 19.Lin, Y. et al. A multi-perspective self-supervised generative adversarial network for FS to FFPE stain transfer. IEEE Trans. Med. Imaging44, 774–788 (2025). [DOI] [PubMed] [Google Scholar]
- 20.Ho, M. M. et al. F2fldm: latent diffusion models with histopathology pre-trained embeddings for unpaired frozen section to ffpe translation. In Proc. CVF Winter Conference on Applications of Computer Vision (WACV), 4382–4391 (2025).
- 21.Linder, K. E. Structure and function of the skin. In Paediatric Dermatology (eds Lewis-Jones, S., Murphy, R., Lewis-Jones, S. & Murphy, R.) (Oxford University Press, 2020).
- 22.Ronchi, A., Argenziano, G., Brancaccio, G., Lallas, A. & Franco, R. Editorial: multidisciplinary approach to the diagnosis and therapy of skin neoplasms. Front. Oncol.12, 939200 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Zhu, J.-Y., Park, T., Isola, P. & Efros, A. A. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proc. IEEE International Conference on Computer Vision, 2223–2232 (IEEE, 2017).
- 24.Park, T., Efros, A. A., Zhang, R. & Zhu, J.-Y. Contrastive learning for unpaired image-to-image translation. In Proc. European Conference on Computer Vision, 319–345 (Springer, 2020).
- 25.Xie, S., Xu, Y., Gong, M. & Zhang, K. Unpaired image-to-image translation with shortest path regularization. In Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 10177–10187 (IEEE, 2023).
- 26.Heusel, M. et al. Gans trained by a two time-scale update rule converge to a local Nash equilibrium. In Proc. 31st International Conference on Neural Information Processing Systems, 6629–6640 (Curran Associates Inc., 2017).
- 27.Varga, V. S., Molnár, B. & Virág, T. Automated high throughput whole slide imaging using area sensors, flash light illumination and solid state light engine. in Perspectives on Digital Pathology. 187–202 (IOS Press, 2012). [PubMed]
- 28.Goode, A., Gilbert, B., Harkes, J., Jukic, D. & Satyanarayanan, M. OpenSlide: a vendor-neutral software foundation for digital pathology. J. Pathol. Inform.4, 27 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Bińkowski, M., Sutherland, D. J., Arbel, M. & Gretton, A. Demystifying MMD GANs. arXiv:1801.01401 (2018).
- 30.He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. In Proc. IEEE Conference on Computer Vision and Pattern Recognition, 770–778 (IEEE, 2016).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
A preview dataset (one Frozen–FFPE WSI pair per tumor subtype) is available on Zenodo (DOI: https://doi.org/10.5281/zenodo.18780726). The datasets generated and/or analyzed during the current study are not publicly available due to institutional data governance and patient privacy regulations, but are available from the corresponding author on reasonable request.
The codes used for model training, inference, and evaluation in this study are publicly available at https://github.com/wormschu/Translation-of-frozen-sections-into-FFPE-like-images-for-skin-cancer-.
