Ethics statement and consent to participate
The study was conducted in accordance with the Declaration of Helsinki. This retrospective study involved data from four centers: The First Affiliated Hospital of Chongqing Medical University (CQMFH), The Second Affiliated Hospital of Chongqing Medical University (CQMSH), The Third Affiliated Hospital of Chongqing Medical University (CQMTH), and Yongchuan Hospital of Chongqing Medical University (YCH). Ethical approval was granted by the Ethics Committee of The First Affiliated Hospital of Chongqing Medical University (Approval No. K2024-187-07), which was recognized by the institutional review boards of CQMSH, CQMTH, and YCH. The requirement for informed consent was waived by the ethics committees due to the retrospective nature of the study and the fact that all data were anonymized and de-identified prior to analysis.
Patient cohorts
This study comprised patients from four cohorts (CQMFH, CQMSH, CQMTH, and YCH) who possessed complete clinical information, CT scans, and pathology slides. The CQMFH data functioned as the development cohort for model training and validation, and the other cohorts (CQMSH, CQMTH, and YCH) were utilized for external validation to evaluate the model’s robustness. Data for this retrospective analysis were obtained from medical records covering the period from December 1, 2012, to the end follow-up on June 1, 2025. Following ethical approval, baseline clinical, CT, and follow-up data were retrieved and verified from January to July 2025. Detailed data distribution and patient selection criteria can be found in Supplementary Fig. 1.
CT image acquisition and ROI sketching procedure
Contrast-enhanced CT scans were acquired using diverse scanning equipment from multiple manufacturers, including Philips, Siemens, GE Healthcare, and Toshiba. Acquisition parameters were optimized as follows: tube voltage (90–120 kV), tube current (125–360 mAs with automatic dose modulation), reconstruction matrix (512 × 512 matrix), and slice thickness (1.0–5.0 mm). For prognostic analysis and segmentation, we employed images from the nephrographic phase, obtained after intravenous injection of iohexol (300 mgI/mL) at a flow rate of 3.0 mL/s followed by a saline flush. To ensure the biological relevance of our baseline assessment, we selected the final scan performed prior to surgical resection for each patient, ensuring that no intervening therapy was administered during the interval between imaging and surgery. Three-dimensional regions of interest (ROIs) for model training were created by a strict multi-reader consensus approach. Initial tumor segmentations were manually delineated by two independent abdominal radiologists using ITK-SNAP (v.3.8.0), referencing synchronized axial, sagittal, and coronal views to ensure precise tumor boundary definition. Discrepancies among observers in the segmented volumes were resolved by a senior radiologist with over 20 years of expertise in multi-phase urological CT assessment, hence assuring a reliable ground truth for the CTVisionNet and interactive segmentation networks.
Interactive segmentation framework construction
The manual labeling of BUC lesions is a time-consuming and labor-intensive process. Although segmentation algorithms offer a solution, current solutions lack the interactivity needed for user-guided refinement. To overcome these limitations, we developed a deep learning-based interactive framework that facilitates rapid ROI delineation and allows for user-guided refinement. Our BUC interactive segmentation framework uses Swin-UNETR as its backbone due to its advanced performance in medical image segmentation, as demonstrated by comparisons in Supplementary Table 1. The U-shaped design of Swin-UNETR combines a CNN-based decoder with a Swin Transformer encoder, allowing for multi-resolution feature fusion through the use of skip connections33. This design, particularly the transformer-based encoder, is highly effective for complex 3D medical imaging tasks because of its ability to capture long-range dependencies (Supplementary Fig. 4).
The segmentation procedure initiates with user interactions on CT images, including clicks or scribbles, to delineate the 3D borders of the BUC region. To reduce the necessity for additional user input, these interactions are encoded into geodesic distance transform maps23. This method guarantees a balance between automation and precision, offering a more efficient and interactive means for users to enhance the segmentation results (Supplementary Fig. 2). The geodesic distance transform steps are detailed below:
Let \({S}_{{\rm{f}}}\) and\({S}_{b}\) denote the sets of pixels corresponding to foreground and background scribbles. For a given pixel \(i\) in the image \(I\), the unsigned geodesic distance from \(i\) to a scribble set \(S(S\in \{{S}_{f},{S}_{b}\})\) is given by:
$$G(i,S,I)=\mathop{\min }\limits_{j\in S}{D}_{geo}(i,j,I)$$
(1)
$${D}_{geo}(i,j,I)=\mathop{\min }\limits_{p\in {P}_{i,j}}{\int }_{0}^{1}\parallel \nabla I(p(s))\cdot u(s)\parallel {d}_{s}$$
(2)
Let \({P}_{i,j}\) be the set of all paths between pixels \(i\) and \(j\), with \(p\) representing a potential path parameterized by \(s\in [0,1]\).\(u(s)\) represents a unit vector that is tangent to the direction of the path. In the absence of user scribbles, a geodesic distance map is automatically generated with random integers. The interactive segmentation framework receives a three-channel input (the original image, user foreground interactions, and user background interactions) to produce an initial segmentation mask. Subsequently, the user can provide additional guidance signals, prompting the framework to iteratively refine the segmentation probability maps based on the new inputs.
To effectively encode these new interactions, we employ the proposed Exponential Geodesic Distance (EGD) transform to generate interaction-based hint maps. Let \({C}_{i}^{f}\) denote the refined EGD foreground hint map, which is derived from the foreground term (\({e}^{-{D}_{i}^{f}}\)) and the background term (\({e}^{-{D}_{i}^{b}}\)) computed via the geodesic distance transform of user clicks. The value of \({C}_{i}^{f}\) ranges from 0 to 1, representing the affinity between pixel \(i\) and the foreground interaction points. Additionally, let \({I}_{i}^{f}\) denote the initial foreground probability map predicted by the Swin-UNETR.
Furthermore, we propose an information fusion strategy to refine the initial segmentation prediction using the interaction encoding map \({C}^{f}\). The objective is to design a fusion algorithm that rectifies the initial prediction \({I}^{f}\) based on the geodesic proximity of pixel \(i\) to the refinement clicks. Intuitively, regions next to interaction points should be more affected by user inputs than distant regions. Accordingly, we define the refined foreground probability \({R}_{i}^{f}\) for pixel \(i\) as follows:
$${C}_{i}^{f}=\frac{{e}^{-{D}_{i}^{f}}}{{e}^{-{D}_{i}^{f}}+{e}^{-{D}_{i}^{b}}}$$
(3)
$${\alpha }_{i}={e}^{-\,{\min }({D}_{i}^{f},{D}_{i}^{b})}$$
(4)
$${R}_{i}^{f}=(1-{\alpha }_{i})\ast {I}_{i}^{f}+{\alpha }_{i}\ast {C}_{i}^{f}$$
(5)
where \({\alpha }_{i}\in [0,1]\) serves as an adaptive weighting factor. As pixel \(i\) approaches any refinement click, \({\alpha }_{i}\) tends toward 1.0, causing the refined probability \({R}_{i}^{f}\) to be dominated by the interaction hint \({C}_{i}^{f}\). The entire interactive segmentation procedures are presented in Supplementary Fig. 5. Total click count serves as a quantitative measure of model usability. As illustrated in Supplementary Fig. 7, the majority of subjects required 9 to 11 clicks for initial segmentation and 3 to 6 clicks for refinement.
WSI file acquisition
For every individual in the training and validation cohorts, a representative H&E-stained tumor slide was selected. These slides, which contained comprehensive tumor and surrounding tissue information, were digitized at ×40 magnification using four scanners: KF-PRO-020, KF-PRO-005-EX, and KF-PRO-040-HI (Jiangfeng BioInformation Technology, Ningbo, China), alongside the SQS-600P (Shengqiang Technology, Shenzhen, China). The corresponding pixel dimensions at the specimen level for these scanners were 0.246 μm, 0.246 μm, 0.252 μm, and 0.206 μm, respectively.
Tissue probability and segmentation heatmap generation
We adopted the BUCSegNet tile classification network to enable local pathological knowledge-guided slide representation (Supplementary Fig. 6). This network generates tissue probability and segmentation heatmaps. Patches for training were annotated into eight regions: tumor, connective tissue, muscularis tissue, lymphovascular tissue, non-ROI, adipose tissue, empty, and lymphocytes. To improve annotation efficiency and precision, we used the Segment Anything Model (SAM) in QuPath34. Two proficient pathologists independently labeled each tile, with a senior pathologist adjudicating any inconsistencies. The BUCSegNet feature extractor, \({f}_{BUCS{\rm{eg}}Net\_conv}\), is an adapted ResNeXt50 network, where the final fully connected layers \({f}_{BUCSegNet\_fc}\) are configured with an output dimension of 835. For model inference, WSIs were first partitioned into tiles with registered coordinates. The OTSU algorithm was implemented to exclude non-tissue regions from tissue thumbnails. Patches of 256 × 256 pixels were then extracted at ×20 magnification from the tissue-containing areas of these thumbnails. Let \({p}_{l}(x,y)\) be the local knowledge probability and \({s}_{l}(x,y)\) the local knowledge classification result for each input patch and its coordinates\(i(x,y)\). These are defined as follows:
$${p}_{l}(x,y)=softmax({f}_{BUCSegNet\_fc}({f}_{BUCSegNet\_conv}(i(x,y))))$$
(6)
$${s}_{l}(x,y)=argmax({p}_{l}(x,y))$$
(7)
The outputs \({p}_{l}(x,y)\) and \({s}_{l}(x,y)\) from continuous patch-level inference are aggregated to construct the corresponding local knowledge probability heatmaps \({P}_{l}\) and local knowledge segmentation heatmaps \({S}_{l}\).
Tumor phenotype probability and segmentation heatmap generation
After generating the local slide representation, we obtained the coordinates and distribution of tumor tissue. While BUCSegNet differentiates tissue components, global pathological information (Tumor phenotype), such as tumor classification, grading, and invasion status, is often subject to the biases of subjective pathologist evaluations. Additionally, achieving accurate classification with fully supervised learning is challenging due to the difficulty of obtaining extensive and precise annotations. To address this, we used CONCH, a vision-language model leveraging contrastive learning on large-scale image-text pairs. CONCH’s ability to recognize visual representations via textual prompts and its state-of-the-art performance in visual-language tasks make it suitable for our purpose.
To construct the global knowledge-driven representation, tumor-localized coordinates derived from the initial local analysis were first targeted. Utilizing the DeepZoomGenerator from OpenSlide, image patches were harvested from these locations and subsequently normalized to a 448 × 448 pixel format to meet CONCH’s input specifications. The framework generated high-dimensional image and text embeddings for each tile. The computed patch-level probability distributions were derived from the cosine similarity with the logit scale application (Supplementary Fig. 6).
Let \({v}_{i}\) represent the image feature embeddings, \({v}_{t}\) the text feature embeddings, and \({e}^{logit\_scale}\) a learnable scaling factor. For a patch and its specific coordinates \(i(x,y)\), the global knowledge patch probability, \({p}_{g}(x,y)\), and the global knowledge classification result, \({s}_{g}(x,y)\), are defined as follows:
$${p}_{g}(x,y)=softmax({v}_{i}\times {v}_{t}^{T}\times {e}^{logit\_scale})$$
(8)
$${s}_{g}(x,y)=argmax({p}_{g}(x,y))$$
(9)
The continuous patch inference process combines \({p}_{g}(x,y)\) and \({s}_{g}(x,y)\) to create the corresponding tumor phenotype probability and segmentation heatmaps.
Generation of structured pathology reports
To address the challenge of transforming unstructured narrative pathology reports into a standardized, structured format suitable for clinical research and data aggregation, we developed and deployed a novel automated agent powered by LLMs. Our methodology is centered on a sophisticated two-stage prompting strategy, specifically designed to maximize both the accuracy of data extraction and the logical integrity of the final structured output. The first stage initiates the process by guiding the LLMs to perform a deep semantic analysis of the raw narrative text. In this phase, it is tasked not only with extracting explicit data points such as patient demographics and histological grade but also with the more complex inferential task of determining the correct pTNM stage from descriptive text, all based on a comprehensive set of predefined rules. This initial step is crucial for converting nuanced, non-standardized language into a preliminary structured representation. To enhance the reliability of this output, the second stage of our strategy introduces a critical self-correction and refinement loop. Here, the LLM is prompted to meticulously review its own initial output, acting as an automated quality control agent. The primary purpose of this stage is to verify the internal medical logic and to autonomously correct any detected inconsistencies or errors, such as making sure the assigned T stage is entirely consistent with the textual description of tumor invasion. This two-step approach, combining initial interpretation with subsequent logical validation, was chosen to systematically improve the fidelity and accuracy of the structured data. The final, validated output is then used to programmatically generate a coherent, standardized report, thereby achieving our primary objective of creating a reliable, automated tool for medical data standardization.
Evaluation of structured pathology report accuracy
To rigorously evaluate our LLM-based agent, we benchmarked its performance against a manually curated ground truth dataset containing key clinical parameters, including patient age, gender, pathological TNM stage, histological grade, and lymphovascular invasion (LVI) status. The evaluation framework was designed to assess two critical aspects of performance: the accuracy of discrete information extraction and the quality of the final generated text. Our evaluation was two steps: First, we assessed information extraction accuracy by calculating the proportion of correctly identified parameters in a direct field-by-field comparison against the ground truth. Second, we evaluated text generation quality by comparing the complete AI-generated report to a golden standard report, which was programmatically generated from the ground truth labels using a deterministic, rule-based system. This textual comparison utilized ROUGE-L to measure lexical similarity and BERTScore to assess semantic equivalence, providing a comprehensive, multi-faceted assessment of the agent’s ability to produce both accurate and coherent structured reports36,37.
CTVisionNet construction procedure
The construction of CTVisionNet began with a 3D-cropbox to extract and fill ROIs. As depicted in Supplementary Fig. 3, this workflow comprises three steps: ROI cropping, background filling, and area saving. To facilitate survival prediction, a 3D SEResNext50 network was deployed to derive prognostic risk scores from the processed BUC images. The CTVisionNet \({f}_{CTVision}\) integrates three distinct functional units: a CT-based image encoding module \({f}_{CTVision\_enco}\), a feature compression and stabilization module \({f}_{CTVision\_stab}\), and a prognostic prediction module \({f}_{pred}\). A 3D SEResNext50 feature extractor \({f}_{CTVision\_enco}\) maps the 3D-cropbox information \(R\) into a 2048-dimensional feature vector (\({K}_{radio}\in {{\mathbb{R}}}^{2048}\)). To down-sample this vector to \({S}_{radio}\in {{\mathbb{R}}}^{32}\) while augmenting model resilience, the feature compression and stabilization module \({f}_{CTVision\_stab}\) was employed. This specific unit incorporates a fully connected layer integrated with batch normalization and a rectified linear unit. Finally, the prognosis risk score (\(R{S}_{radio}\)) was determined based on \({S}_{radio}\in {{\mathbb{R}}}^{32}\) through a fully connected layer (\({f}_{pred}\)) optimized by a survival-specific loss function. The model equations are formulated as follows:
$${K}_{radio}={f}_{CTVision\_enco}(R)$$
(10)
$${S}_{radio}={f}_{CTVision\_stab}({K}_{radio})=ReLU(BN(FC({K}_{radio})))$$
(11)
$$R{S}_{radio}={f}_{pred}({S}_{radio})$$
(12)
MacroVisionNet construction procedure
MacroVisionNet \({f}_{MacroVision}\) shares the three-part structure of CTVisionNet, including an encoding module (\({f}_{MacroVision\_enco}\)), a feature compression and stabilization module (\({f}_{MacroVision\_stab}\)), and a prediction module (\({f}_{pred}\)). For survival prediction from WSI macroscopic tissue information, we used a ResNeXt50 network to encode the concatenated local and global slide representations (\(P\)) into a 2048-dimensional feature vector. To accommodate the channel number of \(P\), we adjusted the input channel count of ResNeXt50 to 16. The \({f}_{MacroVision\_stab}\) module further compressed the encoded macro feature vector \({K}_{MacroVision}\in {{\mathbb{R}}}^{2048}\) to \({S}_{MacroVision}\in {{\mathbb{R}}}^{32}\). The final patient-level risk score \(R{S}_{MacroVision}\) was then derived from \({S}_{MacroVision}\) using \({f}_{pred}\). Detailed model equations are as follows:
$${K}_{MacroVision}={f}_{MacroVision\_enco}(P)$$
(13)
$${S}_{MacroVision}={f}_{MacroVision\_stab}({K}_{MacroVision})=ReLU(BN(FC({K}_{MacroVision})))$$
(14)
$$R{S}_{MacroVision}={f}_{pred}({S}_{MacroVision})$$
(15)
MATCH-Net construction procedure
At present, most methodologies for multimodal integration utilize late-fusion strategies. However, substantial divergence exists among various data modalities, such as pathology images, radiographic features, and unstructured clinical text, which presents a substantial obstacle to their effective integration. Late-fusion paradigms restrict the capacity for profound, cross-modal interactions, thereby diminishing the interpretability of prognostic models. To uncover explainable correlations between microscopic, macroscopic, radiographic, and textual elements, we conceptualized a weakly supervised, multimodal deep learning framework: the Multimodal Pre-Gated Attention Transformer with Contextual Hierarchies (MATCH-Net). This architecture leverages a pre-gated multi-head contextual gated attention (PG-MHCA) mechanism to effectively integrate these diverse data sources.
Informed by co-attention transformer architectures that capture dependencies between heterogeneous data types, our model learns the interactions between high-dimensional microscopic histological features and the more structured radiographic, macroscopic, and semantic textual features to estimate prognostic outcomes22. We first employ a self-supervised learning model (UNI) to extract patch-level microscopic features \({K}_{MicroVision}\) from WSIs18. Concurrently, we process narrative clinical reports using a pre-trained ClinicalBERT model to generate powerful semantic embeddings \({K}_{TextVision}\). These features, along with radiographic\({K}_{radio}\) and macroscopic \({K}_{MacroVision}\) features, are subsequently passed to their respective encoder layers.
Subsequently, the encoded radiographic, macroscopic, and textual features are used as queries to guide the extraction of relevant information from the vast feature space of the WSIs. To effectively suppress noise and emphasize task-relevant regions within the gigapixel WSI prior to complex interaction, we introduce a Pre-Gated Attention (PGA) mechanism. The PGA computes a gating vector based on the relevance between the modality query and WSI patches, which is then used to re-weight the WSI features.
$${\mathscr{G}}=\sigma (({K}_{Mod}{W}_{Q}^{p}){({K}_{MicroVision}{W}_{K}^{p})}^{T})$$
(16)
$${\tilde{K}}_{MicroVision}={K}_{MicroVision}\odot {{\mathscr{G}}}^{T}$$
(17)
\({K}_{mod}\in \{{K}_{radio},{K}_{MacroVision},{K}_{TextVision}\}\) represents the features of a specific modality. The PGA generates a gating mask \({\mathscr{G}}\) and refines the microscopic features \({K}_{MicroVision}\). \(\sigma\) represents the sigmoid function. \({W}_{Q}^{p}\) and \({W}_{K}^{p}\) are learnable projection matrices for the pre-gating mechanism.
These re-weighted features \({\tilde{K}}_{MicroVision}\) then serve as the keys and values for the PG-MHCA mechanism which is further enhanced with a contextual attention gate (CAG) to dynamically adjust the attention output based on contextual information38,39. The formulation of the proposed mechanism is defined as follows:
$$Q={K}_{Mod}{W}_{q}\,,K={\tilde{K}}_{MicroVision}{W}_{k\,}\,,V={\tilde{K}}_{MicroVision}{W}_{v}\,$$
(18)
$$Attention(Q,K,V)=softmax(\frac{Q{K}^{T}}{\sqrt{{d}_{k}}})V$$
(19)
$$MultiHead(Q,K,V)=Concat({h}_{1}\,,\ldots ,{h}_{H}){W}_{O}\,$$
(20)
$$c=CAG(Q,MultiHead(Q,K,V))$$
(21)
$$Output=MultiHead(Q,K,V)+c$$
(22)
Following the co-attention step, the features from each modality are processed by their respective transformer encoders. These encoders comprise several layers of multi-head self-attention, allowing the model to capture complex intra-modal dependencies. After this encoding, the transformed features are passed through gated attention heads to produce pooled representations that summarize the most salient information from each modality. Finally, the pooled embeddings from the micro-pathology, macro-pathology, radiology, and text modalities are fused into a unified feature vector, which is passed to a linear classifier to produce the final prediction. To assess the relative weight of each modality, we calculated the L2 norm of the respective feature vectors during the forward inference pass. The variations in prognostic contribution scores across all study cohorts are depicted in Supplementary Fig. 8. Thorough analyses model dimension optimization, the impact of various fusion strategies, and ablation studies are provided in Supplementary Table 2.
Interpretability framework and visual explanations
To enhance the transparency of the inference process within our deep learning models, we leveraged Grad-CAM, saliency maps, and attention score maps to elucidate and visualize the underlying mechanisms of CTVisionNet, MacroVisionNet, and MATCH-Net. Specifically, Grad-CAM was utilized to clarify the relevance of feature maps within CTVisionNet by analyzing gradients in the final convolutional layer. Saliency attribution heatmaps were derived by computing the MacroVisionNet risk gradient relative to the input pixels. To probe the interplay between radiographic, textual, macroscopic, and microscopic attributes, we extracted PG-MHCA co-attention scores alongside their spatial WSI coordinates. These scores were projected onto corresponding pathological thumbnail images to generate co-attention score heatmaps. Concurrently, we utilized integrated gradients (IG) to assess the significance of textual feature properties40. We illustrated the weighted contributions of structured pathology reports using IG heatmaps. In this context, positive attributions within the structured reports drive an increase in the output value (indicating high risk), while negative attributions serve to decrease the output value (indicating low risk).
Loss function definition
The interactive segmentation model was trained using the Dice loss function, while the BUCSegNet patch classifier was trained with cross-entropy loss. We chose not to employ the standard negative Cox partial log-likelihood loss for our survival tasks. This decision was made because its mini-batch dependency poses a notable challenge when working with heterogeneous pathology WSIs, where microscopic patch features vary greatly between slides. Instead, for the CTVisionNet, MacroVisionNet, and MATCH-Net survival models, we adopted a category-based negative log-likelihood loss function as detailed in ref. 41. We divided the continuous overall survival time \({T}_{s}\) into four distinct intervals: [\({T}_{0}\),\({T}_{1}\)], [\({T}_{1}\),\({T}_{2}\)], [\({T}_{2}\),\({T}_{3}\)], and [\({T}_{3}\),\({T}_{4}\)], according to the uncensored patient’s survival time quartiles in the training set. Subsequently, we discretized the survival time \({T}_{i}\) for the \(i-th\) patient into one of these intervals.
$${T}_{i}=n\,if\,{T}_{s}\in [{T}_{n},{T}_{n+1})$$
(23)
Leveraging the patient’s ultimate integrated representation \({M}_{final}\), the prediction layer computed the hazard function \({M}_{h}\) and the survival function \({M}_{s}\), which are defined as:
$${M}_{h}(n|{M}_{final})=P({T}_{i}=n|{T}_{i}\ge n,{M}_{final})$$
(24)
$$\begin{array}{l}{M}_{s}(n|{M}_{final})=P({T}_{i} > n|{M}_{final})\\ \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,=\mathop{\prod }\limits_{s=1}^{n}(1-{M}_{h}(s|{M}_{final}))\end{array}$$
(25)
The discrete survival log-likelihood objective can consequently be expressed as:
$$\begin{array}{l}{L}_{i}=-{c}_{i}\,log({M}_{s}({Y}_{i}|{M}_{final}))\\ \,\,\,\,-(1-{c}_{i})log({M}_{s}({Y}_{i}-1|{M}_{final}))\\ \,\,\,\,-(1-{c}_{i})log({M}_{h}({Y}_{i}|{M}_{final}))\end{array}$$
(26)
In this context, \({Y}_{i}\) denotes the ground-truth label for the \(i\)-th individual, whereas \({{c}_{i}}\) represents the binary censoring indicator (\({{c}_{i}}\)=1 if the patient was censored at the end of the follow-up period, and \({{c}_{i}}\)=0, otherwise). To ensure the impactful contribution of non-censored patient data, we employed a weighted sum to derive the final training loss.
Statistical analysis
Overall survival (OS) served as the primary clinical endpoint, measured as the time interval from surgical resection to all-cause mortality or the final follow-up census. We rigorously evaluated the model’s discriminative performance using the concordance index (C-index) and time-dependent area under the receiver operating characteristic curves (AUC) at 1, 3, and 5-year intervals. To avoid arbitrary thresholds, we employed maximally selected rank statistics on the training cohort to identify the optimal cut-off for stratifying patients into high- and low-risk groups. Survival distributions were estimated via the Kaplan–Meier method and compared using the log-rank test, while hazard ratios (HRs) were derived from Cox proportional hazards regression to quantify risk status. Beyond discrimination, we assessed calibration accuracy through calibration plots and evaluated clinical utility via decision curve analysis (DCA). Crucially, to quantify the incremental value of our multimodal agent over a clinical-only baseline, we computed the net reclassification improvement (NRI) and C-index improvement. The statistical robustness of these comparative metrics was validated using stratified bootstrap resampling (1000 iterations). All analyses were two-sided, with statistical significance set at P < 0.05.
Software and development environment
The technical framework for this study was implemented using a suite of specialized Python libraries. The AI agent’s backend architecture was developed utilizing LangGraph (v0.4.10), with the corresponding frontend interface constructed via FastAPI (v0.115.13). We leveraged Ollama for the local management and deployment of the large language models integral to our agent. In the domain of medical image analysis, the MONAI framework (v1.3) was employed for image processing tasks, while the OpenSlide library (v1.1.2) was specifically used for pathology slide manipulation. All model training and validation were conducted within a Python (v3.12.6) environment built on PyTorch (v2.0.0). All computational tasks were carried out on a high-performance workstation featuring a 48 GB NVIDIA A6000 GPU.