CN116844687A - Prescription recommendation method and system based on tongue images and knowledge patterns - Google Patents
Prescription recommendation method and system based on tongue images and knowledge patterns Download PDFInfo
- Publication number
- CN116844687A CN116844687A CN202310589649.0A CN202310589649A CN116844687A CN 116844687 A CN116844687 A CN 116844687A CN 202310589649 A CN202310589649 A CN 202310589649A CN 116844687 A CN116844687 A CN 116844687A
- Authority
- CN
- China
- Prior art keywords
- prescription
- tongue
- tongue image
- neural network
- network model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000003745 diagnosis Methods 0.000 claims abstract description 74
- 238000003062 neural network model Methods 0.000 claims abstract description 52
- 238000012549 training Methods 0.000 claims abstract description 49
- 238000012360 testing method Methods 0.000 claims abstract description 42
- 239000003814 drug Substances 0.000 claims abstract description 23
- 238000007781 pre-processing Methods 0.000 claims abstract description 18
- 230000006870 function Effects 0.000 claims abstract description 11
- 230000004927 fusion Effects 0.000 claims description 34
- 239000000463 material Substances 0.000 claims description 17
- 238000004891 communication Methods 0.000 claims description 15
- 239000013598 vector Substances 0.000 claims description 15
- 238000010276 construction Methods 0.000 claims description 7
- 238000010606 normalization Methods 0.000 claims description 7
- 239000000654 additive Substances 0.000 claims description 6
- 230000000996 additive effect Effects 0.000 claims description 6
- 238000013499 data model Methods 0.000 claims description 5
- 238000013461 design Methods 0.000 claims description 5
- 230000008569 process Effects 0.000 claims description 5
- 238000005457 optimization Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 238000011478 gradient descent method Methods 0.000 claims description 3
- 230000003993 interaction Effects 0.000 claims description 3
- 239000004615 ingredient Substances 0.000 claims 1
- 239000011248 coating agent Substances 0.000 description 7
- 238000000576 coating method Methods 0.000 description 7
- 208000011580 syndromic disease Diseases 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000007721 medicinal effect Effects 0.000 description 6
- 201000010099 disease Diseases 0.000 description 4
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 4
- 238000007689 inspection Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 238000013480 data collection Methods 0.000 description 2
- 230000004069 differentiation Effects 0.000 description 2
- 229940079593 drug Drugs 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000011176 pooling Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 241000132012 Atractylodes Species 0.000 description 1
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 1
- 241000218671 Ephedra Species 0.000 description 1
- 235000006679 Mentha X verticillata Nutrition 0.000 description 1
- 235000002899 Mentha suaveolens Nutrition 0.000 description 1
- 235000001636 Mentha x rotundifolia Nutrition 0.000 description 1
- 206010037660 Pyrexia Diseases 0.000 description 1
- 208000031975 Yang Deficiency Diseases 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000003542 behavioural effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 210000005069 ears Anatomy 0.000 description 1
- 230000001815 facial effect Effects 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 210000003734 kidney Anatomy 0.000 description 1
- 210000004185 liver Anatomy 0.000 description 1
- 206010025482 malaise Diseases 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000000056 organ Anatomy 0.000 description 1
- 238000002559 palpation Methods 0.000 description 1
- 230000001575 pathological effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003014 reinforcing effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 210000000952 spleen Anatomy 0.000 description 1
- 210000002784 stomach Anatomy 0.000 description 1
- 208000024891 symptom Diseases 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 210000003462 vein Anatomy 0.000 description 1
Classifications
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H20/00—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
- G16H20/10—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to drugs or medications, e.g. for ensuring correct administration to patients
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/02—Knowledge representation; Symbolic representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H20/00—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
- G16H20/90—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to alternative medicines, e.g. homeopathy or oriental medicines
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H50/00—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
- G16H50/20—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- Public Health (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Epidemiology (AREA)
- Primary Health Care (AREA)
- Multimedia (AREA)
- Biomedical Technology (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Pathology (AREA)
- Chemical & Material Sciences (AREA)
- Alternative & Traditional Medicine (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Medicinal Chemistry (AREA)
- Computational Linguistics (AREA)
- Pharmacology & Pharmacy (AREA)
- Mathematical Physics (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical field
本发明涉及计算机图像识别和计算机视觉的技术领域,更具体的说是涉及一种基于舌像和知识图谱的处方推荐方法及系统。The present invention relates to the technical fields of computer image recognition and computer vision, and more specifically to a prescription recommendation method and system based on tongue images and knowledge maps.
背景技术Background technique
作为中医四诊“望、闻、问、切”之首,望诊是中医辨证论治的重要组成部分。望诊通过对面部、耳、舌等典型映射区域进行观察,依据这些体表特征判断相应脏器的健康情况,并诊断疾病。望诊主要关注面诊和舌诊。舌诊是医师通过观察舌体、舌质、舌苔、舌下脉络等舌象特征来判断人体健康状况的一种方法,其具有“观舌本可验机体阴阳虚实,审舌垢即知邪之寒热深浅”的特性,是中医辨证论治必不可少的参考依据,并且对临床用药有重要指导作用。As the first of the four diagnostics of traditional Chinese medicine (inspection, smelling, questioning, and palpation), inspection is an important part of syndrome differentiation and treatment in traditional Chinese medicine. Inspection is based on the observation of typical mapping areas such as the face, ears, and tongue, and based on these body surface characteristics, the health of the corresponding organs is judged and diseases are diagnosed. Inspection mainly focuses on facial examination and tongue examination. Tongue diagnosis is a method for doctors to judge the health status of the human body by observing the tongue body, tongue texture, tongue coating, sublingual veins and other tongue characteristics. The characteristics of "cold and heat, depth and lightness" are an indispensable reference for TCM syndrome differentiation and treatment, and have an important guiding role in clinical medication.
传统中医舌诊依赖于专家医生的知识和诊断技能,容易受到主观因素的影响,且面临着专家医生稀缺的压力。随着计算机科学与人工智能的高速发展,许多研究人员将人工智能与传统中医诊疗相结合,例如在舌诊方面,通过引入现代化计算机视觉技术,对舌苔图像中的信号加以提取,捕捉其特征信息,实现对于舌苔图像的处理和分析,来完成诊察等医学任务,甚至在某些特定任务上有着超过人类顶尖医师的水平。可以说,人工智能在中医各个领域的有效应用,能够大大提升中医诊疗效率,缓解医疗资源稀缺压力,进一步推进现代化中医诊疗。Traditional Chinese medicine tongue diagnosis relies on the knowledge and diagnostic skills of expert doctors, is easily affected by subjective factors, and faces the pressure of a scarcity of expert doctors. With the rapid development of computer science and artificial intelligence, many researchers have combined artificial intelligence with traditional Chinese medicine diagnosis and treatment. For example, in tongue diagnosis, they have introduced modern computer vision technology to extract signals from tongue coating images and capture their characteristic information. , realize the processing and analysis of tongue coating images to complete medical tasks such as diagnosis, and even surpass the level of top human doctors in some specific tasks. It can be said that the effective application of artificial intelligence in various fields of traditional Chinese medicine can greatly improve the efficiency of traditional Chinese medicine diagnosis and treatment, relieve the pressure of scarce medical resources, and further promote modern traditional Chinese medicine diagnosis and treatment.
推荐系统是计算机领域一个重要的研究方向,主要用来应对海量互联网数据带来的信息超载、数据噪声泛滥等问题。推荐系统实现了用户个性化推荐,它通过对用户行为兴趣的进行分析,再根据算法定制用户的推荐项目列表,达到信息筛选的效果。Recommendation systems are an important research direction in the computer field, mainly used to deal with problems such as information overload and data noise flooding caused by massive Internet data. The recommendation system realizes personalized recommendations for users. It analyzes the user's behavioral interests and then customizes the user's recommended item list based on the algorithm to achieve the effect of information screening.
近年来,结合信息融合、知识图谱等技术,来缓解推荐系统所面临的数据稀疏、关键信息缺失等问题的研究,也受到越来越多的关注。推荐系统的个性化定制特性,使得其可以作为开具处方任务上的一种解决方案。In recent years, research on combining information fusion, knowledge graph and other technologies to alleviate the problems of data sparsity and missing key information faced by recommendation systems has also received more and more attention. The personalized customization feature of the recommendation system makes it a solution for the task of prescribing.
因此,如何基于计算机视觉技术,根据舌像实现对处方的推荐,是本领域技术人员亟需解决的问题。Therefore, how to recommend prescriptions based on tongue images based on computer vision technology is an urgent problem that those skilled in the art need to solve.
发明内容Contents of the invention
有鉴于此,针对现有技术的不足,本发明提供了一种基于舌像和知识图谱的处方推荐方法及系统,能够根据舌像状况推荐相应的中医处方,为中医舌诊提供智能化辅助。In view of this, and in view of the shortcomings of the existing technology, the present invention provides a prescription recommendation method and system based on tongue images and knowledge maps, which can recommend corresponding TCM prescriptions based on tongue image conditions and provide intelligent assistance for TCM tongue diagnosis.
为了实现上述目的,本发明采用如下技术方案:In order to achieve the above objects, the present invention adopts the following technical solutions:
第一方面,本发明实施例提供一种基于舌像和知识图谱的处方推荐方法,包括以下步骤:In a first aspect, embodiments of the present invention provide a prescription recommendation method based on tongue images and knowledge maps, which includes the following steps:
构建舌像处方数据集,划分舌像处方训练集和测试集并进行预处理;Construct a tongue image prescription data set, divide the tongue image prescription training set and test set and perform preprocessing;
构建中医舌诊知识图谱,并进行知识表示学习;Construct a TCM tongue diagnosis knowledge graph and perform knowledge representation learning;
构建神经网络模型;所述神经网络模型包括:舌像特征模块、处方特征模块和处方推荐模块,用于提取舌像特征、处方特征;并融合第一多模态特征和第二多模态特征,得出处方推荐及得分;所述第一多模态特征为所述舌像特征与所述中医舌诊知识图谱中相对应节点的融合结果;所述第二多模态特征为所述处方特征与中医舌诊知识图谱中相对应节点的融合结果;Construct a neural network model; the neural network model includes: a tongue image feature module, a prescription feature module and a prescription recommendation module, used to extract tongue image features and prescription features; and fuse the first multimodal features and the second multimodal features , to obtain prescription recommendations and scores; the first multi-modal feature is the fusion result of the tongue image feature and the corresponding node in the TCM tongue diagnosis knowledge map; the second multi-modal feature is the prescription Fusion results of features and corresponding nodes in the TCM tongue diagnosis knowledge graph;
利用所述舌像处方训练集和所述中医舌诊知识图谱,对所述神经网络模型进行迭代训练,并利用舌像处方测试集进行测试,获得优神经网络模型;Using the tongue image prescription training set and the TCM tongue diagnosis knowledge map, the neural network model is iteratively trained, and the tongue image prescription test set is used for testing to obtain an optimal neural network model;
采用所述最优神经网络模型,对采集待处理的舌像进行识别,获得对应的推荐处方。The optimal neural network model is used to identify the collected tongue images to be processed and obtain the corresponding recommended prescription.
进一步地,所述舌像处方数据集,包括多张舌头图像以及相对应的处方信息;所述处方信息包括:药材和剂量信息。Further, the tongue image prescription data set includes multiple tongue images and corresponding prescription information; the prescription information includes: medicinal materials and dosage information.
进一步地,划分舌像处方训练集和测试集并进行预处理,包括:Further, divide the tongue image prescription training set and test set and perform preprocessing, including:
根据预设比例划分舌像处方训练集和舌像处方测试集;Divide the tongue image prescription training set and the tongue image prescription test set according to the preset ratio;
对所述舌像处方训练集的预处理为随机裁剪、大小缩放、随机水平垂直翻转和归一化操作;The preprocessing of the tongue image prescription training set includes random cropping, size scaling, random horizontal and vertical flipping and normalization operations;
对所述舌像处方测试集的预处理为大小缩放、居中裁剪和归一化操作。The preprocessing of the tongue image prescription test set includes size scaling, center cropping and normalization operations.
进一步地,构建中医舌诊知识图谱,并进行知识表示学习;包括:Further, construct a TCM tongue diagnosis knowledge graph and perform knowledge representation learning; including:
以医学资源数据库、中医医学文献以及医学百度百科作为中医舌诊知识图谱的数据来源;The medical resource database, TCM medical literature and medical Baidu Encyclopedia are used as the data sources of the TCM tongue diagnosis knowledge map;
采用自顶向下的构建方式,根据设计知识图谱顶层数据模式,从所述数据来源中抽取实体、关系和属性信息,获取三元组知识;Using a top-down construction method, based on the top-level data model of the design knowledge graph, entities, relationships and attribute information are extracted from the data sources to obtain triple knowledge;
通过图数据库Neo4j进行存储,完成中医舌诊知识图谱的构建,并进行知识表示学习。Through storage in the graph database Neo4j, the construction of the TCM tongue diagnosis knowledge graph is completed, and knowledge representation learning is performed.
进一步地,所述处方特征模块,输入为处方信息,转换为独热向量,经过全连接层降维,得到文本模态下的处方特征表示。Further, the prescription feature module inputs prescription information, converts it into a one-hot vector, and performs dimensionality reduction through a fully connected layer to obtain a prescription feature representation in text mode.
进一步地,所述处方推荐模块的处理过程包括:Further, the processing process of the prescription recommendation module includes:
将所述舌像特征与所述中医舌诊知识图谱中舌象节点特征两者采用相加操作融合后,形成舌象融合特征;The tongue image features and the tongue image node features in the TCM tongue diagnosis knowledge map are fused using an additive operation to form tongue image fusion features;
将所述处方特征与所述中医舌诊知识图谱中药材节点特征两者采用相加操作融合后,形成处方融合特征;After the prescription characteristics and the Chinese medicinal material node characteristics of the TCM tongue diagnosis knowledge map are fused using an additive operation, the prescription fusion characteristics are formed;
将所述舌象融合特征与处方融合特征标准化处理并经过拼接,输入到多层感知机学习两者之间的内在交互,输出模型所预测的推荐分数;根据推荐分数对不同处方进行降序排列,最终得到推荐处方及对应的推荐分数。The tongue image fusion features and prescription fusion features are standardized and spliced, input into a multi-layer perceptron machine to learn the internal interaction between the two, and output the recommendation scores predicted by the model; different prescriptions are arranged in descending order according to the recommendation scores. Finally, the recommended prescription and corresponding recommendation score are obtained.
进一步地,利用所述舌像处方训练集和所述中医舌诊知识图谱,对所述神经网络模型进行迭代训练;包括:Further, using the tongue image prescription training set and the TCM tongue diagnosis knowledge map, the neural network model is iteratively trained; including:
将所述舌像处方训练集中的舌像-处方对样本,及与所述中医舌诊知识图谱中对应的舌象节点特征、药材节点特征,共同作为训练样本数据对神经网络模型进行训练;The tongue image-prescription pair samples in the tongue image prescription training set, and the corresponding tongue image node features and medicinal material node features in the TCM tongue diagnosis knowledge map are used together as training sample data to train the neural network model;
采用交叉熵损失函数,优化算法采用随机梯度下降方法,多次迭代对神经网络模型件优化训练。The cross-entropy loss function is used, the optimization algorithm uses the stochastic gradient descent method, and the neural network model is optimized and trained multiple iterations.
第二方面,本发明实施例还提供一种基于舌像和知识图谱的处方推荐系统,包括:In a second aspect, embodiments of the present invention also provide a prescription recommendation system based on tongue images and knowledge graphs, including:
第一构建模块,用于构建舌像处方数据集,划分舌像处方训练集和测试集并进行预处理;The first building module is used to construct the tongue image prescription data set, divide the tongue image prescription training set and test set and perform preprocessing;
第二构建模块,用于构建中医舌诊知识图谱,并进行知识表示学习;The second building module is used to construct a TCM tongue diagnosis knowledge graph and perform knowledge representation learning;
第三构建模块,用于构建神经网络模型;所述神经网络模型包括:舌像特征模块、处方特征模块和处方推荐模块,用于提取舌像特征、处方特征;并融合第一多模态特征和第二多模态特征,得出处方推荐及得分;所述第一多模态特征为所述舌像特征与所述中医舌诊知识图谱中相对应节点的融合结果;所述第二多模态特征为所述处方特征与中医舌诊知识图谱中相对应节点的融合结果;The third building module is used to build a neural network model; the neural network model includes: a tongue image feature module, a prescription feature module and a prescription recommendation module, used to extract tongue image features and prescription features; and fuse the first multi-modal features and the second multi-modal feature to obtain prescription recommendations and scores; the first multi-modal feature is the fusion result of the tongue image feature and the corresponding node in the TCM tongue diagnosis knowledge graph; the second multi-modal feature The modal feature is the fusion result of the prescription feature and the corresponding node in the TCM tongue diagnosis knowledge graph;
训练测试模块,利用所述舌像处方训练集、测试集和所述中医舌诊知识图谱,对所述神经网络模型进行迭代训练及测试,得到最优的神经网络模型;The training and testing module uses the tongue image prescription training set, the test set and the TCM tongue diagnosis knowledge map to iteratively train and test the neural network model to obtain the optimal neural network model;
推荐模块,采用最优的神经网络模型,对采集待处理的舌像进行识别,获得对应的推荐处方。The recommendation module uses the optimal neural network model to identify the collected tongue images to be processed and obtain the corresponding recommended prescriptions.
第三方面,本发明实施例又提供一种计算机设备,包括处理器、通信接口、存储器和通信总线,其中,处理器、通信接口和存储器通过通信总线完成相互间的通信;In a third aspect, embodiments of the present invention provide a computer device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
存储器,用于存放计算机程序;Memory, used to store computer programs;
处理器,用于执行存储器上所存放的程序时,能够实现如第一方面中任一项所述的基于舌像和知识图谱的处方推荐方法。The processor, when executing the program stored in the memory, can implement the prescription recommendation method based on the tongue image and the knowledge graph as described in any one of the first aspects.
第四方面,本发明实施例再提供一种存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如第一方面中任意一项所述的基于舌像和知识图谱的处方推荐方法。In a fourth aspect, embodiments of the present invention further provide a storage medium in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the tongue-based method as described in any one of the first aspects. Prescription recommendation method for images and knowledge graphs.
本发明中第二方面至第四方面的描述,可以参考第一方面的详细描述;并且,第二方面至第三方面的描述的有益效果,可以参考第一方面的有益效果分析,此处不再赘述。For the description of the second to fourth aspects of the present invention, reference may be made to the detailed description of the first aspect; and for the beneficial effects of the description of the second to third aspects, reference may be made to the analysis of the beneficial effects of the first aspect, which is not included here. Again.
经由上述的技术方案可知,与现有技术相比,本发明公开提供了一种基于舌像和知识图谱的处方推荐方法:It can be seen from the above technical solutions that compared with the existing technology, the present invention provides a prescription recommendation method based on tongue images and knowledge maps:
1、本发明所述方法采用深度学习的推荐方法,并应用在中医舌诊的开具处方场景中。通过网络模型能够对患者舌头图像的特征和处方信息进行提取和挖掘,学习两者之间的内在交互关系,即当前处方与舌像是否匹配,依据匹配度预测最终推荐结果。1. The method of the present invention adopts the recommendation method of deep learning and is applied in the prescription scenario of tongue diagnosis in traditional Chinese medicine. Through the network model, the characteristics and prescription information of the patient's tongue image can be extracted and mined, and the intrinsic interactive relationship between the two can be learned, that is, whether the current prescription matches the tongue image, and the final recommendation result can be predicted based on the matching degree.
2、本发明所述方法以知识图谱的形式引入了中医舌诊的相关理论知识,通过构建中医舌诊知识图谱,以及对知识图谱进行知识表示学习,得到融合了知识信息的特征表示,能够提供不同模态的辅助信息。2. The method of the present invention introduces the relevant theoretical knowledge of tongue diagnosis of traditional Chinese medicine in the form of a knowledge map. By constructing a knowledge map of tongue diagnosis of traditional Chinese medicine and performing knowledge representation learning on the knowledge map, a feature representation that integrates knowledge information is obtained, which can provide Auxiliary information in different modalities.
3、本发明所述方法基于患者舌头图像和中医处方数据集,将深度学习的推荐技术以及所构建的中医舌诊知识图谱,应用到传统中医诊疗领域,实现了依据患者舌像推荐中医处方的辅助诊疗功能。相比于传统中医舌诊依赖于专家医师,减少重复性工作和人力时间成本,缓解医疗资源稀缺压力,并且,这种方法不依赖特定器材,具有一定的推广价值。3. The method of the present invention is based on the patient's tongue image and the TCM prescription data set, and applies the recommendation technology of deep learning and the constructed TCM tongue diagnosis knowledge map to the field of traditional TCM diagnosis and treatment, realizing the recommendation of TCM prescriptions based on the patient's tongue image. Auxiliary diagnosis and treatment functions. Compared with traditional Chinese medicine tongue diagnosis, which relies on expert doctors, it reduces repetitive work and labor time costs, and relieves the pressure of scarce medical resources. Moreover, this method does not rely on specific equipment and has certain promotion value.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without exerting creative efforts.
图1为本发明提供的基于舌像和知识图谱的处方推荐方法流程图;Figure 1 is a flow chart of a prescription recommendation method based on tongue images and knowledge maps provided by the present invention;
图2为本发明提供的构建舌像处方数据集的流程图;Figure 2 is a flow chart for constructing a tongue image prescription data set provided by the present invention;
图3为本发明提供的神经网络模型的架构示意图;Figure 3 is a schematic diagram of the architecture of the neural network model provided by the present invention;
图4为本发明提供的神经网络模型的训练及测试流程图;Figure 4 is a flow chart of training and testing of the neural network model provided by the present invention;
图5为本发明提供的基于舌像和知识图谱的处方推荐系统的框图;Figure 5 is a block diagram of a prescription recommendation system based on tongue images and knowledge maps provided by the present invention;
图6为本发明提供的计算机设备的框图。Figure 6 is a block diagram of the computer equipment provided by the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
实施例1:Example 1:
本发明实施例公开了一种基于舌像和知识图谱的处方推荐方法,包括以下步骤:The embodiment of the present invention discloses a prescription recommendation method based on tongue images and knowledge maps, which includes the following steps:
S10、构建舌像处方数据集,划分舌像处方训练集和测试集并进行预处理;S10. Construct a tongue image prescription data set, divide the tongue image prescription training set and test set, and perform preprocessing;
S20、构建中医舌诊知识图谱,并进行知识表示学习;S20. Construct a TCM tongue diagnosis knowledge graph and perform knowledge representation learning;
S30、构建神经网络模型;所述神经网络模型包括:舌像特征模块、处方特征模块和处方推荐模块,用于提取舌像特征、处方特征;并融合第一多模态特征和第二多模态特征,得出处方推荐及得分;所述第一多模态特征为所述舌像特征与所述中医舌诊知识图谱中相对应节点的融合结果;所述第二多模态特征为所述处方特征与中医舌诊知识图谱中相对应节点的融合结果;S30. Construct a neural network model; the neural network model includes: a tongue image feature module, a prescription feature module and a prescription recommendation module, used to extract tongue image features and prescription features; and fuse the first multimodal features and the second multimodal features. modal features to obtain prescription recommendations and scores; the first multi-modal features are the fusion results of the tongue image features and the corresponding nodes in the TCM tongue diagnosis knowledge graph; the second multi-modal features are the The fusion result of the above prescription characteristics and the corresponding nodes in the TCM tongue diagnosis knowledge graph;
S40、利用所述舌像处方训练集和所述中医舌诊知识图谱,对所述神经网络模型进行迭代训练,并利用舌像处方测试集进行测试,获得优神经网络模型;S40. Use the tongue image prescription training set and the TCM tongue diagnosis knowledge map to iteratively train the neural network model, and use the tongue image prescription test set to test to obtain an optimal neural network model;
S50、采用所述最优神经网络模型,对采集待处理的舌像进行识别,获得对应的推荐处方。S50. Use the optimal neural network model to identify the collected tongue images to be processed and obtain the corresponding recommended prescription.
本实施例中,通过构建舌像处方数据集、中医舌诊知识图谱及神经网络模型,基于舌像处方数据集、中医舌诊知识图谱对该神经网络进行优化训练;基于训练好的神经网络模型,可实现依据患者舌像推荐中医处方的辅助诊疗功能。基于该方法开发为软件程序,也无需依赖特定医疗器材,具有一定的推广价值。In this embodiment, by constructing a tongue image prescription data set, a TCM tongue diagnosis knowledge graph and a neural network model, the neural network is optimized and trained based on the tongue image prescription data set and the TCM tongue diagnosis knowledge graph; based on the trained neural network model , which can realize the auxiliary diagnosis and treatment function of recommending TCM prescriptions based on the patient's tongue image. A software program developed based on this method does not need to rely on specific medical equipment and has certain promotion value.
下面分别对上述各个步骤进行详细说明。Each of the above steps is described in detail below.
步骤S10中,构建舌像处方数据集,比如本实施例所用数据集共包含26422张患者舌头图像以及对应的26422个中医处方,所收集的处方药材种类为577类和对应的剂量信息。该数据集的舌头图像来源均为广东省广州市的多家合作医疗机构,其数据采集均由经过培训的医疗助理,使用已经部署舌像采集系统的安卓移动端完成。采集时医疗助理所持设备为移动端摄像头。采集过程中,医疗助理将完成以下工作:采集患者的舌苔图像,记录专家医师对于该患者开具的处方信息。本实例使用Python语言,基于PyTorch深度学习框架,在Ubuntu系统上实现实施例的代码及运行。In step S10, a tongue image prescription data set is constructed. For example, the data set used in this embodiment contains a total of 26,422 patient tongue images and corresponding 26,422 Chinese medicine prescriptions. The collected types of prescription medicinal materials are 577 categories and corresponding dosage information. The tongue images in this data set come from multiple cooperative medical institutions in Guangzhou City, Guangdong Province. The data collection is completed by trained medical assistants using Android mobile terminals that have deployed tongue image collection systems. The device held by the medical assistant during collection is a mobile camera. During the collection process, the medical assistant will complete the following tasks: collect images of the patient's tongue coating and record the prescription information issued by the expert physician for the patient. This example uses Python language and is based on the PyTorch deep learning framework to implement the code and operation of the embodiment on the Ubuntu system.
如图2所示将采集的患者舌头图像数据以8:2的比例划分为训练集和测试集。训练集的数据预处理方式为:按比例对原始图像进行裁剪,裁剪后的图片缩放至224×224尺寸,随后进行随机水平翻转操作,并对图像RGB通道分别进行归一化与标准化处理,即遍历数据集中图像矩阵的每一像素,得到每个通道的均值μ和方差σ,然后通过z-score公式得到标准化后的数值As shown in Figure 2, the collected patient tongue image data is divided into a training set and a test set at a ratio of 8:2. The data preprocessing method of the training set is: crop the original image proportionally, scale the cropped image to 224×224 size, then perform random horizontal flipping operations, and normalize and standardize the RGB channels of the image, that is, Traverse each pixel of the image matrix in the data set to obtain the mean μ and variance σ of each channel, and then obtain the standardized value through the z-score formula
x`=(x-μ)/σx`=(x-μ)/σ
测试集的数据预处理方式为居中裁剪,缩放至224×224尺寸,并同样对图像RGB通道分别进行归一化与标准化处理。数据集中的处方信息则以药材列表形式记录。The data preprocessing method of the test set is center cropping, scaling to 224×224 size, and also normalizing and standardizing the image RGB channels respectively. The prescription information in the data set is recorded in the form of a list of medicinal materials.
本实施例数据集中数据为舌头图像-中医处方样本对的形式,其标签为样本处方与真实处方的余弦相似度(即:输入舌像-处方样本对,输出预测得分;标签是指真实得分。),即对于一张舌像ti与一具处方pj组成的样本对,舌像在数据采集时所记录对应的真实处方为pi,则该样本对的标签标记为pj与pi的余弦相似度,相似度越高,则pj与pi之间所包含的药材种类越相近,pj越适合推荐给舌像ti的患者。The data in the data set of this embodiment is in the form of a tongue image-TCM prescription sample pair, and its label is the cosine similarity between the sample prescription and the real prescription (that is: input the tongue image-prescription sample pair, and output the predicted score; the label refers to the real score. ), that is, for a sample pair consisting of a tongue image t i and a prescription p j , the real prescription corresponding to the tongue image recorded during data collection is p i , then the labels of the sample pair are p j and p i The higher the similarity, the closer the types of medicinal materials contained between p j and p i , and the more suitable p j is to be recommended to patients with tongue images t i .
在步骤S20中,构建中医舌诊知识图谱,并进行知识表示学习;In step S20, construct a TCM tongue diagnosis knowledge graph and perform knowledge representation learning;
本实施例所构建的中医舌诊知识图谱数据来源为医学资源数据库、中医医学文献以及医学百度百科,采用自顶向下的构建方式,比如采用由专家医师设计知识图谱顶层数据模式,共包括7种实体类型,6种关系类型,详细设计分别如表1与表2所示:The data sources of the TCM tongue diagnosis knowledge map constructed in this embodiment are medical resource databases, TCM medical literature and medical Baidu Encyclopedia. It adopts a top-down construction method. For example, the top-level data model of the knowledge map is designed by expert doctors, including a total of 7 There are three entity types and six relationship types. The detailed designs are shown in Table 1 and Table 2 respectively:
表1中医舌诊知识图谱实体类型表Table 1 Entity type table of TCM tongue diagnosis knowledge graph
表2中医舌诊知识图谱关系类型表Table 2 Table of relationship types of TCM tongue diagnosis knowledge map
完成图谱顶层数据模式设计后,从具体数据中抽取实体、关系信息,形成三元组知识,并通过图数据库Neo4j进行存储,并采用TransR模型,便于将知识图谱中的实体与关系嵌入到低维向量空间中,具体操作为:After completing the design of the top-level data model of the graph, entity and relationship information is extracted from the specific data to form triplet knowledge, which is stored through the graph database Neo4j and uses the TransR model to facilitate embedding entities and relationships in the knowledge graph into low-dimensional In vector space, the specific operations are:
知识图谱中的三元组实例为(head,relation,tail),尾部实体tail是头部实体head经过关系relation的翻译,表示为:h+r≈t。通过不断调整h、r、t的向量使其满足使其满足约束函数 The triple instance in the knowledge graph is (head, relation, tail). The tail entity tail is the translation of the head entity head through the relationship, expressed as: h+r≈t. By continuously adjusting the vectors of h, r, and t to satisfy the constraint function
TransR模型在对三元组进行约束前,通过投影矩阵Mr将实体向量投影到关系空间中:Before constraining triples, the TransR model projects the entity vector into the relationship space through the projection matrix M r :
hr=hMr h r =hM r
tr=tMr t r =tM r
将投影后的实体向量hr、tr代入约束函数中得到Substitute the projected entity vectors h r and t r into the constraint function to obtain
通过loss训练得到新的三元组向量来表示知识图谱:A new triplet vector is obtained through loss training to represent the knowledge graph:
其中,S为所构建的中医舌诊知识图谱中的三元组集合,而S`为随机抽取实体h`、t`和关系r组成的不属于S的负样本三元组合集,γ为阈值。Among them, S is a set of triples in the constructed knowledge map of traditional Chinese medicine tongue diagnosis, and S` is a negative sample triple combination set that does not belong to S composed of randomly selected entities h`, t` and relationship r, and γ is the threshold. .
在步骤S30中,构建神经网络模型,架构如图3所示;该神经网络模型包括:舌像特征模块、处方特征模块和处方推荐模块,用于提取舌像特征、处方特征;并融合第一多模态特征和第二多模态特征,得出处方推荐及得分;所述第一多模态特征为所述舌像特征与所述中医舌诊知识图谱中相对应节点的融合结果;所述第二多模态特征为所述处方特征与中医舌诊知识图谱中相对应节点的融合结果。In step S30, a neural network model is constructed, the architecture of which is shown in Figure 3; the neural network model includes: a tongue image feature module, a prescription feature module and a prescription recommendation module, which are used to extract tongue image features and prescription features; and fuse the first The multi-modal features and the second multi-modal features are used to obtain prescription recommendations and scores; the first multi-modal features are the fusion results of the tongue image features and the corresponding nodes in the TCM tongue diagnosis knowledge map; The second multi-modal feature is the fusion result of the prescription feature and the corresponding node in the TCM tongue diagnosis knowledge graph.
其中:in:
1)舌像特征模块,基于卷积神经网络提取舌像特征;1) Tongue image feature module, extracts tongue image features based on convolutional neural network;
具体地,本实施例可搭建一个基于舌像的卷积神经网络,网络结构为残差网络ResNet18,首先对输入舌苔图像进行7×7卷积和3×3池化,然后通过四个残差模块,每个模块由两个残差块组成,输出大小分别为56×56×64,28×28×128,14×14×256,7×7×512。经过残差模块后连接一个平均池化层和全连接层得到输入舌像的特征表示。Specifically, this embodiment can build a convolutional neural network based on the tongue image. The network structure is the residual network ResNet18. First, the input tongue coating image is subjected to 7×7 convolution and 3×3 pooling, and then through four residual module, each module consists of two residual blocks, and the output sizes are 56×56×64, 28×28×128, 14×14×256, and 7×7×512 respectively. After passing through the residual module, an average pooling layer and a fully connected layer are connected to obtain the feature representation of the input tongue image.
2)处方特征模块,用多标签向量表示处方并提取其特征;2) Prescription feature module, which uses multi-label vectors to represent prescriptions and extract their features;
具体地,本实施例中以药材列表形式输入的处方,通过独热编码转换为One-Hot向量,向量中每一维度0/1表示处方是否包含该药材,在输入一层全连接层进行向量维度压缩,得到128维的处方特征表示。Specifically, in this embodiment, the prescription input in the form of a list of medicinal materials is converted into a One-Hot vector through one-hot encoding. Each dimension 0/1 in the vector indicates whether the prescription contains the medicinal material. A fully connected layer is used to input the vector. Dimension compression results in a 128-dimensional prescription feature representation.
3)处方推荐模块,融合舌像、处方、图谱多模态的特征向量,输出推荐得分;3) The prescription recommendation module integrates multi-modal feature vectors of tongue images, prescriptions, and atlases, and outputs recommendation scores;
具体地,本实施例构建了中医处方推荐模块,将舌像特征Xt、处方特征Xp与图谱特征G三种不同模态下的信息分别进行融合,并依据融合后新的特征预测推荐结果,具体步骤如下:Specifically, this embodiment constructs a traditional Chinese medicine prescription recommendation module, which fuses the information in three different modes: tongue image feature X t , prescription feature X p and map feature G respectively, and predicts recommendation results based on the new features after fusion ,Specific steps are as follows:
S301、对舌像特征表示Xt与知识图谱中相应舌象节点特征表示 的向量进行点到点相加操作,得到基于这两种模态下的特征融合输出为S301. Compare the tongue image feature representation X t with the corresponding tongue image node feature representation in the knowledge graph Perform point-to-point addition operation on the vectors, and obtain the feature fusion output based on these two modes as
其中,gt,i为第i个舌象在知识图谱中的特征表示,nt为舌象总数。Among them, g t,i is the characteristic representation of the i-th tongue image in the knowledge graph, and n t is the total number of tongue images.
S302、对处方特征表示Xp与知识图谱中相应药材节点特征表示 的向量进行点到点相加操作,得到基于这两种模态下的特征融合输出为S302. Represent prescription features X p and corresponding medicinal material node features in the knowledge graph Perform point-to-point addition operation on the vectors, and obtain the feature fusion output based on these two modes as
其中,gh,j为处方第j味药材在知识图谱中的特征表示,np为处方的药材总数。Among them, g h,j is the characteristic representation of the jth medicinal material in the prescription in the knowledge graph, and n p is the total number of medicinal materials in the prescription.
S303、最后将舌象融合特征et、处方融合特征ep,二者再融合后的特征经过标准化处理(Normalization)并进行连接操作(Concatenate),再输入三层感知机中,每一层输出维度分别为128/64/1,使用Softmax激活函数得到网络的输出为[0,1]的推荐得分。根据推荐分数对不同处方进行降序排列,最终得到模型为患者推荐的处方。S303. Finally, the tongue image fusion feature e t and the prescription fusion feature e p are fused. The features after the fusion of the two are normalized (Normalization) and connected (Concatenate), and then input into the three-layer perceptron. Each layer outputs The dimensions are 128/64/1 respectively. Using the Softmax activation function, the output of the network is a recommendation score of [0,1]. Different prescriptions are sorted in descending order according to the recommendation scores, and finally the prescriptions recommended by the model for the patient are obtained.
在步骤S40中,如图4所示,利用舌像处方训练集和所述中医舌诊知识图谱,对所述神经网络模型进行迭代训练,并利用舌像处方测试集进行测试,获得优神经网络模型。In step S40, as shown in Figure 4, the neural network model is iteratively trained using the tongue image prescription training set and the TCM tongue diagnosis knowledge map, and tested using the tongue image prescription test set to obtain an optimal neural network Model.
首先,使用将舌像处方训练集中的舌像-处方对样本训练模型;First, use the tongue image-prescription pair samples in the tongue image prescription training set to train the model;
具体地,本实施例的模型训练过程为:输入训练集的舌像-处方样本对以及中医舌诊知识图谱,模型输出该处方的推荐得分,计算其与真实标签的损失,采用反向传播算法,调整参数的权重,迭代优化模型。本实施例采用随机梯度下降优化算法,损失函数为交叉熵损失函数,初始学习率为0.1,训练批次大小(batchsize)为64,迭代轮数为200,分别在迭代次数为50,100,160时下降为原来的0.1,权重衰减为0.0001。Specifically, the model training process of this embodiment is as follows: input the tongue image-prescription sample pair of the training set and the TCM tongue diagnosis knowledge graph, the model outputs the recommendation score of the prescription, calculates the loss between it and the real label, and uses the back propagation algorithm , adjust the weight of parameters and iteratively optimize the model. This embodiment uses a stochastic gradient descent optimization algorithm. The loss function is a cross-entropy loss function. The initial learning rate is 0.1. The training batch size (batchsize) is 64. The number of iteration rounds is 200. The number of iterations is 50, 100, and 160. When it drops to the original 0.1, the weight decays to 0.0001.
其次,将舌像处方测试集中的测试样本输入训练好的网络模型,模型推荐相应的处方。Secondly, the test samples in the tongue image prescription test set are input into the trained network model, and the model recommends the corresponding prescription.
具体地,将经过预处理后的测试集中的患者舌像配对处方,输入训练得到的网络模型,从而得到相应处方的预测推荐得分。将所有处方依据预测得分从高到低依次排列,前K项对应的处方即为该患者的推荐处方;将测试集中舌像对应的真实处方与推荐的处方进行比对,若满足预期,则停止迭代训练,作为最优的模型。Specifically, the patient's tongue image in the preprocessed test set is paired with the prescription and input into the trained network model to obtain the predicted recommendation score of the corresponding prescription. Arrange all prescriptions from high to low according to the prediction score. The prescriptions corresponding to the first K items are the recommended prescriptions for the patient; compare the real prescriptions corresponding to the tongue images in the test set with the recommended prescriptions. If the expectations are met, stop Iterative training as the optimal model.
在步骤S50中,最后采用训练生成的最优神经网络模型,对采集待处理的舌像进行识别,获得对应的推荐处方;即为推荐分值最高的处方。In step S50, the optimal neural network model generated by training is finally used to identify the collected tongue images to be processed, and the corresponding recommended prescription is obtained; that is, the prescription with the highest recommended score.
实施例2:Example 2:
基于同一发明构思,参照图5所示,本发明实施例还提供一种基于舌像和知识图谱的处方推荐系统,包括:Based on the same inventive concept, as shown in Figure 5, an embodiment of the present invention also provides a prescription recommendation system based on tongue images and knowledge graphs, including:
第一构建模块51,用于构建舌像处方数据集,划分舌像处方训练集和测试集并进行预处理;The first building module 51 is used to construct the tongue image prescription data set, divide the tongue image prescription training set and the test set and perform preprocessing;
第二构建模块52,用于构建中医舌诊知识图谱,并进行知识表示学习;The second building module 52 is used to construct a TCM tongue diagnosis knowledge graph and perform knowledge representation learning;
第三构建模块53,用于构建神经网络模型;所述神经网络模型包括:舌像特征模块、处方特征模块和处方推荐模块,用于提取舌像特征、处方特征;并融合第一多模态特征和第二多模态特征,得出处方推荐及得分;所述第一多模态特征为所述舌像特征与所述中医舌诊知识图谱中相对应节点的融合结果;所述第二多模态特征为所述处方特征与中医舌诊知识图谱中相对应节点的融合结果;The third building module 53 is used to build a neural network model; the neural network model includes: a tongue image feature module, a prescription feature module and a prescription recommendation module, used to extract tongue image features and prescription features; and fuse the first multi-modal Features and the second multi-modal feature to obtain prescription recommendations and scores; the first multi-modal feature is the fusion result of the tongue image feature and the corresponding node in the TCM tongue diagnosis knowledge map; the second multi-modal feature is the fusion result of the tongue image feature and the corresponding node in the TCM tongue diagnosis knowledge map; Multimodal features are the fusion results of the prescription features and corresponding nodes in the TCM tongue diagnosis knowledge graph;
训练测试模块54,利用所述舌像处方训练集、测试集和所述中医舌诊知识图谱,对所述神经网络模型进行迭代训练及测试,得到最优的神经网络模型;The training and testing module 54 uses the tongue image prescription training set, the test set and the TCM tongue diagnosis knowledge map to iteratively train and test the neural network model to obtain the optimal neural network model;
推荐模块55,采用最优的神经网络模型,对采集待处理的舌像进行识别,获得对应的推荐处方。The recommendation module 55 uses the optimal neural network model to identify the collected tongue images to be processed and obtain the corresponding recommended prescription.
进一步地,第一构建模块51中的舌像处方数据集,包括多张舌头图像以及相对应的处方信息;所述处方信息包括:药材和剂量信息。Further, the tongue image prescription data set in the first building module 51 includes multiple tongue images and corresponding prescription information; the prescription information includes: medicinal materials and dosage information.
划分舌像处方训练集和测试集并进行预处理,包括:Divide the tongue image prescription training set and test set and perform preprocessing, including:
根据预设比例划分舌像处方训练集和舌像处方测试集;Divide the tongue image prescription training set and the tongue image prescription test set according to the preset ratio;
对所述舌像处方训练集的预处理为随机裁剪、大小缩放、随机水平垂直翻转和归一化操作;The preprocessing of the tongue image prescription training set includes random cropping, size scaling, random horizontal and vertical flipping and normalization operations;
对所述舌像处方测试集的预处理为大小缩放、居中裁剪和归一化操作。The preprocessing of the tongue image prescription test set includes size scaling, center cropping and normalization operations.
进一步地,第二构建模块52具体包括:Further, the second building module 52 specifically includes:
以医学资源数据库、中医医学文献以及医学百度百科作为中医舌诊知识图谱的数据来源;The medical resource database, TCM medical literature and medical Baidu Encyclopedia are used as the data sources of the TCM tongue diagnosis knowledge map;
采用自顶向下的构建方式,根据设计知识图谱顶层数据模式,从所述数据来源中抽取实体、关系和属性信息,获取三元组知识;Using a top-down construction method, based on the top-level data model of the design knowledge graph, entities, relationships and attribute information are extracted from the data sources to obtain triple knowledge;
通过图数据库Neo4j进行存储,完成中医舌诊知识图谱的构建,并进行知识表示学习。Through storage in the graph database Neo4j, the construction of the TCM tongue diagnosis knowledge graph is completed, and knowledge representation learning is performed.
进一步地,第三构建模块53中的处方特征模块,用于输入为处方信息,转换为独热向量,经过全连接层降维,得到文本模态下的处方特征表示。Further, the prescription feature module in the third building module 53 is used to input prescription information, convert it into a one-hot vector, and obtain a prescription feature representation in text mode through dimensionality reduction through a fully connected layer.
处方推荐模块的处理过程包括:The processing process of the prescription recommendation module includes:
将所述舌像特征与所述中医舌诊知识图谱中舌象节点特征两者采用相加操作融合后,形成舌象融合特征;The tongue image features and the tongue image node features in the TCM tongue diagnosis knowledge map are fused using an additive operation to form tongue image fusion features;
将所述处方特征与所述中医舌诊知识图谱中药材节点特征两者采用相加操作融合后,形成处方融合特征;After the prescription characteristics and the Chinese medicinal material node characteristics of the TCM tongue diagnosis knowledge map are fused using an additive operation, the prescription fusion characteristics are formed;
将所述舌象融合特征与处方融合特征标准化处理并经过拼接,输入到多层感知机学习两者之间的内在交互,输出模型所预测的推荐分数;根据推荐分数对不同处方进行降序排列,最终得到推荐处方及对应的推荐分数。The tongue image fusion features and prescription fusion features are standardized and spliced, input into a multi-layer perceptron machine to learn the internal interaction between the two, and output the recommendation scores predicted by the model; different prescriptions are arranged in descending order according to the recommendation scores. Finally, the recommended prescription and corresponding recommendation score are obtained.
进一步地,训练测试模块54,训练部分包括:Further, the training test module 54, the training part includes:
将所述舌像处方训练集中的舌像-处方对样本,及与所述中医舌诊知识图谱中对应的舌象节点特征、药材节点特征,共同作为训练样本数据对神经网络模型进行训练;采用交叉熵损失函数,优化算法采用随机梯度下降方法,多次迭代对神经网络模型件优化训练。The tongue image-prescription pair samples in the tongue image prescription training set, as well as the corresponding tongue image node characteristics and medicinal material node characteristics in the TCM tongue diagnosis knowledge map, are used together as training sample data to train the neural network model; using Cross-entropy loss function, optimization algorithm uses stochastic gradient descent method, multiple iterations to optimize and train the neural network model.
实施例3:Example 3:
基于同一发明构思,本发明实施例又提供一种计算机设备,如图6所示,包括处理器61、通信接口62、存储器63和通信总线64,其中,处理器61、通信接口62和存储器63通过通信总线64完成相互间的通信;Based on the same inventive concept, an embodiment of the present invention also provides a computer device, as shown in Figure 6, including a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62 and the memory 63 Complete mutual communication through the communication bus 64;
存储器63,用于存放计算机程序;Memory 63, used to store computer programs;
处理器61,用于执行存储器63上所存放的程序时,能够实现如实施例1中的基于舌像和知识图谱的处方推荐方法。When the processor 61 is used to execute the program stored on the memory 63, it can implement the prescription recommendation method based on the tongue image and the knowledge map as in Embodiment 1.
实施例4:Example 4:
本发明实施例再提供一种存储介质,存储介质中存储有至少一条指令,该指令由处理器加载并执行以实现如实施例1的基于舌像和知识图谱的处方推荐方法。An embodiment of the present invention further provides a storage medium in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the prescription recommendation method based on tongue images and knowledge graphs as in Embodiment 1.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on its differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For relevant details, please refer to the description in the method section.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310589649.0A CN116844687A (en) | 2023-05-24 | 2023-05-24 | Prescription recommendation method and system based on tongue images and knowledge patterns |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310589649.0A CN116844687A (en) | 2023-05-24 | 2023-05-24 | Prescription recommendation method and system based on tongue images and knowledge patterns |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116844687A true CN116844687A (en) | 2023-10-03 |
Family
ID=88167879
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310589649.0A Pending CN116844687A (en) | 2023-05-24 | 2023-05-24 | Prescription recommendation method and system based on tongue images and knowledge patterns |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116844687A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117611581A (en) * | 2024-01-18 | 2024-02-27 | 之江实验室 | A tongue image recognition method, device and electronic equipment based on multi-modal information |
CN118016236A (en) * | 2024-04-08 | 2024-05-10 | 西安力邦医疗网络科技有限公司 | Rehabilitation management method, device, equipment and storage medium |
CN118942638A (en) * | 2024-08-08 | 2024-11-12 | 北京大学第一医院(北京大学第一临床医学院) | Traditional Chinese medicine tongue diagnosis method and system based on multimodal model |
-
2023
- 2023-05-24 CN CN202310589649.0A patent/CN116844687A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117611581A (en) * | 2024-01-18 | 2024-02-27 | 之江实验室 | A tongue image recognition method, device and electronic equipment based on multi-modal information |
CN117611581B (en) * | 2024-01-18 | 2024-05-14 | 之江实验室 | Tongue image recognition method, device and electronic device based on multimodal information |
CN118016236A (en) * | 2024-04-08 | 2024-05-10 | 西安力邦医疗网络科技有限公司 | Rehabilitation management method, device, equipment and storage medium |
CN118016236B (en) * | 2024-04-08 | 2024-08-02 | 西安力邦医疗网络科技有限公司 | Rehabilitation management method, device, equipment and storage medium |
CN118942638A (en) * | 2024-08-08 | 2024-11-12 | 北京大学第一医院(北京大学第一临床医学院) | Traditional Chinese medicine tongue diagnosis method and system based on multimodal model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Alzubaidi et al. | DFU_QUTNet: diabetic foot ulcer classification using novel deep convolutional neural network | |
Bhadula et al. | Machine learning algorithms based skin disease detection | |
CN110689025B (en) | Image recognition method, device, system and endoscopic image recognition method and device | |
Lei et al. | A novel data-driven robust framework based on machine learning and knowledge graph for disease classification | |
CN116844687A (en) | Prescription recommendation method and system based on tongue images and knowledge patterns | |
CN111863237A (en) | A mobile terminal disease intelligent auxiliary diagnosis system based on deep learning | |
Hu et al. | Automatic construction of Chinese herbal prescriptions from tongue images using CNNs and auxiliary latent therapy topics | |
CN108898175A (en) | Area of computer aided model building method based on deep learning gastric cancer pathological section | |
Huan et al. | Deep convolutional neural networks for classifying body constitution based on face image | |
CN115410046A (en) | Skin disease tongue picture classification model based on deep learning, establishing method and application | |
CN113610118A (en) | Fundus image classification method, device, equipment and medium based on multitask course learning | |
CN117788881A (en) | Multimodal macular degeneration recognition model construction method, device, equipment and medium | |
Huang et al. | Development of a deep learning-based tool to assist wound classification | |
CN110837777A (en) | Partial occlusion facial expression recognition method based on improved VGG-Net | |
CN113658151A (en) | Mammary gland lesion magnetic resonance image classification method and device and readable storage medium | |
CN117524460A (en) | Disease prediction system based on mixed multi-modal data and graph convolution neural network | |
Aljohani et al. | A hybrid framework for glaucoma detection through federated machine learning and deep learning models | |
CN114511759A (en) | A method and system for category recognition and feature determination of skin state images | |
CN113077894A (en) | System, method, apparatus and medium for skin diagnosis based on graph convolution neural network | |
CN110853764B (en) | Diabetes syndrome prediction system | |
CN118430790A (en) | Mammary tumor BI-RADS grading method based on multi-modal-diagram neural network | |
CN118229708A (en) | Multitasking image segmentation method and system for burn injury assessment | |
CN116385806B (en) | Method, system, equipment and storage medium for classifying strabismus type of eye image | |
Wang et al. | Classification of clinical skin lesions with double-branch networks | |
CN111798455A (en) | A Real-time Segmentation Method for Thyroid Nodules Based on Fully Convolutional Dense Hollow Networks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |