背景
人工智能可能有助于提高诊断性兽医细胞学的速度和一致性,但经过验证的工具仍然有限。
目的
开发并评估一种卷积神经网络(CNN),用于在细胞学全切片图像(WSI)上对7种常见犬肿瘤进行自动分类。
方法
选取91例May–Grünwald Giemsa染色的犬细胞学病例,涵盖癌、组织细胞瘤、淋巴瘤、肥大细胞瘤、黑色素瘤、浆细胞瘤和软组织肉瘤,并设置背景类别。将玻片切分为22,577个图像区块(512×512像素),进行人工标注,并采用按病例划分的3折设计进行分割以避免数据泄漏。对ImageNet预训练的Inception-v3 CNN进行微调,用于8类分类。在区块水平评估性能,使用Grad-CAM进行定性可解释性分析,并通过注意力引导推理在ROI水平以及无注意力全切片推理在WSI水平进一步评估多数投票预测。
结果
区块水平的平均测试准确率为86.3%,平均宏平衡准确率为92.0%,平均宏F1分数为85.6%。Grad-CAM显示注意力主要集中在细胞学相关的细胞区域。在ROI水平,注意力引导推理达到100%的Top1准确率(28/28例)。在WSI水平,无注意力全切片推理达到92.9%的Top1准确率(26/28例),且所有病例的正确诊断均包含在前3位预测中。
结论
Inception-v3在犬细胞学WSI上取得了高诊断性能。结果支持AI辅助的基于ROI的决策支持和全自动全切片推理在兽医细胞学中的可行性。这些发现来自一个经过精选的单机构队列,包含典型、分化良好的病例,属于概念验证证据,在临床使用前需要在诊断上具有挑战性的病例和外部病例中进行验证。
[内容请查看原文]
引言
诊断性细胞学是兽医肿瘤学临床决策的基石,提供了一种微创、快速且相对廉价的表征肿瘤性病变的手段。细胞学诊断高度依赖专家判读,容易出现观察者间和观察者内变异。在人类医学中,这些挑战推动了细胞学筛查自动化的尝试(1)。
数字玻片扫描仪和WSI格式的广泛采用使这一演变成为可能。当代深度卷积神经网络(CNN)改变了计算机视觉的性能,并为大多数现代医学图像分析系统提供了骨干(2–5)。在组织病理学中,CNN已成功应用于广泛的诊断和预后任务,包括WSI水平的肿瘤检测、分级和生物标志物预测(6)。这些成功加速了将类似方法应用于细胞学的兴趣,其中重叠细胞、固有缺乏组织结构以及染色变异性为表征学习方法提供了天然的试验平台。
在人类细胞学研究中,深度学习已被转化为WSI上临床相关问题的解决方案。在宫颈筛查方面,Cheng及其同事提出了一种多阶段系统,结合低分辨率和高分辨率的基于ResNet的模型以及循环神经网络,在超过3,500例液基细胞学WSI上进行玻片级分诊,实现了与专家细胞病理学家相当的敏感性和特异性,同时大幅减少了复核工作量(7)。另一团队训练了一个WSI水平模型,将宫颈液基细胞学标本分类为肿瘤性与非肿瘤性,在独立测试集上达到0.89至0.96的AUC,证明了使用数字化WSI进行稳健全自动分诊的可行性(8)。
除宫颈筛查外,CNN已应用于其他细胞学标本类型:Tsuneki及其同事开发了一个用于尿液细胞学WSI中尿路上皮癌筛查的系统,报告了高诊断性能,并提示AI辅助尿液细胞学可以标准化巴黎系统的应用并降低假阴性率(9)。更广泛地说,商业和研究级系统正在出现用于血涂片、骨髓、积液和细针抽吸物,AI模型辅助进行分类计数、原始细胞检测和恶性肿瘤分诊(1, 10)。这些研究表明,基于CNN的细胞学WSI分析可以达到临床有用的性能,并整合到现有的实验室工作流程中。
在兽医医学中,细胞学在诊断中的核心地位可以说比人类医学更为突出,因为它能够在一线诊疗实践中对实体器官/病变和体腔积液进行快速、低成本评估(11, 12),但尽管组织学应用相对较为成熟,经过验证的兽医细胞学AI工具仍然相对匮乏(13)。
近期关于数字兽医临床病理学的综述记录了细胞学平台的快速增长,包括即时检验扫描仪和远程会诊服务,并强调了AI驱动的图像分析在血液、骨髓和细胞学制片中的新兴潜力,同时强调质量控制和决策支持的必要性,并指出了数据整理、金标准定义和伦理考量等实际挑战(14, 15)。
少数完全成熟的例子之一是Marzahl等人的工作,他们使用深度学习来量化马支气管肺泡灌洗细胞学玻片中的肺含铁血黄素巨噬细胞,以评估运动诱发性肺出血(16)。他们基于CNN的方法优于传统的半定量评分,但其针对的是狭窄的单任务终点,而非广泛的诊断类别(13, 14, 16)。
据我们所知,尚无已发表的研究评估过在来自多样化小动物肿瘤病变的WSI上训练的多任务CNN。基于在大规模图像分类和医学影像任务中表现稳健的Inception-v3架构(5),我们开发并评估了该CNN,用于将兽医细胞学WSI自动分类为这七个诊断相关类别。我们的目标是评估此类模型能否在切片和WSI水平上达到相关性能,从而为未来AI增强的兽医诊断细胞学工作流程提供支持。
[内容请查看原文]
材料与方法
[内容请查看原文]
病例选择与数字化
病例由一位作者(IO)从利物浦大学细胞学档案中选取,目标是根据文献中描述的既定细胞形态学标准(17–19)具有典型形态学诊断特征的病例,排除否则需要组织学和/或免疫组化才能最终诊断的低分化肿瘤。肿瘤类别为:肥大细胞瘤(MCT)、淋巴瘤(LYM)、癌(CAR)、软组织肉瘤(STS)、黑色素瘤(MEL)、组织细胞瘤(HIS)和浆细胞瘤(PCT)。这些病例由两位委员会认证的病理学家(LR, TT)复核;诊断一致的病例被选入群体,而被认为总体质量差的病例被剔除。对于每个入选病例,使用数字玻片扫描仪(Aperio CS2, Leica Biosystems, Wetzlar, Germany)以400倍最终放大率将一张MGG染色的玻片数字化为RGB彩色格式的全切片图像(WSI),保存为.SVS文件。
[内容请查看原文]
图像预处理
在整个WSI中,操作者使用Aperio Imagescope软件(Aperio, Leica Biosystems)手动选择以玻片最具代表性/细胞最丰富区域为中心的较小感兴趣区域(ROI),并获得新的.SVS文件。为了从ROI生成切片级图像数据集,我们在MATLAB(MathWorks, Natick, MA, USA)中使用Bio-Formats库(bfGetReader、bfGetPlane、bfopen;Open Microscopy Environment)实现了自定义切片流程。对于每张玻片,初始化一个Bio-Formats读取器,并在最高分辨率平面(400倍最终分辨率)查询所有图像系列,切片大小设为512×512且无重叠。根据这些输入,脚本计算切片原点之间的垂直和水平步长,并以规则网格扫描玻片。对于每个切片位置,从所选系列读取相应的ROI,并将切片保存为.JPG文件。给定WSI的切片完成后,进行后处理步骤以移除图像边界处因不完整切片而产生的任何非正方形切片。该过程依次应用于所有WSI,所得图像(切片)构成原始图像数据集。该过程的视觉摘要见图1E–H。
[图:用于卷积神经网络(CNN)开发、训练、测试和全切片应用的工作流程]
[内容请查看原文]
真实标签创建与训练/测试划分
切片由一位操作者(MA)根据以下标准手动选择:图像代表根据已发表细胞学标准(17–19)细胞学特征明显的显微镜视野,且诊断性细胞物质至少占切片面积的20%。对于背景类别,选择的切片包含以下任一情况:清晰的無细胞背景、蛋白性背景或血细胞(例如红细胞、中性粒细胞、单核细胞等)且不存在肿瘤诊断性细胞。为了构建训练集和测试集,同时避免同一细胞学病例切片间的数据泄漏,我们实现了一个专用MATLAB脚本(MathWorks, Natick, MA, USA),对切片化WSI数据集进行操作。尽管每只动物/玻片属于一个肿瘤类别,病例玻片也贡献于非诊断性(背景类别)。
[内容请查看原文]
切片水平的CNN训练与评估
所有卷积神经网络(CNN)均在MATLAB R2023a(MathWorks,Natick,MA,USA)中使用深度学习工具箱、深度网络设计器应用和实验管理器进行训练。训练期间,给定细胞学病例的所有图块始终保留在该网络的训练集或留出测试集中,而不会同时出现在两者中。在深度网络设计器中,导入了一个在ImageNet上预训练的Inception-v3架构,并将最终分类层替换为新的全连接层和具有八个输出单元的softmax/分类层,对应八个类别。训练期间,所有图块均自动调整大小以匹配该输入尺寸(299 × 299 × 3)。对于每一折,创建了单独的深度网络设计器项目(网络1、网络2和网络3)。在每个项目中,该折的训练目录作为图像数据存储加载,使用文件夹名称作为分类标签,并在每个epoch开始时启用随机打乱。同一折的测试目录完全分开保存,在优化过程中未使用。折大小以类别特异性病例实例而非独特动物数量报告。每个病例向其肿瘤类别贡献一个实例,当背景图块可用时,还向背景类别贡献一个额外实例。因此,类别特异性实例总数计算为肿瘤类别实例与背景实例之和。例如,网络3的训练集在7个肿瘤类别中各包含9个病例,对应63个肿瘤类别实例(7 × 9),加上60个背景实例,共产生123个类别特异性病例实例。超参数优化使用实验管理器进行。对于每一折,我们定义了实验,系统比较应用中提供的主要求解器(“rmsprop”、“sgdm”、“adam”)在三个初始学习率(0.1、0.01和0.001)下的表现。每个求解器和学习率的组合作为单独试验运行,其他设置(批量大小、epoch数、数据增强和L2正则化)完全相同。在实验管理器中监测训练和测试性能曲线(准确率、损失),网络训练不同数量的epoch(5、10、15),选择最佳结果以避免过拟合。根据测试集性能和收敛行为(最高测试准确率且损失稳定、无逐步过拟合证据)选择每一折的最佳配置。本研究报告的最终网络(网络1–3)对应于各自表现最佳的求解器/学习率/epoch组合。获得了训练集和测试集的混淆矩阵。一旦给定折的训练完成并确定最佳配置,将所得网络从深度网络设计器导出到MATLAB工作区并保存为.mat文件。然后,这三个训练好的网络(代表每个折划分)以编程方式用于各自留出测试集上的图块级评估。对于所有试验,小批量大小为128,L2正则化系数为0.0001。数据增强包括沿X轴和Y轴的随机反射、0至30度的随机旋转以及0至0.3像素的随机水平和垂直平移。随机缩放范围为1至1,因此未引入尺度增强。训练在Windows 11、A9 CPU、64GB RAM、1xNvidia RTX6000工作站上进行。该过程的视觉总结见图1I–N。
[内容请查看原文]
图块的Grad-CAM分析
为了可视化对测试集上CNN预测贡献最大的图像区域,我们在MATLAB(MathWorks,Natick,MA,USA)中使用自定义脚本实现了批量Grad-CAM流程。选择网络1–3中测试准确率居中的网络来测试Grad-CAM分析。为了识别用于Grad-CAM计算的特征图,脚本自动检测网络中的最后一个卷积层,确保从可用的最深卷积表示计算类别判别定位图。脚本递归枚举根目录内的所有文件,对每张图像执行空间调整大小以匹配网络的输入高度和宽度,并调整通道数 to 匹配网络输入。每张预处理图像使用网络进行分类,并将预测标签映射到分类层对应的类别索引。该预测类别索引用作Grad-CAM的目标类别。对于每张图像,计算Grad-CAM热图。作为输出,对于每张处理后的图像,生成一个图,包含调整大小后的原始图像以及同一图像以50%透明度叠加Grad-CAM热图并附有颜色条。Grad-CAM输出在随机选择的图块群体(测试集中每类100个图块)上进行定性评估。该过程的视觉总结见图1O。
[内容请查看原文]
基于多数投票的ROI水平CNN预测分析(注意力引导推理)
为了将CNN预测从单个图块水平扩展到测试病例感兴趣区域(ROI)水平的所有图块总和,模拟人类引导的诊断工作流程(其中CNN充当决策支持副驾驶),我们实现了一个自定义MATLAB脚本,该脚本对单个病例同一ROI的所有图块进行分类,并通过多数投票总结预测类别的分布。选择网络1–3中测试准确率平均的网络进行此分析。处理完所有图块后,脚本为每个ROI生成摘要,报告分类图块总数、分配到每个类别的图块数量以及每个预测类别所代表的ROI相应百分比。然后通过多数投票得出ROI水平的解释,即预测图块数量最多的类别被视为最终的ROI水平分类。该过程的视觉摘要如图1P所示。
[内容请查看原文]
基于多数投票的WSI水平CNN预测分析(无注意力全切片推断)
为了评估细胞学实际报告水平(全切片)的性能,模拟全自动AI方法,我们将CNN应用于测试图块来源的整个WSI,并通过非背景图块的多数投票得出每张切片的单一诊断。这将预测扩展到整个切片区域,不一定具有诊断性,且在训练或测试期间未见,模拟全自动筛查工作流程,其中算法必须自主遇到诊断相关和非相关区域,并在无人工指导的情况下生成切片水平预测。对于每个WSI,排除所有预测为背景的图块,剩余图块按预测肿瘤类别分组。占非背景图块百分比最高的类别(Top1)作为切片水平预测;第二和第三最频繁的类别(Top2和Top3)也被记录。作为ROI水平和WSI水平类别分离的额外描述性分析,Top1–Top2边际计算为分配给最高排名和第二高排名类别的图块百分比之差。边际以百分点表示,并使用均值、中位数和范围进行总结。还报告了边际低于5和15个百分点的ROI和全切片的数量和百分比。这些阈值是描述性的,并未改变Top1分类规则。选择网络1–3中测试准确率平均的网络进行WSI水平分析:测试病例细胞学涂片的Whole-slide images(WSIs)使用围绕Bio-Formats库构建的自定义MATLAB脚本(MathWorks, Natick, MA, USA)批量处理。该脚本扫描用户定义的输入目录,识别所有支持的WSI文件,并依次处理它们。在每个位置,使用适当的ROI坐标提取图块,并使用CNN对所有图块进行分类。预测的类别标签映射到网络最终层中的索引,并为整个切片累积类别图块计数和图块像素面积。同时,为每张图像生成颜色编码的可视化图块:基于颜色映射为每个类别分配纯RGB掩码颜色[背景(BG):红色;癌(CAR):琥珀色/金黄色;组织细胞瘤(HIS):柠檬绿;淋巴瘤(LYM):春绿;肥大细胞瘤(MCT):青色/水绿色;黑色素瘤(MEL):皇家蓝;浆细胞瘤(PCT):紫罗兰色;软组织肉瘤(STS):品红/紫红色],并以40%不透明度与原图块混合以保留底层形态。为了提供紧凑的切片水平视觉摘要,从分类图块重建了一个强烈降采样(每个轴为原始WSI尺寸的5%)的合成Jpg图像。对于定量报告,为每张切片生成一个纯文本文件。该报告列出了每个类别的分配图块数量、这些图块覆盖的总像素数以及它们相对于所有分类图块像素总和所代表的切片面积百分比。还记录了原始WSI尺寸和请求的基础图块大小。该过程的视觉摘要如图1Q所示。
[内容请查看原文]
统计分析
统计分析为描述性。对于每个折叠,使用混淆矩阵和标准多类分类指标评估图块水平的性能,包括总体准确率、宏平均平衡准确率、宏平均F1分数、加权F1分数、Cohen's kappa和多类Matthews相关系数(MCC)。类别特异性性能使用精确率、召回率和F1分数描述。
[内容请查看原文]
伦理声明
该项目获得利物浦兽医科学学院伦理委员会批准,参考ID:VREC1697。
[内容请查看原文]
结果
[内容请查看原文]
数据集组成和按病例交叉验证划分
最终细胞学数据集包含91个独立病例(每类13例),对应7个诊断类别:癌(CAR)、组织细胞瘤(HIS)、淋巴瘤(LYM)、肥大细胞瘤(MCT)、黑色素瘤(MEL)、浆细胞瘤(PCT)和软组织肉瘤(STS)。背景类(BG)来源于89/91个病例的非诊断区域。总体共获得22,577个图像块(tiles):4,025个BG图像块和18,552个肿瘤图像块。对于肿瘤类别,几乎所有病例各贡献204个图像块(204×13=每类2,652个图像块),仅1例黑色素瘤病例包含192个图像块(黑色素瘤图像块总计2,640个)。完整数据集可在Zenodo.org获取(DOI: 10.5281/zenodo.19493409)。
在三个按病例划分的折中,训练集和测试集分别包含56–63个和28–35个独立病例(动物),对应115–123个和57–65个类别特异性病例实例,以及14,215–15,517个和7,060–8,362个图像块。类别特异性病例实例总数超过独立动物总数,因为一个病例可同时向其肿瘤类别和背景类别贡献图像块,但来自同一病例的所有图像块均保留在同一训练集或测试集分区内。
在每个折中,肿瘤类别在病例水平上大致均衡:对于每个肿瘤类别,8–9个病例(1,632–1,836个图像块)被分配至训练集,4–5个病例(816–1,020个图像块)被分配至测试集。背景类在每病例图像块数量方面更为异质,但也按病例划分,每个折中分别有59–60个BG病例(2,582–2,791个图像块)用于训练,29–30个BG病例(1,234–1,443个图像块)用于测试。
[内容请查看原文]
CNN在单图像块上的性能
在三个训练折中,网络表现出近乎完美的性能:平均训练准确率为0.9993(范围0.9992–0.9994),平均宏平衡准确率为0.9996,宏F1分数为0.9993,加权F1分数为0.9993。Cohen's kappa和多分类Matthews相关系数(MCC)平均均为0.9991,表明在训练集上与参考标签几乎完全一致。
在独立测试折上,总体性能仍然较高,但如预期在划分之间表现出更大的变异性。三个网络的平均测试准确率为0.8630,平均宏平衡准确率为0.9201,宏F1分数为0.8555,加权F1分数为0.8616。相应的平均Cohen's kappa和MCC分别为0.8427和0.8437,与多分类环境下的强一致性相符。
在单个折水平上,测试准确率范围为0.793(网络2)至0.901(网络1),网络3达到中间值0.895。
按类别分析显示,LYM、MCT、MEL和CAR的性能始终最高,而PCT、HIS、STS和BG的变异性更大。在表现最佳的折(网络1)中,测试集上LYM、MCT和MEL的F1分数≥0.95(F1分别为0.975、0.984和0.955),CAR、BG和HIS约为0.89–0.92(F1分别为0.891、0.918和0.884)。相比之下,PCT和STS的F1分数较低,分别为0.756和0.831,反映这些类别的误分类率较高。
网络3表现出大致相似的模式,LYM(0.975)、HIS(0.945)、CAR(0.909)和PCT(0.884)的F1分数较高,但MEL(F1=0.805)、MCT(0.866)和STS(0.810)的性能降低。
总体测试性能最低(网络2)与PCT(0.592)、HIS(0.651)和STS(0.725)F1分数的显著下降相关,而BG、LYM和MCT保持相对稳健(F1分别为0.938、0.840和0.889)。
对混淆矩阵的检查显示,在肿瘤类别中,错误最常发生于PCT、HIS和STS之间,以及STS与CAR之间,而LYM与MCT之间的交叉误分类罕见。由于网络3的准确率处于中间水平(0.895),选择其测试集进行以下分析。
[内容请查看原文]
Grad-CAM分析
在测试集中,BG一致显示注意力集中于空白背景区域、蛋白性背景或血细胞,与RBC染色变化(从红色到绿色)无关。在所有肿瘤类别中,网络注意力主要集中在细胞物质上,而非非细胞背景区域。在许多圆形细胞肿瘤中,注意力明显集中于单个细胞。在通常形成团块的肿瘤类型中(如上皮细胞簇或间充质聚集物),这些区域常被用作预测区域。有趣的是,除细胞团块外,在STS病例中单个细胞成分也被作为靶标。以三维细胞簇为特征且细胞细节较差的区域未被选择用于预测,而具有较好细胞特征的单层细胞簇表现出高注意力值。在圆形细胞肿瘤中,人为细胞聚集/浓缩区域和具有单个细胞成分的区域均被用于预测。不同类别的Grad-CAM热图总结见图2。
[图:8个类别图像块水平预测的代表性Grad-CAM定性评估。对于每个类别,3个代表性]
[内容请查看原文]
ROI测试图像块水平诊断性能(注意力引导推断)
在所有28个精选ROI测试图像块(每病例204个图像块)中,Top1预测在所有病例中均与真实诊断一致,对应总体ROI水平准确率为100%。
在21/28例中,Top2和Top3类别各自占图块的比例均<10%,符合单一主导诊断且无显著鉴别诊断的情况。在其余7/28例中,可能的替代类别占图块比例>10%,包括2/4例MCT、1/4例CAR、2/4例STS、1/4例MEL和1/4例PCT,而LYM或HIS中未观察到如此显著的鉴别诊断。异质性最高的例子包括1例STS,其中STS、HIS和PCT分别占图块的31.6%、30.6%和16.3%;以及1例MEL,其中MEL和MCT分别占图块的50.2%和48.8%。在类别水平上,每个ROI中被分配到正确Top1诊断的所选图块的中位比例从MCT的87.4%到MEL的100%不等,LYM(99.8%)、HIS(98.3%)和PCT(98.3%)的中位值同样较高,CAR(91.4%)和STS(88.4%)略低。在28个ROI中,Top1–Top2差距的平均值为80.5个百分点,中位数为95.8,范围为1.0–100.0。两个ROI(2/28;7.1%)的差距低于5个百分点:病例48(1.0)和病例73(1.4)。三个ROI(3/28;10.7%)的差距低于15个百分点。结果汇总见表1。
Table 1. ROI-level diagnostic predictions obtained by attention-guided inference.
| ROI test tiles–level diagnostic performance ( Attention-guided inference ) | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Case | Ground truth | Predicted class (% of tiles) | Final diagnosis | ||||||
| MCT | LYM | CAR | STS | MEL | HIS | PCT | |||
| 4 | MCT | 97.5 | 0.0 | 0.0 | 0.0 | 2.5 | 0.0 | 0.0 | MCT |
| 8 | MCT | 77.2 | 0.0 | 0.0 | 0.0 | 22.3 | 0.0 | 0.5 | MCT |
| 11 | MCT | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | MCT |
| 14 | MCT | 56.9 | 0.0 | 0.0 | 0.0 | 43.1 | 0.0 | 0.0 | MCT |
| 19 | LYM | 0.0 | 99.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | LYM |
| 23 | LYM | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | LYM |
| 26 | LYM | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | LYM |
| 29 | LYM | 0.0 | 95.6 | 0.0 | 0.0 | 0.0 | 4.4 | 0.0 | LYM |
| 33 | CAR | 0.5 | 1.5 | 97.5 | 0.5 | 0.0 | 0.0 | 0.0 | CAR |
| 37 | CAR | 0.0 | 13.2 | 77.9 | 2.5 | 0.0 | 0.0 | 6.4 | CAR |
| 40 | CAR | 0.0 | 0.0 | 97.1 | 0.0 | 1.0 | 0.0 | 2.0 | CAR |
| 43 | CAR | 2.0 | 4.4 | 85.8 | 0.0 | 1.5 | 0.0 | 6.4 | CAR |
| 48 | STS | 4.1 | 3.1 | 5.1 | 31.6 | 9.2 | 30.6 | 16.3 | STS |
| 51 | STS | 0.0 | 0.0 | 0.0 | 99.5 | 0.0 | 0.0 | 0.5 | STS |
| 55 | STS | 0.0 | 0.0 | 19.2 | 79.8 | 0.0 | 0.0 | 1.0 | STS |
| 59 | STS | 0.0 | 0.0 | 2.0 | 97.0 | 0.0 | 0.0 | 1.0 | STS |
| 63 | MEL | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | 0.0 | 0.0 | MEL |
| 66 | MEL | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | 0.0 | 0.0 | MEL |
| 70 | MEL | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | 0.0 | 0.0 | MEL |
| 73 | MEL | 48.8 | 0.0 | 0.0 | 1.0 | 50.2 | 0.0 | 0.0 | MEL |
| 78 | HIS | 0.0 | 0.0 | 0.0 | 2.0 | 0.0 | 98.0 | 0.0 | HIS |
| 81 | HIS | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 98.5 | 0.5 | HIS |
| 85 | HIS | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 94.6 | 4.4 | HIS |
| 88 | HIS | 0.0 | 0.0 | 0.5 | 0.0 | 0.0 | 99.5 | 0.0 | HIS |
| 93 | PCT | 0.0 | 0.0 | 0.5 | 7.8 | 29.9 | 0.5 | 61.3 | PCT |
| 98 | PCT | 0.0 | 2.0 | 0.5 | 0.0 | 0.0 | 0.0 | 97.5 | PCT |
| 101 | PCT | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | PCT |
| 104 | PCT | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 0.0 | 99.0 | PCT |
[内容请查看原文]
全切片水平诊断性能(无注意力全切片推断)
该分析在测试集的28张独立完整WSI上进行(每个诊断类别4例)。切片包含的中位非背景图块数为9,358(平均值13,159),表明每个全切片决策聚合了数千个未经整理的非独立图块水平预测。在所有28张切片中,Top1预测与真实诊断匹配26例,对应总体切片水平准确率为92.9%。当允许正确诊断出现在排名前三的类别中(Top1–Top3)时,所有28张切片(100%)均在三个最 prevalent 的预测类别中被正确识别。
大多数诊断类别的性能一致。CAR、HIS、LYM、MCT和STS的所有4例在切片水平均被正确分类(每个类别的Top1准确率为4/4)。MEL和PCT各有三张切片被正确分类(Top1准确率为3/4),每个类别各有一例误分类。在误分类的MEL切片中,MCT是主要预测类别(占非背景图块的62.9%),MEL排名第二(占图块的32.3%)。在误分类的PCT切片中,STS为Top1(占图块的34.5%),而PCT和MEL紧随其后(分别占图块的23.4%和24.8%);在这两种情况下,真实诊断仍出现在Top3排名中。
平均而言,Top1类别占每张切片非背景图块的73.4%(中位数80.5%;范围34.5–97.3%),表明多数投票决策通常得到切片大部分区域的支持,尽管一些病例显示出竞争类别的显著混合。在13/28例中,Top2或Top3类别各自占图块的比例<10%,表明单一强诊断且无鉴别诊断。在其余15/28例中,2/4例MCT、1/4例LYM、4/4例CAR、3/4例STS、2/4例MEL、1/4例HIS和2/4例PCT具有占图块比例>10%的合理Top2和/或Top3鉴别诊断。
在类别水平上,每张切片中被分配到正确Top1诊断的图块中位比例约为48–86%,CAR最低(中位数48.6%),LYM最高(中位数91.9%),HIS、MCT、MEL、PCT和STS为中间值。在28张全切片中,Top1–Top2差距的平均值为59.4个百分点,中位数为69.3,范围为9.7–95.4。没有切片的差距低于5个百分点。两张切片(2/28;7.1%)的差距低于15个百分点:病例43(10.3)和病例93(9.7)。WSI水平掩码样本的可视化展示见图3,结果汇总见表2。
[图:由训练好的卷积神经网络生成的7个诊断类别的代表性全切片图像(WSI)水平预测]
Table 2. Whole slide level diagnostic predictions obtained by attention-free whole slide inference.
| Whole-slide–level diagnostic performance ( Attention-free whole slide inference ) | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Case | Ground truth | Predicted class (% non-background tiles) | Final diagnosis | ||||||
| MCT | LYM | CAR | STS | MEL | HIS | PCT | |||
| 4 | MCT | 97.3 | 0.0 | 0.4 | 0.3 | 2.0 | 0.1 | 0.1 | MCT |
| 8 | MCT | 43.6 | 0.6 | 15.5 | 9.6 | 25.6 | 1.1 | 4.1 | MCT |
| 11 | MCT | 86.8 | 8.7 | 1.2 | 1.4 | 0.4 | 0.0 | 1.4 | MCT |
| 14 | MCT | 61.9 | 0.2 | 0.9 | 3.8 | 31.4 | 0.5 | 1.4 | MCT |
| 19 | LYM | 2.9 | 91.0 | 1.6 | 2.8 | 0.2 | 1.5 | 0.1 | LYM |
| 23 | LYM | 0.1 | 92.8 | 3.6 | 0.7 | 0.2 | 2.6 | 0.1 | LYM |
| 26 | LYM | 1.4 | 94.3 | 1.6 | 0.8 | 0.6 | 1.2 | 0.1 | LYM |
| 29 | LYM | 3.9 | 66.5 | 6.4 | 13.6 | 0.7 | 8.7 | 0.1 | LYM |
| 33 | CAR | 0.3 | 22.7 | 48.8 | 26.3 | 0.4 | 0.2 | 1.4 | CAR |
| 37 | CAR | 0.1 | 13.4 | 50.9 | 23.5 | 0.4 | 3.8 | 8.0 | CAR |
| 40 | CAR | 14.8 | 0.2 | 48.5 | 15.8 | 14.9 | 2.5 | 3.4 | CAR |
| 43 | CAR | 5.5 | 34.9 | 45.2 | 10.6 | 0.4 | 1.9 | 1.5 | CAR |
| 48 | STS | 2.6 | 7.0 | 14.3 | 48.7 | 4.2 | 14.7 | 8.3 | STS |
| 51 | STS | 0.3 | 0.8 | 11.8 | 82.5 | 0.4 | 1.2 | 3.1 | STS |
| 55 | STS | 0.1 | 0.1 | 10.9 | 84.9 | 1.8 | 0.6 | 1.7 | STS |
| 59 | STS | 3.2 | 1.4 | 3.5 | 89.1 | 0.0 | 1.9 | 0.8 | STS |
| 63 | MEL | 1.9 | 0.0 | 0.0 | 0.8 | 97.3 | 0.0 | 0.0 | MEL |
| 66 | MEL | 4.8 | 0.0 | 0.0 | 1.4 | 93.8 | 0.0 | 0.0 | MEL |
| 70 | MEL | 6.3 | 0.0 | 0.2 | 19.1 | 74.3 | 0.1 | 0.1 | MEL |
| 73 | MEL | 62.9 | 0.0 | 0.0 | 4.7 | 32.3 | 0.0 | 0.0 | MCT |
| 78 | HIS | 0.3 | 3.0 | 1.3 | 9.8 | 0.1 | 85.3 | 0.3 | HIS |
| 81 | HIS | 1.7 | 2.5 | 2.3 | 25.5 | 0.2 | 65.6 | 2.3 | HIS |
| 85 | HIS | 0.1 | 0.6 | 1.1 | 7.7 | 0.0 | 85.4 | 5.1 | HIS |
| 88 | HIS | 0.3 | 0.1 | 4.9 | 5.9 | 0.0 | 88.0 | 0.9 | HIS |
| 93 | PCT | 7.7 | 0.1 | 8.0 | 34.5 | 24.8 | 1.6 | 23.4 | STS |
| 98 | PCT | 0.0 | 13.1 | 3.4 | 2.0 | 0.0 | 0.5 | 80.9 | PCT |
| 101 | PCT | 2.3 | 0.5 | 4.0 | 9.3 | 0.2 | 3.6 | 80.2 | PCT |
| 104 | PCT | 2.9 | 0.3 | 5.5 | 9.4 | 2.7 | 3.7 | 75.6 | PCT |
[内容请查看原文]
讨论
在本研究中,我们证明了一个相对简单的深度卷积神经网络(Inception-v3)能够在细胞学全切片图像(WSIs)中对七种常见犬肿瘤类型的典型样本进行分类,并达到相对较高的准确率。据我们所知,该方法代表了兽医细胞学中首个基于CNN的多肿瘤人工智能分类。数据集包括了这些常见皮肤肿瘤的平衡选择,这些肿瘤占犬皮肤肿瘤的相当大比例(20)。重要的是,我们的数据集由非常典型且具有完整诊断信息的肿瘤病例组成,旨在建立对高分化病例的概念验证性能。因此,所报告的准确率可能高估了在常规临床细胞学中的性能,因为常规切片可能存在细胞保存不佳、炎症与肿瘤细胞混合群体或未良好分化的肿瘤细胞。未来的工作必须明确评估该模型或其改进版本在诊断上更具挑战性的病例中的表现,以确定其真正的临床效用。
在本工作中,我们使用了严格的按病例划分,以确保同一患者的图像不会同时出现在训练集和测试集中,防止数据泄漏。这一做法遵循了计算病理学中避免数据泄漏的推荐指南,并反映了真实世界的部署情况,即模型必须泛化到新病例(21)。尽管按照人类医学研究的深度学习标准,我们的总样本量较为适中,但与兽医病理学中近期使用每类约50张图像的概念验证研究相当(22)。此类数据集规模在结合仔细的数据增强和迁移学习时仍可产生相对稳健的模型,但也强调了未来需要更大的多机构数据集以进一步提高泛化能力(23, 24)。我们选择Inception-v3是因为,对于许多组织病理学问题,一个良好正则化的中等复杂度CNN可以泛化得与更复杂网络一样好,甚至更好。当标记数据集较为适中且判别线索主要由多尺度纹理和细胞形态学主导时,非常高容量的模型可能会过拟合到切片特定的伪影,而较小的骨干网络则被约束学习更具可迁移性的特征(25, 26)。
我们的CNN在切片块水平上取得了强劲性能,正确分类了大多数细胞学视野。值得注意的是,模型的图像块级精确度(约85%)与类似组织病理学任务中的报告相当(22)。考虑到细胞学与组织学相比的独特挑战,如缺乏有意义的组织结构以及涂片染色、细胞保存和采样技术的差异,使得细胞学总体上成为图像分析更困难的领域,这一准确率水平是显著的。一项兽医研究报告,在区分恶性和良性软组织肿瘤方面,细胞学敏感性约为69%(27)。
三个CNN几乎完美地拟合了训练切片块(平均训练准确率0.9993),而跨折的平均测试准确率为0.8630(范围0.793–0.901),宏平衡准确率较高(0.9201)。这种泛化差距与基于图像块的工作流程一致,其中病例间的生物学和技术变异性可能超过病例内变异性。关键的是,如果同一病例的切片块泄漏到训练和测试分区中,基于图像块的流程可能会高估性能;因此,严格的按病例划分对于可信的性能报告和现实的临床转化至关重要(28)。LYM/MCT/MEL/CAR的性能保持稳健,而PCT/HIS/STS/BG则更具变异性,混淆矩阵显示大多数误分类发生在PCT-HIS-STS和STS-CAR之间。这一模式表明,错误主要由形态学重叠驱动,而非广泛的网络不稳定性。
然而,近期应用于细胞学以外不同学科的医学影像研究提出了可补充这一概念验证基线的策略。Uyar及其同事从15个预训练CNN中选出最强的三个,并使用人工蜂群优化的加权投票进行集成,用于眼病分类,将准确率从最强单一模型的93.17%提高到集成模型的98.84%,F1分数达到98.85%(29)。这种多样性可减少模型特异性方差并稳定模糊的细胞学预测。Yurdakul和Taşdemir还研究了CNN集成与视觉Transformer用于脑肿瘤检测(30)。这种局部-全局组合对细胞学具有吸引力,因为卷积可强调细胞形态,而自注意力可能捕捉空间分离图像区域之间的关系。然而,集成会增加训练、推理和校准成本,而基于Transformer的模型通常需要大量数据或强预训练;在仅91个独立病例的情况下,灵活的架构或权重选择本身就可能过拟合,除非在嵌套的按病例验证中进行并随后进行外部测试。
Yurdakul和Taşdemir随后将EfficientNetV2与基于注意力的MLP-Mixer和Grad-CAM整合,在3,064张脑MRI图像上采用分层五折交叉验证报告了98.53%的准确率(31)。这支持评估结合多尺度特征、token混合、注意力和可解释性的高效混合模型。然而,MRI和细胞学WSI具有不同的图像结构和域偏移来源,图像级性能不能假定可迁移至按病例或跨机构的细胞学。Yurdakul等人将Swin-Mamba U-Net与区域级Bézier强度增强相结合,用于域泛化的脑肿瘤分割,并观察到在外部目标数据集上的增益大于源数据集(32)。使用生物学上合理的强度扰动进行训练的原则与细胞学中的染色和扫描仪变异相关,但其标签感知、基于掩膜的增强针对的是分割而非多类WSI分类。
因此,在本研究启动时,鉴于兽医细胞学中缺乏AI多类肿瘤分类方法,选择inception-v3作为起点,作为成熟的ImageNet预训练基线,与可用的MATLAB工作流程和适中的病例数兼容。集成、Transformer混合模型、注意力模块和状态空间模型可能提高稳健性,但仅凭架构复杂性无法消除观察到的近乎完美的训练准确率(99.93%)与平均测试准确率(86.30%)之间的差距,这也反映了有限的病例间和机构间多样性。未来研究应测试用于架构和集成权重选择的嵌套验证、带有不确定性感知决策阈值的置信度校准,以及独立的多机构队列。
为进一步理解网络做出决策所依据的线索,我们还通过Grad-CAM可视化探索了模型可解释性,这提供了关于CNN依赖哪些细胞学特征的见解。Grad-CAM热图一致突出显示载玻片中含有细胞簇或单个完整肿瘤细胞的区域,同时忽略背景伪影,如过多血液或载玻片碎片。在许多情况下,CNN的注意力图与细胞学家认为具有诊断意义的细胞特征相对应,这非常令人鼓舞。我们相信,这种形式的可解释AI对于建立对副驾驶或自动化诊断系统的信任至关重要,Grad-CAM风格的可视化支持模型注意力的定性验证(33)。
为最小化选择偏倚并保持独立评估,我们将表现中等/平均的网络3用于Grad-CAM及所有后续ROI和全切片分析。尽管网络1达到了最高的图块级测试准确率,但事后选择表现最佳的折叠可能产生过于乐观的估计;这种将留出集性能重复用于模型选择是性能评估中被公认的选择偏倚来源(28)。关键的是,网络3的ROI和WSI级实验仅在其相应的留出测试折叠上进行,该折叠未影响训练,并如前所述按病例分离。这一选择对聚合有直接影响:来自网络3的多数投票ROI和WSI结果可解释为完整流程在“典型”图块级行为下对先前未见病例的端到端性能,而非最佳情况网络。然而我们承认仍存在局限性:我们的分析在单一实验室数据集折叠上展示,未来工作应包括在所有折叠上重新训练并在外部、最好为前瞻性队列(例如不同实验室)中验证。然而,与旨在解决“全局泛化性”这一不可能问题的大型云模型的前景相比,开发本地训练/部署、质量受控的网络供单一实验室使用可能代表CNN应用的未来(34)。
在ROI层面,对每个病例由人工选择的204个代表性图块进行多数投票,在28个病例中产生了100%的Top1诊断准确率。在大多数ROI中(21/28),Top2和Top3类别各自占图块的比例<10%,表明经过筛选后决策通常由一个高度占主导的类别支持。这与专家阅片行为集中于诊断显著区域的证据相一致,提供了一种可用的“注意力先验”,可在推理时减少背景噪声(35)。尽管在全部28个筛选ROI中正确类别均排名第一,但有两个预测接近平局。Top1–Top2分析突出了这种变异:尽管中位差距为95.8个百分点,病例48和病例73的差距分别仅为1.0和1.4个百分点,表明两个领先类别之间几乎没有分离。该差距描述的是ROI内图块级类别分配的平衡情况,而非诊断正确的校准概率。因此,100%的Top1准确率不应被解释为可保证全切片分类正确,正如随后病例73的误分类所示。这些病例表明,在临床部署前,基于排名的准确率应伴随类别比例、差距以及最终的校准不确定性或弃权阈值。
在无注意力全切片推理中,每个决策聚合了数千个非背景图块(中位数9,358;均值13,159),并达到92.9%的Top1准确率(26/28),Top3一致率为100%。值得注意的是,切片级准确率超过了平均单图块准确率,这与多数投票抑制偶发图块级错误相一致。与筛选ROI相比,全切片推理显示出较少的类别分离,Top1–Top2中位差距较低(69.3对95.8个百分点)。仅有两个全切片预测的差距低于15个百分点:病例43被正确分类,而病例93被误分类;相反,另一个误分类切片病例73保留了30.6个百分点的差距。因此,Top1–Top2差距反映的是领先预测类别的相对优势,但不应被解释为诊断正确性的校准指标。多数投票是一种公认的WSI基线聚合方法;然而,观察到的类别混合凸显了为何越来越多地使用更具自适应性的聚合方法(如基于注意力的池化)进行切片级推理(21)。
两种多数投票推理模式(注意力引导推理和无注意力全切片推理)对应不同的临床角色。注意力引导推理模拟AI“副驾驶”:临床医生选择代表性ROI,模型对已判断为相关的内容提供快速、标准化的第二意见。其优势为决策性高、时间较短、计算负担较低以及错误可更清晰地归因于图块内容;其局限性为操作者依赖性、潜在采样偏倚以及可能遗漏所选ROI之外的局灶性成分。无注意力全切片推理是对稳健性的更严格检验,更能反映自主筛查/分诊;其优势为全面覆盖和空间预测映射,而其局限性包括对背景患病率和类别混合的敏感性、速度较慢以及计算量较高(21)。
尽管结果令人鼓舞,我们的研究仍存在值得讨论的局限性。数据集规模仍是一个弱点,这在兽医研究中较为典型。我们的训练集可能无法涵盖即使每种肿瘤类型内部存在的全部形态学多样性。用更多病例扩充数据集,尤其是来自不同机构的病例,是明确的下一步。缺乏此类外部验证是许多首次AI研究的常见弱点,我们承认我们的结果代表的是在某些受控条件下的性能。
病例选择标准带来了额外局限性。由于排除了低分化肿瘤和总体质量较差的制片,所报告的估计值以具有典型形态学和充足诊断材料的切片为条件。当前队列无法量化在未经选择的实践中性能损失的程度。定性地讲,较低细胞密度、保存不佳、血液或炎性污染、混合肿瘤群体以及谱系特异性形态的丧失预计会降低Top1优势并增加重叠类别之间的混淆。因此,具有临床代表性的验证应连续入组病例,保留不确定和非诊断性样本,预先指定标本质量和诊断难度分层,并报告各分层内以及跨外部实验室的准确率、校准和弃权/转诊率。在此类测试完成之前,这些结果不应外推至诊断上存在歧义的常规送检样本。
另一个局限性是所涉及的肿瘤类别范围。我们聚焦于七种定义明确的肿瘤类型;然而,真实世界的细胞学实践还必须应对包括较少见肿瘤在内的样本。在低分化、低细胞密度或其他诊断困难的常规样本中的性能无法从当前筛选队列推断。
据我们所知,此前尚无研究尝试在兽医细胞学全切片图像中对多种不同肿瘤类型进行多类别CNN分类。这是朝着人工智能辅助细胞学诊断发展迈出的令人鼓舞的一步,尽管仍需使用不同架构在更大规模、前瞻性及外部数据集上进行测试,以确认我们方法的临床适用性。
查看英文原文▾
Background
Artificial intelligence may help improve speed and consistency of diagnostic veterinary cytology, but validated tools remain limited.
Objectives
To develop and evaluate a convolutional neural network (CNN) for automatic classification of 7 common canine tumors on cytology whole-slide images (WSIs).
Methods
Ninety-one May–Grünwald Giemsa–stained canine cytology cases were selected, representing carcinoma, histiocytoma, lymphoma, mast cell tumor, melanoma, plasma cell tumor, and soft tissue sarcoma, together with a background class. Slides were tiled into 22,577 image patches (512 × 512 pixels) and manually labeled and split using a case-wise 3-fold design to avoid data leakage. An ImageNet-pretrained Inception-v3 CNN was fine-tuned for 8-class classification. Performance was assessed at tile level, Grad-CAM was used for qualitative interpretability analysis, and majority-vote prediction was further evaluated at ROI level using attention-guided inference and at WSI level using attention-free whole-slide inference.
Results
Mean test accuracy at tile level was 86.3%, with mean macro balanced accuracy of 92.0% and mean macro F1-score of 85.6%. Grad-CAM showed attention focused predominantly on cytologically relevant cellular regions. At ROI level, attention-guided inference achieved 100% Top1 accuracy (28/28 cases). At WSI level, attention-free whole-slide inference achieved 92.9% Top1 accuracy (26/28 cases), and the correct diagnosis was included within the top 3 predictions in all cases.
Conclusion
Inception-v3 achieved high diagnostic performance on canine cytology WSIs. The results support the feasibility of both AI-assisted ROI-based decision support and fully automated whole-slide inference in veterinary cytology. These findings are proof-of-concept evidence from a curated, single-institution cohort of typical, well-differentiated cases and require validation on diagnostically challenging and external cases before clinical use.
[内容请查看原文]
Introduction
Diagnostic cytology is a cornerstone of clinical decision-making in veterinary oncology, providing a minimally invasive, rapid and relatively inexpensive means of characterizing neoplastic processes. Cytologic diagnosis highly depends on expert interpretation and is prone to inter- and intra-observer variability. In human medicine, these challenges have driven attempts to automate cytologic screening (1).
The widespread adoption of digital slide scanners and WSI formats enables this evolution. Contemporary deep convolutional neural networks (CNNs) have transformed computer vision performance and provide the backbone for most modern medical image analysis systems (2–5). In histopathology, CNNs have been successfully applied to a wide range of diagnostic and prognostic tasks, including tumor detection, grading and biomarker prediction at the WSI level (6). These successes have accelerated interest in applying similar approaches to cytology, where overlapping cells, inherent lack of tissue architecture and staining variability present a natural testbed for representation-learning methods.
In human cytology research, deep learning has already been translated to clinically relevant problems on WSIs. For cervical screening, Cheng and colleagues proposed a multi-stage system that combines low- and high-resolution ResNet-based models and a recurrent neural network for slide-level triage on more than 3,500 liquid-based cytology WSIs, achieving sensitivities and specificities comparable to expert cytopathologists while substantially reducing review workload (7). Another group trained a WSI-level model to classify cervical liquid-based cytology specimens as neoplastic versus non-neoplastic, reaching AUCs of 0.89 to 0.96 across independent test sets demonstrating the feasibility of robust, fully automated triage using digitized WSIs (8).
Beyond cervical screening, CNNs have been applied to other cytology specimen types: Tsuneki and colleagues developed a system for urothelial carcinoma screening in urine cytology WSIs, reporting high diagnostic performance and suggesting that AI-assisted urine cytology could standardize the application of the Paris System and reduce false-negative rates (9). More broadly, commercial and research-grade systems are emerging for blood smears, bone marrow, effusions and fine-needle aspirates, with AI models assisting in differential counts, blast detection and malignancy triages (1, 10). These studies suggest that CNN-based analysis of cytology WSIs can achieve clinically useful performance, integrating into existing laboratory workflows.
In veterinary medicine, cytology is arguably more central to diagnostics than in human medicine, as it enables rapid, low-cost assessment of solid organs/lesions and body cavity effusions in first-opinion practice (11, 12), but while histologic applications are comparatively well developed, there remains a relative paucity of validated AI tools for veterinary cytology (13).
Recent reviews on digital veterinary clinical pathology document the rapid growth of cytology platforms, including point-of-care scanners and teleconsultation services, and highlight the emerging potential of AI-driven image analysis for blood, bone marrow and cytology preparations, while emphasizing the need for quality control and decision support, and underscore practical challenges such as data curation, ground-truth definition and ethical considerations (14, 15).
One of the few fully developed examples is the work by Marzahl et al., who used deep learning to quantify pulmonary hemosiderophages in equine bronchoalveolar lavage cytology slides for assessing exercise-induced pulmonary hemorrhage (16). Their CNN-based approach outperformed conventional semi-quantitative scoring, but it targeted a narrow, single-task endpoint rather than broad diagnostic categories (13, 14, 16).
To our knowledge, no published work has yet evaluated a multitask CNN trained on WSIs from a diverse set of small-animal tumor lesions. Building on the solid Inception-v3 architecture in large-scale image classification and medical imaging tasks (5), we developed and evaluated this CNN for automated classification of veterinary cytology WSIs into these seven diagnostically relevant classes. Our aim was to assess whether such a model could achieve relevant performance at tile and WSI levels, thereby providing support for future AI-augmented veterinary diagnostic cytology workflows.
[内容请查看原文]
Materials and methods
[内容请查看原文]
Case selection and digitalisation
Cases were selected from University of Liverpool cytology archive by one Author (IO) aiming at typical morphologically diagnostic cases according to established cytomorphological criteria described in the literature (17–19), excluding poorly differentiated tumors that would otherwise require histology and/or immunohistochemistry for the final diagnosis. Tumor classes were: mast cell tumor (MCT), lymphoma (LYM), carcinoma (CAR), soft tissue sarcoma (STS), melanoma (MEL), histiocytoma (HIS), and plasma cell tumor (PCT). These were reviewed by two board-certified pathologists (LR, TT); cases with concordant diagnosis were selected for inclusion in the population, while those considered of general poor quality were discarded. For each selected case, an MGG-stained slide was digitized as a whole-slide image (WSI) in RGB color format using a digital slide scanner (Aperio CS2, Leica Biosystems, Wetzlar, Germany) at 400x final magnification as an. SVS file.
[内容请查看原文]
Image pre-processing
Across the WSI, a smaller region of interest (ROI) centered on the most representative/cellular area of the slide was manually selected by the operator using Aperio Imagescope software (Aperio, Leica Biosystems), and a new. SVS file was obtained. To generate a tile-level image dataset from the ROIs, we implemented a custom tiling pipeline in MATLAB (MathWorks, Natick, MA, USA) using the Bio-Formats library (bfGetReader, bfGetPlane, bfopen; Open Microscopy Environment). For each slide, a Bio-Formats reader was initialized, and all image series were queried at the highest-resolution plane (400× final resolution) and the tile size set at 512×512 with no overlap. From these inputs, the script computed the vertical and horizontal step size between tile origins, and the slide was scanned in a regular grid. For each tile position, the corresponding ROI was read from the selected series and tiles were saved as. JPG files. After tiling was completed for a given WSI, a post-processing step removed any non-square tiles arising from incomplete tiles at image borders. This procedure was applied sequentially to all WSIs and resulting images (tiles) constituted the raw image dataset. A visual summary of the process is depicted in Figures 1E–H.
[图:Workflow used for development, training, testing, and whole-slide application of the convolutional neural network (CNN) ]
[内容请查看原文]
Ground truth creation and training/test split
Tiles were manually selected by one operator (MA) according to the following criteria: images representative of microscopic fields where cytologic characteristics were obvious according to published cytologic criteria (17–19) and where diagnostic cellular material represented at least 20% of the tile area. For the background class, tiles were selected containing either: clear, acellular background, proteinaceous background, or blood cells (e.g., erythrocytes, neutrophils, monocytes, etc.) with no tumor-diagnostic cells present. To construct training and test sets while avoiding data leakage between tiles from the same cytology case, we implemented a dedicated MATLAB script (MathWorks, Natick, MA, USA) that operates on the tiled WSI dataset. Although each animal/slide belonged to one tumor class, case slides contributed to non-diagnostic (background class).
[内容请查看原文]
CNN training and evaluation at tile level
All convolutional neural networks (CNNs) were trained in MATLAB R2023a (MathWorks, Natick, MA, USA) using the Deep Learning Toolbox, Deep Network Designer app, and Experiment Manager. During training all tiles from a given cytology case remained either in the training or in the held-out test set for that network, but never in both. Within Deep Network Designer, an Inception-v3 architecture pre-trained on ImageNet was imported and the final classification layers replaced by a new fully connected layer and a softmax/classification layer with eight output units, corresponding to the eight categories. During training, all tiles were automatically resized to match this input size (299 × 299 × 3). For each fold, a separate Deep Network Designer project was created (Network 1, Network 2 and Network 3). In each project, the train directory for that fold was loaded as an image datastore, using folder names as categorical labels and enabling random shuffling at the beginning of each epoch. The test directory of the same fold was kept completely separate and was not used during optimization. Fold sizes were reported as class-specific case instances rather than as numbers of unique animals. Each case contributed one instance to its tumor class and, when background tiles were available, one additional instance to the background class. Thus, the total number of class-specific instances was calculated as the sum of the tumor-class instances and background instances. For example, the Network 3 training set contained 9 cases in each of the 7 tumor classes, corresponding to 63 tumor-class instances (7 × 9), plus 60 background instances, yielding 123 class-specific case instances. Hyperparameter optimization was performed using Experiment Manager. For each fold, we defined experiments that systematically compared the main solvers provided in the app (“rmsprop,” “sgdm,” “adam”) across three initial learning rates (0.1, 0.01 and 0.001). Each combination of solver and learning rate was run as an individual trial, using otherwise identical settings (batch size, number of epochs, data augmentation, and L2-regularization). Training and test performance curves (accuracy, loss) were monitored within Experiment Manager, and networks were trained for different numbers of epochs (5,10,15), choosing the best result to avoid overfitting. The best configuration for each fold was selected based on test set performance and convergence behavior (highest test accuracy with stable loss and no evidence of progressive overfitting). The final networks reported in this study (Network 1–3) correspond to the best-performing solver/learning-rate/epochs combinations for each. Confusion matrices were obtained for both training and test sets. Once training for a given fold was completed and the optimal configuration identified, the resulting network was exported from Deep Network Designer to the MATLAB workspace and saved as a .mat file. These three trained networks (representative of each fold split) were then used programmatically for tile-level evaluation on their respective held-out test sets. For all trials, the mini-batch size was 128, and the L2-regularization coefficient was 0.0001. Data augmentation comprised random reflection about both the X and Y axes, random rotation from 0 to 30 degrees, and random horizontal and vertical translation from 0 to 0.3 pixels. The random rescaling range was 1 to 1 and therefore did not introduce scale augmentation. Training was performed on a Windows 11, A9 CPU, 64GB RAM, 1xNvidia RTX6000 workstation. A visual summary of the process is depicted in Figures 1I–N.
[内容请查看原文]
Grad-CAM analysis of tiles
To visualize the image regions that contributed the most to the CNN predictions on the test set, we implemented a batch Grad-CAM pipeline in MATLAB (MathWorks, Natick, MA, USA), using a custom script. The network with average test accuracy among Networks 1–3 was selected to test Grad-CAM analysis. To identify the feature maps used for Grad-CAM computation, the script automatically detected the last convolutional layer in the network ensuring that class-discriminative localization maps were computed from the deepest convolutional representation available. The script recursively enumerated all files within a root directory and for each image, spatial resizing to match the network’s input height and width, and adjustment of the number of channels to match the network input were performed. Each pre-processed image was classified using the network, and the predicted label mapped to the corresponding class index from the classification layer. This predicted class index was used as the target class for Grad-CAM. For every image, a Grad-CAM heatmap was computed. As output, for each processed image, a figure was generated containing both the resized original image, and the same image overlaid with the Grad-CAM heatmap with 50% transparency and an accompanying color bar. Grad-CAM output was evaluated qualitatively on a randomly selected population of tiles (100 tiles per category in the test set). A visual summary of the process is depicted in Figure 1O.
[内容请查看原文]
Analysis of CNN prediction at ROI level with majority vote (attention-guided inference)
To extend CNN predictions from the individual tile level to the sum of the tiles from the region-of-interest (ROI) level of the test cases, simulating a human-guided diagnostic workflow in which the CNN acts as a decision-support copilot, we implemented a custom MATLAB script that classified all tiles belonging to the same ROI of a single case and summarized the distribution of predicted classes by majority vote. The network with average test accuracy among Networks 1–3 was selected for this analysis. After all tiles were processed, the script generated a summary for each ROI, reporting the total number of classified tiles, the number of tiles assigned to each category, and the corresponding percentage of the ROI represented by each predicted class. ROI-level interpretation was then derived by majority vote, whereby the class with the highest number of predicted tiles was considered the final ROI-level classification. A visual summary of the process is depicted in Figure 1P.
[内容请查看原文]
Analysis of CNN prediction at WSI level with majority vote (attention-free whole slide inference)
To assess performance at the level at which cytology is actually reported (the whole slide) simulating a fully automated AI approach, we applied the CNN to the whole WSIs from which test tiles originated from and derived a single diagnosis per slide by majority vote across non-background tiles. This extended predictions to the entire slide area, not necessarily diagnostic and not seen during training or testing, simulating a fully automated screening workflow, in which the algorithm must both encounter diagnostically relevant and non-relevant areas autonomously and generate a slide-level prediction without human direction. For each WSI, all tiles predicted as background were excluded and the remaining tiles were grouped by predicted tumor classes. The class accounting for the highest percentage of non-background tiles (Top1) was taken as the slide-level prediction; the second and third most frequent classes (Top2 and Top3) were also recorded. As an additional descriptive analysis of ROI-level and WSI-level class separation, the Top1–Top2 margin was calculated as the difference between the tile percentages assigned to the highest-ranked and second-highest-ranked classes. Margins were expressed in percentage points and summarized using the mean, median, and range. The numbers and percentages of ROIs and whole slides with margins below 5 and 15 percentage points were also reported. These thresholds were descriptive and did not alter the Top1 classification rule. The network with average test accuracy among Networks 1–3 was selected for WSI-level analysis: Whole-slide images (WSIs) of cytology smears from test cases were processed in batch using a custom MATLAB script (MathWorks, Natick, MA, USA) built around the Bio-Formats library. The script scanned a user-defined input directory, identified all supported WSI files, and processed them sequentially. In each position, a tile was extracted using the appropriate ROI coordinates and all tiles were classified using the CNN. The predicted class label was mapped to its index in the network’s final layer, and class-wise tile counts and tile pixel areas were accumulated for the entire slide. In parallel, a color-coded visualization tile was generated for each image: a solid RGB mask color was assigned to each class based on a color map [background (BG): red; carcinoma (CAR): amber/golden yellow; histiocytoma (HIS): lime green; lymphoma (LYM): spring green; mast cell tumor (MCT): cyan/aqua; melanoma (MEL): royal blue; plasma cell tumor (PCT): violet; and soft tissue sarcoma (STS): magenta/fuchsia] and blended with the original tile at 40% opacity to preserve underlying morphology. To provide a compact slide-level visual summary, a strongly downsampled (5% of the original WSI dimensions in each axis) composite. Jpg image was reconstructed from the classified tiles. For quantitative reporting, a plain-text file was produced for each slide. This report listed, for every class, the number of tiles assigned to that class, the total number of pixels covered by those tiles, and the percentage of the slide area they represented relative to the sum of all classified tile pixels. The original WSI dimensions and requested base tile size were also recorded. A visual summary of the process is depicted in Figure 1Q.
[内容请查看原文]
Statistical analysis
Statistical analysis was descriptive. For each fold, performance at tile level was assessed on both training and independent test sets using confusion matrices and standard multiclass classification metrics, including overall accuracy, macro balanced accuracy, macro F1-score, weighted F1-score, Cohen’s kappa, and multiclass Matthews correlation coefficient (MCC). Class-specific performance was described using precision, recall, and F1-scores.
[内容请查看原文]
Ethics statement
The project was approved by the Ethics Committee of the School of Veterinary Science, Liverpool, Reference ID: VREC1697.
[内容请查看原文]
Results
[内容请查看原文]
Dataset composition and case-wise cross-validation splits
The final cytology dataset comprised 91 (13 per class) independent cases, corresponding to 7 diagnostic categories: carcinoma (CAR), histiocytoma (HIS), lymphoma (LYM), mast cell tumor (MCT), melanoma (MEL), plasma cell tumor (PCT), and soft tissue sarcoma (STS). Background class (BG) originated from non-diagnostic areas of 89/91 cases. This yielded 22,577 image patches (tiles) overall: 4,025 BG tiles and 18,552 tumor tiles. For the neoplastic categories, almost all cases contributed 204 tiles each (204 × 13 = 2,652 tiles per class), except for a single melanoma case that contained 192 tiles (total 2,640 melanoma tiles). The full dataset is available at Zenodo.org (DOI: 10.5281/zenodo.19493409).
Across the three case-wise folds, training and test partitions comprised 56–63 and 28–35 unique cases (animals), respectively, corresponding to 115–123 and 57–65 class-specific case instances and 14,215–15,517 and 7,060–8,362 tiles. Class-specific case-instance totals exceed unique-animal totals because a case could contribute tiles to both its tumor class and the background class, nevertheless, all tiles from a given condition remained within the same training or test partition.
In each fold, the neoplastic classes were approximately balanced at the case level: for every tumor class, 8–9 cases (1,632–1,836 tiles) were assigned to the training set and 4–5 cases (816–1,020 tiles) to the test set. Background was more heterogeneous in terms of tile counts per case but was also split case-wise, with 59–60 BG cases (2,582–2,791 tiles) used for training and 29–30 BG cases (1,234–1,443 tiles) used for testing in each fold.
[内容请查看原文]
CNN performance on single tiles
Across the three training folds, the networks showed near-perfect performance: mean training accuracy was 0.9993 (range, 0.9992–0.9994), with mean macro balanced accuracy of 0.9996, macro F1-score of 0.9993, and weighted F1-score of 0.9993. Cohen’s kappa and multiclass Matthews correlation coefficient (MCC) were both 0.9991 on average, indicating almost complete agreement with the reference labels on the training sets.
On the independent test folds, overall performance remained high but, expectedly, showed greater variability between splits. Mean test accuracy across the three networks was 0.8630, with a mean macro balanced accuracy of 0.9201, macro F1-score of 0.8555, and weighted F1-score of 0.8616. The corresponding mean Cohen’s kappa and MCC were 0.8427 and 0.8437, respectively, consistent with strong agreement in a multiclass setting.
At the level of individual folds, test accuracy ranged from 0.793 (Network 2) to 0.901 (Network 1), with Network 3 achieving an intermediate value of 0.895.
Class-wise analysis showed that performance was consistently highest for LYM, MCT, MEL and CAR, and more variable for PCT, HIS, STS and BG. In the best performing fold (Network 1), F1-scores on the test set were ≥0.95 for LYM, MCT and MEL (F1 = 0.975, 0.984 and 0.955, respectively), and approximately 0.89–0.92 for CAR, BG and HIS (F1 = 0.891, 0.918 and 0.884, respectively). In contrast, PCT and STS showed lower F1-scores of 0.756 and 0.831, reflecting a higher rate of misclassification for these categories.
Network 3 showed a broadly similar pattern, with high F1-scores for LYM (0.975), HIS (0.945), CAR (0.909) and PCT (0.884), but reduced performance for MEL (F1 = 0.805), MCT (0.866) and STS (0.810).
The lowest overall test performance (Network 2) was associated with a marked drop in F1-scores for PCT (0.592), HIS (0.651) and STS (0.725), while BG, LYM and MCT remained relatively robust (F1 = 0.938, 0.840 and 0.889, respectively).
Inspection of the confusion matrices revealed that among neoplastic categories, errors were most frequent between PCT, HIS and STS, and between STS and CAR, whereas cross-misclassification between LYM and MCT was rare. Due to the intermediate accuracy of Network 3 (0.895) this was chosen for the following analysis on its test set.
[内容请查看原文]
Grad-CAM analysis
Within the test set, BG consistently showed attention focused either on empty background areas, proteinaceous background or blood cells, irrespective of the variation of RBC stain (from red to green). In all the tumor classes, network attention was mainly focused on cellular material and not on non-cellular background areas. In many round cell tumors, attention was clearly focused on individual cells. In tumor types which normally form groups (e.g., epithelial clusters or mesenchymal aggregates), those areas were often used as regions for prediction. Interestingly, in addition to cell groups, in the case of STS, single cell elements were also targeted. Areas characterized by three-dimensional clusters with poor cellular details were not chosen for prediction, while monolayer clusters with better cellular features exhibited high attention values. In round cell tumors, both areas of artifactual cell aggregation/concentration and areas with single cell elements were used for prediction. A summary of Grad-CAM heatmaps from different classes is presented in Figure 2.
[图:Representative Grad-CAM qualitative assessment of tile-level predictions for the 8 classes. For each class, 3 representa]
[内容请查看原文]
ROI test tiles level diagnostic performance (attention-guided inference)
Across all 28 curated ROI test tiles (204 tiles per case), the Top1 prediction matched the true diagnosis in all cases, corresponding to an overall ROI-level accuracy of 100%.
In 21/28 cases, both Top2 and Top3 classes each represented <10% of tiles, consistent with a single dominant diagnosis without substantial differentials. In the remaining 7/28 cases, plausible alternative classes represented >10% of tiles, including 2/4 MCT, 1/4 CAR, 2/4 STS, 1/4 MEL, and 1/4 PCT cases, whereas no such prominent differentials were observed in LYM or HIS. The most heterogeneous examples included 1 STS case in which STS, HIS, and PCT accounted for 31.6%, 30.6%, and 16.3% of tiles, respectively, and 1 MEL case in which MEL and MCT accounted for 50.2 and 48.8% of tiles. At the class level, the median fraction of selected tiles assigned to the correct Top1 diagnosis per ROI ranged from 87.4% for MCT to 100% for MEL, with similarly high median values for LYM (99.8%), HIS (98.3%), and PCT (98.3%), and slightly lower values for CAR (91.4%) and STS (88.4%). Across the 28 ROIs, the mean Top1–Top2 margin was 80.5 percentage points, the median was 95.8, and the range was 1.0–100.0. Two ROIs (2/28; 7.1%) had margins below 5 percentage points: Case 48 (1.0) and Case 73 (1.4). Three ROIs (3/28; 10.7%) had margins below 15 percentage points. A summary of the results is presented in Table 1.
Table 1. ROI-level diagnostic predictions obtained by attention-guided inference.
| ROI test tiles–level diagnostic performance ( Attention-guided inference ) | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Case | Ground truth | Predicted class (% of tiles) | Final diagnosis | ||||||
| MCT | LYM | CAR | STS | MEL | HIS | PCT | |||
| 4 | MCT | 97.5 | 0.0 | 0.0 | 0.0 | 2.5 | 0.0 | 0.0 | MCT |
| 8 | MCT | 77.2 | 0.0 | 0.0 | 0.0 | 22.3 | 0.0 | 0.5 | MCT |
| 11 | MCT | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | MCT |
| 14 | MCT | 56.9 | 0.0 | 0.0 | 0.0 | 43.1 | 0.0 | 0.0 | MCT |
| 19 | LYM | 0.0 | 99.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | LYM |
| 23 | LYM | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | LYM |
| 26 | LYM | 0.0 | 100.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | LYM |
| 29 | LYM | 0.0 | 95.6 | 0.0 | 0.0 | 0.0 | 4.4 | 0.0 | LYM |
| 33 | CAR | 0.5 | 1.5 | 97.5 | 0.5 | 0.0 | 0.0 | 0.0 | CAR |
| 37 | CAR | 0.0 | 13.2 | 77.9 | 2.5 | 0.0 | 0.0 | 6.4 | CAR |
| 40 | CAR | 0.0 | 0.0 | 97.1 | 0.0 | 1.0 | 0.0 | 2.0 | CAR |
| 43 | CAR | 2.0 | 4.4 | 85.8 | 0.0 | 1.5 | 0.0 | 6.4 | CAR |
| 48 | STS | 4.1 | 3.1 | 5.1 | 31.6 | 9.2 | 30.6 | 16.3 | STS |
| 51 | STS | 0.0 | 0.0 | 0.0 | 99.5 | 0.0 | 0.0 | 0.5 | STS |
| 55 | STS | 0.0 | 0.0 | 19.2 | 79.8 | 0.0 | 0.0 | 1.0 | STS |
| 59 | STS | 0.0 | 0.0 | 2.0 | 97.0 | 0.0 | 0.0 | 1.0 | STS |
| 63 | MEL | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | 0.0 | 0.0 | MEL |
| 66 | MEL | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | 0.0 | 0.0 | MEL |
| 70 | MEL | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | 0.0 | 0.0 | MEL |
| 73 | MEL | 48.8 | 0.0 | 0.0 | 1.0 | 50.2 | 0.0 | 0.0 | MEL |
| 78 | HIS | 0.0 | 0.0 | 0.0 | 2.0 | 0.0 | 98.0 | 0.0 | HIS |
| 81 | HIS | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 98.5 | 0.5 | HIS |
| 85 | HIS | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 94.6 | 4.4 | HIS |
| 88 | HIS | 0.0 | 0.0 | 0.5 | 0.0 | 0.0 | 99.5 | 0.0 | HIS |
| 93 | PCT | 0.0 | 0.0 | 0.5 | 7.8 | 29.9 | 0.5 | 61.3 | PCT |
| 98 | PCT | 0.0 | 2.0 | 0.5 | 0.0 | 0.0 | 0.0 | 97.5 | PCT |
| 101 | PCT | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0 | PCT |
| 104 | PCT | 0.0 | 0.0 | 0.5 | 0.5 | 0.0 | 0.0 | 99.0 | PCT |
[内容请查看原文]
Whole-slide–level diagnostic performance (attention-free whole slide inference)
This analysis was performed on 28 independent full WSIs of the test set (4 cases per diagnostic category). The slides contained a median of 9,358 non-background tiles (mean 13,159), indicating that each whole-slide decision aggregated thousands of non-curated independent tile-level predictions. Across all 28 slides, the Top1 prediction matched the true diagnosis in 26 cases, corresponding to an overall slide-level accuracy of 92.9%. When allowing the correct diagnosis to appear within the top three ranked classes (Top1–Top3), all 28 slides (100%) were correctly identified within the three most prevalent predicted categories.
Performance was consistent across most diagnostic classes. All four cases of CAR, HIS, LYM, MCT and STS were correctly classified at the slide level (Top1 accuracy 4/4 for each class). MEL and PCT each had three correctly classified slides (Top1 accuracy 3/4), with a single misclassified case per class. In the misclassified MEL slide, MCT was the predominant predicted class (62.9% of non-background tiles) and MEL was ranked second (32.3% of tiles). In the misclassified PCT slide, STS was Top1 (34.5% of tiles), while PCT and MEL were close behind (23.4 and 24.8% of tiles, respectively); in both cases, the true diagnosis still appeared within the Top3 ranking.
On average, the Top1 class accounted for 73.4% of non-background tiles per slide (median 80.5%; range 34.5–97.3%), indicating that the majority-vote decision was typically supported by a large proportion of the slide, although some cases showed substantial mixture of competing classes. In 13/28 cases, the Top2 or Top3 classes were each represented by <10% of tiles, indicating a single strong diagnosis without differentials. In the remaining 15/28 cases, 2/4 MCT, 1/4 LYM, 4/4 CAR, 3/4 STS, 2/4 MEL, 1/4 HIS, and 2/4 PCT cases had plausible Top2 and/or Top3 differential diagnoses represented by >10% of tiles.
At the class level, the median fraction of tiles assigned to the correct Top1 diagnosis per slide ranged from approximately 48–86%, being lowest for CAR (median 48.6%) and highest for LYM (median 91.9%), with intermediate values for HIS, MCT, MEL, PCT and STS. Across the 28 whole slides, the mean Top1–Top2 margin was 59.4 percentage points, the median was 69.3, and the range was 9.7–95.4. No slides had margins below 5 percentage points. Two slides (2/28; 7.1%) had margins below 15 percentage points: Case 43 (10.3) and Case 93 (9.7). A visual representation of samples of WSI-level masks is presented in Figure 3 while a summary of the results is presented in Table 2.
[图:Representative whole-slide image (WSI)–level predictions generated by the trained convolutional neural network for 7 dia]
Table 2. Whole slide level diagnostic predictions obtained by attention-free whole slide inference.
| Whole-slide–level diagnostic performance ( Attention-free whole slide inference ) | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Case | Ground truth | Predicted class (% non-background tiles) | Final diagnosis | ||||||
| MCT | LYM | CAR | STS | MEL | HIS | PCT | |||
| 4 | MCT | 97.3 | 0.0 | 0.4 | 0.3 | 2.0 | 0.1 | 0.1 | MCT |
| 8 | MCT | 43.6 | 0.6 | 15.5 | 9.6 | 25.6 | 1.1 | 4.1 | MCT |
| 11 | MCT | 86.8 | 8.7 | 1.2 | 1.4 | 0.4 | 0.0 | 1.4 | MCT |
| 14 | MCT | 61.9 | 0.2 | 0.9 | 3.8 | 31.4 | 0.5 | 1.4 | MCT |
| 19 | LYM | 2.9 | 91.0 | 1.6 | 2.8 | 0.2 | 1.5 | 0.1 | LYM |
| 23 | LYM | 0.1 | 92.8 | 3.6 | 0.7 | 0.2 | 2.6 | 0.1 | LYM |
| 26 | LYM | 1.4 | 94.3 | 1.6 | 0.8 | 0.6 | 1.2 | 0.1 | LYM |
| 29 | LYM | 3.9 | 66.5 | 6.4 | 13.6 | 0.7 | 8.7 | 0.1 | LYM |
| 33 | CAR | 0.3 | 22.7 | 48.8 | 26.3 | 0.4 | 0.2 | 1.4 | CAR |
| 37 | CAR | 0.1 | 13.4 | 50.9 | 23.5 | 0.4 | 3.8 | 8.0 | CAR |
| 40 | CAR | 14.8 | 0.2 | 48.5 | 15.8 | 14.9 | 2.5 | 3.4 | CAR |
| 43 | CAR | 5.5 | 34.9 | 45.2 | 10.6 | 0.4 | 1.9 | 1.5 | CAR |
| 48 | STS | 2.6 | 7.0 | 14.3 | 48.7 | 4.2 | 14.7 | 8.3 | STS |
| 51 | STS | 0.3 | 0.8 | 11.8 | 82.5 | 0.4 | 1.2 | 3.1 | STS |
| 55 | STS | 0.1 | 0.1 | 10.9 | 84.9 | 1.8 | 0.6 | 1.7 | STS |
| 59 | STS | 3.2 | 1.4 | 3.5 | 89.1 | 0.0 | 1.9 | 0.8 | STS |
| 63 | MEL | 1.9 | 0.0 | 0.0 | 0.8 | 97.3 | 0.0 | 0.0 | MEL |
| 66 | MEL | 4.8 | 0.0 | 0.0 | 1.4 | 93.8 | 0.0 | 0.0 | MEL |
| 70 | MEL | 6.3 | 0.0 | 0.2 | 19.1 | 74.3 | 0.1 | 0.1 | MEL |
| 73 | MEL | 62.9 | 0.0 | 0.0 | 4.7 | 32.3 | 0.0 | 0.0 | MCT |
| 78 | HIS | 0.3 | 3.0 | 1.3 | 9.8 | 0.1 | 85.3 | 0.3 | HIS |
| 81 | HIS | 1.7 | 2.5 | 2.3 | 25.5 | 0.2 | 65.6 | 2.3 | HIS |
| 85 | HIS | 0.1 | 0.6 | 1.1 | 7.7 | 0.0 | 85.4 | 5.1 | HIS |
| 88 | HIS | 0.3 | 0.1 | 4.9 | 5.9 | 0.0 | 88.0 | 0.9 | HIS |
| 93 | PCT | 7.7 | 0.1 | 8.0 | 34.5 | 24.8 | 1.6 | 23.4 | STS |
| 98 | PCT | 0.0 | 13.1 | 3.4 | 2.0 | 0.0 | 0.5 | 80.9 | PCT |
| 101 | PCT | 2.3 | 0.5 | 4.0 | 9.3 | 0.2 | 3.6 | 80.2 | PCT |
| 104 | PCT | 2.9 | 0.3 | 5.5 | 9.4 | 2.7 | 3.7 | 75.6 | PCT |
[内容请查看原文]
Discussion
In this study, we demonstrated that a relatively simple deep CNN (Inception-v3) can achieve relative high accuracy in classifying seven typical examples of common canine tumor types from cytology whole-slide images (WSIs). This approach represents, to our knowledge, the first CNN based multi-tumor AI classification in veterinary cytology. The dataset included a balanced selection of these frequent cutaneous neoplasms, which represent a substantial proportion of canine skin tumors (20). Importantly, our dataset consisted of very typical and fully diagnostic tumor cases selected to establish a proof-of-concept performance on well differentiated cases. As a result, the reported accuracy likely overestimates performance in routine clinical cytology, where slides may have suboptimal cell preservation, mixed inflammatory and neoplastic populations, or neoplastic cells that are not well-differentiated. Future work must explicitly evaluate the model, or improvements of the same, on diagnostically more challenging cases to determine its true clinical utility.
In this work we used a rigorous case-wise split to ensure that no images from the same patient appeared in both training and testing sets, preventing data leakage. This practice follows recommended guidelines in computational pathology for avoiding data leakage and reflects real-world deployment, where models must generalize to new cases (21). Although our total sample size was modest by deep learning standards in human medicine studies, it is comparable to recent proof-of-concept studies in veterinary pathology that used ~50 images per class (22). Such dataset sizes can still yield relatively robust models when combined with careful augmentation and transfer learning, but they also underscore the need for larger multi-institutional datasets in the future to further improve generalizability (23, 24). We selected Inception-v3 because, for many histopathology problems, a well-regularized mid-complexity CNN can generalize as well as, or better than, more complex networks. When labeled datasets are modest and discriminative cues are dominated by multi-scale texture and cytomorphology, very high-capacity models can overfit to slide-specific artifacts, whereas smaller backbones are constrained to learn more transferable features (25, 26).
Our CNN achieved strong performance at the tile level, correctly classifying most cytological fields of view. Notably, the model’s patch-level precision (~85%) was comparable to reports in similar histopathology tasks (22). This level of accuracy is remarkable given the unique challenges of cytology versus histology such as the lack of meaningful tissue structure and differences in smear staining, cell preservation, and sampling technique, making cytology a more difficult domain for image analysis in general. One veterinary study reported cytology sensitivities of approximately ~69% for differentiating malignant from benign soft-tissue tumors (27).
The three CNNs fitted training tiles almost perfectly (mean training accuracy 0.9993), while mean test accuracy across folds was 0.8630 (range 0.793–0.901) with high macro balanced accuracy (0.9201). This generalization gap is consistent with patch-based workflows where inter-case biological and technical variability can exceed within-case variability. Crucially, patch-based pipelines can overestimate performance if tiles from the same case leak into both training and testing partitions; therefore, rigorous case-wise splitting is essential for credible performance reporting and realistic clinical translation (28). Performance remained robust for LYM/MCT/MEL/CAR, while PCT/HIS/STS/BG were more variable, and confusion matrices showed most misclassifications between PCT-HIS-STS and STS–CAR. This pattern suggests that errors are primarily driven by morphologic overlap, rather than broad network instability.
However, recent medical-imaging studies, applied to different disciplines than cytology, propose strategies that could complement this proof-of-concept baseline. Uyar and colleagues selected the three strongest of 15 pretrained CNNs and combined them using Artificial Bee Colony-optimized weighted voting for eye-disease classification, increasing accuracy from 93.17% for the strongest single model to 98.84% for the ensemble, which achieved an F1-score of 98.85% (29). Such diversity could reduce model-specific variance and stabilize ambiguous cytology predictions. Yurdakul and Taşdemir also investigated an ensemble of CNNs and a Vision Transformer for brain-tumor detection (30). This local–global combination is attractive for cytology because convolutions can emphasize cellular morphology while self-attention may capture relationships among spatially separated image regions. However, ensembles increase training, inference, and calibration costs, while transformer-based models generally require substantial data or strong pretraining; with only 91 independent cases, flexible architecture or weight selection could itself overfit unless performed within nested case-wise validation and followed by external testing.
Yurdakul and Taşdemir subsequently integrated EfficientNetV2 with an attention-based MLP-Mixer and Grad-CAM, reporting 98.53% accuracy under stratified five-fold cross-validation on 3,064 brain MRI images (31). This supports evaluation of efficient hybrids that combine multi-scale features, token mixing, attention, and explainability. Nevertheless, MRI and cytology WSIs have different image structure and sources of domain shift, and image-level performance cannot be assumed to transfer to case-wise or cross-institutional cytology. Yurdakul et al. combined a Swin-Mamba U-Net with region-wise Bézier intensity augmentation for domain-generalized brain-tumor segmentation and observed a larger gain on external target datasets than on the source dataset (32). The principle of training with biologically plausible intensity perturbations is relevant to staining and scanner variation in cytology, but their label-aware, mask-based augmentation addresses segmentation rather than multiclass WSI classification.
Accordingly, in our study inception-v3 was selected as a starting point, given the lack of AI- multi class tumor classification approaches in veterinary cytology, as a well-established ImageNet-pretrained baseline that was compatible with the available MATLAB workflow and modest case count. Ensembles, transformer hybrids, attention modules, and state-space models may improve robustness, but architectural complexity alone cannot eliminate the observed gap between near-perfect training accuracy (99.93%) and mean test accuracy (86.30%), which also reflects limited inter-case and inter-institutional diversity. Future studies should test nested validation for architecture and ensemble-weight selection, confidence calibration with uncertainty-aware decision thresholds, and independent multi-institutional cohorts.
To further understand the clues used by the network to make a decision, we also explored model interpretability via Grad-CAM visualization, which provided insights into what cytologic features the CNN relied upon. The Grad-CAM heatmaps consistently highlighted the areas of slides containing clusters or single intact neoplastic cells, while ignoring background artifacts such as excessive blood or slide debris. In many instances, the CNN’s attention maps corresponded to the same cellular features that a cytologist would consider diagnostic, which is very encouraging. We believe that this form of explainable AI is crucial for building trust in co-pilots or automated diagnostic systems and Grad-CAM-style visualization supports qualitative validation of model attention (33).
To minimize selection bias and preserve an independent evaluation, we carried forward the intermediate/average-performing Network 3 for Grad-CAM and all subsequent ROI- and whole-slide analyses. Although Network 1 achieved the highest tile-level test accuracy, selecting the best-performing fold post-hoc may yield an overly optimistic estimate; such reuse of held-out performance for model choice is a recognized source of selection bias in performance evaluation (28). Crucially, Network 3’s ROI- and WSI-level experiments were conducted only on its corresponding held-out test fold, which did not influence training and was separated case-wise as previously discussed. This choice has direct implications for aggregation: majority-vote ROI and WSI results derived from Network 3 can be interpreted as end-to-end performance of the full pipeline on previously unseen cases under “typical” tile-level behavior, rather than a best-case network. We acknowledge however that limitations remain: our analyses were demonstrated on a single laboratory dataset fold and future work should include retraining on all folds and validation in external, preferably prospective, cohorts (e.g., different laboratories). However, the development of locally-trained/deployed, quality-controlled networks for single lab use may represent the future of the use of CNNs compared to the promise of large cloud models aiming at solving the impossible problem of “global generalizability” (34).
At ROI level, majority vote across 204 human-selected representative tiles per case produced 100% Top1 diagnosis accuracy across 28 cases. In most ROIs (21/28), Top2 and Top3 classes each represented <10% of tiles, indicating that the decision was usually supported by a highly dominant class after curation. This aligns with evidence that expert viewing behavior concentrates on diagnostically salient regions, offering a usable “attention prior” that reduces background noise at inference (35). Although the correct class ranked first in all 28 curated ROIs, two predictions were near-ties. The Top1–Top2 analysis highlighted this variation: despite a median margin of 95.8 percentage points, Cases 48 and 73 had margins of only 1.0 and 1.4 percentage points, respectively, indicating little separation between the two leading classes. This margin describes the balance of tile-level class assignments within an ROI, rather than a calibrated probability that the diagnosis is correct. Thus, the 100% Top1 accuracy should not be interpreted as guaranteeing correct whole-slide classification, as illustrated by the subsequent misclassification of Case 73. These cases show that rank-based accuracy should be accompanied by class proportions, margins, and ultimately calibrated uncertainty or an abstention threshold before clinical deployment.
In attention-free whole-slide inference, each decision aggregated thousands of non-background tiles (median 9,358; mean 13,159) and achieved 92.9% Top1 accuracy (26/28) with 100% Top3 agreement. Notably, slide-level accuracy exceeded mean single-tile accuracy, consistent with majority vote suppressing sporadic tile-level errors. Compared with the curated ROIs, whole-slide inference showed less class separation, with a lower median Top1–Top2 margin (69.3 versus 95.8 percentage points). Only two whole-slide predictions had margins below 15 percentage points: Case 43 was correctly classified, whereas Case 93 was misclassified; conversely, the other misclassified slide, Case 73, retained a margin of 30.6 percentage points. Thus, the Top1–Top2 margin reflects the relative dominance of the leading predicted class but should not be interpreted as a calibrated indicator of diagnostic correctness. Majority vote is a recognized baseline WSI aggregation method; however, the observed class-mixture highlights why more adaptive aggregation (e.g., attention-based pooling) is increasingly used for slide-level inference (21).
The two majority vote inference modes (attention-guided inference and attention-free whole slide inference) map to different clinical roles. Attention-guided inference simulates an AI “co-pilot”: the clinician chooses representative ROIs and the model provides a rapid, standardized second opinion on material already judged relevant. Its strengths are high decisiveness, shorter time, lower computational burden and clearer attribution of errors to tile content; its limitations are operator dependence, potential sampling bias, and the possibility of missing focal components outside the selected ROI. Attention-free whole-slide inference is a stricter test of robustness and better reflects autonomous screening/triage; its strengths are comprehensive coverage and spatial prediction mapping, while its limitations include sensitivity to background prevalence and class mixture, slower speed, and higher compute (21).
Despite the promising results, our study has limitations that warrant discussion. The dataset size remains a weakness, which is typical of veterinary studies. Our training set may not capture the full morphologic diversity present even within each tumor type. Expanding the dataset with additional cases, especially from different institutions, is a clear next step. Lack of such external validation is a common weakness in many inaugural AI studies, and we acknowledge that our results represent performance under some controlled conditions.
The case-selection criteria impose an additional limitation. Because poorly differentiated tumors and generally poor-quality preparations were excluded, the reported estimates are conditional on slides with typical morphology and adequate diagnostic material. The present cohort cannot quantify the magnitude of performance loss in unselected practice. Qualitatively, lower cellularity, poor preservation, blood or inflammatory contamination, mixed neoplastic populations, and loss of lineage-specific morphology are expected to reduce Top1 dominance and increase confusion among overlapping classes. A clinically representative validation should therefore enroll consecutive cases, retain indeterminate and non-diagnostic samples, pre-specify specimen-quality and diagnostic-difficulty strata, and report accuracy, calibration, and abstention/referral rates within each stratum and across external laboratories. Until such testing is completed, these results should not be extrapolated to diagnostically ambiguous routine submissions.
Another limitation is the scope of tumor classes addressed. We focused on seven well-defined tumor types; real-world cytology practice, however, must also contend with samples including less common neoplasms. Performance in poorly differentiated, low-cellularity, or otherwise diagnostically difficult routine samples cannot be inferred from the present curated cohort.
To our knowledge, no prior study has attempted multi-class CNN classification across a spectrum of different tumor types in veterinary cytology WSIs. This represents an encouraging step towards the development of AI assisted cytological diagnosis, although a larger, prospective and external dataset should be tested with different architectures to confirm the clinical applicability of our approach.
兽研