Disclosure of Invention
In order to solve the problems, the invention provides a medication prediction system for timely adjusting medication of a patient through a personalized neural network, and the invention adopts the following technical scheme:
the invention provides a medicine use prediction system based on a neural network, which is characterized by comprising the following components: the basic information acquisition module is used for acquiring basic information of the patient, and the basic information at least comprises a diagnosis conclusion of the patient and prescription conditions; the total healing duration prediction module is used for predicting the total healing duration of the patient by utilizing a pre-trained classification model based on basic information and taking the total healing duration as the first total healing duration T1(ii) a The tracking data acquisition module is used for acquiring feedback information of the patient in the medicine taking process as tracking data, and the tracking data comprises the taken medicine time delta t of the patient; residual duration prediction module based on basic informationThe time length needed by the patient when the patient reaches the recovery state is obtained through forecasting by utilizing a pre-trained time sequence model and is used as the residual time length T; a time length setting and judging module for setting the sum of the used time length delta T and the residual time length T as a second total healing time length T2And judging the total first healing duration T1And the total duration of the second healing period T2Whether they are similar; the pharmacodynamic survival analysis module is used for obtaining a pharmacodynamic curve taking the medication stoppage as a termination event through the COX regression model based on the basic information and the tracking data when the duration setting and judging module judges that the duration is not the duration setting and judging module; the drug effect curve optimizing module is used for optimizing the drug effect curve so as to obtain an optimized drug effect curve; the time sequence model fine tuning module is used for taking parameters corresponding to the optimized pharmacodynamic curve as a fine tuning direction, and fine tuning is carried out on the time sequence model according to the fine tuning direction, so that an individualized time sequence model is obtained; and the medication suggestion module predicts the medication of the patient at the next moment by utilizing the personalized time sequence model based on the tracking data, so that a medication prediction result is obtained and is used as a reference for the medication adjustment of the doctor.
The invention also provides a medicine prediction system based on the neural network, which is characterized in that: the training process of the pre-trained classification model and the pre-trained time sequence model comprises the following steps: step S1-1, acquiring a training basic data set and a training tracking data set; step S1-2, obtaining the actual healing duration of different patients according to the basic data set for training; step S1-3, building a classification model, training the classification model by using the actual healing time as a real label and using a training basic data set until the classification model is converged, thereby obtaining a trained classification model; and step S1-4, constructing a time sequence model, and training the time sequence model by using a training basic data set and a training tracking data set until the time sequence model is converged, thereby obtaining the trained time sequence model.
The invention also provides a medicine prediction system based on the neural network, which is characterized in that: the tracking data set for training is obtained through the following steps: step S2-1, obtaining the history of medication process of different patientsAn order data set; step S2-2, dividing the historical time sequence data set into a complete data set and an incomplete data set, taking the complete data set as a current complete data set, and separating the incomplete data set to obtain a right deletion data set; step S2-3, calculating the average duration N of the recording time of the historical time sequence data corresponding to all patients in the historical time sequence data set; step S2-4, determining the recording time n corresponding to each right deleted data in the right deleted data setiIf the average duration is longer than N, if so, the right deleted data is supplemented into the current complete data set to form a new current complete data set, and if not, the right deleted data is used as alternative data; step S2-5, calculating consistency index C between each alternative data and the current complete data setR(ii) a Step S2-6, judging consistency index C corresponding to each alternative dataRWhether greater than the standard conformance indexC0(ii) a And S2-7, when the judgment in the step S2-6 is yes, supplementing the alternative data into the current complete data set to form a new current complete data set as a tracking data set for training.
The invention also provides a medicine prediction system based on the neural network, which is characterized in that: wherein, the standard consistency indexC0The method comprises the following steps: step S3-1, based on the basic data set for training, using COX regression model to carry out regression analysis on the recovery conditions of the diseases corresponding to each patient, thereby obtaining the recovery curves corresponding to the patients; step S3-2, obtaining the prediction data of COX regression model according to the cure curve, calculating the consistency between the prediction data and the corresponding basic data set for training, and obtaining the standard consistency indexC0。
The invention also provides a medicine prediction system based on the neural network, which is characterized in that: wherein, the time sequence model is an LSTM model.
The invention also provides a medicine prediction system based on the neural network, which is characterized in that: the basic information also comprises basic information, detection indexes, disease symptoms and related indexes of the patient, and the tracking data comprises medication time, medicine dosage, symptom feedback, index change, medication delay and related matters.
According to the medicine use prediction system based on the neural network, the total healing time prediction module predicts the total healing time of the patient by using the pre-trained classification model, and the residual time prediction module predicts the time required by the patient to reach the healing state by using the pre-trained time sequence model, so that the healing time of the patient without medicine use is predicted by the classification neural network, the time required by the patient for healing is predicted by the time sequence data of a period of time taken by the patient through the time sequence neural network, if the two healing times are not consistent, the effect of taking the current medicine or medicine amount by the patient is not in accordance with the expected requirement and is adjusted in time, but the doctor considers the medicine use adjustment through the examination index of the patient, and the medicine use time of the patient can be shortened by adjusting the medicine in time, so that the patient can be healed quickly, realizes the safe medication supervision of patients. In addition, the time sequence model fine tuning module fine tunes the time sequence model according to the parameters corresponding to the optimized drug effect curve to obtain the personalized time sequence model, and then the personalized time sequence model is used for predicting to obtain the drug use prediction result of the patient at the next time, so that different patients correspond to the personalized time sequence model, the corresponding drug use prediction result is more targeted and has higher accuracy, and the appropriateness, effectiveness and safety of drug use are improved.
Detailed Description
In order to make the technical means, the creation features, the achievement purposes and the effects of the invention easy to understand, a neural network-based medication prediction system of the invention is specifically described below with reference to the embodiments and the accompanying drawings.
Examples
As shown in fig. 1, the neural network-basedmedication prediction system 1 includes a basicinformation acquisition module 11, a total healingtime prediction module 12, a trackingdata acquisition module 13, a remainingtime prediction module 14, a time setting andjudgment module 15, a drug effectsurvival analysis module 16, a drug effectcurve optimization module 17, a time sequence model fine-tuning module 18, and amedication suggestion module 19.
The basicinformation acquisition module 11 acquires basic information of a patient.
As shown in fig. 2, the basic information (as shown in fig. 2) includes basic information of the patient, detection index, disease symptom, related index (i.e., other index), diagnosis conclusion, and prescription condition.
The basic information is sex, age, height, weight and the like of the patient, the detection indexes are blood pressure, blood routine, urine routine and the like of the patient, the related indexes are medical images and other existing diseases, the diagnosis conclusion is the disease type of the patient, and the prescription condition is the prescription prescribed by a doctor and comprises the name of a medicine, the components of the medicine, the dosage and the like.
The total healingduration prediction module 12 predicts the total healing duration of the patient by using a pre-trained classification model based on the basic information and takes the total healing duration as the first total healing duration T1。
The trackingdata obtaining module 13 obtains feedback information of the patient during the medication process as tracking data, wherein the tracking data includes the medication time Δ t of the patient.
As shown in fig. 3, the tracking data includes time, drug dosage, symptom feedback, index change, medication delay, and related items (i.e., other items).
Time 1, 2, 3, 4, and the healing time is the medication time of the patient, such as the medication of the 1 st time, the medication of the 2 nd time, and the like; the dosage of the medicine is normal dosage, halved dosage and the like; symptom feedback uses 4, 3, 2, 1 and 0 to represent symptom degree, 4 is a little relieved of symptom, 0 is recovery, and the degrees corresponding to 3, 2 and 1 are analogized in sequence; index changes are similar to symptom feedback, withnumbers 6 to 0 reflecting the degree of index change; the delay of medication is to record the deviation of the patient's medication time from the prescribed time, for example, 0.5h represents 0.5h earlier for taking the medicine, 1h represents 1h later for taking the medicine; the relevant items are other data of the patient and are not described herein.
The remainingduration prediction module 14 predicts the duration required by the patient to reach the healing state by using a pre-trained time sequence model based on the basic information and the tracking data, and uses the duration as the remaining duration T. Specifically, a pre-trained time sequence model is used for predicting a state (namely a healing state) that the medicine dosage of the patient at a certain moment is absent, and the time required by the patient to reach the healing state is obtained according to the time corresponding to the state and is used as the residual time T.
As shown in fig. 4, the training process of the above-mentioned pre-trained classification model and pre-trained time sequence model includes the following steps:
step S1-1, a training basic data set and a training tracking data set are obtained.
As shown in fig. 5, the training trace data set is obtained by the following steps:
and step S2-1, acquiring historical time sequence data sets in the medication process of different patients.
And step S2-2, dividing the historical time sequence data set into a complete data set and an incomplete data set, taking the complete data set as a current complete data set, and separating the incomplete data set to obtain a right deletion data set.
The complete data in the complete data set refers to the complete data from the observation start point to the occurrence of the terminal event (i.e. the event that the patient is observed to die or be terminal).
Incomplete data means that the patient's observed cutoff is not due to a termination event, but due to other causes, including loss of visit (loss of patient contact), withdrawal (withdrawal of the patient from the study due to non-research or non-treatment factors), and termination (the time specified in the design has met the limit of terminating observation, but the patient has not yet healed).
Right deletion data means that the starting time of administration of the patient is known but the recovery time is unknown in follow-up observation of the patient.
The trace data acquired by the tracedata acquisition module 13 is right-deleted data.
And step S2-3, calculating the average duration N of the recording time of the historical time sequence data corresponding to all patients in the historical time sequence data set.
Step S2-4, determining the recording time n corresponding to each right deleted data in the right deleted data setiAnd if the average duration is longer than the average duration N, the right deleted data is supplemented into the current complete data set to form a new current complete data set if the average duration is yes, and the right deleted data is used as alternative data if the average duration is not yes.
Step S2-5, calculating consistency index C between each alternative data and the current complete data setR。
Step S2-6, judging consistency index C corresponding to each alternative dataRWhether greater than the standard conformance indexC0If yes, the process proceeds to step S2-7, if no, the candidate data are discarded, and then the process proceeds to step S2-5, where a consistency index C corresponding to the next candidate data is calculatedR。
Wherein, the standard consistency indexC0Specifically, the calculation is performed in the following steps S3-1 to S3-2.
And step S3-1, performing regression analysis on the disease healing conditions corresponding to each patient by using a COX regression model based on the training basic data set, thereby obtaining a healing curve corresponding to the patient.
In the disease survival analysis, each healing factor of a patient is used as a dependent variable, and the COX regression model can be used for obtaining the instantaneous death rate of the disease corresponding to the patient at a certain moment (namely, the healing rate of the patient at a certain moment). Wherein, the healing factors can be the course of medication, the timing of medication, the frequency of medication, the dosage and the like.
As shown in fig. 6, the horizontal axis represents the survival time of the disease, the vertical axis represents the survival rate of the disease, the two recovery curves represent the recovery curves of two patients under the same disease, and when the survival rate of the disease approaches to 0, the patient is cured. The healing time of different patients is different, and the healing curve can be changed by adjusting various healing factors, so that the healing time is shortened.
Step S3-2, obtaining the prediction data of COX regression model according to the cure curve, calculating the consistency between the prediction data and the corresponding basic data set for training, and obtaining the standard consistency indexC0。
In this embodiment, the consistency calculation steps are specifically as follows:
1. all samples were paired with each other for a total of N x (N-1)/2 pairs, where N is the number of samples. If a total of 20 patient data sets are assumed, N = 20.
2. The excluded pairs in the sample are: (1) the observation endpoint was not reached in both of the pairs, i.e. recovery was complete; (2) one patient a was administered for a shorter time than the other patient B, however patient a had not reached the event endpoint (this pairing did not tell who healed first). The number of pairs left at this time is denoted as M.
If it is assumed that the exclusion of 5 groups does not reach the observation end point; excluding 5 groups with non-uniform timing, 10 patients remained, i.e. log matched M = 10.
3. And calculating the number of pairs of the rest M pairs, wherein the number of pairs with the predicted result consistent with the actual result is recorded as K, namely (if the predicted medication time of one patient with longer medication time is longer than that of the other patient, or the medication time of one patient with higher predicted cure probability is longer than that of the other patient, the predicted result is consistent with the actual result, and the result is called as consistent.
4. As a result: calculate C-index = K/M, i.e. the standard conformance index C0=K0/M0. Assuming that the prediction is consistent with reality, denoted as K =10, C-index =10/20= 0.5.
And step S2-7, supplementing the alternative data into the current complete data set to form a new current complete data set as a tracking data set for training.
And step S1-2, obtaining the actual healing time of different patients according to the basic data set for training.
And step S1-3, building a classification model, training the classification model by using the actual healing time as a real label and using the training basic data set until the classification model is converged, thereby obtaining the trained classification model.
And step S1-4, constructing a time sequence model, and training the time sequence model by using a training basic data set and a training tracking data set until the time sequence model is converged, thereby obtaining the trained time sequence model.
The time sequence model is an LSTM model, and the LSTM model is a special RNN, can learn long dependency relationships and is a RNN with better memorability.
The time length setting and judgingmodule 15 sets the sum of the used time length delta T and the residual time length T as the second total healing time length T2And judging the total first healing duration T1And the total duration of the second healing period T2Whether or not they are close.
When the time length setting anddetermination module 15 determines yes, the patient medication does not need to be adjusted.
When the time length setting and determiningmodule 15 determines that the event is negative, the pharmacodynamic-survival analyzing module 16 obtains a pharmacodynamic curve in which the drug administration is stopped as a termination event through a COX regression model based on the basic information and the trace data.
In this embodiment, assuming that the predicted recovery period T1 of the patient is 15 days, and the medication period Δ T =6 and the remaining period T =12, the second total recovery period T is2= Δ T + T =18,. At this time, the duration setting and determiningmodule 15 determines whether the medication effect is not good.
The pharmacodynamiccurve optimizing module 17 optimizes the pharmacodynamic curve to obtain an optimized pharmacodynamic curve.
In this embodiment, the pharmacodynamiccurve optimizing module 17 optimizes the pharmacodynamic curve by adjusting the biased regression coefficient of independent variables (e.g., different drugs, different dosages) in the COX regression model, thereby obtaining an optimized pharmacodynamic curve with the shortest recovery time. Wherein, the biased return coefficient can be parameters such as medication time, medication frequency, dosage, medicine type and the like.
Suppose that the pharmacodynamic-survival analysis module 16 has a dose curve based on the underlying information and the follow-up data and obtained by a COX regression model as shown in fig. 7. In fig. 7, the vertical axis represents the target value of drug administration, the horizontal axis represents time (unit: day), the curve corresponding to "a patient" represents the curve obtained by actual drug administration, and the curve corresponding to "COX regression" represents the drug administration curve obtained by the pharmacodynamic-survival analysis module 16 using the COX regression model.
Next, the pharmacodynamiccurve optimization module 17 adjusts the bias return coefficient so that the target value of the medication curve is reduced, and the final optimized curve is shown in fig. 8.
The time sequence modelfine tuning module 18 uses the parameters corresponding to the optimized pharmacodynamic curve (i.e. the parameters such as the drug and the dosage corresponding to the optimized pharmacodynamic curve) as the fine tuning direction, and fine tunes the time sequence model according to the fine tuning direction, thereby obtaining the personalized time sequence model.
Themedication suggestion module 19 predicts the medication of the patient at the next time by using the personalized time sequence model based on the tracking data, so as to obtain a medication prediction result as a reference for the medication adjustment of the doctor.
As shown in fig. 9, the operation process of the neural network-basedmedication prediction system 1 includes the following steps:
step S4-1, the basicinformation obtaining module 11 obtains the basic information of the patient, and then step S4-2 is entered;
step S4-2, the total healingduration prediction module 12 predicts the total healing duration of the patient by using a pre-trained classification model based on the basic information, and the total healing duration is used as a first total healing duration T1Then, it goes to step S4-3;
step S4-3, the trackingdata obtaining module 13 obtains the feedback information of the patient in the medicine taking process as the tracking data, the tracking data includes the time length delta t of the taken medicine of the patient, and then the step S4-4 is entered;
step S4-4, the residualduration prediction module 14 predicts the duration needed by the patient to reach the recovery state by using a pre-trained time sequence model based on the basic information and the tracking data to be used as the residual duration T, and then the step S4-5 is carried out;
step S4-5, the duration setting and judgingmodule 15 sets the sum of the used duration Deltat and the remaining duration T as the second total healing duration T2And judging the total first healing duration T1And the total duration of the second healing period T2If the judgment result is yes, the medicine is not adjusted, and the process enters an end state;
step S4-6, the pharmacodynamicsurvival analysis module 16 obtains a pharmacodynamic curve taking the drug administration stop as a termination event through a COX regression model based on the basic information and the tracking data, and then the step S4-7 is carried out;
step S4-7, the pharmacodynamiccurve optimization module 17 optimizes the pharmacodynamic curve to obtain an optimized pharmacodynamic curve, and then the step S4-8 is carried out;
step S4-8, the time sequence modelfine tuning module 18 takes the parameters corresponding to the optimized pharmacodynamic curve as a fine tuning direction, fine tuning is carried out on the time sequence model according to the fine tuning direction, so as to obtain an individualized time sequence model, and then the step S4-9 is carried out;
and step S4-9, themedication suggestion module 19 predicts the medication of the patient at the next moment by using the personalized time sequence model based on the tracking data, so as to obtain a medication prediction result as a reference for the medication adjustment of the doctor, and then enters an ending state.
According to themedication prediction system 1 based on the neural network provided by the embodiment, the total healingtime prediction module 12 predicts the total healing time of the patient by using the pre-trained classification model, and the residualtime prediction module 14 predicts the time required by the patient to reach the healing state by using the pre-trained time sequence model, so that the healing time of the patient without medication is predicted by the classification neural network, the time required by the patient for long time to heal is predicted by the time sequence data of the patient taking a period of time through the time sequence neural network, if the two healing times are not consistent, the effect of the current medicine or the dosage taken by the patient is not in accordance with the expected need to be adjusted in time, but the doctor considers medication adjustment through the examination index of the patient, and the medication adjustment can shorten the medication time of the patient in time, the patient can be quickly cured, and the safe medication supervision of the patient is realized. In addition, the time sequence modelfine tuning module 18 fine tunes the time sequence model according to the parameters corresponding to the optimized drug effect curve to obtain an individualized time sequence model, and then the medication prediction result of the patient at the next time is obtained by using the individualized time sequence model prediction, so that different patients correspond to the individualized time sequence model, the corresponding medication prediction result is more targeted and has higher accuracy, and the medication appropriateness, effectiveness and safety are improved.
In the above embodiment, the complete data set and the incomplete data set are firstly classified into the historical time series data set, and then the average duration N and the standard consistency index are usedC0And further brushing and selecting right deleted data in the incomplete data set to form a new current complete data set as a tracking data set for training, so that under the condition that the historical time sequence data set is largely incomplete, as much useful data as possible are obtained from the historical time sequence data set as the tracking data set for training, and the two neural network models are ensured to have enough training data.
The above-described embodiments are merely illustrative of specific embodiments of the present invention, and the present invention is not limited to the description of the above-described embodiments.