Artificial intelligence (Al) has reached expert-level performance on curated benchmarks for prostate cancer histopathology, yet a gap persists before clinically trustworthy implementation, which requires more than accuracy in model validation. Real-world deployment introduces sources of variation that current development and evaluation designs may have overlooked, including differences across clinical sites, imaging devices, and data characteristics introduced by time. The extent to which contemporary AI systems keep reliable under such conditions, and the mechanisms by which their robustness can be assured, remain to be fully characterized. This thesis aims to investigate the generalization and robustness of AI models for computational prostate cancer pathology across multiple sources of variation and to examine possible strategies for improvement.In Study I, we addressed between-site variation and offered an AI model-agnostic method for color calibration of whole slide image (WSI) scanners. Using a biomaterial-based physical calibrant slide and a chosen color profile reference, cross-scanner generalization of cancer diagnosis and grading performance substantially improved for both a fully supervised convolutional model and a weakly supervised foundation model-based system across multiple cohorts. For example, the concordance of grading with pathologists improved from 0.354 to 0.738 for the internal cohort and from 0.439 to 0.619 for an external cohort with the fully supervised model. The method also outperformed existing computational color normalization approaches, while requiring no additional training data and introducing no visible artifacts.In Study II, we illustrated a secondary clinical application of AI-assisted grading. When a sensitivity-prioritized threshold was picked, an end-to-end attention-based multiple instance learning (ABMIL) model without retraining managed to reduce unnecessary immunohistochemistry orders by 20-44% across three cohorts of diagnostically challenging biopsies without missing any cancer, supporting the broader clinical utility of grading models in streamlining decision-making in prostate pathology and alleviating resource burdens.In Study III, we established a preregistered external validation protocol conforming to STARD-AI, defining data inclusion and exclusion criteria, reference standards, and performance evaluation metrics, while being transparent about the model architecture and data preprocessing pipeline, to enable a rigorous generalization assessment of the AI model on long-term archival material.In Study IV, we executed the protocol from Study III on 10,366 biopsy cores from 1,028 patients archived across 14 Swedish regions between 1998 and 2015. Core-level grading of the model presented comparable performance to several experienced pathologists, with an overall quadratic-weighted kappa of 0.86 against the reference standard. Confusion matrices and survival analysis further supported the model's ability to capture clinically relevant features from tissue morphology. Notably, the model performance remained stable across the 17-year archival span, superior in consistency to the foundation model-based systems.In Study V, we conducted the first investigation of temporal variation within a single scanner on contemporary AI computational pathology models. Evaluating models on WSIs obtained by rescanning a fixed biopsy set every 14 days over one year, we found that foundation model encoders carry strong temporal signatures from their pretraining that task-specific training of the downstream attention aggregator could only partially suppress, even with a training dataset exceeding 60,000 WSIs. In contrast, the end-to-end ABMIL model learned to focus mostly on morphological information and largely ignored irrelevant temporal variation. This representation-level difference was reflected in performance stability, as the end-to-end model maintained consistent self-agreement across the year, whereas several foundation model-based systems showed measurable degradation over the time span.List of scientific papersI. Xiaoyi Ji, Richard Salmon, Nita Mulliqi, Umair Khan, Yinxi Wang, Anders Blilie, Henrik Olsson, Bodil Ginnerup Pedersen, Karina Dalsgaard Sørensen, Benedicte Parm Ulhøi, Svein R. Kjosavik, Emilius A.M. Janssen, Mattias Rantalainen, Lars Egevad, Pekka Ruusuvuori, Martin Eklund, Kimmo Kartasalo. Physical color calibration of digital pathology scanners for robust artificial intelligence-assisted cancer diagnosis. Modern Pathology, 2025, 38(5): 100715. https://doi.org/10.1016/j.modpat.2025.100715II. Anders Blilie*, Nita Mulliqi*, Xiaoyi Ji, Kelvin Szolnoky, Sol Erika Boman, Matteo Titus, Geraldine Martinez Gonzalez, José Asenjo, Marcello Gambacorta, Paolo Libretti, Einar Gudlaugsson, Svein R. Kjosavik, Lars Egevad, Emiel A. M. Janssen, Martin Eklund, Kimmo Kartasalo. Artificial intelligence-assisted prostate cancer diagnosis for reduced use of immunohistochemistry. Communications Medicine, 2025, 5(1): 425. https://doi.org/10.1038/s43856-025-01185-yIII. Xiaoyi Ji, Renata Zelic, Oskar Aspegren, Nita Mulliqi, Michelangelo Fiorentino, Francesca Giunchi, Luca Molinaro, Sol Erika Boman, Kelvin Szolnoky, Luana Xuan Liu, Andreas Pettersson, Per Henrik Vincent, Martin Eklund, Olof Akre, Kimmo Kartasalo. Retrospective validation of an artificial intelligence system for diagnostic assessment of prostate biopsies on the ProMort cohort: study protocol. BMJ open, 2025, 15(12): e111361. https://doi.org/10.1136/bmjopen-2025-111361IV. Xiaoyi Ji, Renata Zelic, Oskar Aspegren, Nita Mulliqi, Michelangelo Fiorentino, Francesca Giunchi, Luca Molinaro, Sol Erika Boman, Andreas Pettersson, Lorenzo Richiardi, Per Henrik Vincent, Martin Eklund, Olof Akre, Kimmo Kartasalo. Validation of an AI-based end-to-end model for prostate pathology using long-term archived routine samples. [Manuscript]V. Anders Blilie*, Xiaoyi Ji*, Nita Mulliqi, Richard Salmon, Einar...