Six models, two worse than a coin flip
Dr. Aleks Zuraw: Welcome, my digital pathology trailblazers, to our DigiPath Digest number 51. Six deep learning models scored above 0.95 detecting high-grade lesions in cervical cytology. Then these models were shown cell clusters. Someone shown them cell clusters, and two of them did worse than a coin flip. Same slide, same patient, same diagnosis. This is what we’re gonna be diving into today. We’re gonna be talking about AI in cytology. Two types of AI in cytology. That’s what we’re gonna be covering. And what breaks and what’s next? Uh, what the evidence says about image models and language models in cytology.
Intro: Learn about the newest digital pathology trends in science and industry, meet the most interesting people in the niche, and gain insights relevant to your own projects. Here is where pathology meets computer science. You are listening to the Digital Pathology Podcast with your host, Dr. Aleksandra Zuraw.
Image models, language models and vision-language models
Dr. Aleks Zuraw: What is the AI landscape in cytology? What is the AI landscape in cytology? Well, what goes into the model decides how it has to be validated. And if the thing that goes into the model is the cell image, then we are going to be using now the state of art for the computer vision in pathology for cell images, are going to be convolutional neural networks. But uh there was a label for non-malignant and high-grade single-cell lesions in cervical cytology with a probability assigned to it. Then, if report text is the thing going into the model, then we’re going to be probably talking about large language models at the moment. And there’s going to be text summary, structured fields, and an answer.
And we can also have the option of images and text going into the model. And we have so-called vision language models. Then we have a label plus a written rationale for an image. So a vision language model is a language model with an image encoder. So the picture gets the words, like for example, if we had a report and a pathology image, the report would match to the pathology image, and that would be a vision language model.
The thing is that 87% of pathologists don’t really use AI. 87% of pathologists report using no AI in cytology at all. And that is basically the baseline. We’re starting from scratch. We’re starting with a zero.
Paper one: scattered single cells versus crowded cell groups
The first publication that we’re going to be discussing is the diagnostic performance of artificial intelligence models trained on scattered single cell images is not preserved for hyperchromatic crowded cell groups in cervical cytology. So I read this title and I’m like, why would you think it would work on crowded cell groups in the first place? And it’s gonna make sense to you. Well, why would you think that? Because it is part of uh a cytology, like this, these crowded cells can be part of cytology slides, so you look at them at the same slide. But let’s have a look, let’s see like what the difference is. And the difference is already kind of described in the name: scattered single cells and hyperchromatic crowded groups.
Scattered single cells are scattered single cells that are separated in the image and usually don’t have anything around, and you can basically see all the features of the cell. So you can easily recognize the malignancy criteria or whatever features you’re using to diagnose. Whereas crowded cell groups is a bunch of like is a cluster. So I’m looking at this and I’m thinking, like from the even like very basic computer vision principles, these are things that look so differently. But from a diagnostics, like a specimen standpoint, these types of cells, um, types of things that you see come up in the same slide, right? So for a pathologist, you would do this slide and they would be able to interpret two these two different things, and obviously applying different criteria to uh each of uh these different appearances. Um unfortunately that’s not the case for AI.
Yeah, and maybe that is the premise of this paper. Like, just don’t try if it looks so differently. But we’re gonna get to that. So basically, I looked at these images, single cell versus clusters, and I’m like, why would you even think it’s gonna perform? Well, because I know how computer looks at it. But it is a good like good message countering the AI hype, where people actually are afraid that AI is gonna take pathologist’s job, cytotechnologist’s job. So um, you know, this this kind of message says, hey, not it’s still narrow.
So let’s have a look at the graph, how well it performs. So um when we look at the scattered cells, uh, these are the like single cells, the accuracy of all the all these different convolutional neural neural net architectures was kind of good. It was almost one eight ninety nine zero ninety nine six zero ninety nine three, like very good. Everything over 0.9, so fantastic, right? And then you apply it the same thing, the same model to crowded groups. The best one actually did 0.68, the worst one point three eight. Oh my oh my goodness.
So just for your reference, uh this uh dotted line that tells us 0.5 is equal to flipping a coin. This is kind of how well it would look if it was just like random by chance. So not great, not great. Uh, when you apply something trained on one specific appearance of a cell to another appearance of cell.
How ResNet-50 and GoogLeNet failed differently
Here’s the part that surprised me. Each model kept one half of the job and lost the other. So ResNet-50 caught almost every high-grade cluster, but it called almost every benign cluster high-grade too. Its specificity fell below 1%. GoogLeNet did the opposite. It left the benign clusters alone and it caught one high-grade cluster in a hundred. Same training sets, same thresholds, opposite failures. And you can’t tell from the scattered cell numbers which way your model is going to break.
They also checked, and our our authors checked where the models looked because they were like there are ways to checking this, and they were interested in how is it possible that they like act so differently? So they stated that attention maps uh, so where the model would look would sit on the cluster rim where nuclei don’t overlap and it would skip the whole crowded center. And basically, the whole crowded center of a cluster of cells in cervical cytology is where a lot of information is um included as well.
Another thing that was kind of limitation was how they were acquiring these images. So the HDR, the high dynamic range capture and that blends exposure, or so bright and dark areas uh stay readable. This was switched off here to equalize exposure. Meaning, if this is switched off, then the dark areas are not gonna be readable anymore. And the dark areas are the dense clusters. So basically, it kind of acted to the disadvantage of the cell clusters. This was switched off, which yeah, they say it may hit details in dry dark clusters. Yeah, it did.
Why a negative result matters in a young field
So let me just go back to the image and kind of the main message of this. And let me know if this is surprising to you, because to me it was not surprising at all, but I thought it was valuable to put it out there for people who are like first encountering um applications of AI and cytology and pathology to actually read this paper and see hey, if you apply a model that was um a convolutional neural network that is very narrowly trained on scattered single cells to, even though biologically these are the same cells clumped together, it’s not gonna perform. Which is like a big lesson learned for the whole field. What is the intended use of the model? What was it trained for? And it was clearly trained for single cells. So if it wasn’t trained for clusters, it’s not gonna perform on clusters, don’t expect it to perform on clusters. Let me know if that makes sense to you.
It’s kind of like a simple message that had to be backed by a lot of work in this paper, I have to say, because they they had a bunch of uh images, they had like 101 cases for the single cells, a lot of images, over a thousand images, and then they had 48 cases for hyperchromatic crowded uh groups and 330 images. These were static images, these were not dynamic images, so um obviously they say, hey, if there was an option to actually evaluate 3D, if it was trained for clusters, it would be better. But this like blunt statement, hey, if you apply it to something that looks different, it’s not gonna perform, is kind of obvious and a very um strong message basically to the field because a lot of us are just beginning this digital pathology journey.
Uh, what has happened? This this is a relatively new field, like right. What is it, 25 years, 30 years, let’s say around the year 2000, we had the first Aperio scanner. So it’s just like 25 years, and people who are have been active in this field from the very beginning, they’re very advanced now. Although the uh adoption of the technology in the clinical world is pretty low. I’m talking about the US, it’s gonna be probably less than 10 uh. There are countries in Asia, I think um maybe Arab Peninsula, where you would have like 50% adoption, but this is an exception, this is not the rule. Let’s take it say 10%.
So low adoption, people who’ve been in the field are super advanced and like pursuing that cutting edge, but as the adoption grows, more people are coming in. So this kind of statement in a peer-reviewed paper is relevant. I like that they put it out there. Although I was like, really, at the beginning, and then I’m like, yes, you need to put it out there because you need to put out their negative results.
Paper two: large language models in cytopathology
So moving on to the next paper on our list, the next thing are the large language models. So the second paper, leveraging large language models to enhance cytopathology, opportunities, challenges, and future directions, a practical review from the ASC Clinical Practice Committee. This one is also published in Cancer Cytopathology by Hasan Bilal et al. And I want to go back to the beginning to tell you how many of uh people use AI in cytopathology. Not too many, because 87% of the people don’t use AI in cytopathology. So let’s keep that in mind and then look at applications with evidence. So this is a pretty extensive review where uh they looked at applications with evidence and they identified three uses and that actually have numbers behind them, and every number uh comes with an asterisk.
So the first application is structured reporting. That kind that kind of is the default most natural thing that large language models were designed for. And uh you can use free text, then um Bethesda categories and coded fields. You can like put any type of text and an LLM can support you. It was uh tested on fine needle aspirate reports. Um in there was a peer-reviewed publication on this um coming from one institution. Um, but for this particular uh purpose of structured reporting, it was okay. Well, it was good 99.4% accuracy.
Then the other option to have an LLM help you would be diagnostic support. So um differential diagnosis by a dialogue, clinical history summarized before sign out. So basically, like chatting with your text-based information, clinical data. And there is this AMIE model that can chat with you, and it had 59.1% accuracy and diagnostic support versus 33.6% comparison is unassisted clinicians in general medicine, not pathologists. This one wasn’t a cytopathology study at all. This comes with an asterisk as well, because it only tells you that in 59.1% of the cases, uh, this AMIE model, this is the like medical intelligence uh model that can chat with you and is trained on medical data, uh, the diagnosis that was the agreed-upon diagnosis was in top 10.
Top 10 means the correct answer appeared somewhere in 10 ranked differentials. So it’s gonna give you 10 differentials, and somewhere there is the correct one. So I don’t know how fair is the comparison against unassisted clinicians, and this was the domain here was general medicine. The structured reporting application was actually specific to cytopathology, and the diagnostic support that was general medicine. So you can chat with it with the chat as a cytopathologist, and somewhere there in the top 10 is gonna be the correct differential in almost 60% of the cases.
Then there was also uh the application of quality control, draft reports checked against uh requisitions and radiology. So this is an interesting application. 84% of errors behind amended reports were flagged. So here was no false positive rate reported. So each false alarm costs review time, and uh, there’s a big discussion. Okay, if you have to police this tool so much, then is it even useful? There are like different frameworks that you can apply to this, but that is a totally valid question.
Um, but I thought this was an interesting application for report quality checks because it was a hybrid approach where rule-based approaches for like semantics and basically having the right specimen in the right place of the report were combined with an LLM checking for different types of data. The example in the paper is molecular testing, a language model flagging that a PTH gene expression result points to a parathyroid lesion rather than an indeterminate thyroid nodule. The error types they looked at were laterality mistakes, narrative to synoptic inconsistencies, and incomplete reports.
No language model trained for cytopathology yet
Asterisk overarching all the uh use cases is that there is no language model that has been trained specifically for cytopathology. So that kind of is a long review, but if you don’t feel like reading it, there is nothing trained specifically for cytopathology. And this rule kind of applies across the board, regardless whether it’s a convolutional neural network or if it’s a large language model in AI world, we are not yet at the stage of general AI, meaning like an AI that can do a lot of things. We are still in the era of narrow AI, it can be narrower or less narrow, but basically, if it was not trained for a specific use case, just don’t believe it. Like if anybody comes to you and says, oh, there is this fantastic AI that’s gonna write you a cytopathology report, and uh you look at it and it was trained on anatomic pathology reports, well, maybe you don’t need to retrain a lot, but don’t expect it to perform because it’s a different different type of data. So that’s kind of like the message today. Don’t expect performance on data that it was not trained on.
But the LLMs can be useful. There is some preliminary evidence uh that they are useful in cytopathology. So, first, a hypothetical application. This is kind of a uh plausible way to use LLMs, you know, everybody has access to the commercial AIs that work with language, the paid tiers of uh these different language models are pretty good. You can employ uh so-called retrieval augmented generation where the LLM has to cite the sources, and then if you see that the source actually makes sense, you can trust the answer a little bit more. So the hypothetical the first hypothetical application in this ladder of um LLM applications in cytopathology would be education, uh research support, and workflow integration.
Research support, you could, for example, ask the LLM to flag knowledge gaps and summarize papers. This is something that there are a bunch of tools already out there. It’s not tested, it’s probably used, and then there are disclaimers that hey, AI was used for this and that. Decent, I use it. Workflow integration, uh a little bit more challenging because you have to integrate with different systems in the lab. The step two that has preliminary evidence is the structured reporting, diagnostic support and quality control. That’s what we uh saw a second ago. Um this is measured, but mostly in surgical pathology.
So, well, there was one application. The structure reporting was in cytopathology, but again, similar domain, but not the same domain. And step three, validated in cytopathology. Of course, keyword here, validated nothing yet, my trailblazers. There is no cytopathology-specific benchmark, no prospective study that the authors of this review found. So hopefully there’s gonna be something more um soon.
Direct validation and context of use
When we look at both of these families, the convolutional neural networks and uh large language models, where do these two families land? Uh, two different failures, one gate in front of both failures. So the image models they’re strong on the morphology they’re trained on, but unreliable on morphology they never ever saw and language model they are useful for on task text tasks and measured on cytology reports and cytology materials. So text tasks that they were trained on. Oh, I I need to tell you a story. Don’t leave yet. There is a story about text.
So but but what’s necessary for both of these to actually be reliable is the direct validation on the material that tool will actually see always, always, always with AI. The um in the preclinical world, so there was this FDA guidance for uh using AI in drug development, and they call it context of use. Uh context of use, purpose, call it whatever you want to call it, intended use. Basically, you need to define very much what is it used for. So in this first paper, like it uh what is it uh supposed to do? What is it gonna be used for? So if it’s gonna be used for detecting single cells, then go and detect single cells, don’t deploy it on non-single cells.
If you need something for clusters, train something for clusters and then like deploy them both or or however you wanna figure that out. But the requirement is the same, whichever family the tool belongs to. Uh so whichever like AI you’re dealing with, if it wasn’t trained on a specific data type, don’t expect it to perform well on this data type, right?
Destructive book scanning for AI training data
And what I wanted to tell you: ChatGPT came out at the end of November 2022. So call it three and a half years of AI-generated content piling up on the internet. And I read this article that Amazon was secretly buying books that were out of print, like large quantities of books, and then doing so-called destructive scanning of these books to get high quality content, high quality, meaning edited by people, by editors, you know how much uh time it takes to like a publish conventional book, it takes forever. Like my non-conventional takes forever because I actually want people to read through it before I publish it. But the quality data is the um human-reviewed data. So they buy these books that are uh limited editions, they’re out of print, they destructively scan them. What does that mean? So uh the book doesn’t survive it.
The employees there say they cut the binding off uh so the pages scan faster, and the printed book is destroyed in the process, and that’s why it’s called destructive scanning. So obviously, there was too much garbage on the internet that was already generated by AI, so you were feeding this AI-generated stuff into AI to get trained, and you want AI to be better, so you want higher quality data. So this came out of 404 Media. They put a tracking device inside a shipment of rare books to find out which AI company was buying them and followed it to an Amazon warehouse in Las Vegas. I was like, oh my goodness, that’s no good. Then this AI is digital, and where is the knowledge gonna go? Um, as much as I love AI.
Updating AI models and low-risk applications first
Anyway, now okay, we we said validated, right? So how are you gonna be validating? Depending on the regulatory framework and depending where you are, but there are two regimen part company when the model is updated. So for for the regulations, like if we take the models as medical device, right, there are two ways you can update them, and uh it’s regulated differently, it’s regulated differently by the FDA, and it’s regulated differently in the uh European Union. So by the FDA, when like let’s say it takes 15 minutes to collect all the data on a case and how multiplied by I don’t know how many cases, how about a language model already knows what to extract out of the case information, right? QC flagging currently done on the microscope or manually on whole slide images, like people’s time that could be gained back by these low-risk applications first. So I’m a big fan of low-risk applications.
That’s where cytopathology stands today. A lot of work to do. You put it on the slide and you can image, it’s kind of like direct to digital imaging, you don’t need to process the tissue, so it would be fantastic if the digitization would also enable AI. Um, it kind of does, but it kind of doesn’t because it’s not that uniform of a preparation. Let me know if you have any questions. Let me know what other topics would you want to have covered next time.
And uh, if you’re just starting your digital pathology journey, there is a book I want to share with you. It’s my book. I wrote it. Here is the book, my friends. You can get it, get the PDF for free. Start reading about digital pathology applications, what it is, and I have a date for when the new edition is gonna be available. I am planning to make it available at PathVisions. So if you’re going to PathVisions, which is the annual conference of the Digital Pathology Association, let me know in the comments and maybe we can meet in person.
I always love meeting the digital pathology trailblazers in person, and I will have at least the digital version of the new edition of Digital Pathology 101. 101, all you need to know to start and continue your digital pathology journey. Thank you so much for joining me for staying till the end. If you stay till the end, you are a true digital pathology trailblazer. And I talk to you in the next episode.