Insomnia acupuncture formula prediction method based on machine learning

CN122822293APending Publication Date: 2026-09-25JIANGSU YAHUAN SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610951304.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0003]在实际的失眠症临床治疗中,由于每位患者的病因和症状存在差异,因此针刺治疗方案的选择也非常复杂,传统的针刺组方方法主要依赖于临床医生的经验和知识,但这种方法存在主观性强、个体差异难以把握等问题,使得难以对每一位患者给出最优的针刺治疗方案,因此,亟需一种基于机器学习的新方法,能够更加准确和鲁棒地预测失眠症患者的最佳针刺组方

Benefits of technology

[0013]本发明的有益效果为:本发明提供的对失眠症针刺组方的预测方法使用各种机器学习技术预测最适合目标失眠症病人的针刺组方,将使用来自医院的人口统计数据、生理指标、治疗前的评估数据、详细健康状况、症状表现、针刺组方数据构建预测模型,以预测针刺组方并量化该模型的准确性在数据集的独立部分上建模,本发明还将对病人不同类型的特征进行分类处理后进行拼接和归一化处理,并使用多种机器学习模型进行训练,最后,挑选最佳模型,预测最适合目标失眠症病人的针刺组方,与现有研究相比,通过使用更广泛、更精准的患者数据集训练并测试多种机器学习模型,进而实现对失眠症针刺组方的预测,避免了传统失眠症针刺组方方法依赖于临床医生的经验和知识,主观性强、个体差异难以把握等问题,也解决在有效解释非线性关系和变量-变量相互作用的能力方面受到限制的问题,并且它们依赖于在人类生物系统中可能不正确的假设。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122822293A_ABST
    Figure CN122822293A_ABST
Patent Text Reader

Abstract

The application provides a kind of insomnia acupuncture formula prediction method based on machine learning, it is related to medical scheme prediction field, collects and collates known insomnia patient acupuncture formula set, determines corresponding insomnia patient sign health data set, and establishes basic data set;The basic data set established is preprocessed;Combining various machine learning models is trained on data set, and the corresponding target prediction model is selected;Based on the machine learning model selected;Based on the probability of various acupuncture formula used by the target patient predicted by the final model, the final insomnia patient acupuncture formula prediction result is obtained.The traditional insomnia acupuncture formula method avoids relying on the experience and knowledge of clinicians, is highly subjective, and is difficult to grasp individual differences, etc.Also solves the problem that the ability to effectively explain nonlinear relationships and variable-variable interactions is limited, and they rely on incorrect assumptions in human biological systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of edge computing technology, and in particular to a machine learning-based method for predicting acupuncture prescriptions for insomnia. Background Technology

[0002] Insomnia is a common sleep disorder characterized by difficulty falling asleep, difficulty maintaining sleep, early awakening, and poor sleep quality. Insomnia not only affects the quality of life of patients, but may also lead to a series of physical and mental health problems, such as depression, anxiety, poor concentration, and decreased immunity. The causes of insomnia are complex, including psychological and environmental factors, as well as physiological factors, such as neurotransmitter imbalance and circadian rhythm disorder.

[0003] In actual clinical treatment of insomnia, the choice of acupuncture treatment plan is very complex because the causes and symptoms of each patient are different. Traditional acupuncture prescription methods mainly rely on the experience and knowledge of clinicians, but this method has problems such as strong subjectivity and difficulty in grasping individual differences, making it difficult to give the optimal acupuncture treatment plan for each patient. Therefore, there is an urgent need for a new method based on machine learning that can more accurately and robustly predict the best acupuncture prescription for insomnia patients. Summary of the Invention

[0004] This invention provides a machine learning-based method for predicting acupuncture prescriptions for insomnia. The method addresses the problems existing in current clinical acupuncture treatment plans for insomnia by using machine learning to process patients using various acupuncture plans, train multiple machine learning models to find the applicable population for various acupuncture prescriptions, and finally establish a prediction model to obtain an acupuncture prescription prediction system.

[0005] The methods include: S101. Collect and organize known acupuncture prescriptions for insomnia patients, determine the corresponding health data set of insomnia patients, and establish a basic dataset; S102. Perform preprocessing operations on the established basic dataset; preprocessing operations include missing data imputation and patient information encoding. S103. Combine multiple machine learning models to train on the dataset, and test the reliability of the machine learning models on the test set until the prediction accuracy meets the requirements, and select the best model. S104. Based on the selected best-performing machine learning model, the dataset is randomly divided into training and test sets multiple times, and the model with the highest accuracy is selected as the final model for the acupuncture prescription prediction task for insomnia patients. S105. Use the final model to predict the probability of various acupuncture prescription treatment plans that the target patient may adopt, and take the acupuncture prescription treatment plan with the highest probability as the final acupuncture prescription prediction result for insomnia patients.

[0006] It should be further noted that in step S101, the collection and organization of known acupuncture prescriptions for insomnia patients is as follows: M = M1M2...Mp; The corresponding insomnia patient health data set was determined as follows. P=P11P12...P1aP21P22...P2a...Pp1Pp2...Ppa; Where 'a' represents the dimension of patient health data, and 'p' represents the number of patients with insomnia.

[0007] It should be further noted that step S101 also includes: S1011. Define Pi as the physical health data of the i-th insomnia patient; Pi1~Pia as a characteristic of the patient; Mi as the acupuncture prescription matched with the i-th insomnia patient; S1012, the acupuncture formula includes: unblocking the Du meridian to nourish the heart, unblocking the Du meridian to regulate the Wei meridian, and unblocking the Du meridian to regulate the Zang organs.

[0008] S1013. Select the physical health data characteristics of patients with insomnia. The physical health data characteristics include: demographic data: gender, education level, marital status, occupation, patient complaints, age, height, and weight; physiological indicators: vital signs such as blood pressure, heart rate, body temperature, and respiration; pre-treatment assessment data: PSQI (Pittsburgh Sleep Quality Index), ISI (Insomnia Severity Index), FSS (Fatigue Severity Scale), and SAS (Self-Rating Anxiety Scale); detailed health status: endocrine and metabolic system, neuropsychiatric system, musculoskeletal system, history of tumors, other systemic diseases, and daytime function; symptom manifestations: emotional symptoms, head and face symptoms, cardiothoracic symptoms, spleen and stomach symptoms, digestive symptoms, and reproductive symptoms; tongue appearance and pulse appearance; sleep monitoring: detailed monitoring indicators of various sleep times and sleep pulse rates.

[0009] It should be further noted that the specific preprocessing steps for the data in step S102 are as follows: S1021. For numerical data, if there is missing data, fill it with the average of the values ​​of all other patients with the same acupuncture prescription. S1022. For text data, if there is missing data, it is assumed that the patient does not have any special symptoms for that item, so it is uniformly filled with "none". S1023. For numerical data, convert the original numerical values ​​into feature vectors. S1024. For text data, each text data in the collected patient vital signs and health data consists of several words representing patient characteristics separated by commas. First, it is cut into entities according to commas. After embedding using BioBERT, the embedding vectors of several entities within the same feature are averaged and converted into feature vectors. S1025. After processing the above information, the resulting vectors are concatenated into a one-dimensional vector and normalized so that all data are in the range of (0, 1). This one-dimensional vector is the encoding result of the corresponding patient information.

[0010] It should be further noted that the machine learning models used in step S103 include, but are not limited to, extreme gradient boosting classifiers, stacked models of four better algorithms among the remaining algorithms, random forest classifiers, gradient boosting classifiers, decision tree classifiers, K nearest neighbor classifiers, Gaussian Naive Bayes classifiers, and support vector classifiers.

[0011] It should be further noted that in step S103, the machine learning model is also evaluated, and the evaluation metrics include: accuracy score, recall, precision, and F1 score.

[0012] It should be further noted that in step S104, when the dataset is randomly divided into training and test sets multiple times, the division is based on 90% training set and 10% test set.

[0013] The beneficial effects of this invention are as follows: The method for predicting acupuncture prescriptions for insomnia provided by this invention uses various machine learning techniques to predict the most suitable acupuncture prescription for the target insomnia patient. It constructs a prediction model using demographic data, physiological indicators, pre-treatment assessment data, detailed health status, symptom presentation, and acupuncture prescription data from hospitals to predict the acupuncture prescription and quantify the accuracy of the model on independent parts of the dataset. This invention also classifies and normalizes the characteristics of different patient types, and trains them using multiple machine learning models. Finally, it selects the best model to predict the most suitable acupuncture prescription for the target insomnia patient. Compared with existing research, by using a broader and more accurate patient dataset to train and test multiple machine learning models, it achieves the prediction of acupuncture prescriptions for insomnia. This avoids the problems of traditional acupuncture prescription methods for insomnia relying on the experience and knowledge of clinicians, being highly subjective, and having difficulty grasping individual differences. It also solves the problem of limitations in effectively explaining nonlinear relationships and variable-variable interactions, and these methods rely on assumptions that may be incorrect in human biological systems. Attached Figure Description

[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 Flowchart of a machine learning-based acupuncture prescription prediction method for insomnia; Figure 2 This is a flowchart illustrating the process of generating prediction results for acupuncture prescriptions for the target patient in this invention. Detailed Implementation

[0015] The insomnia acupuncture prescription prediction method based on machine learning provided by this invention uses machine learning to process patients using various acupuncture prescriptions, train multiple machine learning models, select the best model to find the applicable population for various acupuncture prescriptions, and finally establish a prediction model to obtain an insomnia acupuncture prescription system.

[0016] The insomnia acupuncture prescription prediction method can acquire and process related data based on artificial intelligence technology. The insomnia acupuncture prescription prediction method uses digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. The insomnia acupuncture prescription prediction method mainly includes natural language processing technology and machine learning / deep learning.

[0017] The acupuncture prescription prediction method for insomnia also has machine learning capabilities. The machine learning and deep learning in the method of this invention typically include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and other techniques.

[0018] The machine learning algorithms used in the insomnia acupuncture prescription prediction method include the Extreme Gradient Boosting Classifier, the Stacking Model of Four Optimal Algorithms (a stack of four relatively good algorithms), Random Forest Classifier, Gradient Boosting Classifier, Decision Tree Classifier, K-Nearest Neighbors Classifier, Gaussian Naive Bayes Classifier, and Support Vector Classifier. By obtaining the corresponding target prediction model, the method generates a corresponding predictive acupuncture prescription based on the vital signs data of the target patient. This addresses the problems of relying on the experience and knowledge of clinicians, strong subjectivity, difficulty in grasping individual differences, and limitations in effectively explaining nonlinear relationships and variable-variable interactions.

[0019] like Figure 1 A flowchart illustrating a preferred embodiment of the machine learning-based acupuncture prescription prediction method for insomnia according to the present invention is shown.

[0020] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0021] Please see Figures 1 to 2 The diagram shows a flowchart of a machine learning-based acupuncture prescription prediction method for insomnia in a specific embodiment. The method includes: S101. Retrieve in batches the vital signs and health data of insomnia patients and the corresponding valid acupuncture prescriptions and clinical prescriptions from the electronic medical record information system to form a basic dataset. This is based on collecting and organizing known prescriptions from insomnia patients. , The corresponding insomnia patient health data set was determined as follows. , Where 'a' represents the dimension of patient health data, and 'p' represents the number of patients with insomnia.

[0022] As an embodiment of the present invention, the collected data is defined as follows: S1011, Definition The physical and health data of the i-th insomnia patient; ~ For the patient's a characteristics; Acupuncture prescription matched to the i-th insomnia patient; S1012, the acupuncture formula includes: unblocking the Du meridian to nourish the heart, unblocking the Du meridian to regulate the Wei meridian, and unblocking the Du meridian to regulate the Zang organs.

[0023] S1013. Select the physical health data characteristics of patients with insomnia. The physical health data characteristics include: demographic data: gender, education level, marital status, occupation, patient complaints, age, height, and weight; physiological indicators: vital signs such as blood pressure, heart rate, body temperature, and respiration; pre-treatment assessment data: PSQI (Pittsburgh Sleep Quality Index), ISI (Insomnia Severity Index), FSS (Fatigue Severity Scale), and SAS (Self-Rating Anxiety Scale); detailed health status: endocrine and metabolic system, neuropsychiatric system, musculoskeletal system, history of tumors, other systemic diseases, and daytime function; symptom manifestations: emotional symptoms, head and face symptoms, cardiothoracic symptoms, spleen and stomach symptoms, digestive symptoms, and reproductive symptoms; tongue appearance and pulse appearance; sleep monitoring: detailed monitoring indicators of various sleep times and sleep pulse rates.

[0024] S102. Perform preprocessing operations on the established basic dataset, including missing data imputation and patient information encoding; In step S102, the specific preprocessing steps for the data are as follows: S1021. For numerical data, if there is missing data, fill it with the average of the values ​​of all other patients with the same acupuncture prescription. S1022. For text data, if there is missing data, it is assumed that the patient does not have any special symptoms for that item, so it is uniformly filled with "none". S1023. For numerical data, convert the original numerical values ​​into feature vectors. S1024. For text data, each text data in the collected patient vital signs and health data consists of several words representing patient characteristics separated by commas. First, it is cut into entities according to commas. After embedding using BioBERT, the embedding vectors of several entities within the same feature are averaged and converted into feature vectors. BioBERT is a model that initializes weights using BERT and continues pre-training based on a corpus in the biomedical field. Essentially, it is an extended version of BERT, and its performance is far superior to BERT in information mining tasks of medical texts.

[0025] S1025. After processing the above information, the resulting vectors are concatenated into a one-dimensional vector and normalized so that all data are in the range of (0, 1). This one-dimensional vector is the encoding result of the corresponding patient information.

[0026] S103. Combine multiple machine learning models to train on the dataset, and test the reliability of the machine learning models on the test set until the prediction accuracy meets the requirements, and select the best model. The machine learning algorithms used include the Extreme Gradient Boosting Classifier, the Stacking Model of Four Optimal Algorithms (one of the better algorithms), the Random Forest Classifier, the Gradient Boosting Classifier, the Decision Tree Classifier, the K-Nearest Neighbors Classifier, the Gaussian Naive Bayes Classifier, and the Support Vector Classifier.

[0027] The various machine learning models are described below: (1) XGBoost Extreme Gradient Boosting Classifier: It is an improved gradient boosting method that improves the generalization ability of the model by regularizing the model and performs well when dealing with large-scale data.

[0028] (2) Stacking model: By combining four high-performing basic machine learning models, and then using a meta-learner to synthesize the outputs of these basic models, the overall prediction performance is improved.

[0029] (3) RF Random Forest Classifier: Random forest is an ensemble learning method based on multiple decision trees. It improves the accuracy and stability of classification by voting on the results of multiple decision trees.

[0030] (4) GB gradient booster classifier: By gradually building a series of weak classifiers and combining them into a strong classifier, it can effectively handle complex classification problems.

[0031] (5) DT Decision Tree Classifier: It is a classification method based on a tree structure. It forms tree-like classification rules by making conditional judgments on the features of the data. It is intuitive and easy to understand.

[0032] (6) KNN K nearest neighbor classifier: It is a non-parametric, supervised learning classifier that classifies or predicts new data points by calculating the distance between new data points and the central points of the training dataset.

[0033] (7) GNB Gaussian Naive Bayes Classifier: Based on Bayes' theorem, it classifies data by assuming that the features are independent of each other and that each feature conforms to a Gaussian distribution. It is suitable for classifying high-dimensional data.

[0034] (8) SVC Support Vector Classifier: It achieves classification by finding a hyperplane in a high-dimensional space to maximize the classification boundary, and has good generalization ability.

[0035] In step S103, the present invention further evaluates the machine learning models. Evaluation metrics include accuracy score, recall, precision, and F1 score. Specifically, for the collected patient dataset, a 10-fold cross-validation method is used to systematically evaluate the machine learning models. Simultaneously, a grid search method is used to identify the optimal hyperparameters for each model. Finally, these optimal hyperparameters are used to evaluate the models. Commonly used performance metrics include: (1) Accuracy score: We only consider the proportion of correct results.

[0036] (2) Recall rate: , refers to the percentage of samples that are actually true that are judged as "true".

[0037] (3) Precision: This refers to the percentage of samples that are indeed true among all samples deemed "true" by the system.

[0038] (4) F1 score: Precision is the harmonic mean of Recall, which measures the model's ability to classify positive and negative scenarios.

[0039] All results are compared together to determine the machine learning algorithm whose performance meets the preset requirements based on accuracy metrics.

[0040] In step S103, the present invention uses the ten-fold cross-validation method to evaluate the machine learning model. Specifically, the collected patient dataset is randomly divided into ten subsets. Each time, one subset is selected as the validation set, and the remaining nine subsets are used as the training set. This process is repeated ten times to ensure that each subset is used as a validation set once. This method can effectively reduce the variance of the model evaluation, avoid model overfitting, improve the model's generalization ability, and thus obtain more stable and reliable evaluation results.

[0041] In step S103, the present invention employs a grid search method to optimize the hyperparameters of the machine learning model. Grid search exhaustively searches for predefined combinations of hyperparameters and performs 10-fold cross-validation on each set of hyperparameters to find the hyperparameter combination that optimizes the model's performance. The specific process includes: defining the search range of hyperparameters, applying each possible combination to the model, evaluating the performance of each combination based on the cross-validation results, and finally selecting the best-performing hyperparameter combination for the final training and evaluation of the model. This method can effectively optimize the model's performance and improve the accuracy and reliability of predictions.

[0042] S104. Based on the selected best-performing machine learning model, the dataset is randomly divided into training and test sets multiple times, and the model with the highest accuracy is selected as the final model for the acupuncture prescription prediction task for insomnia patients.

[0043] S105. Use the final model to predict the probability of various acupuncture prescription treatment plans that the target patient may adopt, and take the acupuncture prescription treatment plan with the highest probability as the final acupuncture prescription prediction result for insomnia patients.

[0044] Thus, this invention collects patient datasets based on the aforementioned machine learning-based acupuncture prescription prediction method for insomnia, and trains and tests various machine learning models using a broader and more accurate patient dataset. In this way, the best model is selected and the analysis and prediction of clinical prescriptions for insomnia are achieved. This avoids the problems of traditional acupuncture prescription methods for insomnia relying on the experience and knowledge of clinicians, being highly subjective, and having difficulty in grasping individual differences. It also solves the problem of being limited in the ability to effectively explain nonlinear relationships and variable-variable interactions.

[0045] This invention retrieves health data and corresponding acupuncture treatment plans from electronic medical record systems in batches. The data is then aggregated, categorized, and normalized based on different patient characteristics to form a dataset containing health data and applicable acupuncture treatment plans for insomnia patients. Multiple machine learning models are then trained on this dataset, and the reliability of different prediction models is tested. The best-performing model is selected. Based on this best-performing model, the dataset is randomly divided into training and testing sets multiple times. The model with the highest accuracy is selected as the final model for the task. Using the trained model, the probability of a target patient needing various acupuncture treatment plans can be predicted, and the acupuncture treatment plan with the highest probability is taken as the final acupuncture prescription prediction result for insomnia patients.

[0046] This improves the accuracy and robustness of acupuncture prescription prediction results for insomnia patients, reduces the risk of multiple data affecting prediction accuracy, thereby enabling full-process supervision of acupuncture prescription prediction, reducing the complexity and difficulty of prediction, and enhancing the scientific nature of prediction.

[0047] In one embodiment of the present invention, based on step S103, a possible embodiment will be given below, and its specific implementation will be described in a non-limiting manner.

[0048] For example, the basic steps for training an XGBoost model are as follows: (1) Randomly select m features from the features. (2) Randomly select n samples from the sample. (3) Train a basic model based on the samples and features obtained in the first and second steps.

[0049] (4) By weighted combination of multiple basic models, the error of the model is gradually reduced. The number of iterations is 100, that is, 100 basic models are trained.

[0050] (5) After a new data input, the class or value of the new data is predicted by a weighted combination of multiple basic models.

[0051] For example, the basic steps for training a Random Forest (RF) model are as follows: (1) Randomly select m features from the features. (2) Randomly select n samples from the sample. (3) Train a decision tree model based on the samples and features obtained in the first and second steps. (4) Iterate through the first three steps to obtain multiple decision tree models. The number of iterations is 200, that is, train 200 decision tree models.

[0052] (5) After a new data input, the class or value of the new data is predicted by voting through multiple decision tree models.

[0053] The specific training process for other models will not be elaborated upon due to space limitations.

[0054] To illustrate with examples, the accuracy scores of different models on the collected dataset of insomnia patients during the implementation of this invention are shown in the table below:

[0055] Since we aim to predict acupuncture prescriptions that best match the target patient—that is, to predict the acupuncture prescription suitable for a particular patient, the best prediction among all acupuncture prescriptions should be the one that best matches the target patient—we use accuracy scores as the metric for selecting the best machine learning model. Based on the accuracy scores on the test set, we select an extreme gradient boosting classifier as the best acupuncture prescription prediction model for insomnia patients.

[0056] The dataset was randomly divided into training and test sets multiple times at a ratio of 9:1. The selected best model was trained multiple times, and the model with the highest accuracy on the test set among the multiple divisions was selected as the final model for the acupuncture prescription prediction task for insomnia patients.

[0057] To illustrate with examples, the final model for predicting acupuncture prescriptions for insomnia patients, obtained through multiple training iterations during the implementation of this invention, performs as follows on the test set: Model accuracy: 91.30% Nourishing the Heart and Regulating the Governing Vessels: Precision: 1.00, Recall: 0.92, F1 Score: 0.96 Detection and screening results: Precision rate: 1.00, Recall rate: 0.80, F1 score: 0.89 Viagra: Precision: 0.71, Recall: 1.00, F1 Score: 0.83 By inputting the physical signs and health data of the target insomnia patient into the final model, the prediction results of the acupuncture prescription can be obtained.

[0058] The units and algorithm steps of the various examples described in the machine learning-based acupuncture prescription prediction method for insomnia provided by this invention can be implemented in electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this invention.

[0059] The flowcharts and block diagrams of the machine learning-based acupuncture prescription prediction method for insomnia illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, segment, or part of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the figures.

[0060] In the machine learning-based acupuncture prescription prediction method for insomnia, computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof. The aforementioned programming languages ​​include, but are not limited to, object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or power server.

[0061] Example 2 is an embodiment of the present invention, which differs from the previous embodiment in that: If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0062] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0063] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0064] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0065] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A machine learning-based method for predicting acupuncture prescriptions for insomnia, characterized in that: include: S101. Collect and organize known acupuncture prescriptions for insomnia patients, determine the corresponding health data set of insomnia patients, and establish a basic dataset; S102. Perform preprocessing operations on the established basic dataset; Preprocessing operations include missing data imputation and patient information coding; S103. Combine multiple machine learning models to train on the dataset, and test the reliability of the machine learning models on the test set until the prediction accuracy meets the requirements. Select the best model to obtain the corresponding acupuncture prescription prediction. S104. Based on the selected best-performing machine learning model, the dataset is randomly divided into training and test sets multiple times, and the model with the highest accuracy is selected as the final model for the acupuncture prescription prediction task for insomnia patients. S105. Use the final model to predict the probability of various acupuncture prescription treatment plans that the target patient may adopt, and take the acupuncture prescription treatment plan with the highest probability as the final acupuncture prescription prediction result for insomnia patients.

2. The machine learning-based acupuncture prescription prediction method for insomnia as described in claim 1, characterized in that: In step S101, the known prescriptions for insomnia patients are collected and organized as follows: ; The corresponding insomnia patient health data set was determined as follows. ; in, For the patient's vital signs and health data dimensions, This refers to the number of patients with insomnia.

3. The machine learning-based acupuncture prescription prediction method for insomnia as described in claim 2, characterized in that: Step S101 further includes: S1011. Define Pi as the physical health data of the i-th insomnia patient; Pi1~Pia as a characteristic of the patient; Mi as the acupuncture prescription matched with the i-th insomnia patient; S1012. Select the physical health data characteristics of insomnia patients. The physical health data characteristics include: demographic data: gender, education level, marital status, occupation, patient complaints, age, height, and weight; physiological indicators: vital signs such as blood pressure, heart rate, body temperature, and respiration; pre-treatment assessment data: PSQI (Pittsburgh Sleep Quality Index), ISI (Insomnia Severity Index), FSS (Fatigue Severity Scale), and SAS (Self-Rating Anxiety Scale); detailed health status: endocrine and metabolic system, neuropsychiatric system, musculoskeletal system, history of tumors, other systemic diseases, and daytime function; symptom manifestations: emotional symptoms, head and face symptoms, cardiothoracic symptoms, spleen and stomach symptoms, digestive symptoms, and reproductive symptoms; tongue appearance and pulse appearance; sleep monitoring: detailed monitoring indicators of various sleep times and sleep pulse rates.

4. The machine learning-based acupuncture prescription prediction method for insomnia as described in claim 1, characterized in that: In step S102, the specific preprocessing steps for the data are as follows: S1021. For numerical data, if there is missing data, fill it with the average of the value of all other patients with the same treatment. S1022. For text data, if there is missing data, it is assumed that the patient does not have any special symptoms for that item, so it is uniformly filled with "none". S1023. For numerical data, convert the original numerical values ​​into feature vectors. S1024. For text data, bag-of-words encoding is used to convert it into feature vectors. For text data, each text data in the collected patient vital signs and health data consists of several words representing patient features separated by commas. First, it is cut into entities according to commas. After embedding using BERT, the embedding vectors of several entities within the same feature are averaged and converted into feature vectors. S1025. For binary data, convert it into feature vectors with values ​​of "0" or "1"; S1026. After processing the above information, the resulting vectors are concatenated into a one-dimensional vector and normalized so that all data are in the range of (0, 1). This one-dimensional vector is the encoding result of the corresponding patient information.

5. The machine learning-based acupuncture prescription prediction method for insomnia as described in claim 1, characterized in that: In step S103, the machine learning models used include, but are not limited to, extreme gradient boosting classifiers, stacked models of four better algorithms among the remaining algorithms, random forest classifiers, gradient boosting classifiers, decision tree classifiers, K nearest neighbor classifiers, Gaussian Naive Bayes classifiers, and support vector classifiers.

6. The machine learning-based acupuncture prescription prediction method for insomnia as described in claim 5, characterized in that: In step S103, the machine learning model is also evaluated, and the evaluation metrics include: accuracy score, recall, precision, and F1 score.

7. The machine learning-based acupuncture prescription prediction method for insomnia as described in claim 1, characterized in that: In step S104, when the dataset is randomly divided into training and test sets multiple times, the division is done with 90% training set and 10% test set.

8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the machine learning-based acupuncture prescription prediction method for insomnia as described in any one of claims 1 to 7.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the machine learning-based acupuncture prescription prediction method for insomnia as described in any one of claims 1 to 7.