基于大语言模型Function-calling架构的中医舌象辅助问诊系统

施浩然 ,  王月明 ,  石磊 ,  王瑾 ,  谷宇 ,  李琦

科学技术与工程 ›› 2026, Vol. 26 ›› Issue (13) :5583-5593

PDF (12495KB)
科学技术与工程 ›› 2026, Vol. 26 ›› Issue (13) :5583-5593 DOI: 10.12404/j.issn.1671-1815.2503704
自动化技术、计算机技术

基于大语言模型Function-calling架构的中医舌象辅助问诊系统

作者信息 +

Auxiliary Tongue Diagnosis System for Traditional Chinese Medicine Based on Large Language Model Function-calling Architecture

Author information +
文章历史 +

摘要

针对大语言模型缺乏视觉能力及现有多模态大模型在中医舌象分析中准确率不足的问题,构建了一个中医舌象辅助问诊系统,实现舌象的自动分类与中医辅助诊疗方案的生成。在利用UNet进行舌象分割的基础上,使用TransNeXt主干网络构建舌象多标签分类系统,实现舌体分割与舌象多标签分类。进一步,结合舌象多标签分类系统与大语言模型,并基于微调后的Function-calling架构,实现了中医舌象辅助问诊系统。在舌象多标签分类系统的有效性验证实验中,UNet模型在舌象分割的平均精确度、平均召回率和平均交并比指标上表现较好,分别达到97.58%,98.61%和96.25%;基于TransNeXt主干网络开发的舌象多标签分类模型在舌象识别的子集准确率、精确度、召回率、F1方面表现更佳,分别达到75.69%、91.18%、91.41%、91.28%。在中医辅助诊疗方案的生成实验中,甄选出的最佳大语言模型相较于多模态大模型在Bleu-4、Rouge-1、Rouge-2、Rouge-L同样表现更佳,分别达到79.03%、82.46%、76.00%、86.46%。结合舌象多标签分类系统以及大语言模型构建的中医舌象辅助问诊系统能够辅助中医进行舌诊,为中医辅助诊断方案的生成提供技术支持。

Abstract

The lack of visual capability in large language models and the insufficient accuracy of existing multimodal models in traditional Chinese medicine (TCM) tongue-image analysis are identified as current challenges. To address these issues, a TCM tongue-image assisted consultation system was constructed, enabling automatic classification of tongue images and the generation of auxiliary diagnostic schemes. Based on UNet, tongue-image segmentation was performed, and a multi-label classification system was built using the TransNeXt backbone to achieve both tongue-body segmentation and multi-label classification. Furthermore, the classification system was integrated with a large language model through a fine-tuned function-calling framework, thereby realizing the TCM tongue-image assisted consultation system. In the validation experiments, the UNet model demonstrated favorable performance in tongue-image segmentation, with mean precision, recall, and intersection over union reaching 97.58%, 98.61%, and 96.25%, respectively. The multi-label classification model developed with the TransNeXt backbone exhibited superior performance in subset accuracy, precision, recall, and F1, achieving 75.69%, 91.18%, 91.41%, and 91.28%, respectively. In the generation of TCM auxiliary diagnostic schemes, the best-performing large language model outperforms the multimodal model in Bleu-4, Rouge-1, Rouge-2, and Rouge-L metrics, achieving 79.03%, 82.46%, 76.00%, and 86.46%, respectively. The traditional Chinese medicine tongue image auxiliary diagnosis system constructed by combining the tongue image multi label classification system and the large language model can assist traditional Chinese medicine in tongue diagnosis, providing technical support for the generation of traditional Chinese medicine auxiliary diagnosis schemes.

Graphical abstract

关键词

大语言模型 / Function-calling架构 / 舌象识别 / 中医知识问答

Key words

large language model / Function-calling architecture / tongue image recognition / TCM knowledge Q & A

引用本文

引用格式 ▾
施浩然, 王月明, 石磊, 王瑾, 谷宇, 李琦. 基于大语言模型Function-calling架构的中医舌象辅助问诊系统[J]. 科学技术与工程, 2026, 26(13): 5583-5593 DOI:10.12404/j.issn.1671-1815.2503704
SHI Hao-ran, WANG Yue-ming, SHI Lei, WANG Jin, GU Yu, LI Qi. Auxiliary Tongue Diagnosis System for Traditional Chinese Medicine Based on Large Language Model Function-calling Architecture[J]. Science Technology and Engineering, 2026, 26(13): 5583-5593 DOI:10.12404/j.issn.1671-1815.2503704

登录浏览全文

4963

注册一个新账户 忘记密码

中医舌诊作为“望诊”之首,舌象特征与人体脏腑功能、气血津液状态存在显著相关性,在中医诊断疾病、判断病情、辨证施治中具有独特的临床价值[1-2]。例如慢性肾脏病患者常表现出舌苔厚重、边缘齿痕和多发红点等血虚瘀阻特征[3],而胃阴虚与胃络瘀滞则分别表现为裂纹紫舌与黄苔干燥[4]。此外,舌苔的脱落和油腻程度的变化也是特定疾病的重要标志[5],对于新冠病毒感染者,舌苔油腻程度与病情严重度显著相关,是评估病情的关键指标[6]。
随着社会健康意识的提升和人口老龄化进程的加速,中医调理需求呈现爆发式增长[7-8],这一现象对医疗体系造成压力。青年医生群体因临床经验的积累周期过长,无法满足不断扩大的医患需求。此外,偏远地区医疗资源分配失衡,导致医患供需矛盾在偏远区域尤为突出。在此背景下,构建中医舌象辅助问诊系统,不仅能够通过智能化的辅助诊疗技术缩短青年医生的临床经验培养周期,其中蕴含的诊疗方案和诊疗逻辑还可以为青年医生提供宝贵的学习资源和实践指导。有助于推动中医辅助诊疗技术的普及与发展,促进中医的对外传播。
目前,随着深度学习技术的迅速发展和中医服务普及率的不断提升,基于深度学习的舌象识别技术为解决舌诊中“一舌多病”的复杂情况提供了新的思路[9-10]。近年来,研究者尝试将SwinTransformer的注意力机制、多分支网络的度量学习方法[11]等深度学习技术引入舌象识别,并构建专业舌象数据集以应对“一舌多病”的复杂诊断需求[12-14],但现有方法仍难以全面融合中医理论与视觉特征。与此同时,大语言模型和多模态大模型作为人工智能领域的前沿技术,在自然语言处理和视觉分析等方面展现出强大的能力[15-16]。例如,得克萨斯大学西南医学中心使用10万条真实的医患互动数据对LLaMA模型进行微调,并结合医学知识开发出了医疗助手ChatDoctor[17]。Wang等[18]利用中医领域问答知识和强化学习技术,同样对LLaMA模型进行微调,推出首个基于知识指令数据调整的中文生物医学大语言模型。微软使用GPT-4从图题数据中自我指导生成开放性指令遵循数据,并以此进行端到端的训练以开发生物医学多模态对话助手LLaVA-Med[19]。谷歌采用了自训练和搜索工具使用相结合的策略,通过在大规模医学问答数据进行微调训练,推出了Med-Gemini医学多模态大模型,为医疗决策提供更专业的支持[20]。如何有效结合医学大模型与传统中医理论,特别是在提升视觉特征识别精度的同时确保中医诊断的准确性,成为当前亟待探索的方向。
因此,面向中医辅助诊疗服务日益增长的临床需求,针对大语言模型缺乏视觉能力及现有多模态大模型在中医舌象分析中准确率不足的问题,现基于构建的舌图像多标签数据集、舌图像分割数据集、Function-calling功能微调数据集和舌象多模态数据集,结合舌象多标签分类系统以及大语言模型,实现中医舌象辅助问诊系统。为实现中医舌象辅助问诊系统,构建300张舌图像分割数据集、9 132幅舌图像多标签数据集、9 132条Function-calling功能微调数据集和9 132组舌象多模态数据集。对比多种分割模型和分类主干网络,选取最适合舌象分割和舌象诊断的模型构建舌象多标签分类系统,实现舌体分割与舌象多标签分类。对比多种大语言模型,从中选择性能最优的大语言模型作为中医舌象辅助问诊系统的基座大模型。引入并微调大语言模型的Function-calling架构,进一步与多模态大语言模型进行对比,确认Function-calling架构在构建中医舌象辅助问诊模型中的优越性和可行性。研究不仅为舌象多标签分类领域提供新的思路,同时有助于推动大语言模型在中医领域的应用和发展。

1 数据与材料

1.1 舌图像分割数据集

为最小化背景对舌象识别的影响,排除人脸面部多余元素的干扰,利用Github上的300张舌部图像,通过Labelme软件标注的舌体区域如图1所示。

1.2 舌象多标签分类数据集

中医舌诊是一项传统诊断技术,其准确性高度依赖于在恒定光源下通过肉眼对舌头的直接观察。这一过程易受多种外因干扰,比如食物残留可能导致遮挡或染色,以及有效可视舌面的大小变化等。目前,还没有公开的、包含多元化标签的舌象分类数据库,为此,需要创建一个新的多标签分类的舌图像数据集。

依托于中医诊所提供的9 132幅舌部图像,并由中医专家依据舌质和舌苔两种特征的7种典型舌象进行标注,包括齿痕舌、裂纹舌、瘀点舌、剥苔舌、腻苔舌、薄苔舌及焦苔舌。每幅图像根据其表现出来的特征被赋予一个七位的标签编码,若图像展示了特定的舌象特征,则对应的标签值设为1;反之则设为0,如表1所示。

1.3 Function-calling架构微调数据集

当前大语言模型虽然在通用领域展现出较强的泛化能力,但在中医舌诊垂直领域仍存在专业性不足的局限性。因此,通过微调Function-calling数据集进行定向训练,可以让大语言模型更加专注于解决具体问题,提供更精确的输出。Function-calling架构微调数据集是基于舌象多标签数据集构建的,每张舌图像都对应着具有Function-calling功能的文本段。Function-calling架构微调数据集样例如表2所示。

1.4 舌象多模态数据集

多模态大模型采用对比学习方法在处理多模态数据方面表现优异,并能够从多个角度提供辅助诊断信息,但在具体的舌象分类任务中,通过Function-calling调用专门训练的视觉网络更能保证对舌象细节的高度敏感性和分类准确性。为了验证这一论点,构建一个多模态数据集来进行对比实验。该舌象多模态数据集依然基于舌象多标签数据集构建,并移除Function-calling架构的相关内容,同时引入图片的标记token。舌象多模态数据集样例如表3所示。

2 中医舌象辅助问诊系统架构方法

为实现中医舌象辅助问诊系统,以下将分别从总体框架结构、舌象多标签分类系统以及大模型Function-calling架构来具体阐述中医智能舌诊系统的架构方法。

2.1 总体框架结构

针对不断增长的中医辅助诊疗服务的临床需求,提出的中医舌象辅助问诊系统如图2所示,包括3个阶段。

在第一阶段中,为实现中医舌象辅助问诊系统“问诊”的交互逻辑,系统将接收患者的舌图像及病症描述。利用大语言模型对输入文本进行上下文分析,识别患者需求。

在第二阶段中,为消除如嘴唇、背景等非舌体区域对舌象分类模型的干扰,通过对比多种分割模型,选择最佳模型从复杂背景中分离出舌头区域。在分割好的舌图像上对比多种分类模型,选取最优主干网络构建舌象多标签分类系统。

在第三阶段中,为实现中医辅助诊疗方案的生成,引入大语言模型的Function-calling架构,通过调用舌象多标签分类系统对舌象进行分类,并根据舌象分类结果和中医理论知识生成辅助诊疗方案。输出内容涵盖舌象分类结果、舌象对应的中医证候、调理之宜、调理之忌、食疗推荐以及针灸穴位调理方案。

2.2 舌象多标签分类系统

在第二阶段中,舌象作为中医诊断的重要依据,其分类不仅涉及单一病症的诊断,更需要同时考虑多种病症的影响。鉴于“一舌多病”这一复杂现象,为更好地识别舌体病灶,在利用UNet模型进行舌象分割的基础上,开发了舌象多标签分类系统。现将从舌体分割模型,舌象多标签分类网络模型两个部分对舌象多标签分类系统进行阐述。

2.2.1 舌体分割模型

为消除非舌体区域对舌象分类模型的干扰,需要使用舌象分割网络进行分割。对比Deeplab-V3+[21]、RDRNet[22]、SCTNet[23]、UNet[24]、HRNet[25]5种分割模型,UNet作为一种经典的医学图像分割网络,被广泛应用于各种医学场景。UNet模型结构是采用U形结构的编码器和解码器。编码器负责提取图像的深层特征,解码器逐步恢复图像的空间分辨率,并通过跳跃连接融合浅层细节信息,提高分割精度。

2.2.2 舌象多标签分类网络模型

为模拟中医舌诊过程中对舌象细节的判断,并赋予网络以类似医生综合分析多种舌象病灶的能力,需训练主干网络模型来学习舌体病灶的变化特征。针对10种主流深度学习模型进行对比研究,具体包括MambaOut[26]、Repvit[27]、RDNet[28]、Resnet50[29]、SwinTransformer[30]、SwinTransformer-v2[31]、ConvNeXt[32]、InceptionNeXt[33]、UniRepLK-Net[34]以及TransNeXt[35]。将舌象病灶定义为一个标签集$\{{\mathit{y}}_{1},{\mathit{y}}_{2},\dots,{\mathit{y}}_{\mathit{n}}\}$,其中yi表示第i个病灶,则模型的目标是通过优化二元交叉熵损失函数来最小化预测标签与真实标签之间的差异,表达式为

$\mathit{L}(\stackrel{\wedge }{\mathit{y}},\mathit{y})=-\sum _{\mathit{i}=1}^{\mathit{n}}[{\mathit{y}}_{\mathit{i}}\mathit{l}\mathit{n}{\stackrel{\wedge }{\mathit{y}}}_{\mathit{i}}+(1-{\mathit{y}}_{\mathit{i}})\mathit{l}\mathit{n}(1-{\stackrel{\wedge }{\mathit{y}}}_{\mathit{i}})]$

式(1)中:${\stackrel{\wedge }{\mathit{y}}}_{\mathit{i}}$为模型预测的第i个标签的概率;yi为真实标签。

2.3 大语言模型Function-calling架构

大模型在自然语言处理领域展现出卓越性能[36],但其在医学影像数据的处理效能仍低于基于深度学习的视觉模型。这一差距主要源于模型训练过程中面临的不同模态数据表征困难、计算资源消耗以及长周期训练的需求[37]。引入Function-calling架构使得大模型能够调用视觉模型,理解患者的病症描述并生成相应的辅助诊疗方案。Function-calling架构如图3所示,大语言模型基于舌诊的文本描述能够生成包含工具模型函数名称、功能描述、所需输入和输出描述的Json指令集,并触发注册在函数库中的视觉处理模型对图像进行处理,提取并分析舌体区域图像。基于舌象分类系统的结果,大语言模型能够理解患者的病症描述,并生成相应的辅助诊疗方案。

2.4 实验评估与实验配置

2.4.1 评估指标

为评估舌象多标签分类系统的有效性和中医辅助诊疗方案生成的准确性,采用9个评价指标进行评估。

对于舌象多标签分类系统的有效性验证实验,分别采用平均交并比(mIoU)、精确度(P)、召回率(R)、F1以及子集准确率(SA)来评价。

$\mathit{m}\mathit{I}\mathit{o}\mathit{U}=\frac{1}{\mathit{C}}\sum _{\mathit{i}=1}^{\mathit{C}}\frac{\mathit{T}{\mathit{P}}_{\mathit{i}}}{\mathit{T}{\mathit{P}}_{\mathit{i}}+\mathit{F}{\mathit{P}}_{\mathit{i}}+\mathit{F}{\mathit{N}}_{\mathit{i}}}\times 100\mathit{\%}$
$\mathit{P}=\frac{\mathit{T}\mathit{P}}{\mathit{T}\mathit{P}+\mathit{F}\mathit{P}}\times 100\mathit{\%}$
$\mathit{R}=\frac{\mathit{T}\mathit{P}}{\mathit{T}\mathit{P}+\mathit{F}\mathit{N}}\times 100\mathit{\%}$
$\mathit{S}\mathit{A}=\frac{1}{\left|\mathit{G}\right|}\sum _{\mathit{i}=1}^{\left|\mathit{G}\right|}\mathit{H}({\mathit{y}}_{\mathit{i}}={\stackrel{\wedge }{\mathit{y}}}_{\mathit{i}})\times 100\mathit{\%}$
${\mathit{F}}_{1}=\frac{2\mathit{T}\mathit{P}}{2\mathit{T}\mathit{P}+\mathit{F}\mathit{P}+\mathit{F}\mathit{N}}\times 100\mathit{\%}$

式中:C为舌象类别数;TP为真正类的样本数;FN为假负类的样本数;FP为假正类的样本数;$\left|\mathit{G}\right|$为样本数;yi为第i个类的真实值;${\stackrel{\wedge }{\mathit{y}}}_{\mathit{i}}$为第i类的预测值;H(·)为多标签分类。

对于中医辅助诊疗方案生成的评估,分别采用BLEU-4(B-4)、ROUGE-1(R-1)、ROUGE-2(R-2)以及ROUGE-L(R-L)来评价。

$\mathit{B}-4=\mathit{B}\mathit{P}\mathit{e}\mathit{x}\mathit{p}\left(\sum _{\mathit{n}=1}^{4}{\mathit{w}}_{\mathit{n}}\mathit{l}\mathit{n}{\mathit{p}}_{\mathit{n}}\right)$
$\mathit{R}-1=\frac{{\sum }_{\mathit{w}\in \mathit{m}\mathit{a}\mathit{t}\mathit{c}\mathit{h}\mathit{e}\mathit{d}\mathit{ }\mathit{w}\mathit{o}\mathit{r}\mathit{d}\mathit{s}}^{}\mathit{c}\mathit{o}\mathit{u}\mathit{n}\mathit{t}\left(\mathit{w}\right)}{{\sum }_{\mathit{w}\in \mathit{r}\mathit{e}\mathit{f}\mathit{e}\mathit{r}\mathit{e}\mathit{n}\mathit{c}\mathit{e}\mathit{ }\mathit{w}\mathit{o}\mathit{r}\mathit{d}\mathit{s}}^{}\mathit{c}\mathit{o}\mathit{u}\mathit{n}\mathit{t}\left(\mathit{w}\right)}$
$\mathit{R}-2=\frac{{\sum }_{\mathit{b}\in \mathit{m}\mathit{a}\mathit{t}\mathit{c}\mathit{h}\mathit{e}\mathit{d}\mathit{ }\mathit{b}\mathit{i}\mathit{g}\mathit{r}\mathit{a}\mathit{m}\mathit{s}}^{}\mathit{c}\mathit{o}\mathit{u}\mathit{n}\mathit{t}\left(\mathit{b}\right)}{{\sum }_{\mathit{b}\in \mathit{r}\mathit{e}\mathit{f}\mathit{e}\mathit{r}\mathit{e}\mathit{n}\mathit{c}\mathit{e}\mathit{ }\mathit{b}\mathit{i}\mathit{g}\mathit{r}\mathit{a}\mathit{m}\mathit{s}}^{}\mathit{c}\mathit{o}\mathit{u}\mathit{n}\mathit{t}\left(\mathit{b}\right)}$
$\mathit{R}-\mathit{L}=\frac{\mathit{L}\mathit{C}\mathit{S}(\mathit{c}\mathit{a}\mathit{n}\mathit{d}\mathit{i}\mathit{d}\mathit{a}\mathit{t}\mathit{e},\mathit{ }\mathit{r}\mathit{e}\mathit{f}\mathit{e}\mathit{r}\mathit{e}\mathit{n}\mathit{c}\mathit{e})}{\mathit{l}\mathit{e}\mathit{n}\mathit{g}\mathit{t}\mathit{h}\mathit{ }\mathit{o}\mathit{f}\mathit{ }\mathit{r}\mathit{e}\mathit{f}\mathit{e}\mathit{r}\mathit{e}\mathit{n}\mathit{c}\mathit{e}}$

式中:BP为简短惩罚项,用于抑制过短生成结果对B-4分数的虚高影响;pn为连续n个词所组成序列n-gram的精度;wn为每个n-gram的权重;matched words为候选摘要和参考摘要中共有的单词;count(w)为某个单词的出现次数;matched bigrams为候选摘要和参考摘要中共有的二元组;count(b)为某个二元组出现的次数;LCS(candidate, reference)为候选摘要和参考摘要之间最长公共子序列的长度;length of reference为参考摘要的长度。

2.4.2 实验配置

为确保实验的公正性,所有的实验配置与环境均按照表4所示进行设置。在多标签舌象分类网络的训练阶段,采用了随机梯度下降方法结合指数递减的学习率策略来训练模型,初始学习率设定为1×10-5,权重衰减设为1×10-4,动量参数为0.9。对于大模型的微调训练,统一在LLaMA-Factory框架[38]内执行。

3 实验过程与结果

为验证所提出的中医舌象辅助问诊系统的有效性,基于构建的舌图像分割数据集、舌图像多标签数据集、Function-calling架构微调数据集和舌象多模态数据集进行了两类实验,分别是舌象多标签分类系统的有效性验证实验和中医辅助诊疗方案生成实验。其中,舌象多标签分类系统的有效性验证实验包括两个实验:舌图像分割实验、舌象多标签分类模型的对比实验。中医辅助诊疗方案生成实验包括两个实验:基于Function-calling架构的大语言模型对比实验以及基于Function-calling架构的大语言模型与多模态大模型的对比实验。

3.1 舌象多标签分类系统有效性验证实验

3.1.1 舌图像分割实验

为最小化背景对舌象识别的影响,排除人脸面部多余元素的干扰,在构建的300张舌分割实验数据集上进行舌图像分割实验。该实验对比5种深度学习模型进行训练,选择最佳模型分离舌头与背景区域。

舌图像分割实验的实验结果如图4所示,展示了不同模型在平均交并比(mIoU)、精确度(P)、召回率(R)指标上的表现。UNet在精确度和召回率指标上表现较佳,达到97.58%和98.61%。尽管其平均交并比略逊于HRNet,但综合整体性能,UNet依然优于其他模型。因此,训练完成的UNet在舌体分割任务中表现较佳,能够高效地完成舌体与背景的分离工作。

3.1.2 舌象多标签分类模型的对比实验

为甄选出最适合用于识别舌部病灶的主干网络,在构建的包含9 132幅多标签舌图像数据集上进行了10种深度学习架构的对比实验,这些架构将作为提取舌象病灶特征的前置网络,并被集成到一个配备有全连接层的框架中,从而构成一个完整的多标签分类网络。

舌象多标签分类的主干网络对比实验结果如表5所示。TransNeXt在综合性能上表现最佳,其子集准确率、精确度、召回率、F1这4个指标上分别达到75.69%、91.18%、91.41%、91.28%,超越其他模型。Repvit在舌象识别的各项指标上表现较弱,特别是SA仅达到61.67%,这可能是因为其简化的设计以适应移动设备的算力。相比之下,Resnet50、MambaOut、Swintransformer以及InceptionNeXt在舌象病灶特征提取方面表现平稳。此外,SwinTran-sformer V2、ConvNeXt、RDVit和UniRepLKNet性能相近,但相较于TransNeXt仍有差距。

为进一步优选舌象分类模型,通过受试者操作特征(receiver operating characteristics,ROC)和mAP的雷达图来分析和对比。不同网络的ROC曲线如图5所示,TransNeXt的ROC曲线所围面积,即曲线下的面积(area under curve,AUC)最高,达到0.962 6,这表明TransNeXt能够较好地区分正负样本。此外,不同网络的mAP对比如图6所示,TransNeXt的mAP为92.64%,同样优于其他模型,说明TransNeXt在舌象各类别的分类表现也较为均衡。因此,TransNeXt凭借其在整体评估指标中的稳定性优势,能够较好地解决“一舌多病”情况下的舌象多标签分类问题,应作为舌象病灶特征提取任务的首选主干网络。

3.2 中医辅助诊疗方案生成实验

3.2.1 基于Function-calling架构的大语言模型对比实验

为筛选出最适合作为Function-calling架构的基座大语言模型,通过在构建的9 132条Function-calling功能微调数据集上进行7种大语言模型的微调对比实验,包括Qwen2.5-3B、Qwen2.5-7B[39]、Baichuan2-7B-Chat[40]、LLaMA-3-8B[41]、Internlm2-chat-7B[42]、Internlm3-chat-8B、DeepSeek-LLM-base[43]。

在评估不同大语言模型对Function-calling架构的适应性时,依据定义的文本生成评估指标,进行对比实验。基于Function-calling架构的大语言模型对比实验具体结果如表6所示,展示了各模型在此架构下的性能表现。

根据具体实验结果来看,Internlm2-chat-7B和Internlm3-chat-8B在各项评估指标中均表现卓越,各项指标均领先其他大语言模型。作为拥有同等参数量的Qwen2.5-7B、Baichuan2-7B-Chat和Deepseek-LLM-base在R-1(82.27%、81.94%、81.72%)和R-L(85.42%、85.30%、84.94%)指标上表现较好,能够提供较为精准的内容覆盖和较强的连贯性。然而,这三种模型的B-4得分仅为78.82%、78.71%和78.37%,可能反映其生成文本的多样性和长序列生成的能力相较Internlm系列稍弱。Qwen2.5-3B、LLaMA-3-8B的表现相对平稳,两种模型在大部分指标上得分都低于其他模型,但仍维持在较为合适的范围内,说明这两种模型在一些较为简单的任务中仍能保持一定的竞争力。

此外,除了要考虑文本生成的准确率,大语言模型同时也要兼顾推理效率。如图7所示,在保证推理文本生成质量的同时,Internlm2-chat-7B在推理效率方面表现也相对出色,在样本吞吐率达到0.261个/s,每秒推理步数达到0.066步/s,远高于Baichuan2-7B-Chat,甚至在推理效率上超过参数量更大的 Internlm3-Chat-8B和LLaMA-3-8B。虽然Qwen2.5-3B凭借其参数量最小的优势,推理效率相对更高,但是其中医辅助诊疗方案文本生成的准确率略逊于其他模型,因此无法满足专业医疗文本的质量需求。

3.2.2 基于Function-calling架构的大语言模型与多模态大模型对比实验

为验证基于Function-calling架构的大语言模型相较于多模态大模型更适合构建中医舌象辅助问诊系统,对构建的9 132组舌象多模态数据集进行对比实验。多模态大模型包括Pailgemma系列的Pailgemma-3B[44]和Pailgemma2-3B[45],千问系列[46]的Qwen2-VL-2B、Qwen2-VL-7B、Qwen2.5-VL-3B和Qwen2.5-VL-7B,LLaVA系列的LLaVA-1.5-7B[47]和LLaVA-next-7B[48],以及Yi系列的Yi-VL-6B[49]。Function-calling架构的大语言模型是甄选出的最佳Function-calling功能模型Internlm2-chat-7B。

对多模态大模型进行的评估仍是依据定义的文本生成评估指标。大语言模型Function-calling与多模态大模型的对比实验结果如表7所示,展示了各模型在此架构下的性能表现。

根据实验结果看,Internlm2-chat-7B大语言模型通过Function-calling功能对舌象多标签分类网络进行调用,并根据分类结果生成相应中医辅助诊疗方案效果明显优于其他多模态大模型。在B-4、R-1、R-2和R-L四项指标上都处于领先地位,达到79.03%、82.46%、76.00%、86.46%,这表明Function-calling模型生成的文本与参考文本之间的匹配程度更高,且在生成文本的结构上有较高的相似性。LLaVA-next-7B多模态大模型,虽然在B-4和R-L两个最关键的指标上与其余多模态大模型拉开了差距,分别达到67.89%和77.15%,但与使用Function-calling架构的Internlm2-chat-7B仍存在相当大的差距。Pailgemma系列的两个多模态大模型在整个任务中表现相对较差,在所有评估指标上的得分均为最低水平。千问、Yi等中型模型表现中等,但同样无法满足临床需求。

基于Function-calling架构的大语言模型与多模态大模型的对比实验结果,中医辅助诊疗方案的生成不仅依赖于模型的推理能力,还需要专业的中医领域内知识。多模态大模型通常依赖于复杂的端到端学习方法,从图像直接生成文本,缺乏对任务细节的把控,导致在一些专业性较强的应用中,生成结果可能出现不符合实际需求的情况。而基于Function-calling架构的大语言模型通过引入明确的功能调用机制,使得模型能够在需要执行舌象分类这种特定任务时调用预定义的子模块,极大地提高了模型在特定任务上的准确性。

4 系统界面及功能

中医舌象辅助问诊系统的界面设计利用Web技术实现,确保病患方便使用。系统通过收集用户的舌象图片及其病症描述,结合舌象多标签分类系统和大语言模型,实现中医舌象诊断与分析,并生成相应的辅助诊疗方案。系统界面如图8所示,病患首先上传舌象图片并对病症进行提问,随后中医舌象辅助问诊系统基于所提供的信息,自动进行舌象分析诊断,最终为病患提供中医辅助诊疗方案。

此外该系统同时嵌入了大语言模型为核心的人工智能中医问询模块,病患可通过网页端的AI中医模块直接与AI中医进行交互,实现中医辅助诊断功能。

5 结论

针对大语言模型缺乏视觉感知能力,以及现有多模态大模型在中医舌象分析任务中准确率不足的问题,结合当前中医调理需求持续增长的现实背景,以及青年中医医师临床经验积累周期较长、难以满足日益增长的诊疗服务需求的挑战,构建了中医舌象辅助问诊系统。

(1)基于此背景,针对舌象多标签分类任务,在利用UNet模型进行舌象分割的基础上,对比多种模型选择最佳网络架构实现舌象多标签分类。

(2)针对中医辅助诊疗方案生成的任务,通过结合舌象多标签分类系统与大语言模型,基于微调后的大语言模型Function-calling功能,实现了中医舌象辅助问诊系统。

在所构建的舌图像多标签数据集、舌图像分割数据集、Function-calling功能微调数据集和舌象多模态数据集进行实验验证,实现的中医舌象辅助问诊系统能够辅助中医进行舌诊,为中医辅助诊断方案的生成提供技术支持。未来工作中,如何融合大语言模型或多模态大模型实现中医“四诊合参”的智能化分析与推理,将是下一步的研究重点。

参考文献

[1]

李凯欣, 阎小燕. 中医望诊临床应用研究进展[J]. 中医临床研究, 2023, 15(13): 70-73.

[2]

Li Kaixin, Yan Xiaoyan. A review on the clinical application of TCM inspection[J]. Clinical Journal of Chinese Medicine, 2023, 15(13): 70-73.

[3]

张冬, 庞稳泰, 王可仪, 等. 舌诊客观化在中医药临床诊断和疗效评价中应用与价值[J]. 中医药临床杂志, 2024, 36(6): 1003-1007.

[4]

Zhang Dong, Pang Wentai, Wang Keyi, et al. The application and value of objectification of tongue diagnosis in clinical diagnosis and efficacy evaluation of traditional Chinese medicine[J]. Clinical Journal of Traditional Chinese Medicine, 2024, 36(6): 1003-1007.

[5]

Chung C J, Wu C H, Hu W L, et al. Tongue diagnosis index of chronic kidney disease[J]. Biomedical Journal, 2023, 46(1): 170-178.

[6]

Chen L, Cai J. A survey on TCM tongue diagnosis based on data mining[C]// International Conference on Computational Intelligence and Applications (ICCIA). Nanjing: ICCIA, 2022: 48-51.

[7]

倪喆鑫, 沈磐, 沈歆, 等. 中医体质与肠道微生物群互作: 理论框架与未来展望[J]. 科学通报, 2025, 70(27): 4633-4637.

[8]

Ni Zhexin, Shen Pan, Shen Xin, et al. Interaction between traditional Chinese medicine constitution and gut microbiota: theoretical framework and future prospects[J]. Chinese Science Bulletin, 2025, 70(27): 4633-4637.

[9]

李楠, 郑关毅, 林侃. 奥密克戎变异株新型冠状病毒感染患者舌象特征与核酸循环阈值等实验室指标的关系[J]. 中医临床研究, 2024, 16(13): 109-116.

[10]

Li Nan, Zheng Guanyi, Lin Kan. Relationship between tongue characteristics and laboratory indicators including nucleic acid cycle threshold in Omicron variant COVID-19 patients[J]. Clinical Journal of Chinese Medicine, 2024, 16(13): 109-116.

[11]

王苗, 柴培培. 人口老龄化视域下我国中医药健康服务资源配置研究[J]. 中国卫生经济, 2023, 42(6): 56-62.

[12]

Wang Miao, Chai Peipei. Study on the allocation of TCM health service resources from the perspective of aging[J]. Chinese Health Economics, 2023, 42(6): 56-62.

[13]

秦翠英, 郭祖昌, 张杰, 等. 药食同源物质在主动健康和人口老龄化科技应对方面的应用展望[J]. 中国实验方剂学杂志, 2025, 31(15): 258-267.

[14]

Qin Cuiying, Guo Zuchang, Zhang Jie, et al. Application of medicinal and edible materials in proactive health and technological responses to population aging: a review[J]. Chinese Journal of Experimental Traditional Medical Formulae, 2025, 31(15): 258-267.

[15]

Ding Q. Classification techniques of tongue manifestation based on deep learning[C]// The Proceedings of the 2024 IEEE 3rd International Conference on Electrical Engineering. Changchun: IEEE, 2024: 802-810.

[16]

张世祺, 杨珺涵, 孙宇衡, 等. 移动终端中医舌象辅助诊断系统关键技术及整体架构[J]. 世界科学技术-中医药现代化, 2024, 26(6): 1618-1637.

[17]

Zhang Shiqi, Yang Junhan, Sun Yuheng, et al. The key technology and overall architecture of Chinese medicine tongue image diagnostic system for mobile terminal[J]. Modernization of Traditional Chinese Medicine and Materia Medica-World Science and Technology, 2024, 26(6): 1618-1637.

[18]

任思羽, 吴瑞, 罗庆林, 等. 基于度量学习的多分支舌象识别网络[J]. 中国医学物理学杂志, 2024, 41(4): 521-528.

[19]

Ren Siyu, Wu Rui, Luo Qinglin, et al. Metric learning based multi-branch network for tongue manifestation recognition[J]. Chinese Journal of Medical Physics, 2024, 41(4): 521-528.

[20]

Jiang T, Lu Z, Hu X, et al. Deep learning multi label tongue image analysis and its application in a population undergoing routine medical checkup[J]. Evidence-based Complementary and Alternative Medicine, 2022(1): 3384209.

[21]

Bhatnagar V, Bansod P P. Convolution neural network based multi-label disease detection using smartphone captured tongue images[J]. Applied Sciences, 2024, 14(10): 4208.

[22]

Zhang X, Shao J, Bian H, et al. TIM-Net: a multi-label classification network for TCM tongue images fusing global-local features[J]. IET Image Processing, 2024, 18(7): 1878-1891.

[23]

王帅, 何文春, 王甫棣, 等. 大语言模型融合知识图谱与向量检索的问答系统[J]. 科学技术与工程, 2024, 24(32): 13902-13910.

[24]

Wang Shuai, He Wenchun, Wang Fudi, et al. Question answering system based on large language model integrating knowledge graph and vector retrieval[J]. Science Technology and Engineering, 2024, 24(32): 13902-13910.

[25]

徐春, 苏明钰, 孙彬. 基于ChatGLM和提示微调的旅游知识图谱构建[J]. 科学技术与工程, 2024, 24(31): 13484-13492.

[26]

Xu Chun, Su Mingyu, Sun Bin. Tourism knowledge graph construction based on ChatGLM and prompt-tuning[J]. Science Technology and Engineering, 2024, 24(31): 13484-13492.

[27]

Li Y, Li Z, Zhang K, et al. Chatdoctor: a medical chat model fine-tuned on a large language model Meta-AI (LLaMA) using medical domain knowledge[J]. Cureus, 2023, 15(6): 40895.

[28]

Wang H, Liu C, Xi N, et al. Huatuo: tuning LLaMA model with Chinese medical knowledge[J]. arXiv prePrint, arXiv: 230406975, 2023.

[29]

Li C, Wong C, Zhang S, et al. LlaVA-Med: training a large language-and-vision assistant for biomedicine in one day[J]. Advances in Neural Information Processing Systems, 2023, 36: 28541-28564.

[30]

Saab K, Tu T, Weng W H, et al. Capabilities of gemini models in medicine[J]. arXiv prePrint, arXiv: 240418416, 2024.

[31]

Chen L-C, Zhu Y, Papandreou G, et al. Encoder-decoder with atrous separable convolution for semantic image segmentation[C]// Proceedings of the European Conference on Computer Vision (ECCV). Munich: ECCV, 2018: 801-818.

[32]

Yang G, Wang Y, Shi D. Reparameterizable dual-resolution network for real-time semantic segmentation[J]. arXiv prePrint, arXiv: 240612496, 2024.

[33]

Xu Z, Wu D, Yu C, et al. SCTNet: single-branch CNN with transformer semantic information for real-time segmentation[C]// Proceedings of the AAAI Conference on Artificial Intelligence. Vancouver: AAAI, 2024, 38(6): 6378-6386.

[34]

Ronneberger O, Fischer P, Brox T. U-net: convolutional networks for biomedical image segmentation[C]// Medical Image Computing and Computer-assisted Intervention-MICCAI. Munich: Medical Image Computing and Computer Assisted Intervention Society, 2015: 234-241.

[35]

Sun K, Xiao B, Liu D, et al. Deep high-resolution representation learning for human pose estimation[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach: IEEE, 2019: 5693-5703.

[36]

Yu W, Wang X. Mambaout: Do we really need mamba for vision?[C]// 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Nashville: IEEE, 2025: 4484-4496.

[37]

Wang A, Chen H, Lin Z, et al. Rep ViT: revisiting mobile CNN from ViT perspective[C]// The Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 15909-15920.

[38]

Kim D, Heo B, Han D. DenseNets reloaded: paradigm shift beyond ResNets and ViTs[C]// European Conference on Computer Vision. Milan: IEEE, 2024: 395-415.

[39]

He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2016: 770-778.

[40]

Liu Z, Lin Y, Cao Y, et al. Swin transformer: hierarchical vision transformer using shifted windows[C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Online, 2021: 10012-10022.

[41]

Liu Z, Hu H, Lin Y, et al. Swin Transformer v2: scaling up capacity and resolution[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. New Orleans: IEEE, 2022: 12009-12019.

[42]

Liu Z, Mao H, Wu C Y, et al. A ConvNet for the 2020s[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. New Orleans: IEEE, 2022: 11976-11986.

[43]

Yu W, Zhou P, Yan S, et al. Inceptionnext: when inception meets convnext[C]// Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. Seattle: IEEE, 2024: 5672-5683.

[44]

Ding X, Zhang Y, Ge Y, et al. UniRepLKNet: a universal perception large-kernel ConvNet for audio video point cloud time-series and image recognition[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 5513-5524.

[45]

Shi D. TransNeXt: robust foveal visual perception for vision transformers[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 17773-17783.

[46]

王耀祖, 李擎, 戴张杰, 等. 大语言模型研究现状与趋势[J]. 工程科学学报, 2024, 46(8): 1411-1425.

[47]

Wang Yaozu, Li Qing, Dai Zhangjie, et al. Current status and trends in large language modeling research[J]. Chinese Journal of Engineering, 2024, 46(8): 1411-1425.

[48]

刘静, 郭龙腾. GPT-4对多模态大模型在多模态理解、生成、交互上的启发[J]. 中国科学基金, 2023, 37(5): 793-802.

[49]

Liu Jing, Guo Longteng. Inspiration of GPT-4 on multimodal foundation models in multimodal understanding, generation, and interaction[J]. Bulletin of National Natural Science Foundation of China, 2023, 37(5): 793-802.

[50]

Zheng Y, Zhang R, Zhang J, et al. LlamaFactory: unified efficient fine-tuning of 100+ language models[J]. arXiv prePrint, arXiv: 240313372, 2024.

[51]

Yang A, Yang B, Zhang B, et al. Qwen2. 5 technical report[J]. arXiv prePrint, arXiv: 241215115, 2024.

[52]

Yang A, Xiao B, Wang B, et al. Baichuan 2: open large-scale language models[J]. arXiv prePrint, arXiv: 230910305, 2023.

[53]

Grattafiori A, Dubey A, Jauhri A, et al. The LLaMA 3 herd of models[J]. arXiv prePrint, arXiv: 240721783, 2024.

[54]

Cai Z, Cao M, Chen H, et al. InternLM2 technical report[J]. arXiv prePrint, arXiv: 240317297, 2024.

[55]

Bi X, Chen D, Chen G, et al. DeepSeek LLM: scaling open-source language models with longtermism[J]. arXiv prePrint, arXiv: 240102954, 2024.

[56]

Beyer L, Steiner A, Pinto A S, et al. Paligemma: a versatile 3b VLM for transfer[J]. arXiv prePrint, arXiv: 240707726, 2024.

[57]

Steiner A, Pinto A S, Tschannen M, et al. Paligemma 2: a family of versatile VLMs for transfer[J]. arXiv prePrint, arXiv: 241203555, 2024.

[58]

Wang P, Bai S, Tan S, et al. Qwen2-vl: enhancing vision-language model’s perception of the world at any resolution[J]. arXiv prePrint, arXiv: 240912191, 2024.

[59]

Liu H, Li C, Li Y, et al. Improved baselines with visual instruction tuning[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle, WA: IEEE, 2024: 26296-26306.

[60]

Li F, Zhang R, Zhang H, et al. LLaVA-NeXT-Interleave: tackling multi-image, video, and 3d in large multimodal models[J]. arXiv prePrint, arXiv: 240707895, 2024.

[61]

Young A, Chen B, Li C, et al. Yi: open foundation models by 01. AI[J]. arXiv prePrint, arXiv: 240304652, 2024.

基金资助

国家自然科学基金(62001255)

内蒙古自治区自然科学基金(2024MS06026)

PDF (12495KB)

41

访问

0

被引

详细

导航
相关文章

/

〈 〉