Dr. Aleks Zuraw: Welcome my digital pathology trailblazers. I am so happy to be here. It’s DigiPath Digest time. So now we’re doing DigiPath Digest every other week instead of every week.
Intro: Learn about the newest digital pathology trends in science and industry. Meet the most interesting people in the age and gain insights relevant to your own project. Here is where pathology meets computer science. You are listening to the Digital Pathology Podcast with your host, Dr. Aleksandra Zuraw.
How much of model performance comes from the model
Dr. Aleks Zuraw: The topic of today is the magic of foundation models. So, how much of what we call model performance is actually the model? Pathology foundation models are now the default feature extractor in computational pathology, and every vendor quotes a benchmark ranking, or at least they try to. And today we’re going to be talking about three papers published within the recent weeks that show the ranking moves depending on how you cross-validate which scanner digitized the slide and which section the technician put on the stage. Less than the field assumes, and all three, the data pipeline moved performance further than the architecture did. So, not the model itself, but the data pipeline. So let me show you what we’re covering today.
We’re gonna be talking about uh benchmark study of vision and pathology foundation models for computational pathology. Then uh the other one that we have is slide selection introduces sampling-induced prediction uncertainty in digital pathology AI. This is gonna be about evidence from multi-slide breast cancer cohort. And I love that they have something called simple summary. Now, not only do they have abstract for this paper, they also have a simple summary. Love it. And one about domain generalization.
This is a topic we’ve been talking about several times, but basically domain generalization of histopathology foundation models in multi-center, multi-scanner cohorts. Again, a comparative benchmark. So domain is where we’re like the environment. So if the environment where the slides came from changes, different things in these models change. So uh all of these uh three papers land on the same point from different directions. That the pipeline moves performance more than the model does. So in the first paper, it was we were focusing on the model, so 32 different models ranked.
I didn’t even know we had like 32 foundation models, but I mean the moment you start making them, then you just make them better and more of them. And the top five are statistically indistinguishable. Then we have a scanner, and change in the scanner and model choice starts to matter a great deal, which is kind of counterintuitive for me as the pathologist, but probably um obvious for a computer scientist, and because for me it’s like okay, I look at an image, it’s an image, and I recognize the features, but the metadata, the information embedded in this image for the computer is being read totally different than a human eye that can, you know, see through artifacts, see through like stitching problems and things like that. And then the slide, right? Change the slide and the performance move further than either of the above. So this is like let’s put an exclamation mark here. Because yeah, usually it’s just okay, we take one slide with a tumor and we try to do stuff um with it. Not that simple.
Paper one: the 32-model benchmark
So let’s talk about the benchmark, our paper from Nature Communications, benchmark study of vision and pathology foundation models for computational pathology. Uh so here, this was the study from Stanford and Argonne that benchmark 32 foundation models across 41 tasks. I’m like, no longer, no, no, no wonder it’s Nature Communications because I I’ve been so I’ve been writing a couple of mini reviews for um my main journal, which is Toxicologic Pathology, and then uh I look at what these people do here: 32 foundation models and 41 tasks. It kind of makes me feel so small, but I hope I’m still useful. Anyway, so uh here the top five models sit within 0.006 AUROC of each other, and no pairwise test separates them. This is a figure from the from the paper. We have the first guy is Virchow2.
Yeah, so Virchow2 um 0.830, Prov-GigaPath 0.829, and H-optimus-0, UNI2 0.824. So here our top models, they’re basically like the same, the same um performance, and the pathology trained models beat vision language models, but not general vision models. So, what does that mean? Is that there are vision vision models, vision um yeah, let’s just call them VMs, vision models, and vision language models. So if we have this pathology trained vision model, it’s gonna be better than a pathology trained vision language model, which also is counterintuitive because I was always like, oh, multimodal, you give this more context, more information, you give language, you give the reports, and and it turns out that they don’t learn like that. So the vision models, if they just focus on the image, they’re gonna be better than vision language models for these tasks that they um that they tested on, but not general vision models. So that’s also like counterintuitive for me, but the general vision models are still okay.
Model size and pre-training scale
Also, another kind of concept is big models, they are better. The bigger, the more data, the better. So it turns out that bigger models helped on familiar, familiar data and stopped helping everywhere else. So the the they plotted the model sides and gains appear on TCGA, which is The Cancer Genome Atlas, because the most data of these models were pre-trained on. Sorry, the most the data most of these models were pre-trained on. So an extender, uh, external and out of domain, and that differences were not significant. So neither model size nor pre-training scale predicts downstream performance, which is, I guess, the word of the of today’s episodes is counterintuitive because it was always like throw more throw more data, make it bigger, like pre-trained it on more, but it doesn’t really play out that way.
Paper two: scanner shift
But what about the scanner? What about the scanner, guys? This for me is like particularly sad because I don’t want it to be scanner specific, I want it to be scanner agnostic. Because scanner agnostic, like algorithms and everything. So we’re getting to the topic of domain generalization of histopathology foundation model, and this is multi-center multi-scanner cohorts, a comparative benchmark. Well, here two researchers in Udine tested 10 models by hiding one scanner at a time. So, how it used to be done, it was like okay, you gather data from different sites, from different scanners, you include like three different scanners, four different scanners, but how many you can include?
If you only have two, you include two, and then from different uh sites because you want it to be generalizable, to be able to like build a tool that is gonna do whatever the tool is supposed to do, like diagnose or call or or help you, regardless where the slides come from. Like you show it to a pathologist, and regardless where the slide comes from, the pathologist is able to tell you. So it’s like an AI pathologist. Well, what and then you use 80% of the data for training, and then you test on the 20% of data, and uh this this was your like test set. And what they started doing, they started hiding a scanner, and it turns out that hiding a scanner costs more than hiding a hospital, and Virchow2 lost the least, so it’s still lost, but the least. So here is our scanner, and uh, this is a plot scanner versus center, and here’s our Virchow Virchow model. This is F1 score, and uh, here is accuracy, and this is how much it lost.
So Virchow, as you see on the chart here, stays more or less at the bottom, so it loses the least, but scanner held out F1 was down 13.6 to 19.5 percent, and center held out, F1 was down from 6.9 to 14%. Circle size is the parameter count, so Prov-GigaPath is bigger than Virchow2 and less stable, but it lost more, right? When you look at this, this is how much it lost, whereas our Virchow lost less. So that’s what happened, unfortunately.
Why AUROC missed the losses
And yeah, the the metric that the thing is that the metric everybody quotes barely moved while the models were misreading in situ carcinoma as invasive. So AUROC fell by only 1.7 to 3.7 percent, while F1 score fell by 13.6 to 19.5% on the same run. What happened here is that the problem with the scanner was in at the at the like cellular level, so it wasn’t like any predictions, anything high magnification that you can like deduce from like a higher view of the whole slide image, it was the little cell cell features, right? So the models were misreading in situ carcinoma as invasive, so they were like not seeing so in situ carcinoma, invasive would be something that goes through the basement membrane, and when the cells, the cells are like on something called basement membrane, and when they go through it and start going and doing the malignant progression, they go through that membrane, and it is like a cell going through a very single membrane. So if you have some kind of stitching artifact or any other illumination or something like very subtle uh between scanners, it was different, and the F1 score to depict that fell to by almost like 20%.
That’s kind of sad that the scanners have such influence. I don’t know. I guess, but sad and not so sad, it’s reality check. Reality check.
Pixel pathways and use-case validation
Wait, why do I say reality check? Because when I had a couple of podcast episodes with researchers, with uh Heather Couture as well, who is a computer scientist, and she was telling me about what it is domain shift, how to counter the domain shift, because the like notion or the the the desire was to like train a model that can be used for everything. Train a model that oh, you like click install on your computer and it can receive all the slides from everywhere. And that is not the case, and maybe we should stop striving for it. It makes life kind of simpler because then it’s okay, the tool is specific, and it’s kind of principle of image analysis validation of validation of these systems. It is a tool is specific for a use case, and the use case uh and that’s why FDA is also clearing these systems with specific um devices covering a specific pixel pathway. So we can say, okay, this model is designed for this pixel pathway.
If you want a model for a different and what this pixel pathway, basically, like what the pixels do from the moment you dig digitize a slide with a scanner to where there are there are viewed and diagnosis is being made. So, okay, if it’s a pixel pathway uh with a Hamamatsu scanner, then that’s what this model or this software is going to be designed for. If it’s with a different scanner, then it’s gonna be for the different scanner and don’t interchange, like I don’t know, with cars. If you’re I am bad with cars, but let’s say I have a Toyota and my husband has a Ford. I don’t think even you can use, I don’t know what you can use. Like I wanted to say about uh wheels, but like I don’t know, maybe there is a Toyota specific uh feel free to comment on this because this is like showing my uh ignorance about cars, but maybe there is a Toyota-specific oil that you cannot use in Ford. I don’t know, but you know the analogy, you understand what I mean.
Definitely for sure, there’s gonna be something Toyota specific that you should not use in Ford, even though for me, like okay, you drive them the same, one is has a different shape of than the other. So you need to my husband’s car is bigger, so I have to be more careful when I’m turning. But other than that, it’s a car, so to me it was like okay, scanner is a scanner, is a scanner. There were 10 scanners or more cleared by the FDA, so hey, we’re good, right? We’re good for digital pathology and primary diagnosis for computational pathology tools. We still define the use case, and if pixel pathway is part of the use case, then I think we should do that, and that’s okay, right? I think it’s okay.
Although I’m a little sad because to me it was like, okay, is scanner just a microscope? I can take any microscope. But some people are very particular about their microscopes, so that also differs.
Paper three: which slide goes in
And our last paper talks about the slide. So, what is happening? Um so this paper, slide selection, introduces sampling-induced prediction or uncertainty in digital pathology AI, evidence from multi-slide breast cancer cohort. And here the Wake Forest froze the model and changed only which slide went in. So we have nothing changes with the model, we don’t mess with the scanner, and we know that for a case there’s always more than one slide, right? But these models are are like trained with one slide and a diagnosis, one slide and whatever the label is. But uh we’re gonna have, and they have a very beautiful image.
I’m I wanna show you this image. So here, the tumor. This is our tumor, and we have uh whole slide one, whole slide two, whole slide three, uh, and what happens from the same tumor, because here we have, for example, stroma in the middle of the tumor. Um, here we have some um, and it shows like what’s there. Um, maybe this looks like immune cells, this looks like I don’t know, maybe necrosis or something, but from different parts of the tumor, it shows us high risk, low risk, and high risk. So if we ended up giving this middle slide, we would say, oh, this is low risk, like totally opposite than from the other slides. So, and this, I don’t know, I have not seen a publication where this was actually highlighted that if you if you put like different slides from a case, it’s gonna be a different result.
Which speaks very much to the tumor heterogeneity, but you would think like that there’s like signature in every single piece of the tumor, and that is not the case. So, what they were doing, and they were predicting HER2 status, and one model swung from 0.896 down to 0.530, depending only on which slide went in. So it was um accuracy, sensitivity, specificity, and four of six models fell below 0.5 on the least favorable slide, so worse than a coin flip on tissue with verified tumor in it. So it’s not that like oh, slide with stroma went in and it didn’t predict. So let’s have a look here. So we have AUC accuracy sensitivity specificity. The blue is the best whole slide image, then there were random whole slide image, and then there was the worst whole slide image that they picked to see okay what’s gonna change.
So the best one was between 0.8 and 1, the worst 0.5 for AUC, 0.6 for accuracy, below 0.5 for sensitivity, and a little above 0.6 for specificity. So, like different parameters you can uh if you pick the best slide, which you don’t know which one that is, you just like basically take uh all of them and see where it performs best, and then if it’s random, it was at least you have a worst one, so if you do randomly, then maybe you’re gonna be okay at some point, anyway. So that’s what happened here. That they checked the model itself, they checked the scanner, and then they checked the tissue sample, and each of them influences.
Combining every slide per patient
Um so in the tissue case, feeding the model every slide the patient has recovered performance without touching the architecture. So instead of just giving one from one place of the tumor, you give all of them to the model. So for HER2 prediction, and it was one slide picked at RAM random had the uh AUC across six models from 0.653 to 0.768. But if every slide was available and they were all combined, this was went up to 0.7 to 0.8. So again of 0.036 to 0.073 AUC, and this is larger than the gap between the top five models in paper one. So the cost is computational because several gigapixel images per patients uh have to be processed instead of one. But I mean, that is the cost of being accurate, and you don’t want to be inaccurate in this case, especially if you’re trying to develop clinically deployable tools where you’re gonna try to make decisions based on what this tool is predicting.
Three questions before you trust a benchmark
So, three questions to ask before you believe any benchmark number. Was the cross-validation source mixed, or did they hold out whole centers or like whole scanner or whatever, right? They hold something out and then they validate on this. Then which scanner produced the slide and was it the same one throughout? That is very important. People ask that question or a question already. And how many slides per patient went into the prediction?
So this is a new one. I will be asking this one. Well, this this validation details I didn’t know, so I learned that from these papers. The scanner, let’s say I knew about this one, and this is intuitive. So this wasn’t intuitive, I didn’t know about that, and this uh cross-validation wasn’t intuitive for me. And the slides and the tumor heterogeneity, uh, I didn’t know about it, but it was intuitive for me because I’m a pathologist, I know that tumor is uh heterogeneous, and I’m like, why didn’t I ask this in the first place? I should have like have this thought and given it to some computer scientist, but uh I work in tox path, so uh at the moment, so uh it’s preclinical part of drug development and less uh in oncology.
Audience question on the HER2 dataset
Oh, and then we have a question which uh which HER2 whole slide image data set was this uh and if it’s publicly available, we can check this in the paper. And by the way, these papers you can download them, they are publicly available. I’m gonna put them in the show notes, but they have this set of tools, like they have this AI tool here, PDFgear AI. Okay, let’s see. I’m gonna just copy our question and let’s see if we get an answer. And if we don’t, I can later answer this question. Let’s see what it says.
The source does not contain relevant information regarding the HER2 whole slide image data set or data availability. However, in general, I don’t like pages four. What is that on page four? I don’t like this answer, but I don’t like the answer, guys. Why do they not put this in? Um that is kind of sad. But I can also question to my other robot that analyzes these papers.
And let’s see, I trust my other robot better than this PDF AI, because I haven’t worked with it extensively enough to know if it’s telling the truth. Well, it actually tells us. The other one tells us my other robot, which my other robot is Claude, and I like it has a lot of uh more context. So it says that the development was on TCGA for the HER2 tasks, specifically 980 patients with eligible HER2 annotations, 1040 slides, 154 positive and 826 negative available through the Genomic Data Commons, and they also had an external test. See, our PDF AI was lying to us. These AIs are sometimes lying to us. I am putting this uh as an answer in the chat right now.
Actually, yeah, let’s do this. These AI are lying to us. Sometimes uh my AI, my Claude that is trained on me is lying to me as well, and I know it’s lying, and then I ask it clarifying questions. Thank you so much for joining me, and I talk to you in the next episode.