Readmission risk prediction method and system for inpatient

By constructing a neural network model based on multi-source data, the problem of difficulty in accurately predicting readmission risks of hospitalized patients in the prior art is solved, and risk prediction with high accuracy and dynamic feedback is achieved, and medical resource allocation and patient treatment experience are improved.

CN120015346APending Publication Date: 2025-05-16ZHU XIANYI MEMORIAL HOSPITAL OF TIANJIN MEDICAL UNIV (TIANJIN MEDICAL UNIV METABOLIC DISEASE HOSPITAL TIANJIN METABOLIC DISEASE PREVENTION CENT)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510148452.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the risk of hospitalized patients' readmission, resulting in unoptimized allocation of medical resources and poor patient treatment experience.

Method used

By obtaining multi-source data, including basic health data, lifestyle data and related drug use data, a neural network model is built using feature cross-cutting technology and fully connected neural network (MLP) technology, data preprocessing and model training are carried out, and readmission risk prediction results are generated.

Benefits of technology

It improves the accuracy of readmission risk prediction, reduces the work burden of doctors, enhances the scientific nature of medical decisions, and reduces the readmission rate of patients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120015346A_ABST
    Figure CN120015346A_ABST
Patent Text Reader

Abstract

The invention relates to the field of intelligent medical treatment, in particular to a hospitalized patient re-admission risk prediction method and system, and the method comprises the following steps: 1, obtaining the multi-source data of a hospitalized patient; 2, sorting the multi-source data to obtain recognizable data; 3, constructing a neural network model stacked in sequence based on the recognizable data and a full-connection neural network technology; 4, sending the multi-source data into the neural network model subjected to complete technical evaluation, and returning a predicted re-admission risk probability result by the neural network model; and 5, dynamically supplementing previous prediction data verified by a physician into the multi-source data, and reanalyzing the data by the neural network model. According to the invention, feature information can be automatically learned and identified, a drug-related re-admission risk prediction result is output, a powerful auxiliary tool is provided for a doctor, the re-admission risk of a patient is reduced, and the working efficiency of the doctor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart medical technology, and in particular to a method and system for predicting the risk of hospital readmission for inpatients. Background Art

[0002] With the continuous development of the medical field, readmission rate has gradually become a key indicator to measure the efficiency and service quality of medical institutions.

[0003] Accurately predicting whether a patient needs to be readmitted to the hospital can help optimize the allocation of medical resources and provide patients with more targeted treatment options. Accurate prediction of readmission rates can not only enhance patients' treatment experience, but also provide strong data support for medical policy makers. According to relevant definitions, the readmission rate refers to the rate at which patients return to the hospital for similar or related diseases within 30, 60 or 90 days after discharge. The main factors leading to readmission include drug treatment methods, patient variability, disease type, disease stage, medical economics, comorbidities, etc. Specifically, patients are discharged early, doctors follow inappropriate drug treatment instructions, patients lack medical insurance and financial conditions, and patients have different characteristics and different disease types all have a significant impact on the readmission rate.

[0004] How to accurately predict the risk of patient readmission has become a difficult problem facing hospitals. Summary of the invention

[0005] To achieve the above objectives, the present invention proposes a method for predicting the risk of hospital readmission for inpatients. The present invention provides the following technical solutions: A method for predicting the risk of hospital readmission in hospitalized patients, comprising: Step 1: Obtain multi-source data of hospitalized patients, including basic health data, lifestyle data, and related medication data, including the patient's gender, age, whether they use multiple medications, whether they use high-risk drugs, whether they live alone, whether they live in remote areas, whether they have multiple diseases, and whether they have been readmitted to the hospital within 3 months. Step 2: Sort the multi-source data to obtain identifiable data, including processing the multi-source data and applying feature cross-references to obtain a data set. Then, standardize the data to ensure that the scales of different features are consistent during training, avoid excessive impact of certain features on training, and use the quantiles of the standardized distribution to replace any quantile. After completing the above operations, automatically split the sorted data set to obtain a training data set (80% of the sample size) and a test data set (20% of the sample size).

[0006] Step 3: Based on the identifiable data and the fully connected neural network (MLP) technology, a sequentially stacked neural network model is constructed. The neural network model automatically creates a hierarchical model based on the input identifiable data, which includes an input layer, multiple hidden layers, and an output layer, thereby completing the compilation, training, and evaluation of the neural network model based on the multi-source data of hospitalized patients; Step 4: Feed the multi-source data into the neural network model that has undergone a complete technical evaluation, and the neural network model returns the predicted readmission risk probability result; Step 5: Dynamically add past prediction data verified by physicians to multi-source data, and reanalyze the data using the neural network model.

[0007] As a further solution of the present invention: the method for predicting the risk of readmission of inpatients also includes: a fifth step: displaying the readmission risk probability result on a visual interface. When the readmission risk probability result exceeds a preset safety threshold, the visual interface will prompt a high risk and indicate it in red, which can remind the doctor to handle it; in order to ensure that the patient's privacy is fully protected and is not stolen by a third party during the data communication process, the visual interface uses digital certificate technology to provide data encryption and digital signature mechanisms to prevent information leakage, so as to ensure the security and reliability of the communication process.

[0008] As a further solution of the present invention: the inpatient readmission risk prediction method further includes: Step 7: displaying past prediction data records on a visual interface, and the physician supplements the effective prediction records to the multi-source data according to the actual situation, and the supplemented multi-source data will be automatically applied to the next neural network model training process. In order to ensure that the relevant medical data is fully protected and not stolen by a third party during the data communication process, digital certificate technology is used to provide data encryption and digital signature mechanisms to ensure security and reliability during the communication process.

[0009] As a further solution of the present invention: the specific steps for the physician to supplement the effective prediction records into the multi-source data according to the actual situation are as follows: by accessing the specified page of the visualization interface, a set of past prediction records is obtained; the physician dynamically chooses whether to supplement these data into the multi-source data according to the actual results and the doctor-patient situation, for the next neural network model evaluation.

[0010] As a further solution of the present invention: the specific steps of obtaining multi-source data of hospitalized patients are as follows: obtaining a multi-source data file, the multi-source data file including an initial data set (the original data set used when training a neural network model) and a past prediction record data set (if any) that has been predicted and verified by a physician and has been actually tested and meets expectations; prompting errors for unrecognizable files and multi-source data that failed to be read; organizing the files and multi-source data that prompt errors into recognizable data.

[0011] As a further solution of the present invention: the specific steps of sorting multi-source data to obtain identifiable data are as follows: processing missing values ​​and filling them using the mean method; one-hot encoding categorical variables to generate numerical features; constructing data features using the method of generating polynomial features using feature crossover technology for numerical features to capture the nonlinear relationship between input features; standardizing data features to ensure that they are on the same scale during training; sorting data sets and constructing training sets and test sets.

[0012] As a further solution of the present invention: the specific steps of constructing a sequentially stacked neural network model based on identifiable data and fully connected neural network technology are as follows: construct a fully connected neural network model based on identifiable data; create an input layer, the number of neurons in the input layer is consistent with the number of data features; create 3 hidden layers, each hidden layer has 128 neurons; create an output layer, the output layer contains 1 neuron, and can output prediction probabilities; train and evaluate the fully connected neural network model through an optimizer and a loss function.

[0013] As a further solution of the present invention: the specific steps of displaying the readmission risk probability results in a visual interface are as follows: obtaining the predicted readmission risk probability results; using different colored fonts to intuitively display the readmission risk probability results, using red bold fonts if there is a high risk, otherwise using green bold fonts.

[0014] A hospital readmission risk prediction system, comprising: The data collection module is used to obtain multi-source data of hospitalized patients, including basic health data, lifestyle data and related medication data; The data preprocessing module is used to organize multi-source data to obtain recognizable data, including the processing of multi-source data and the application of feature cross-pollination, so as to obtain a data set. After that, the data is standardized to ensure that the scales of different features are consistent during training, to avoid excessive impact of certain features on training, and to use the quantiles of the standardized distribution to replace any quantile. After completing the above operations, the organized data set is automatically split to obtain a training data set (80% of the sample size) and a test data set (20% of the sample size). A neural network module is used to construct a sequentially stacked neural network model based on identifiable data and fully connected neural network (MLP) technology. The neural network model automatically creates a hierarchical model based on the input identifiable data, which includes an input layer, multiple hidden layers, and an output layer, thereby completing the compilation, training, and evaluation of the neural network model based on multi-source data of hospitalized patients; The risk prediction module is used to feed multi-source data into a neural network model that has undergone a complete technical evaluation, and the neural network model returns the predicted readmission risk probability result; The dynamic supplement module is used to dynamically supplement the past prediction data verified by physicians into the multi-source data, and the neural network model re-analyzes the data.

[0015] The inpatient readmission risk prediction system also includes a visualization module for interacting with doctors. The doctor inputs the patient data to be predicted according to the prompts and obtains the prediction results through the visualization module. The entire communication process is encrypted to prevent information leakage. The readmission risk probability results are displayed on the visualization interface. When the readmission risk probability results exceed the preset safety threshold, the visualization interface will prompt high risk and indicate it in red. The red font can also be bolded for the doctor to see. When the readmission risk probability results are lower than the preset safety threshold, it will be prompted with bold green low risk words.

[0016] The inpatient readmission risk prediction system also includes an effective supplement module for displaying past prediction data records on a visual interface, and the physician supplements the effective prediction records to the multi-source data according to actual conditions.

[0017] Compared with the prior art, the present invention has the following beneficial effects: High accuracy: The monitoring method based on the neural network model can automatically learn and identify the patient's basic health, lifestyle and related medication data characteristics (whether multiple medications are used, whether high-risk drugs are used), avoiding interference from human factors and improving the accuracy of monitoring; Possess dynamic feedback capability: The present invention has built-in unique dynamic feedback collection technology. During the life cycle of the system, according to the dynamic feedback of the physician, the entire neural network model has the ability to continuously self-update and adjust, further improving the accuracy of prediction; Strong generalization ability: Through transfer learning technology, the neural network model can make full use of existing data sets for pre-training, improving its applicability in different patient and discharge scenarios, providing strong support for the accurate prediction of patient readmission risk, helping to reduce patient readmission rates and protect patient life safety; Enhanced complex data processing capabilities: The neural network model can automatically learn and extract key features from complex inpatients' basic health, lifestyle, and related medication data, which not only improves data processing efficiency but also enhances the model's predictions when faced with complex and changing data; Achieved highly automated and intelligent monitoring: The feature cross-talk technology and prediction function of the present invention can provide doctors with accurate readmission risk prediction information in a timely manner, which greatly reduces the workload of doctors; Increased scientific nature of medical decision-making: intuitive display of readmission risk prediction information, doctors can make more scientific adjustments to discharge medication decisions, and ensure the safety of patients after leaving the hospital.

[0018] The present invention is not only applicable to specific data sets, but also can expand the scope of application by adding new data types (such as other drug information, diagnosis records, etc.).

[0019] The present invention is not only applicable to different medical environments, but can also be retrained and optimized based on patient data from different hospitals.

[0020] The present invention takes into account the application requirements of the state and medical and health authorities for information security in the application of medical information systems. In the process of collecting and transmitting medical information, the present invention uses encryption and digital signature technologies to ensure that key information is not peeped or tampered with during transmission, thereby ensuring the security of medical information. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 Flow chart of a method for predicting the risk of hospital readmission for inpatients in an embodiment of the present invention.

[0022] Figure 2 This is a first sub-flow chart of the method for predicting the risk of hospital readmission for inpatients in an embodiment of the present invention.

[0023] Figure 3 This is a second sub-flow chart of the method for predicting the risk of hospital readmission for inpatients in an embodiment of the present invention.

[0024] Figure 4 This is a flowchart of the third sub-process of the method for predicting the risk of hospital readmission for inpatients in an embodiment of the present invention.

[0025] Figure 5 The present invention is a structural block diagram of the system for predicting the risk of hospital readmission for inpatients in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Technical problems of the existing technology: 1. Limited processing capabilities for complex data: Traditional methods are inefficient in processing multi-dimensional and highly complex demographic information and medication information, and are unable to fully tap the hidden features in the data that have a decisive impact on the risk of readmission. 2. Insufficient automation and intelligence levels: The existing technology is not mature enough in the automated processing of patient drug information data, especially in the automatic identification of drug types, high-risk drugs, and readmissions due to multiple medications. It relies on the doctor's independent judgment, which affects the patient's quality of life after discharge. The present invention proposes a readmission risk prediction method and system based on feature crossover technology with drug management as the core. The method uses polynomial feature crossover to construct new features, further improving the neural network model's ability to model complex nonlinear relationships, and at the same time using the powerful learning and processing capabilities of the neural network, combined with the patient's basic health, lifestyle and related medication data during hospitalization, to achieve readmission risk prediction with drug management as the core. Specifically, the present invention first obtains the basic health, lifestyle and related medication data of hospitalized patients, including the patient's gender, age, whether multiple medications are used, whether high-risk drugs are included, whether they live alone, whether they live in remote areas, whether they suffer from multiple diseases, whether they are readmitted within 3 months, etc. Then, these data are preprocessed, including missing value processing and unique hot encoding operations. A feature crossover method is used to construct new features to capture the nonlinear relationship between input features. In particular, PolynomialFeatures is used to generate second-order crossover features, and the method includes combining the input features so that the newly generated features can better reflect the complex patterns in the input data. Operations such as standardization are used to improve the quality and consistency of the data. Next, the preprocessed data is input into a neural network model. The neural network model can automatically learn and identify the patient's basic health information, lifestyle and related medication data features, and output the corresponding readmission risk prediction results. Finally, the prediction results are presented to the doctor through a visual interface. In the design of the neural network model, deep learning technology is used to achieve deep mining and feature extraction of the basic health, lifestyle and related medication data of hospitalized patients by constructing a multi-layer neural network structure. At the same time, transfer learning technology is also used to pre-train the model using existing data sets of readmitted patients to improve the generalization ability and accuracy of the model. By combining modern deep learning technology with traditional demographic information and medication information, the present invention significantly improves the accuracy and intelligence level of readmission risk prediction, which has important practical significance for improving the level of medication management for inpatients and optimizing medical resources.

[0028] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0029] The readmission risk threshold with drug management as the core in the present invention is a binary classification problem (risky or not). The neural network model designed in the present invention is based on a feedforward neural network, which implements the binary classification task through weighting, activation function and back propagation. The ReLU activation function is used to perform nonlinear transformation in the hidden layer, and the output layer uses the Sigmoid activation function to convert the result into a probability value, which is ultimately used to determine the patient's readmission risk. During the training process, the gap between the prediction and the true value is minimized by optimizing the binary cross-entropy loss function, thereby improving the accuracy of the model.

[0030] See also Figure 1-Figure 5 , the relevant algorithms and mathematical models of the present invention are described as follows: Dataset characteristics The dataset needs to contain the following features: Age: continuous variable.

[0031] sex: 0 or 1 (e.g. 1 for male, 0 for female).

[0032] Polypharmacy: 0 or 1 (1 for yes, 0 for no).

[0033] high_risk_med (whether to include high-risk drugs): 0 or 1 (1 for yes, 0 for no).

[0034] living_alone: ​​0 or 1 (1 for yes, 0 for no).

[0035] remote_area (Do you live in a remote area): 0 or 1 (1 for yes, 0 for no).

[0036] Comorbidities: 0 or 1 (1 for yes, 0 for no).

[0037] Predicted_risk (whether to be readmitted within 3 months): target variable, 0 or 1 (1 for yes, 0 for no).

[0038] Data preprocessing Missing value processing: SimpleImputer is used for data filling, and missing values ​​will be filled with the mean of the feature. This method ensures that there are no missing values ​​in the data set, because missing values ​​will affect the results of training and prediction.

[0039] Feature Crossover Technology: The present invention uses feature crossover to construct new features to capture the nonlinear relationship between input features. In particular, PolynomialFeatures is used to generate second-order crossover features, which includes combining input features so that the newly generated features can better reflect the complex patterns in the input data. The second-order crossover feature generation process is as follows: 1. For the original input feature set (such as age, gender, medication status, etc.), use second-order polynomial feature crossover (degree=2) and set interaction_only=True to retain only the cross terms of the features, excluding all possible polynomial terms.

[0040] 2. The generated cross-feature set is added to the original feature set to provide additional context for the further training process.

[0041] 3. The resulting new feature set can enhance the performance of the neural network model, especially in capturing complex nonlinear relationships.

[0042] Crossover combination example: Assumptions: X1 = [25, 30, 40] (age); X2 = [0, 1, 0] (gender: 0 for male, 1 for female); Explicit crossover can be achieved by combining these two features into a new feature X1_X2: X1_X2 = X1 * X2 = [0, 30, 0] In this case, X1_X2 is a new feature that may reveal some potential nonlinear relationships in the model. For example, the risk of readmission for certain diseases may be associated with the interaction between age and gender, but this is just an assumption.

[0043] We choose the second-order crossover, then the generated polynomial features are in the form of:

[0044] These new features can reveal nonlinear relationships between features. By crossing features such as age and high-risk drugs, or patients' comorbidities and living conditions, the neural network model of the present invention can capture the complex nonlinear relationships that may exist between these features. This technology effectively improves the accuracy of the neural network model, especially when analyzing medical data, and can provide more accurate readmission risk assessment.

[0045] Feature standardization: For continuous variables (such as age), standardization is required. For binary features (such as gender, etc.), standardization is not required. Multi-source data is standardized (StandardScaler), that is, all features are transformed into data with a mean of 0 and a standard deviation of 1. This is because neural networks are very sensitive to the magnitude of different features. Standardization can avoid unstable training or excessive training time due to different magnitudes. The standardization formula is: , where: X is the original feature data, μ is the mean of the feature, and σ is the standard deviation of the feature.

[0046] Neural network model architecture A neural network is a mathematical model inspired by biological neural networks. It consists of multiple neurons (i.e. nodes) connected by weights and biases. The output of each neuron is the weighted sum of the input signal and the result of the activation function.

[0047] The structure of the neural network model includes: Input layer: Receives data input. In this code, the number of neurons in the input layer is equal to the number of features (i.e. the number of columns in the dataset).

[0048] Hidden layer: The input signal is transformed nonlinearly through the hidden layer, which usually contains multiple hidden layers. The number of neurons and layers in each hidden layer is determined according to the complexity of the problem.

[0049] Output layer: Outputs a result suitable for a specific task. In this code, the output layer is a single neuron with a sigmoid activation function for a binary classification task (re-admission or not).

[0050] Compiling and training neural network models The basic operation of the neural network model is weighted sum plus bias, and then nonlinear transformation through activation function. The specific mathematical expression is as follows: Weighted sum: Each neuron calculates the weighted sum of the input features and adds a bias: , where: xi is the input feature, wi is the weight of the input feature, and b is the bias term.

[0051] Activation function: The output of a neuron is the result of processing with an activation function. Common activation functions include: ReLU (Rectified Linear Unit): used in hidden layers. Its mathematical formula is: ,ReLU is a commonly used activation function that truncates all negative values ​​to 0 and retains positive values.

[0052] Sigmoid function: used in the output layer, suitable for binary classification problems. Its mathematical formula is: , the Sigmoid function maps the output value to the interval [0, 1], which is suitable for probability prediction.

[0053] Forward propagation and loss function: Forward propagation: The readmission patient dataset passes through layers of neural networks from the input layer (each layer calculates the output through weighted sum, bias and activation function) until the last layer outputs the predicted value.

[0054] Loss function: Calculates the difference between the model's output and the actual label. For binary classification problems, the binary cross-entropy loss function is used, and its formula is: ,in: is the actual label (0 or 1), is the predicted probability.

[0055] Back propagation and weight update Backpropagation: By calculating the gradient of the loss function for each weight, use gradient descent or other optimization algorithms (such as Adam optimizer) to update the weights and biases in the network. The goal of gradient descent is to minimize the loss function, which is expressed as follows: , where: η is the learning rate, which determines the step size of the weight update, It is the partial derivative of the loss function with respect to the weight, which indicates the rate of change of the loss function with respect to the weight.

[0056] The training process optimizes the network parameters through multiple forward propagation and back propagation until the loss function converges or reaches the preset training cycle (epochs). After each training, the test set is used to evaluate the performance of the neural network model.

[0057] Use the model.fit() function to train, which will gradually optimize the weights in the neural network during the training process. You can set the epochs (number of iterations) and batch_size (the number of samples used for each gradient update) of the training.

[0058] The model loss and accuracy are calculated through the model.evaluate() function to evaluate the performance of the neural network model on the test set.

[0059] The present invention provides a simplified implementation example of a readmission risk monitoring method based on feature crossover technology and drug management as the core, combining algorithms and programs. This example will use Python language and Keras library to build and train a neural network model.

[0060] The detailed algorithm design and program implementation steps are as follows: Since the actual collection of patients' basic health, lifestyle, and related medication data involves complex hardware equipment and medical ethical issues, we use simulated data here (adjusted according to actual conditions). The multi-source data set of readmitted patients is organized into a CSV file, which contains the patient's basic health, lifestyle, related medication data and the corresponding readmission risk prediction label. In addition to the initial multi-source data set, it also supports reading multi-source data sets generated by the dynamic feedback function and screened by physicians based on past prediction records. By loading model files and Scaler files, the system can reuse trained neural network models on different devices without the need to retrain each time.

[0061] import pandas as pd # Check if the model file and scaler file exist model_file = 'readmission_risk_model.keras' scaler_file = 'scaler.pkl' # Save the scaler file name if os.path.exists(model_file): # If the model file exists, load the model model = load_model(model_file) print("Loaded existing model.") # Check if the scaler file exists if os.path.exists(scaler_file): # Load scaler scaler = joblib.load(scaler_file) print("Loaded existing scaler.") else: print(f"Warning: {scaler_file} not found. Please retrain themodel to create it.") exit(1) # Exit the program and prompt the user to retrain the model else: # If the model file does not exist, build and train the model # 1. Load data from a CSV file # Load the initial dataset and cumulative dataset patient_data = pd.read_csv('patient_data.csv') predicted_risk_data = pd.read_csv('predicted_risk.csv') # Merge datasets combined_data = pd.concat([predicted_risk_data, patient_data], ignore_index=True) # Save the merged dataset combined_data.to_csv('patient_engine.csv', index=False) df = pd.read_csv('patient_engine.csv') # Save data file for neural network analysis # Check for missing values print("Missing values ​​in the dataset:") print(df.isnull().sum()) # Remove missing values df = df.dropna() # Feature columns (X) and target columns (y) X = df.drop(columns=['predicted_risk']) y = df['predicted_risk'] # Data preprocessing imputer = SimpleImputer(strategy='mean') X_imputed = imputer.fit_transform(X) # One-hot encode categorical features X_encoded = pd.get_dummies(X_imputed, columns=['sex', 'high_risk_med', 'living_alone', 'remote_area', 'comorbidities'], drop_first=True) # Feature crossover (generating polynomial features, including feature crossover) poly = PolynomialFeatures(degree=2, interaction_only=True, include_bias=False) X_poly = poly.fit_transform(X_encoded) # Perform standardization operations scaler = StandardScaler() X_scaled = scaler.fit_transform(X_poly) # Split into training and test sets X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.2, random_state=42) #Build a neural network model import pandas as pd import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.impute import SimpleImputer from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.optimizers import Adam model = Sequential() # Create the required input layer model.add(Input(shape=(X_train.shape[1],))) # Create three hidden layers model.add(Dense(units=128, activation='relu')) model.add(Dense(units=128, activation='relu')) model.add(Dense(units=128, activation='relu')) #Create the required output layer (using the sigmoid activation function to solve the binary classification problem of whether there is a risk of readmission) model.add(Dense(units=1, activation='sigmoid')) #Start compiling the core neural network model for patient readmission risk analysis model.compile(optimizer=Adam(), loss='binary_crossentropy', metrics=['accuracy']) # Set early stopping to monitor the validation loss (val_loss) during model training and stop training early when the validation loss no longer improves to prevent model overfitting.

[0062] early_stopping = EarlyStopping(monitor='val_loss', patience=10, restore_best_weights=True) #After completing model compilation, start training the core model model.fit(X_train, y_train, epochs=100, batch_size=16, validation_data=(X_test, y_test)) #Test performance of the core neural network model loss, accuracy = model.evaluate(X_test, y_test) print(f"Model Accuracy: {accuracy * 100: .2f}%") #Predict new patient data def index(): if request.method == 'POST': # Get user input user_id = request.form['id'] # Get the ID entered by the user age = int(request.form['age']) sex = int(request.form['sex']) polypharmacy = int(request.form['polypharmacy']) high_risk_med = int(request.form['high_risk_med']) living_alone = int(request.form['living_alone']) remote_area = int(request.form['remote_area']) comorbidities = int(request.form['comorbidities']) # Construct new patient data using user input #Example: The doctor inputs patient data according to the guidance of the interactive page. For example, a 60-year-old male takes multiple medications, including high-risk medications, lives alone, lives in a non-remote area, and suffers from multiple diseases. The corresponding input value during the neural network program is new_patient_data[60, 1, 1, 1, 1, 0, 1] new_patient_data = [age, gender, medications, high_risk_med, living_alone, remote_area, comorbidities] new_patient = np.array([new_patient_data]) new_patient_scaled = scaler.transform(new_patient) # Predicting the risk of readmission predicted_risk = model.predict(new_patient_scaled) #Display the readmission risk prediction results based on drug management to assist doctors in making decisions.

[0063] #Output the result according to the threshold (for example, if the predicted probability is greater than or equal to 0.5, it is considered to be high risk and is indicated in red bold font as High risk of readmission; otherwise, it is indicated in green bold font as Low risk of readmission) risk_level = "High risk of readmission." if predicted_risk>= 0.5 else"Low risk of readmission." risk_color = "red" if predicted_risk>= 0.5 else "green" # Save the user's input and prediction results to a temporary storage area save_user_input([user_id] + new_patient_data + [predicted_risk]) # Contains ID #Display the predicted response information in the human-computer interaction interface through the visualization module.

[0064] return render_template_string(''' <title> Inpatient Readmission Risk Prediction System< / title> <h1 style="color: {{ color}};"> Readmission risk prediction results< / h1> <h1 style="color: {{ color}}; font-weight: bold;"> Predicted readmission risk: {{ risk}}< / h1> Go back ''', risk=risk_level, color=risk_color) #After completing this round of prediction, it has a return function to accept the next prediction input return ''' <!DOCTYPE html> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title> Inpatient Readmission Risk Prediction System< / title> <h1> Inpatient Readmission Risk Prediction System< / h1> <form method="post"> Age: <input type="text" name="age"> Gender (0 for male,1 for female): <input type="text" name="gender"> Medications: <input type="text" name="medications"> High Risk Medications (0 for No,1 for Yes): <inputtype="text" name="high_risk_med"> Living Alone (0 for No,1 for Yes): <input type="text" name="living_alone"> Remote Area (0 for No,1 for Yes): <input type="text" name="remote_area"> Comorbidities (0 for No,1 for Yes): <input type="text" name="comorbidities"> <input type="submit" value="Submit"> < / form> ''' # Dynamic feedback module processes physician data feedback @app.route(' / dynamicverify', methods=['GET', 'POST']) def dynamic_verify(): if request.method == 'POST': # Get selected rows selected_rows = request.form.getlist('selected') df = pd.read_csv('user_input.csv') # Check if there is any past prediction data selected by the physician if not selected_rows: print("No rows selected.") return redirect(url_for('dynamic_verify')) selected_data = df.iloc[list(map(int, selected_rows))] # Check if selected_data is empty if selected_data.empty: print("Selected data is empty.") return redirect(url_for('dynamic_verify')) # Save selected data to predicted_risk.csv selected_data['predicted_risk'] = (selected_data['predicted_risk']>= 0.5).astype(int) # Convert to 0 or 1 according to the value # Select columns and save them in the specified order columns_order = ['age', 'sex', 'polypharmacy', 'high_risk_med', 'living_alone', 'remote_area', 'comorbidities', 'predicted_risk'] selected_data.to_csv('predicted_risk.csv', index=False, columns=columns_order) # Make sure not to save the index and time columns print("Data saved to predicted_risk.csv:", selected_data) # debug output # Delete the selected data from user_input.csv df = df.drop(selected_data.index) # delete the selected row df.to_csv('user_input.csv', index=False) # Update user_input.csv return redirect(url_for('dynamic_verify')) #Read the data file of physician feedback df = pd.read_csv('user_input.csv') # Transform columns except 'predicted_risk' and 'date' for display columns_to_convert = df.columns.difference(['predicted_risk', 'date']) df[columns_to_convert] = df[columns_to_convert].astype(int) return render_template_string(''' <title> Inpatient Readmission Risk Prediction System< / title> <h1> Dynamic information feedback< / h1> <form method="post"> Select RecordTime ID {% for col in df.columns[2:] %} {{ col}} {% endfor %} {% for index,row in df.iterrows() %} <input type="checkbox" name="selected" value="{{ index}}"> {{ row['date']}} {{ row['id']}} {% for col in df.columns[2:] %} {% if col == 'predicted_risk' %} <span style="color: {{ 'red' if row[col]>= 0.5 else 'green'}};" >{{ 'High risk' if row[col]>= 0.5 else'Low risk'}} {% else %} {{ row[col]}} {% endif %} {% endfor %} {% endfor %} <input type="submit" value="Update Dataset"> < / form> ''',df=df) #The visualization module loads digital certificates and private key files to provide encryption and digital signature services for the communication process, preventing medical and patient data from being stolen and improving system security if __name__ == '__main__': # Use the digital certificate and private key issued by the trusted CA organization app.run(ssl_context=('server.pem', 'serverkey.pem'), host='0.0.0.0', port=8888) Other considerations: Robustness: The system should have a certain anti-interference ability and be able to operate stably in various complex environments.

[0065] Security: The system should have strict data protection measures to ensure the privacy of patients.

[0066] Maintainability: The system should have good maintainability to facilitate subsequent upgrades and maintenance.

[0067] This embodiment assumes that the readmission risk threshold with drug management as the core is a continuous value. In practical applications, the readmission risk is a classification problem (such as risky, no risk), and requires a more complex network structure and data processing flow. In addition, factors such as robustness and security need to be considered.

[0068] Through the above steps and algorithm details, the neural network-based method of the embodiment of the present invention realizes the prediction of patient readmission risk based on drug management, provides a powerful auxiliary tool for doctors, reduces the patient's readmission risk, and improves the work efficiency of doctors.

[0069] A computer device is provided in an embodiment of the present invention, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for predicting the risk of hospital readmission of inpatients based on a neural network.

[0070] A computer-readable storage medium provided by an embodiment of the present invention stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the neural network-based inpatient readmission risk prediction method.

[0071] An embodiment of the present invention provides an information data processing terminal, which is used to implement the step of interacting with the visualization module of the readmission risk prediction system based on drug management based on feature cross-technology to obtain a prediction result.

[0072] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for predicting the risk of hospital readmission of inpatients, characterized in that: The following steps are involved: Step 1: Obtain multi-source data of hospitalized patients, including basic health data, lifestyle data, and related medication data; Step 2: Sort the multi-source data to obtain identifiable data; Step 3: Build a sequentially stacked neural network model based on identifiable data and fully connected neural network technology; Step 4: Feed the multi-source data into the neural network model that has undergone complete technical evaluation, and the neural network model returns the predicted readmission risk probability result; Step 5: Dynamically add past prediction data verified by physicians to multi-source data, and reanalyze the data using the neural network model.

2. The method for predicting the risk of hospital readmission of inpatients according to claim 1, characterized in that: Also includes: Step 6: Display the readmission risk probability results on the visualization interface. When the readmission risk probability results exceed the preset safety threshold, the visualization interface will prompt high risk and indicate it in red.

3. The method for predicting the risk of hospital readmission of inpatients according to claim 2, characterized in that: Also includes: Step 7: Display past prediction data records on a visual interface, and doctors will add effective prediction records to multi-source data based on actual conditions.

4. The method for predicting the risk of hospital readmission of an inpatient according to claim 1 or 2, characterized in that: The specific steps of obtaining the multi-source data of hospitalized patients are as follows: obtaining multi-source data files; prompting errors for unrecognizable files and multi-source data that failed to be read; and organizing the files and multi-source data that prompted errors into recognizable data.

5. The method for predicting the risk of hospital readmission of inpatients according to claim 1, characterized in that: The specific steps of arranging multi-source data to obtain identifiable data are as follows: processing missing values ​​and filling them using the mean method; performing one-hot encoding on categorical variables to generate numerical features; and constructing data features by using a method of generating polynomial features using feature crossover technology for numerical features; Standardize data features; organize data sets and construct training sets and test sets.

6. The method for predicting the risk of hospital readmission of an inpatient according to claim 1 or 2, characterized in that: The specific steps of constructing a sequentially stacked neural network model based on identifiable data and fully connected neural network technology are as follows: construct a fully connected neural network model based on identifiable data; create an input layer, the number of neurons in the input layer is consistent with the number of data features, create 3 hidden layers, each hidden layer has 128 neurons, and create an output layer, the output layer contains 1 neuron; train and evaluate the fully connected neural network model through an optimizer and a loss function.

7. A system for predicting the risk of hospital readmission for inpatients, characterized in that: The system comprises: The data collection module is used to obtain multi-source data of hospitalized patients, including basic health data, lifestyle data and related medication data; Data preprocessing module, used to sort out multi-source data to obtain identifiable data; A neural network module, which is used to construct a sequentially stacked neural network model based on identifiable data and fully connected neural network technology; The risk prediction module is used to feed multi-source data into a neural network model that has undergone a complete technical evaluation, and the neural network model returns the predicted readmission risk probability result; The dynamic supplement module is used to dynamically supplement the past prediction data verified by physicians into the multi-source data, and the neural network model re-analyzes the data.

8. The inpatient readmission risk prediction system according to claim 6, characterized in that: It also includes a visualization module for displaying the readmission risk probability results on a visualization interface. When the readmission risk probability results exceed a preset safety threshold, the visualization interface will indicate a high risk and indicate it in red.

9. The inpatient readmission risk prediction system according to claim 7, characterized in that: It also includes an effective supplement module for displaying past prediction data records in a visual interface, and the physician can supplement the effective prediction records to the multi-source data according to the actual situation.