PathKGen: Pathology Knowledge Assisted MLLM for Explainable Histopathology
Organizations: University of Moratuwa, Sri Lanka · Idiap Research Institute, Switzerland · EPFL, Switzerland
Abstract
Whole Slide Image (WSI) analysis serves as the fundamental method for the clinical diagnosis of cancer in digital histopathology. Recent advances in Multimodal Large Language Models (MLLMs) have enabled state-of-the-art (SOTA) automated histopathology report generation. However, MLLMs reason purely through distributions encoded in their neural parameters, limiting the amount of knowledge and reasoning logic they can contain given the model scale. Their black-box reasoning poses another challenge to the human interpretation of intermediate reasoning. We address these issues by utilizing knowledge graphs to inject external structured knowledge for MLLMs to reason over, while making this reasoning component visible. Knowledge graphs are capable of partially externalizing the containment of medical knowledge, an area that remains underexplored in pathology report generation. We introduce PathKGen, a knowledge graph-assisted MLLM for histopathology report generation. PathKGen has two main branches: (1) a visual path that learns visual token inputs to the MLLM using pathology foundation models, and (2) a knowledge path that learns knowledge token inputs by extracting key morphological features of WSIs through querying a pathology-specific knowledge graph. A comprehensive evaluation on WSI-Bench dataset shows that PathKGen surpasses previous SOTA methods while revealing diagnostic reasoning as visually intuitive graphs. Due to its modular design, the proposed knowledge path is complementary to vision-aligned MLLMs and can be extended to other applications by curating domain-specific knowledge graphs to generate knowledge tokens.
Figures & tables
| Input | Acc. | Prec. | Rec. | F1 |
|---|---|---|---|---|
| Primary site only | 0.8416 | 0.6764 | 0.7393 | 0.6941 |
| Slide emb. only | 0.9356 | 0.8685 | 0.8873 | 0.8754 |
| Slide emb. + site | 0.9752 | 0.9656 | 0.9848 | 0.9711 |
| Models | B-1 | B-2 | B-3 | B-4 | R-L | M | W-P |
|---|---|---|---|---|---|---|---|
| GPT-4o [ 12 ] | 0.202 | 0.069 | 0.030 | 0.016 | 0.132 | 0.167 | 0.067 |
| Quilt-LLaVA [ 29 ] | 0.334 | 0.170 | 0.093 | 0.057 | 0.246 | 0.291 | 0.324 |
| MI-Gen [ 3 ] | 0.403 | 0.306 | 0.248 | 0.209 | 0.446 | 0.407 | 0.310 |
| Hist-Gen [ 9 ] | 0.406 | 0.307 | 0.248 | 0.208 | 0.448 | 0.416 | 0.300 |
| WSI-Agents [ 26 ] | 0.444 | 0.308 | 0.231 | 0.183 | 0.448 | 0.472 | 0.440 |
| WSI-LLaVA [ 17 ] | 0.480 | 0.358 | 0.287 | 0.240 | 0.490 | 0.465 | 0.380 |
| Knowledge-path input | B-1 | B-2 | B-3 | B-4 | R-L | M | W-P |
|---|---|---|---|---|---|---|---|
| None | 0.4922 | 0.3745 | 0.3063 | 0.2548 | 0.5185 | 0.4730 | 0.4661 |
| Predicted histology (H) | 0.5020 | 0.3805 | 0.3088 | 0.2558 | 0.5174 | 0.4789 | 0.4570 |
| Primary site (PS) only | 0.4959 | 0.3773 | 0.3072 | 0.2549 | 0.5142 | 0.4750 | 0.4480 |
| PathKGen (H + PS + MF) | 0.5122 | 0.3885 | 0.3154 | 0.2611 | 0.5194 | 0.4849 | 0.4802 |
| Method | B-1 | B-2 | B-3 | B-4 | R-L | M | W-P |
|---|---|---|---|---|---|---|---|
| V path only (7B) | 0.4922 | 0.3745 | 0.3063 | 0.2548 | 0.5185 | 0.4730 | 0.4661 |
| (V + K) path (1.5B) | 0.4792 | 0.3607 | 0.2930 | 0.2426 | 0.5040 | 0.4562 | 0.4290 |
| (V + K) path (3B) | 0.4950 | 0.3723 | 0.3011 | 0.2484 | 0.5082 | 0.4719 | 0.4428 |
| (V + K) path (7B) (PathKGen) | 0.5122 | 0.3885 | 0.3154 | 0.2611 | 0.5194 | 0.4849 | 0.4802 |
| Intervention | W-P |
|---|---|
| Predicted histology anchor (default) | 0.4802 |
| Oracle histology anchor | 0.4830 |
| Random-wrong histology anchor | 0.2540 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Class | Precision | Recall | F1-score | Support |
| Adrenocortical Carcinoma | 1.00 | 1.00 | 1.00 | 5 |
| Bladder Urothelial Carcinoma | 1.00 | 0.89 | 0.94 | 9 |
| Brain Lower Grade Glioma | 1.00 | 1.00 | 1.00 | 15 |
| Breast Invasive Carcinoma | 1.00 | 0.96 | 0.98 | 23 |
| Cervical Squamous Cell Carcinoma | 1.00 | 1.00 | 1.00 | 2 |
| Cholangiocarcinoma | 1.00 | 1.00 | 1.00 | 2 |
| Metric | 95% CI |
|---|---|
| B-1 | (0.5094, 0.5138) |
| B-2 | (0.3852, 0.3911) |
| B-3 | (0.3122, 0.3185) |
| B-4 | (0.2580, 0.2645) |
| M | (0.4826, 0.4896) |
| R-L | (0.5179, 0.5203) |
| Model | Model Responses |
|---|---|
| WSI | |
| Ground Truth | Microscopic observation of the pathology slide reveals a presence of tumor cells forming irregular glandular structures that moderately deviate from the normal tissue architecture, consistent with moderate differentiation. The nuclei exhibit slight pleomorphism, with moderate variability in size and shape, and there is an intermediate rate of mitosis observed. Vascular invasion is not specified in the observations available, and there is no mention of necrosis or calcification. Based on these observations, the diagnosis is adenocarcinoma, moderately differentiated. |
| WSI-LLaVA | Microscopic observation of the pathology slide reveals a moderately differentiated adenocarcinoma characterized by irregular clusters of epithelial cells infiltrating the lung tissue. The tumor cells exhibit moderate glandular formation, deviating from normal alveolar architecture. The nuclei show moderate variability in size and shape, indicative of nuclear pleomorphism. There is no evidence of vascular invasion or necrosis within the observed slide. Based on these observations, the diagnosis is adenosquamous carcinoma, moderately-differentiated. |
| PathKGen | Microscopic observation of the pathology slide reveals a moderately differentiated adenocarcinoma characterized by irregular clusters of epithelial cells infiltrating the stroma, forming glandular structures that moderately deviate from normal tissue architecture. The nuclei exhibit moderate variability in size and shape, indicative of nuclear pleomorphism, and there is a moderate rate of cell division observed. There is no evidence of vascular invasion, necrosis, or calcification within the examined tissue. Based on these observations, the diagnosis is adenoc arcinoma, moderately differentiated. |
| Model | Model Responses | ||
|---|---|---|---|
| WSI | |||
| Ground Truth | Microscopic observation of the pathology slide reveals well-differentiated endometrioid carcinoma cells invading minimally into the myometrium. The architecture is predominantly glandular, exhibiting preserved tubule formation indicative of low-grade differentiation, corresponding to a FIGO Grade 1 classification. There is an absence of lymphovascular invasion, which is a favorable prognostic indicator. The tumor primarily shows superficial invasion with no significant features of atypical necrosis or calcification. Based on these observations, the diagnosis is well-differentiated endometrioid adenocarcinoma, FIGO Grade I. | ||
| WSI-LLaVA | Microscopic observation of the pathology slide reveals well-differentiated glandular structures with minimal deviation from normal endometrial gland architecture, consistent with a FIGO grade 1 classification. The tumor cells exhibit nuclear features ranging from intermediate to high-grade, indicating a nuclear grade of 2-3. There is no evidence of lymphovascular space invasion. The surrounding non-neoplastic endometrium appears atrophic. Based on these observations, the diagnosis is endometrioid adenocarcinoma, FIGo grade 2.carinoma. | ||
| PathKGen | Microscopic observation of the pathology slide reveals endometrioid adenocarcinoma characterized by well-differentiated glandular structures, consistent with a FIGO grade 1 classification. The tumor cells exhibit minimal nuclear atypia and a low rate of mitotic activity. There is no evidence of lymphovascular space invasion, and the tumor is confined to the endometrium without invasion into the myometrium. Based on these observations, the diagnosis is endometrial carcinoma, FIGO Grade 1. |
| Model | Model Responses |
|---|---|
| WSI | |
| Ground Truth | Microscopic observation of the pathology slide reveals that the serous adenocarcinoma is characterized by high-grade papillary structures with areas of solid and glandular growth patterns. Tumor cells exhibit significant atypia with prominent nucleoli and high mitotic activity. Numerous psammoma bodies , which are concentrically calcified structures, are present throughout the specimen. There is widespread tumor necrosis and lymphovascular invasion, indicating aggressive behavior of the carcinoma. Reactive stromal changes, including fibrosis and secondary inflammation , are noted, suggesting a chronic inflammatory response. Additionally, foci of calcification are seen, which may correspond to previous necrotic or injured tissues. Based on these observations, the diagnosis is high-grade papillary serous carcinoma. |
| WSI-LLaVA | Microscopic observation of the pathology slide reveals a high-grade neoplasm characterized by the presence of malignant epithelial cells forming complex papillary structures with fibrovascular cores. The tumor cells exhibit marked nuclear atypia, including pleomorphic nuclei with prominent nucleoli and irregular nuclear contours. There is a high mitotic activity indicative of rapid cell division. Areas of necrosis are present, and there is evidence of vascular invasion within the lymphovascular spaces. The ovarian stroma shows infiltration by the tumor, and the tumoral cells extend to the serosal surfaces. Based on these observations, the diagnosis is high- grade mullerian-derived adenocarcinoma, papillay type. |
| PathKGen | Microscopic observation of the pathology slide reveals a high-grade serous carcinoma characterized by papillary and solid growth patterns. The tumor cells exhibit marked nuclear atypia with prominent nucleoli and frequent mitotic figures, indicating a high proliferative activity. There is evidence of lymphovascular invasion, as tumor cells are observed within vascular spaces. Necrosis is present within the tumor tissue, contributing to its heterogeneous appearance. Based on these observations, the diagnosis is serous adenocarcinoma, high grade. |
Medical Report Generation
Medical report generation turns medical images, clinical records, or conversations into structured, clinically useful reports.
See all 82 papers