Why PD-L1 Scoring Matters PD-L1 (Programmed Death-Ligand 1) expression is the primary biomarker used to determine eligibility and expected response to immune checkpoint inhibitor therapy in non-small cell lung cancer. High PD-L1 Tumor Proportion Score (TPS) predicts response to pembrolizumab monotherapy, making accurate PD-L1 scoring a direct determinant of treatment decisions for hundreds of thousands of patients annually.
The Problem with Manual Scoring Current PD-L1 scoring requires pathologists to manually count the percentage of tumor cells with membrane staining above a threshold. This is time-consuming, subjective, and shows significant inter-observer variability - studies have documented disagreement rates of 20-30% between pathologists on clinically relevant threshold calls (such as 50% TPS).
The Deep Learning Solution This study developed a three-component deep learning framework: a Vision Transformer for PD-L1 expression classification (F1 score 97.54%), a SelfONN DeepLabV3+ model for tumor cell segmentation (Dice coefficient 83.47%), and StarDist for individual nuclei detection. Together these components automate the full PD-L1 TPS calculation workflow.
Validation Result The automated TPS scores showed a Pearson correlation of 0.9635 with pathologist-assigned TPS scores, indicating near-linear agreement with expert human scoring across the full range of expression levels. This level of agreement surpasses many prior automated approaches and is clinically meaningful for threshold-based treatment decisions.
Checkpoint Inhibitor Therapy Anti-PD-1/PD-L1 immune checkpoint inhibitors have transformed lung cancer treatment. Pembrolizumab monotherapy is approved as first-line therapy for patients with TPS of 50% or higher, and as combination therapy down to 1%. Nivolumab, atezolizumab, and durvalumab have their own PD-L1 assays with different scoring algorithms and antibodies - adding complexity to clinical implementation.
The TPS Scoring Process TPS is calculated as the number of viable tumor cells showing partial or complete membrane staining divided by the total number of viable tumor cells, multiplied by 100. Pathologists count cells in representative high-power fields, usually 100-300 cells per field across multiple regions, to arrive at a representative score.
Sources of Variability Inter-observer variability in PD-L1 scoring comes from multiple sources: identification of viable tumor cells versus necrosis, assessment of staining intensity thresholds, selection of representative fields in heterogeneous tumors, and differences in calibrating what constitutes membranous versus cytoplasmic staining. These sources of error are greatest near clinical thresholds (1%, 50%).
Need for Automation With checkpoint inhibitor decisions affecting the majority of NSCLC patients, the demand for PD-L1 testing has grown dramatically. Manual scoring is a bottleneck in high-volume pathology labs. Automated scoring that reduces inter-observer variability and throughput time directly impacts clinical care quality and operational efficiency.
Vision Transformer for Classification A Vision Transformer (ViT) was trained to classify individual cells as PD-L1 positive or negative based on staining patterns. ViTs use self-attention mechanisms that model long-range pixel relationships, making them effective for distinguishing subtle staining patterns across the cell membrane. The ViT achieved an F1 score of 97.54% on the cell-level classification task.
SelfONN DeepLabV3+ for Segmentation DeepLabV3+ was modified with Self-Organized Operational Neural Networks (SelfONN) layers in the encoder. SelfONN layers use learnable nonlinear activation functions that better capture morphological variability in tissue sections compared to standard ReLU-based convolutions. The model achieved a Dice coefficient of 83.47% for tumor cell region segmentation.
StarDist for Nuclei Detection StarDist uses star-convex polygon representations to detect and delineate individual cell nuclei in a crowded tissue environment. Unlike standard instance segmentation approaches, StarDist handles overlapping and touching cells effectively - a critical capability in densely packed tumor areas where standard methods over-merge adjacent nuclei.
Pipeline Integration The three components operated sequentially: StarDist first detected all nuclei in a region, DeepLabV3+ identified which nuclei belonged to viable tumor cells, and the ViT classified each tumor cell as PD-L1 positive or negative. TPS was then calculated as the ratio of positive to total tumor cells, replicating the formal definition used by pathologists.
TPS Correlation The automated TPS scores showed Pearson correlation r=0.9635 with pathologist-assigned scores across the full range from 0% to 100%. This represents near-linear agreement that validates the system's ability to accurately quantify expression across all clinically relevant score levels, not just binary threshold classification.
Threshold Performance At the clinically critical 50% threshold, automated TPS classification showed high agreement with pathologist calls. Performance at the 1% threshold was also strong, though slightly lower due to the challenge of accurately counting rare positive cells in predominantly negative samples.
Comparison to Prior Automated Methods The framework outperformed previously published automated PD-L1 scoring approaches in both correlation with ground truth and classification accuracy at clinical thresholds. The ViT component was identified as particularly important - substituting a standard CNN for the ViT reduced overall system performance significantly.
Heterogeneous Tumor Performance The system maintained high performance even in cases with heterogeneous PD-L1 expression - where different tumor regions show markedly different staining levels. This is clinically important because PD-L1 heterogeneity is a major source of biopsy sampling error, and quantifying regional variation could provide additional predictive information.
Reducing Inter-Observer Variability By replacing subjective manual counting with deterministic algorithmic scoring, the framework could substantially reduce the 20-30% inter-observer disagreement rate that currently undermines PD-L1 testing consistency. Patients near scoring thresholds would benefit most from this standardization.
Laboratory Throughput Automated analysis runs in seconds per slide compared to 10-20 minutes of pathologist time per manual assessment. For high-volume cancer centers processing dozens of NSCLC PD-L1 requests per day, this throughput improvement could eliminate scoring backlogs and reduce time-to-treatment-decision.
Multi-Assay Standardization Different PD-L1 assays (22C3, 28-8, SP142, SP263) use different antibody clones and scoring systems that are not directly comparable. An AI system trained across multiple assay types could potentially harmonize scores, reducing confusion when patients are tested with different assays at different institutions.
Integration into Digital Pathology Workflows As digital pathology scanning becomes standard in pathology departments, AI-based PD-L1 scoring can be integrated as an automated step in the digital whole-slide image workflow, generating preliminary scores that pathologists review and approve rather than perform from scratch.
Single Assay Validation The framework was validated primarily on images from a single PD-L1 antibody assay and staining platform. Since different assays produce different staining intensities and patterns, the system would require retraining or adaptation testing before deployment with other PD-L1 assays used in clinical practice.
Dataset Composition The training and validation dataset may not fully represent the spectrum of NSCLC histological subtypes, including rare variants and cases with extensive necrosis or inflammatory infiltrates that complicate tumor cell identification. Prospective collection of edge cases is needed to characterize failure modes.
Regulatory and Clinical Validation Deploying an AI-based PD-L1 scorer in clinical practice requires regulatory clearance (FDA 510(k) or CE mark), which demands performance characterization across multiple sites, scanners, and pathologist reference standards. The high correlation result is a necessary but not sufficient condition for regulatory approval.
Future Directions The system could be extended to predict immunotherapy response beyond TPS - for example, by analyzing spatial patterns of PD-L1 expression, proximity of positive cells to immune infiltrates, or combining PD-L1 scores with tumor mutational burden estimates from the same H&E slide using a multi-task learning approach.