Disclosure of Invention
The invention aims to provide an analgesia pump flow control method and device, which are used for outputting individually customized analgesia pump flow control aiming at each patient by using an artificial intelligence algorithm, can generate analgesia most suitable for the patient according to the self condition of each patient, can improve the postoperative life quality under the condition of ensuring safety, do not depend on the level of a doctor, and are suitable for large-area popularization.
The invention is realized by the following measures: a method for controlling the flow of an analgesic pump, wherein the method is applied to a processor and comprises the following steps of:
s1, establishing an analgesia pump database, recording the analgesia information such as sex, age, operation duration, operation position, operation mode, past history, smoking and alcoholism history and the like of the patient in the database, and simultaneously recording the standard analgesia dosage of the corresponding patient;
s2, training data through a stacking model structure, inputting model characteristics as database recording data, outputting results as appropriate analgesic measures, and performing model training;
s3, inputting medical data into the XGboost model, the LightGBM model and the Random Foreast model, outputting a measurement judgment result by each model, inputting all the results of the three models into a neural network model, performing weighted calculation on the results of the three models respectively to give a final result, and storing the trained models;
s4, deploying the trained model to a cloud server, inputting patient information into a stacking model structure after a new patient appears, and outputting a metering calculation result of the analgesic pump by the model.
In order to better achieve the above object, the present invention further provides an apparatus for implementing a method for controlling a flow rate of an analgesic pump, wherein the apparatus is applied to a processor and comprises a primary model and a secondary model for controlling the analgesic pump: the first-level model comprises an XGboost model, a LightGBM model and a Random Foreast model; the secondary model comprises a neural network model;
the apparatus for controlling an analgesic pump comprises the following:
s1, establishing an analgesia pump database, recording analgesia information such as sex, age, operation duration, operation position, operation mode, past history, smoking and alcoholism history and the like of a patient in the database, and simultaneously recording a standard analgesia metering device corresponding to the patient;
s2, training data through a stacking model structure, inputting model characteristics as database recording data, outputting results as appropriate analgesic measurement, and performing model training;
s3, inputting medical data into the XGboost model, the LightGBM model and the Random Foreast model, outputting a measurement judgment result by each model, inputting all the results of the three models into a neural network model, performing weighted calculation on the results of the three models respectively to give a final result, and storing the trained models;
and S4, deploying the trained model to a cloud server, inputting the patient information into a stacking model structure after a new patient appears, and outputting the metering calculation result of the analgesic pump by the model.
The invention comprises a training stage and an application stage in practical use:
a training stage: the method comprises the steps that 3 primary models are trained by utilizing patient physiological data and standard analgesic flow in a database respectively, then 3 models can all output analgesic flow results, then a neural network model is utilized to train the results of the 3 primary models, the analgesic flow given by the 3 models is input, the standard flow results are output, the input characteristics of the 3 primary models are the patient physiological data, the input label is the patient standard analgesic flow, the output result is algorithm calculation analgesic flow, the input characteristics of the secondary model are the analgesic flow calculated by the 3 primary models, the input label is the standard analgesic flow, and the output is the final calculation result of the algorithm.
An application stage: the physiological data of the patient is input into 3 primary models, the 3 models respectively give corresponding calculation results, the 3 results are input into a secondary model, and the secondary model integrates the results of the 3 primary models and outputs the final result to guide a doctor to take medicine.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention can achieve the advantages of reasonable medication and different treatment schemes according to the advantages of analgesia pump flow under the condition of the patient self condition.
2. The stability of the algorithm is improved by combining 3 models in the algorithm model, the result with larger difference is prevented from being output when the training of a single model fails, and the safety of the analgesia pump is improved.
3. The database required by the model can be continuously expanded according to clinical experience and patient feedback, and meanwhile, the accuracy of algorithm output measurement can be improved due to the addition of new training data.
4. The flow recommendation of the invention is generated by model calculation, does not need to depend on manpower, achieves the purpose of popularizing the experience of experts, can share the trained model to hospitals with weak medical resources, and improves the anesthesia level of the hospitals in the laggard areas.
5. When the hospital algorithm model is deployed at the cloud end, the hospital algorithm model can be shared by other hospitals, and the hospital business income is improved by selling the model using permission.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative of the invention and are not intended to be limiting.
Example 1
Referring to fig. 1 to 2, the present invention provides a method for controlling the flow rate of an analgesic pump, wherein the method is applied to a processor and comprises the following steps for controlling the analgesic pump:
s1, establishing an analgesia pump database, recording the analgesia information such as sex, age, operation duration, operation position, operation mode, past history, smoking and alcoholism history and the like of the patient in the database, and simultaneously recording the standard analgesia dosage of the corresponding patient;
s2, training data through a stacking model structure, inputting model characteristics as database recording data, outputting results as appropriate analgesic measures, and performing model training;
s3, inputting medical data into the XGboost model, the LightGBM model and the Random Foreast model, outputting a measurement judgment result by each model, inputting all the results of the three models into a neural network model, performing weighted calculation on the results of the three models respectively to give a final result, and storing the trained models;
s4, deploying the trained model to a cloud server, inputting patient information into a stacking model structure after a new patient appears, and outputting a metering calculation result of the analgesic pump by the model.
In order to better achieve the above object, the present invention further provides an apparatus for implementing a method for controlling a flow rate of an analgesic pump, wherein the apparatus is applied to a processor and comprises a primary model and a secondary model for controlling the analgesic pump: the first-level model comprises an XGboost model, a LightGBM model and a Random Foreast model; the secondary model comprises a neural network model;
the apparatus for controlling an analgesic pump comprises the following:
s1, establishing an analgesia pump database, recording analgesia information such as sex, age, operation duration, operation position, operation mode, past history, smoking and alcoholism history and the like of a patient in the database, and simultaneously recording a standard analgesia metering device corresponding to the patient;
s2, training data through a stacking model structure, inputting model characteristics as database recording data, outputting results as appropriate analgesic measurement, and performing model training;
s3, inputting medical data into the XGboost model, the LightGBM model and the Random Foreast model, outputting a measurement judgment result by each model, inputting all the results of the three models into a neural network model, performing weighted calculation on the results of the three models respectively to give a final result, and storing the trained models;
and S4, deploying the trained model to a cloud server, inputting the patient information into a stacking model structure after a new patient appears, and outputting the metering calculation result of the analgesic pump by the model.
The invention comprises a training stage and an application stage in practical use:
a training stage: the method comprises the steps that 3 primary models are trained by utilizing patient physiological data and standard analgesic flow in a database respectively, then 3 models can all output analgesic flow results, then a neural network model is utilized to train the results of the 3 primary models, the analgesic flow given by the 3 models is input, the standard flow results are output, the input characteristics of the 3 primary models are the patient physiological data, the input label is the patient standard analgesic flow, the output result is algorithm calculation analgesic flow, the input characteristics of the secondary model are the analgesic flow calculated by the 3 primary models, the input label is the standard analgesic flow, and the output is the final calculation result of the algorithm.
An application stage: the physiological data of the patient is input into 3 primary models, the 3 models respectively give corresponding calculation results, the 3 results are input into a secondary model, and the secondary model integrates the results of the 3 primary models and outputs the final result to guide a doctor to take medicine.
The following are examples of methods and apparatus for implementing the analgesia pump flow control of the present invention:
(1) establishing databases in a plurality of hospitals for collecting safe and comfortable values of analgesic flow of each patient after operation and recording physiological characteristic data of the patient, such as sex, age, operation duration, operation position, operation mode, past history and history of smoking and alcoholism;
(2) establishing an algorithm model, wherein the model is divided into 2 layers, the first layer is 3 XGboost models, LightGBM models and Random Foreast models, the second layer is a neural network model, all the models are regression models, the input of the first layer XGboost model, LightGBM models and Random Foreast models is set as physiological characteristic data of a patient, the output is set as analgesic flow of the patient, the input of the second layer neural network model is set as the output result of the 3 models of the first layer, and the output is set as analgesic flow of the patient;
(3) utilizing a database training model, substituting patient data stored in a database into the model, and carrying out iterative training for a plurality of times until the loss function of the model is reduced to 0.001;
(4) deploying the obtained model to a cloud server;
(5) when a new case occurs, inputting the physiological data of the patient into a cloud model, and outputting the analgesic flow result obtained by calculation by the model;
(6) the doctor sets the analgesia flow for the patient according to the output result of the model.
The following is another example of an implementation of the analgesia pump flow control method and apparatus of the present invention:
1) establishing a database in a plurality of hospitals, wherein the analgesic pump is sufentanil, the database is used for collecting safe and comfortable analgesic flow values of each patient after operation, and simultaneously recording physiological characteristic data of the patient, such as sex, age, operation duration, operation position, operation mode, past history and history of smoking and alcoholism;
the database structure is as follows, 30000 samples are collected from a plurality of hospitals;
2) establishing an algorithm model, wherein the model is divided into 2 layers, the first layer is 3 XGboost models, LightGBM models and Random Foreast models, the second layer is a neural network model, all the models are regression models, the input of the first layer XGboost model, LightGBM models and Random Foreast models is set as physiological characteristic data of a patient, the output is set as analgesic flow of the patient, the input of the second layer neural network model is set as the output result of the 3 models of the first layer, and the output is set as analgesic flow of the patient;
model parameter setting
Leading in a Random Foreast model;
n _ estimators (maximum number of iterations): 500
criterion (evaluation criterion): mse
max _ depth (maximum depth): 20
The other parameters are model default values;
introducing an XGboost model;
the XGboost model type: gbtree
eta (learning Rate): 0.01
max _ depth (maximum depth of tree): 15
LightGBM model (L2 regularization): 0.01
The other parameters are model default values;
importing LightGBM model
boosting _ type (tree structure type): gbdt
object type regression
learning rate 0.03
num _ leaves (maximum number of leaves) 40
max _ depth 12
subsample 0.8
Importing a neural network model
The model input is the result of the first 3 models, so a 30000 × 3 matrix is input, and a 1 × 1 matrix result is output.
The hidden layer is 1 layer, and the number of nodes is 16.
The optimizer is sgd and the learning rate is 0.03.
3) Training the model by using the database;
taking out data in a database, wherein the data are characterized by the first 9 data, one-hot codes are sampled from the past history, so that the total number of data columns is 12, the characteristic data in the database can show a matrix of 30000 multiplied by 12, the data labels are the last 1 data, namely the flow rate of the labor pain, and the label data in the database can show a matrix of 30000 multiplied by 1;
normalizing the data in the matrix, and scaling the maximum and minimum values of each column of data to the range of [ -1,1 ];
in 3 primary models, a 30000 × 12 matrix (patient physiological characteristics) is input and a 30000 × 1 matrix (analgesic pump flow) is output by training the data. Completing the first-level model training;
the data is input into 3 primary models again to obtain a primary prediction result of 30000 multiplied by 3, the data is used as the input of a neural network of a secondary model, and the output is still a matrix of 30000 multiplied by 1 (analgesic pump flow rate). After the iteration is carried out for 800 times, the loss value of the neural network is reduced to 1e-4, and the training of the secondary model is completed;
4) deploying the obtained model to a cloud server;
5) when a new case occurs, the physiological data of the patient is pre-processed by installing the normalized scaling rules in the database. Inputting the preprocessed data into a cloud model, wherein 3 primary models respectively give calculation results and input into a secondary model, and the secondary model integrates the first 3 results to give final flow data;
6) the doctor sets the analgesia flow for the patient according to the output result of the model.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.