Primary CNS lymphoma (PCNSL) is a rare but aggressive malignancy of the central nervous system, accounting for 3-4% of all CNS tumors with an apparently increasing incidence. The standard approach for establishing a tissue diagnosis involves stereotactic-guided or surgical biopsy, but the intraoperative window for decision-making is short and the stakes are high. Patients often present with rapid clinical deterioration including neurocognitive deficits, focal neurological symptoms, and signs of elevated intracranial pressure, meaning a delayed or incorrect diagnosis directly delays life-saving treatment.
Why conventional methods fall short: Traditional intraoperative histopathological techniques, such as frozen section analysis and cytology smear, have shown accuracy rates for PCNSL detection ranging from only 30.8% to 89.6% across published studies. The final permanent histopathological diagnosis, performed on formalin-fixed paraffin-embedded (FFPE) tissue with immunohistochemistry, achieves diagnostic accuracy between 82.2% and 100%, but this takes days. In the interim, surgeons must make decisions about whether to continue resection, take additional biopsies, or close without definitive tissue characterization.
The clinical consequence: PCNSL is treated with high-dose methotrexate-based chemotherapy, not surgical resection. Misidentifying it intraoperatively as a glioma or metastasis would lead to inappropriate tissue removal, unnecessary surgical morbidity, and a delay in initiating effective therapy. Conversely, correctly identifying PCNSL at the time of biopsy allows the surgeon to stop, confirm adequate sample collection, and rapidly transition to medical oncology planning. The treatment pathway bifurcation at this moment makes intraoperative accuracy critically important.
This 2024 paper, published in Acta Neuropathologica, presents RapidLymphoma, an AI-based system combining stimulated Raman histology (SRH) imaging with a self-supervised deep learning pipeline to detect PCNSL and differentiate it from other CNS tumors within three minutes during surgery. The system was prospectively validated in an international multicenter clinical trial across four tertiary neurosurgical centers.
Stimulated Raman histology (SRH) is a label-free optical imaging technique that can generate virtual H&E-like images from fresh, unprocessed tissue samples in minutes without any staining, fixation, or tissue processing. The system used in this study is the NIO Laser Imaging System (Invenio Imaging Inc., Santa Clara, CA), a portable fiber-laser-based stimulated Raman scattering (SRS) microscope deployable directly in the operating room. The instrument excites tissue with a dual-wavelength fiber laser using a fixed pump beam at 790 nm and a Stokes beam tunable from 1015 nm to 1050 nm, generating Raman shifts from 2800 to 3130 cm-1.
The imaging physics: The system captures two specific Raman shifts: 2845 cm-1 (CH2 symmetric stretching in fatty acids, providing contrast for lipid-rich areas) and 2930 cm-1 (CH3-rich regions corresponding to DNA- and protein-rich areas). Images are acquired by beam scanning at 450 nm/pixel spatial sampling with an imaging speed of 0.4 megapixels per second per Raman shift. A virtual H&E-like colorization is then applied to the raw greyscale images, transforming the dual-channel Raman data into a visually familiar histological representation that pathologists and surgeons can interpret at a glance.
Tissue preparation and throughput: Fresh tissue from stereotactic biopsy or surgical resection is placed on an acrylic slide and compressed under a coverslip, with the entire imaging workflow completing in under three minutes. This is dramatically faster than conventional frozen section analysis, which typically requires 20-30 minutes including tissue freezing, sectioning, staining, and microscopy review. The speed advantage is particularly relevant for stereotactic biopsies, where only small tissue samples are available and the surgeon is waiting at the operating table for information to guide next steps.
For deep learning model input, a preprocessing pipeline converts the 16-bit greyscale CH2 and CH3 channel images into three-channel images (2930 minus 2845 cm-1; 2845 cm-1; and 2930 cm-1), which are then divided into non-overlapping 300x300-pixel patches using a sliding window approach. These patches serve as the unit of analysis for both the tumor segmentation model and the PCNSL classification model.
The core deep learning model, RapidLymphoma, uses a self-supervised visual representation learning strategy called BYOL (Bootstrap Your Own Latent) combined with a ResNet-50 convolutional neural network backbone. Self-supervised learning is a training paradigm that learns rich visual representations from unlabeled or weakly labeled data by generating its own supervisory signal, which is particularly valuable for histopathology where expert patch-level annotation is expensive. BYOL specifically avoids the need for negative image pairs required by other contrastive approaches such as SimCLR and SupCon, making it more suitable for the relatively homogeneous appearance of tissue patch images.
BYOL architecture: The system maintains two networks, an online network and a target network. The online network contains a vision encoder (ResNet-50), a projection head, and a prediction head, while the target network mirrors the encoder and projection head but is updated using an exponential moving average (EMA) of the online network parameters rather than direct gradient backpropagation. For each training iteration, two augmented views of each input patch are generated and fed into the respective networks. The similarity loss function minimizes the cosine distance between the online network's prediction and the target network's projection, encouraging the encoder to learn augmentation-invariant representations of tissue morphology.
Training details: The model was trained on 54,000 SRH patch images derived from whole-slide SRH images at four institutions: New York University (NYU), University of Cologne (UKK), University of Michigan (UM), and Medical University of Vienna (MUV). The patch dataset included both PCNSL cases and a broad range of non-PCNSL diagnoses to ensure diverse visual representations. Training ran for 270 epochs with a batch size of 128 using the AdamW optimizer (learning rate 0.001) and cosine learning rate decay with linear warmup. A five-fold hold-out cross-validation strategy was performed every two epochs with balanced class sampling. All training used a single Nvidia A100 80 GB GPU.
Downstream classification: After the self-supervised encoder was trained, its weights were frozen and a single linear classification layer was added for binary PCNSL vs. non-PCNSL prediction. This downstream linear head was trained for five epochs using cross-entropy loss (AdamW, learning rate 0.01, cosine decay) on the same dataset. Downstream training used no additional augmentation. The two-stage approach, pre-training the encoder with BYOL then training a linear probe, is a standard and computationally efficient paradigm for self-supervised learning evaluation.
The prospective multicenter clinical trial was designed with overall balanced accuracy as the primary endpoint, calculated using the standard formula. Secondary endpoints included comparing PCNSL detection accuracy between RapidLymphoma and frozen section analysis on matched cases, and evaluating the model's ability to learn and distinguish PCNSL-specific histomorphological features. Sample size was calculated assuming an expected accuracy of 96.5% against a null hypothesis of 91.75%, with 90% statistical power and a two-sided significance level of 5%, yielding a required sample of 160 patient cases. Patient enrollment for intraoperative SRH imaging began in June 2015 and prospective data collection ended in June 2024.
Cohort inclusion and exclusion: Inclusion criteria required suspected CNS neoplastic or non-neoplastic tissue from surgical resection, stereotactic-guided, or open biopsy at one of the four participating institutions, with informed consent from the patient or caretaker, and an additional specimen beyond what was needed for routine pathological diagnosis. Exclusion criteria included cases where non-diagnostic regions exceeded 90% per SRH image due to substantial blood contamination, cell debris, or artifacts, and cases with broken slides or coverslips during tissue preparation. The final histopathological diagnosis based on FFPE tissue and immunohistochemistry served as the ground truth for all performance calculations.
Semantic probability segmentation and heatmaps: A key translational feature of the system is a semantic probability segmentation pipeline that generates color-coded heatmap overlays on the full SRH whole-slide image for real-time visualization in the operating room. The pipeline applies a sliding window (300x300 pixels, 100-pixel step size) across the whole-slide image, first classifying each patch as tumor, normal brain tissue, or non-diagnostic using a pretrained segmentation model. Only diagnostically confirmed tumor patches are then passed to the RapidLymphoma classifier. Color coding uses red for high PCNSL probability, blue for low probability (non-PCNSL), and white or grey for uncertainty or non-diagnostic areas. A slide-averaged softmax confidence percentage is displayed alongside the heatmap, giving the surgeon a single actionable number.
Two additional independent test cohorts were evaluated to assess performance beyond the prospective trial: one comprising 420 patients including 25 PCNSL cases versus IDH-wildtype diffuse gliomas, and a second comprising 59 patients with PCNSL versus brain metastases. These cohorts were entirely separate from the training dataset and the prospective trial cohort.
In the prospective clinical trial cohort of 160 patients (88 male, 72 female), RapidLymphoma achieved an overall balanced accuracy of 97.81% (+/-0.91, 95% CI: 95.96-99.29) at the patient level. Among the 160 cases, 25 (15.62%) were confirmed PCNSL and 135 (84.38%) were non-PCNSL diagnoses. The most common non-PCNSL diagnosis was IDH-wildtype adult-type diffuse glioma at 52.50% of all cases, followed by metastases (12.50%) and IDH-mutant diffuse glioma (10.62%). Analyses were conducted simultaneously at patient level (n=160), slide level (n=213), and patch level (n=43,083).
Patient-level performance: At the patient level, the model achieved 100% specificity (95% CI: 100.00-100.00) and 95.68% sensitivity (95% CI: 92.14-98.56), with an AUROC of 99.71% (+/-0.25, 95% CI: 99.13-100.00) and an F1 score of 97.78% (+/-0.89, 95% CI: 95.91-99.28). Critically, all 25 PCNSL cases were correctly identified with zero false negatives at the patient level, while 129 of 135 non-PCNSL cases were correctly classified (six false positives).
Slide-level performance: At the slide level, balanced accuracy was 97.21% (+/-1.11, 95% CI: 94.71-99.03), with 98.66% specificity and 95.84% sensitivity. The AUROC was 98.76% (+/-1.02) and F1 score was 97.55% (+/-0.92). Among 213 slides, there were six false positive slides and one false negative slide. The patch-level balanced accuracy was 90.88% (+/-0.16, 95% CI: 90.58-91.20), reflecting the expected reduction in performance when evaluating individual 300x300-pixel tissue patches rather than aggregated whole-slide predictions.
Comparison to frozen section: For the primary non-inferiority comparison, frozen section analysis was available for only 18 of the 25 PCNSL cases. Four of these were incorrectly diagnosed: two as metastasis, one as a glial tumor, and one as an epithelioid tumor, yielding a frozen section accuracy of 77.77% (14/18). In contrast, RapidLymphoma correctly identified all 18 available PCNSL cases, demonstrating clear non-inferiority and outperforming the conventional standard of care on matched cases.
Beyond the prospective trial, RapidLymphoma was evaluated on two fully independent external test cohorts to assess generalizability against the specific differential diagnoses most clinically challenging to distinguish from PCNSL. The first cohort comprised 420 patients (25 PCNSL, 395 IDH-wildtype diffuse gliomas including predominantly glioblastoma CNS WHO grade 4 at 94.94%, plus rare diagnoses such as gliosarcoma and diffuse hemispheric glioma). The mean patient age was 62.93 years, with a slight male predominance (59.28% male).
Performance against IDH-wildtype gliomas: RapidLymphoma achieved a balanced accuracy of 95.44% (+/-0.74, 95% CI: 93.97-96.84) with an AUROC of 98.87% (+/-0.46, 95% CI: 97.87-99.67) at the patient level (n=420). At the slide level (n=1,772), balanced accuracy was 94.21% (+/-0.82, 95% CI: 92.37-95.47) and AUROC was 97.43% (+/-1.12, 95% CI: 94.86-98.94). This is particularly challenging because glioblastoma and PCNSL share overlapping histomorphological features including high nuclear-to-cytoplasmic ratio and dense cellularity, and this distinction represents the most frequent intraoperative diagnostic dilemma.
Performance against brain metastases: In the second external cohort (59 patients: 25 PCNSL, 34 metastases), the model achieved a balanced accuracy of 95.57% (+/-2.47, 95% CI: 90.00-100.00) and AUROC of 99.88% (+/-0.19, 95% CI: 99.30-100.00) at the patient level. The most common metastasis subtype was lung adenocarcinoma (79.41%), with additional cases of urothelial carcinoma, squamous cell carcinoma, melanoma, adenoid cystic carcinoma, and rectal adenocarcinoma. Slide-level balanced accuracy was 95.74% (+/-1.60) with AUROC 97.49% (+/-1.39).
Ablation study comparing self-supervised vs. supervised learning: A direct comparison was performed between RapidLymphoma (BYOL self-supervised) and a cross-entropy (CE) supervised learning baseline using identical architecture, training data, and hyperparameters. At patient level, both approaches performed comparably (97.81% vs. 98.90% balanced accuracy), but at slide level RapidLymphoma clearly outperformed CE (97.21% vs. 91.04% balanced accuracy). Critically, the CE model produced 11 false positive slides versus only 1 for RapidLymphoma. The self-supervised approach also generated tighter, better-separated t-SNE and PaCMAP clusters, indicating superior morphological feature learning that translates into more reliable whole-slide predictions used intraoperatively.
At the slide level in the prospective cohort, six false positive cases and one false negative case were identified. The six false positives comprised two metastatic lung adenocarcinomas and four glioblastomas (IDH-wildtype CNS WHO grade 4). The shared histomorphological features driving these errors include high nuclear-to-cytoplasmic ratios, high chromatin content, and monomorphic cell patterns. In SRH images, these features produce higher pixel intensities in the CH3 channel that visually resemble the dense lymphoid cell morphology characteristic of PCNSL. Additionally, small stereotactic biopsy samples produced image patches with increased noise from squeezing artifacts and blood contamination, which further degraded patch-level classification confidence.
The false negative case: The single false negative slide contained a PCNSL case with an infiltrative pattern with reactive astrocytes, a histomorphological presentation more typical of glial tumors. In this sample, the number of PCNSL-specific patches was insufficient to shift the slide-level aggregate prediction to the correct class. This underscores a fundamental limitation of any patch-based analysis approach: cases with atypical, infiltrative, or treatment-modified (for example, corticosteroid-pretreated) presentations may produce misleading patch distributions even when PCNSL is actually present.
Class rarity and dataset size: The relatively small number of PCNSL cases in the prospective cohort (n=25) reflects the rarity of the disease itself. While this constrains statistical precision, particularly for sensitivity estimates, the authors note that this is unavoidable given the incidence of PCNSL and point to the prospective multicenter design as a compensating strength. Subgroup analyses by age, gender, race, institution, and procedure type all maintained balanced accuracies and AUROCs above 95%, suggesting that the model generalizes across clinically relevant demographic and procedural strata.
Institutional dependence and "black box" concerns: RapidLymphoma requires an SRH imager installed in the operating room, a device not universally available outside major academic neurosurgical centers. The authors acknowledge the inherent interpretability limitations of deep learning models, noting that visual heatmaps provide useful but incomplete transparency. The heatmaps reveal which spatial regions influence the prediction but do not provide mechanistic explanations that would allow a pathologist to fully interrogate the model's reasoning. The preoperative use of corticosteroids, which can suppress PCNSL cellularity and create tissue changes mimicking other entities, was not systematically analyzed as a confounding variable.
RapidLymphoma represents a complete, deployable intraoperative diagnostic pipeline: tissue biopsy, SRH imaging under three minutes, automated segmentation to exclude non-diagnostic tissue, self-supervised PCNSL classification, and a real-time color-coded heatmap visualized directly on the SRH imager screen in the operating room. The three-minute turnaround compares favorably not just to frozen section (20-30 minutes) but to the practical reality of current PCNSL diagnosis, which often involves sending tissue for both frozen section and FFPE analysis and waiting hours to days for definitive results. The system's output is designed for the neurosurgical context: a single confidence percentage and color map interpretable by a surgeon or pathologist without prior deep learning expertise.
Expandability of the training dataset: The authors highlight that expanding the training dataset to include unusual PCNSL presentations, such as T-cell CNS lymphoma, intravascular lymphoma, and corticosteroid-modified lymphoma, is straightforward within the existing pipeline architecture. New SRH images can be added to the training corpus and the model retrained without structural changes. This addresses the current limitation of atypical presentations driving false negatives and would be particularly important for immunocompromised patient populations, where PCNSL presentations may differ substantially from immunocompetent cases.
Generalizability to other imaging modalities: The BYOL-based self-supervised learning pipeline is not inherently dependent on SRH images. The authors explicitly note that the architecture can be adapted to H&E histopathology, immunohistochemistry stains, and other histopathological imaging modalities without structural modification. This extensibility is clinically significant because it means that centers without SRH imagers could potentially deploy a version of the pipeline on conventional digitized histopathology slides, broadening the reach of the technology beyond the current hardware constraint.
Future integration and trial design: The logical next step is integration into a clinical decision support workflow where RapidLymphoma provides a diagnosis simultaneously with ongoing surgical decision-making, not as a replacement for pathological confirmation but as a rapid preliminary signal. Prospective studies examining whether RapidLymphoma-guided intraoperative decisions reduce time to diagnosis and time to treatment initiation would provide the outcomes-level evidence needed for regulatory consideration. The publicly available RapidLymphoma code repository, planned for release upon publication, will enable independent validation and adaptation by other institutions.