Traditional Chinese medicine diagnosis system and method based on artificial intelligence, storage medium and device

Through fine-tuning of the Llama3.1-8B model and optimization of LoRA and RLHF technology, combined with traditional Chinese medicine diagnosis and treatment data and dialogue interaction, the convenience and accuracy of the traditional Chinese medicine diagnosis system are solved, and efficient and accurate traditional Chinese medicine diagnosis services are achieved, suitable for remote and primary medical care.

CN120496791APending Publication Date: 2025-08-15SHANGHAI SEVENTH PEOPLES HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510428035.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Due to the lack of professional knowledge of traditional Chinese medicine, the existing traditional Chinese medicine diagnosis system is unable to accurately understand and deal with problems related to traditional Chinese medicine, resulting in insufficient convenience and accuracy of diagnostic services.

Method used

The Llama3.1-8B big model is used to combine traditional Chinese medicine diagnosis and treatment data for fine-tuning training, and LoRA and RLHF technology are introduced to optimize model parameters. Patient data is obtained through dialogue and interaction and diagnosis is combined with real-time traditional Chinese medicine data, providing personalized treatment suggestions.

Benefits of technology

It improves the accuracy and efficiency of traditional Chinese medicine diagnosis, shortens the diagnosis time, enhances the inheritance and dissemination of traditional Chinese medicine knowledge, is suitable for telemedicine and primary medical scenarios, and improves diagnosis level and patient satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120496791A_ABST
    Figure CN120496791A_ABST
Patent Text Reader

Abstract

The invention relates to a traditional Chinese medicine diagnosis system and method based on artificial intelligence, a storage medium and a device. The system mainly comprises a data acquisition and preprocessing module and a data processing module, the data acquisition and preprocessing module is used for acquiring training data and preprocessing the training data to form a training data set, and the data acquisition and preprocessing module is further used for acquiring data of a patient to be diagnosed and processing the data of the patient to be diagnosed. And the data processing module is used for training a diagnosis model through the training data set obtained by the data acquisition and preprocessing module, processing data of a patient to be diagnosed through the trained diagnosis model and outputting a diagnosis result. The traditional Chinese medicine diagnosis system can provide convenient and accurate traditional Chinese medicine diagnosis service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a traditional Chinese medicine diagnosis system based on artificial intelligence. Background Art

[0002] Traditional Chinese Medicine (TCM) diagnosis is a key component of TCM treatment. Traditional TCM diagnosis relies on the practitioner's personal experience and expertise, gathering patient information through observation, auscultation, inquiry, and palpation. This process is subjective and time-consuming. Furthermore, TCM knowledge is complex, encompassing numerous classic texts, modern research findings, and extensive clinical experience, posing challenges to its inheritance and application.

[0003] Artificial intelligence technology has made significant progress in natural language processing, with large language models such as ChatGPT demonstrating powerful language understanding and generation capabilities. However, in the medical field, particularly in Traditional Chinese Medicine (TCM) diagnosis, existing diagnostic systems lack TCM expertise and are unable to accurately understand and address TCM-related issues. This significantly limits their application, making it difficult for existing diagnostic systems to meet patients' needs for convenient and accurate TCM diagnostic services. Summary of the Invention

[0004] Based on this, a TCM diagnosis system based on artificial intelligence is provided, which is conducive to providing convenient and accurate TCM diagnosis services.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A traditional Chinese medicine diagnosis system based on artificial intelligence, comprising:

[0007] The data acquisition and preprocessing module is used to obtain training data and perform preprocessing operations on the training data to form a training data set. The data acquisition and preprocessing module is also used to obtain data of patients to be diagnosed.

[0008] The data processing module is used to train the diagnostic model using the training data set obtained by the data acquisition and preprocessing module, and to process the data of the patient to be diagnosed using the trained diagnostic model and output the diagnostic results.

[0009] In one embodiment, the data acquisition and preprocessing module obtains the data of the patient to be diagnosed in the form of questions and answers by setting a dialog box.

[0010] In one embodiment, the training data is obtained by at least one of the following methods: historical cases, traditional Chinese medicine books.

[0011] In one embodiment, the preprocessing operation includes a data cleaning operation, a data standardization operation, and a key information extraction operation.

[0012] In one embodiment, the diagnostic model is the Llama3.1-8B model, and LoRA is used to adjust the parameters of the diagnostic model, and the RLHF method is used to optimize the diagnostic model.

[0013] In one embodiment, the data processing module also includes support for real-time retrieval of authoritative traditional Chinese medicine data and updates the training data set based on the retrieved data.

[0014] In one embodiment, the data processing module further outputs treatment recommendations.

[0015] A TCM diagnosis method based on artificial intelligence includes the TCM diagnosis system based on artificial intelligence, and the diagnosis result is outputted through the TCM diagnosis system.

[0016] A computer storage medium stores at least one executable instruction, which enables a processor to execute operations corresponding to the artificial intelligence-based traditional Chinese medicine diagnosis method.

[0017] A computer device includes: a processor, a memory, a communication interface and a communication bus, wherein the processor, memory and communication interface communicate with each other via the communication bus, and the memory is used to store at least one executable instruction, which enables the processor to perform operations corresponding to the artificial intelligence-based traditional Chinese medicine diagnostic method.

[0018] The beneficial effects of this application are:

[0019] 1. The TCM diagnosis system of this application can provide convenient and accurate TCM diagnosis services.

[0020] 2. The data collection and preprocessing module of this application uses a dialog box to obtain patient data in a question-and-answer format. This question-and-answer format guides patients to describe their symptoms in detail, which helps accurately obtain patient data. Since the patient data is more accurately obtained, it also facilitates accurate diagnosis results. It is also simple and convenient for patients to use.

[0021] 3. This application proposes a TCM diagnosis system based on the Llama3.1-8B model, which can effectively improve diagnostic accuracy and generate diagnostic recommendations in line with TCM theory. It adopts LoRA (Low-Rank Adaptation) technology to efficiently adjust model parameters to meet the needs of TCM diagnosis tasks. It introduces RLHF technology to optimize model output based on feedback from TCM experts, improve diagnostic accuracy and interpretation ability, and further improve the quality of model output, that is, the diagnostic results and treatment recommendations are more in line with the patient's actual situation and more accurate.

[0022] This application uses the Llama3.1-8B general model combined with TCM diagnosis and treatment data and knowledge to train a TCM vertical structure model. By fine-tuning the model, it can deeply learn TCM knowledge and diagnostic logic. Combined with real-time information retrieval and verification, it can more accurately understand patient symptoms, provide more reliable diagnostic recommendations, and reduce the occurrence of misdiagnosis and missed diagnoses. The system quickly collects patient symptom information in the form of dialogue and uses the model's efficient computing power to quickly provide diagnostic results and treatment recommendations, greatly shortening diagnosis time and improving medical service efficiency. It is particularly suitable for telemedicine and primary care scenarios.

[0023] 4. The TCM diagnostic system of this application integrates TCM classics and clinical experience, and incorporates rich TCM knowledge into the TCM diagnostic system of this application, which is conducive to the inheritance and wide dissemination of TCM knowledge, so that more people can understand and benefit from TCM culture and diagnosis and treatment methods.

[0024] 5. The TCM diagnostic system of this application provides personalized treatment plans based on the patient's specific symptoms and condition, including Chinese medicine prescriptions, acupuncture point selection, etc., to meet the diverse medical needs of patients, which is conducive to improving treatment efficacy and patient satisfaction. It provides reference diagnostic opinions and relevant knowledge support for TCM practitioners, helping them to make more accurate judgments in clinical diagnosis. It plays an important auxiliary role, especially for inexperienced TCM practitioners, and helps to improve the diagnostic level of the entire TCM industry.

[0025] 6. Compared with other models, the diagnostic model used in the system of this application has a wide similarity distribution range and a median of 0.50. This shows that the model of this application is superior to these comparison models in understanding and generating texts that conform to the diagnostic logic of traditional Chinese medicine. It has stronger adaptability and the generated diagnostic results are semantically closer to the reference text.

[0026] 7. In areas with higher BLEU scores, the diagnostic model of this application (yellow dots) has a higher ROUGE score, indicating that the generated text performs well in both language fluency and information coverage. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a data processing flow chart of the artificial intelligence-based traditional Chinese medicine diagnosis system of an embodiment of the present application.

[0028] Figure 2 Box plot of the cosine similarity score distribution of different models.

[0029] Figure 3 Scatter plots of BLEU and Rouge score distribution for different models.

[0030] Figure 4This is a schematic diagram of the interface of the artificial intelligence-based traditional Chinese medicine diagnosis system of an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0032] Traditional large models are mainly pre-trained on general corpora, which are large in scale. The training and inference processes require a lot of computing resources, resulting in relatively low operating efficiency and high cost. In addition, due to the lack of in-depth understanding of professional knowledge and terminology in the field of Traditional Chinese Medicine, it is difficult to control the quality and accuracy of the generated results.

[0033] Based on the above reasons, this application realizes the construction of a vertical large model of traditional Chinese medicine through the technical solution of combining a small-volume large model Llama3.1-8B model with high-quality traditional Chinese medicine corpus for fine-tuning training. The model has high operating efficiency and accuracy.

[0034] The TCM diagnosis system of this application, based on the Llama3.1-8B large model, adopts the Transformer decoder structure, integrates TCM diagnosis and treatment data and knowledge, and constructs a complete architecture including modules such as data collection and data cleaning, model training and optimization, dialogue interaction, knowledge retrieval and updating. The modules work together to realize intelligent analysis of patient symptoms and generation of diagnostic suggestions.

[0035] The following is a detailed introduction to the solution of the traditional Chinese medicine diagnosis system of this application.

[0036] (1) Figure 1 As shown in the figure, first, TCM diagnosis and treatment data are collected, cleaned and represented: multi-source data such as historical cases in the hospital information system and TCM books (ancient or modern books) are collected and converted into formatted data sets, and information such as disease knowledge, prescriptions and medications, and acupuncture points are extracted. A strict data cleaning strategy is formulated to automatically filter incomplete, meaningless or erroneous data. Natural language processing and information extraction technology are used to unify the format and standardize the data and extract key information, such as normalizing synonyms for symptom descriptions. Combined with manual review, the accuracy and reliability of the data are ensured, and a high-quality TCM diagnosis and treatment corpus is constructed.

[0037] Specifically, this application adopts data cleaning and information extraction methods to achieve high-quality screening of real Chinese medicine diagnosis and treatment records, Chinese medicine classics and other data obtained from the hospital information system, and convert them into formatted data sets. First, by cleaning the hospital's Chinese medicine diagnosis and treatment records, invalid or duplicate information is removed to ensure the quality of the data. In this process, a hash algorithm is used to generate a unique identifier for each data, and noise data (such as invalid characters, null values, etc.) is removed through rule matching (such as regular expressions). In addition, through context analysis, possible semantic errors are eliminated, such as uniformly marking "dry mouth" as "thirst" to ensure data consistency and standardization.

[0038] The dataset primarily includes key information such as the patient's symptom description, current medical history, diagnosis, and treatment plan. For example, symptom descriptions of "headache," "loss of appetite," or "stomach pain" are extracted into standardized terms such as "headache" and "poor appetite," and these are mapped to corresponding diagnostic results and treatment recommendations. This key information is extracted and structured into a standardized data format. Common symptoms include headache, fever, nausea, loss of appetite, and physical weakness, which serve as crucial reference information during Traditional Chinese Medicine (TCM) diagnosis and treatment.

[0039] When formatting the dataset, the JSON format is used to store and manage the data. The standardized fields include:

[0040] Instruction: Task description, such as "Please provide Traditional Chinese Medicine diagnosis and treatment recommendations based on the symptoms and current medical history provided by the user."

[0041] Input: Includes a detailed description of the patient's chief complaint, current medical history, etc., such as "Chief complaint: headache, loss of appetite, accompanied by nausea, lasting for three days."

[0042] Output: Generated TCM diagnosis and treatment recommendations, such as "Diagnosis: Wind-cold headache, syndrome type is wind-cold invasion, recommendation: use wind-dispelling and exterior-clearing drugs, combined with acupuncture treatment."

[0043] Through the above steps, not only high-quality data screening is achieved, but also the structuring and standardization of the dataset are ensured, so that it can effectively support the training and optimization of subsequent models.

[0044] (2) Next, this application constructs and trains an intelligent diagnosis and treatment model of traditional Chinese medicine based on artificial intelligence: Given that Llama3.1-8B is a large-scale language model with powerful natural language processing and generation capabilities, it is particularly suitable for processing ambiguous language and complex symptom descriptions in traditional Chinese medicine diagnosis. Selecting this model as the base can effectively improve the diagnostic accuracy and generate diagnostic recommendations that are consistent with traditional Chinese medicine theory.

[0045] Furthermore, this application combines traditional Chinese medicine diagnosis and treatment data with classical literature to form a large-scale traditional Chinese medicine corpus, fine-tunes the Llama3.1-8B-Chinese-Chat model, and learns traditional Chinese medicine professional knowledge and diagnostic logic. During the training process, the total batch size is set to 256, the learning rate is 5e-5, 5 rounds of training, the maximum sequence length is 4096 words, the warm-up ratio is 0.08, and there is no weight decay. The model performance is improved by optimizing the training parameters, and the reinforcement learning and human feedback (RLHF) mechanism is introduced to optimize the model output based on human expert evaluation and feedback to improve the diagnostic accuracy and intelligence level.

[0046] Specifically, during the fine-tuning process, LoRA (Low-Rank Adaptation) technology was used to efficiently adjust model parameters to meet the needs of TCM diagnosis tasks, optimize TCM diagnosis tasks, and learn TCM diagnostic logic and language features. LoRA technology reduces the number of parameters that need to be adjusted during training by introducing low-rank matrix decomposition, thereby improving training efficiency and reducing the consumption of computing resources. In the scenario of intelligent TCM diagnosis and treatment, LoRA allows only fine-tuning of low-rank parameters related to the task without large-scale adjustment of the weights of the entire model, thereby greatly improving the resource efficiency of training while maintaining the model generation capability. Specific parameter settings include a batch size of 256, a learning rate of 5e-5, a sequence length of 4096, and 5 training rounds.

[0047] Specifically, in order to further improve the quality of model output, reinforcement learning with human feedback (RLHF) technology was introduced to further optimize the model's diagnostic capabilities. RLHF evaluates and adjusts the model output by building a reward model and combining it with feedback from TCM experts. At this stage, the model is first trained to master basic TCM diagnostic tasks through supervised fine-tuning (SFT), and then a reward function is designed based on expert feedback to evaluate the accuracy, logic, and relevance of the generated results. Through reinforcement learning training (such as the proximal policy optimization (PPO) algorithm), the model continuously adjusts its strategy based on rewards and optimizes the generation process, enabling the model to provide more accurate diagnoses and suggestions that are more in line with TCM theory in practical applications.

[0048] (3) This application adopts a dialogue interaction process: in the form of dialogue, the patient is guided to describe the symptoms in detail, covering the onset time, characteristics, accompanying symptoms, changes in the condition, etc., to ensure a comprehensive understanding of the condition. The model gives a possible diagnosis and explanation of the condition based on the symptom information, combined with the knowledge base and diagnostic logic, and provides personalized treatment recommendations. The system guides the patient to describe the symptoms in detail through question and answer. The system combines the input symptoms with the knowledge base to generate diagnostic results and personalized treatment recommendations. For difficult diseases, the system supports real-time retrieval of authoritative traditional Chinese medicine data to enrich the basis for diagnosis.

[0049] The following is the result of comparing the diagnostic model of this application with other models. Among them, the model of this application (OurModel) is the Llama3.1-8B-Chinese-Chat model, and LoRA is used to adjust the parameters of the diagnostic model, and the RLHF method is used to optimize the diagnostic model.

[0050] Figure 2 In the box plot, the model of this application (OurModel) is compared with other comparison models (such as ERNIE, Spark4 and ZJModel). It can be clearly seen that the similarity distribution of the model of this application is wide, and the median is 0.50, which is significantly higher than other models. Specifically, the median similarity of ERNIE and Spark4 is only 0.17, which performs poorly, indicating that they have significant deficiencies in adapting to the task of traditional Chinese medicine diagnosis. The median similarity of ZJModel is 0.20, which is still lower than the model of this application. This shows that the model of this application is superior to these comparison models in understanding and generating texts that conform to the logic of traditional Chinese medicine diagnosis, has stronger adaptability, and the generated diagnosis results are semantically closer to the reference text.

[0051] Figure 3 The scatter plots of different models on BLEU and ROUGE are shown. The yellow dots in the figure represent the diagnostic model (OurModel) used by the system of this application, while the dots of other colors represent ZJModel (blue), ERNIE (red), and Spark4 (green). As can be seen from the figure, the model of this application performs well in both BLEU and ROUGE indicators, and most of the dots are concentrated in the higher score range, especially in the ROUGE indicator, which significantly outperforms other models. Specifically, in the area with high BLEU scores, our model (yellow dots) has a higher ROUGE score, indicating that the generated text performs well in both language fluency and information coverage.

[0052] The following are specific application cases of the TCM diagnosis system of this application.

[0053] Case 1

[0054] enter:

[0055] User: I've been experiencing insomnia for a month and feel tired and exhausted during the day. I also have dry stools but normal urination, and a poor appetite. Please provide a diagnosis and suggestions.

[0056] Output:

[0057] Assistant: Thank you for the information you provided. Based on your symptoms, the likely diagnosis is depression and deficiency of both the heart and spleen. We recommend getting plenty of rest, maintaining a healthy lifestyle, and focusing on regulating the imbalance of yin and yang in your body. Traditional Chinese medicine can help balance yin and yang and prevent worsening of your condition. Maintaining a calm mind and regular exercise can also help relieve fatigue. Please consult a professional doctor for a personalized treatment plan. I wish you a speedy recovery. Remember, health comes first, and maintain a positive attitude. I wish you a speedy recovery.

[0058] Case 2

[0059] enter:

[0060] User: I've been experiencing insomnia and a lipoma in my abdomen for three years. The lipoma has remained unchanged, and my insomnia has improved. I also have cloudy urine, frequent stomach discomfort, and occasional chest tightness and shortness of breath. My bowel movements are normal, and my appetite is fine. Please provide a diagnosis and advice.

[0061] Output:

[0062] Assistant: Thank you for describing your symptoms in detail. I'll do my best to help. Based on your description, possible diagnoses are: 1. Insomnia, 2. Lipoma, 3. Splenomegaly, 4. Stomach Yin Deficiency, and 5. Insomnia. We recommend maintaining a healthy lifestyle, avoiding overwork, and maintaining a calm mind. You can try relaxation techniques such as deep breathing, yoga, or meditation. Also, pay attention to your diet, consuming more fruits and vegetables and less spicy and greasy foods. If symptoms worsen, seek medical attention immediately. I hope these suggestions are helpful!

[0063] Case 3

[0064] enter:

[0065] User: I've been experiencing persistent anxiety and stress for the past two months. I often feel timid and nervous, and I sleep lightly at night, waking early and having trouble falling back asleep. I also feel like there's a blockage in my throat, but I can swallow normally. My appetite is fine, and my bowel movements and urination are normal. Please provide a diagnosis and advice.

[0066] Output:

[0067] Assistant: Considering the symptoms you've mentioned, I believe you may be suffering from insomnia with characteristics of an anxiety disorder. I recommend the following measures to improve your symptoms: 1. Get enough sleep and avoid caffeine and alcohol. 2. Moderate exercise, such as walking or yoga, can relieve anxiety. 3. Learn relaxation techniques, such as deep breathing or meditation, to help you relieve tension in your daily life. 4. Try mindfulness meditation, which can help reduce anxiety reactions. 5. If symptoms persist or worsen, I recommend seeking professional psychological counseling. Remember, an active lifestyle is crucial to improving your symptoms. I wish you good health!

[0068] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.

Claims

1. A Chinese medicine diagnosis system based on artificial intelligence, characterized in that: include: The data acquisition and preprocessing module is used to obtain training data and perform preprocessing operations on the training data to form a training data set. The data acquisition and preprocessing module is also used to obtain data of patients to be diagnosed. The data processing module is used to train the diagnostic model using the training data set obtained by the data acquisition and preprocessing module, and to process the data of the patient to be diagnosed using the trained diagnostic model and output the diagnostic results.

2. The artificial intelligence-based Chinese medicine diagnosis system according to claim 1, characterized in that: The data acquisition and preprocessing module obtains the data of the patient to be diagnosed in the form of questions and answers by setting up a dialog box.

3. The artificial intelligence-based Chinese medicine diagnosis system according to claim 1, characterized in that: The training data is obtained through at least one of the following methods: historical cases, traditional Chinese medicine books.

4. The artificial intelligence-based Chinese medicine diagnosis system according to claim 1, characterized in that: The preprocessing operation includes data cleaning operation, data standardization operation and key information extraction operation.

5. The artificial intelligence-based Chinese medicine diagnosis system according to claim 1, characterized in that: The diagnostic model is the Llama3.1-8B model, and LoRA is used to adjust the parameters of the diagnostic model, and the RLHF method is used to optimize the diagnostic model.

6. The artificial intelligence-based Chinese medicine diagnosis system according to claim 5, characterized in that: The data processing module also includes support for real-time retrieval of authoritative traditional Chinese medicine data.

7. The artificial intelligence-based Chinese medicine diagnosis system according to claim 1, characterized in that: The data processing module also outputs treatment recommendations.

8. A Chinese medicine diagnosis method based on artificial intelligence, characterized in that: Including the artificial intelligence-based traditional Chinese medicine diagnosis system as described in any one of claims 1 to 7, outputting the diagnosis result through the traditional Chinese medicine diagnosis system.

9. A computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, wherein the executable instruction enables a processor to perform operations corresponding to the artificial intelligence-based traditional Chinese medicine diagnosis method as described in claim 8.

10. A computer device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the artificial intelligence-based traditional Chinese medicine diagnostic method as described in claim 8.