Method for risk prediction of chronic diseases and related devices

By constructing a feature extraction network using deep neural networks and a self-attention mechanism, and combining local and global risk prediction, the problems of individualization and time series processing in chronic disease risk prediction are solved, and accurate chronic disease risk prediction is achieved.

CN115862842BActive Publication Date: 2026-08-25BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211583777.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-08-25
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

Existing methods for predicting chronic disease risk are inadequate for accurately and individually predicting the risk of near-term death. Statistical methods are not effective when dealing with time-series variables and fail to reflect the cumulative effect of predictors in dynamic changes.

Method used

Deep neural networks are used for data filtering and feature extraction. A feature extraction network is constructed using a self-attention mechanism. Combined with local and global risk prediction networks, the network is trained through transfer learning and cross-entropy loss function to predict the risk of chronic disease development.

Benefits of technology

It enables accurate prediction of chronic disease risk, improves the accuracy and adaptability of prediction, can process heterogeneous data and consider correlation and time series features, and provides personalized risk warnings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115862842B_ABST
    Figure CN115862842B_ABST
Patent Text Reader

Abstract

The application provides a chronic disease risk prediction method and related device; the method comprises: screening and unifying dimensions of patient data, obtaining initial data and inputting a deep neural network; mapping the initial data to an input matrix, performing self-attention calculation operation of each feature head, combining the outputs of each feature head to obtain a self-attention score matrix, setting residual connection operation and layer normalization operation for the input matrix and the self-attention score matrix to construct a gradient forward propagation feature extraction network; according to the time length covered by the initial data, inputting the local feature information of the output of the feature extraction network corresponding to the time length to the corresponding local risk prediction network, and splicing the local feature information output by each feature extraction layer into global feature information input to a global risk prediction network; predicting the risk probability of the global feature information and the local feature information, and obtaining a prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application relate to the fields of computer technology and medical and health technology, and in particular to a method and related apparatus for predicting the risk of chronic diseases. Background Technology

[0002] In predicting the risk of chronic diseases, clinicians still find it difficult to make accurate quantitative predictions of mortality risk for a particular individual over a certain period of time. Statistical methods based on existing observational cohort studies have many limitations when applied to risk prediction in chronic disease populations.

[0003] Therefore, a solution is needed that can provide precise and quantitative risk warnings. Summary of the Invention

[0004] In view of this, the purpose of this application is to propose a method and related device for predicting the risk of chronic diseases.

[0005] For the purposes described above, this application provides a method for predicting the risk of chronic diseases, including:

[0006] The patient data is filtered using the mean and standard deviation of the pre-set patient data, and the dimensions of the patient data are unified to obtain initial data, which is then input into a pre-set deep neural network. In the deep neural network, the initial data is mapped to an input matrix. Based on multiple coefficient matrices assigned to the input matrix, self-attention calculation operations are performed on each feature head and output. The outputs of each feature head are combined and then linearly transformed to obtain a self-attention score matrix. Residual connection operations and layer normalization operations are set on the input matrix and the self-attention score matrix to construct a feature extraction network, so as to propagate the gradient forward and output local feature information. In the deep neural network, a local risk prediction network and a global risk prediction network are set up. According to the time length covered by the initial data, the local feature information output by the feature extraction network corresponding to the time length is input into the corresponding local risk prediction network, and the local feature information output by the extraction layer of each feature is concatenated to form the global feature information input into the global risk prediction network. Based on the pre-training of the deep neural network, the global feature information input to the global risk prediction network and the local feature information input to the corresponding local risk prediction network are used to predict the risk probability and obtain the prediction result.

[0007] Furthermore, the pre-training of the deep neural network includes: The network parameters of the deep neural network are pre-set using transfer learning; Construct a loss function using cross-entropy; Based on the preset categories of the patient data, the error between the category and the prediction results of the corresponding local risk prediction network and the global risk prediction network is determined using the loss function. The network parameters are updated by backpropagating the error. The training of the deep neural network is completed when the updated network parameters reduce the error of the deep neural network to a preset error threshold.

[0008] Further, the patient data is screened, including: Use the mean and the standard deviation to set the filtering range; Patient data with values ​​within the specified filtering range are retained.

[0009] Furthermore, based on the multiple coefficient matrices assigned to the input matrix, self-attention calculation operations are performed on each feature head, including: Set a first weight matrix, a second weight matrix, and a third weight matrix for the input matrix, and multiply them by the input matrix respectively; Obtain the feature matrix to be matched, the feature query matrix, and the eigenvalue matrix; For each feature head, a self-attention calculation operation is performed on the feature head using a preset self-attention activation function, and the output for the feature head is determined.

[0010] Furthermore, before obtaining the self-attention score matrix, the following steps are also included: Determine the missing values ​​in the input matrix; A missing value mask is set for the missing values ​​to obtain a mask matrix, wherein the missing value mask consists of 0 representing missing values ​​and 1 representing the presence of values; The self-attention score matrix is ​​obtained by linearly transforming the output of each feature head and multiplying the result by the corresponding element in the mask matrix.

[0011] Further, residual connection operations and layer normalization operations are applied to the input matrix and the self-attention score matrix to construct a feature extraction network, including: The residual connection operation is performed by adding the input matrix and the self-attention score matrix; Perform layer normalization using the formula shown below:

[0012] in, Represents the input matrix, Let H represent the self-attention score matrix, FFN represent the feedforward neural network, and H represent the result of the layer normalization operation. Furthermore, the self-attention calculation, the residual connection operation, the layer normalization operation, the gradient forward propagation, and the residual connection operation and the layer normalization operation are concatenated to obtain the feature extraction network.

[0013] Furthermore, before inputting the local feature information of the output of the feature extraction network corresponding to the time series length into the corresponding local risk prediction network, the following steps are taken: Based on the time length covered by the initial data, different sequence lengths are configured for each initial data with different time series lengths; Multiple feature extraction networks are set up, and initial data of different sequence lengths are configured for each network.

[0014] Based on the same inventive concept, this application also provides a risk prediction device for chronic diseases, including: a heterogeneous data processing module, a risk factor extraction module, a multi-time series joint prediction module, and a training and prediction module; The heterogeneous data processing module is configured to filter the patient data using the mean and standard deviation of the preset patient data, unify the dimensions of the patient data, obtain initial data, and input it into a preset deep neural network. The risk factor extraction module is configured to map the initial data into an input matrix in the deep neural network, perform self-attention calculation operations on each feature head based on multiple coefficient matrices allocated to the input matrix and output them, perform a linear transformation after combining the outputs of each feature head to obtain a self-attention score matrix, and set residual connection operations and layer normalization operations on the input matrix and the self-attention score matrix to construct a feature extraction network to propagate the gradient forward and output local feature information. The multi-time series joint prediction module is configured to set up a local risk prediction network and a global risk prediction network in the deep neural network, and input the local feature information of the feature extraction network corresponding to the time series length to the corresponding local risk prediction network according to the time length covered by the initial data, and concatenate the local feature information output by the extraction layer of each feature to the global feature information input to the global risk prediction network. The training and prediction module is configured to predict the risk probability based on the global feature information input to the global risk prediction network and the local feature information input to the corresponding local risk prediction network, and obtain the prediction result, based on the pre-training of the deep neural network.

[0015] Based on the same inventive concept, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the risk prediction method for chronic diseases as described in any of the above claims.

[0016] Based on the same inventive concept, this application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions for causing the computer to perform the risk prediction method for chronic diseases as described above.

[0017] As can be seen from the above, the chronic disease risk prediction method and related device provided in this application, based on the screening of patient data and after the same dimension of patient data, solves the problem of heterogeneous data, making the obtained data applicable to deep neural networks. When constructing the deep neural network, a feature extraction network for risk factors is constructed based on the self-attention mechanism, and the results of the self-attention calculation operations of each feature head are combined. In the constructed feature extraction network for risk factors, correlation features and time series features are comprehensively considered. Multiple information extraction modules are constructed according to different time lengths of data, and multiple time series risk factor features are combined to perform feature extraction, thereby realizing the prediction of the risk of chronic disease development in patients using a trained deep neural network. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart of a method and related apparatus for predicting the risk of chronic diseases according to an embodiment of this application; Figure 2 This is a general execution logic diagram of an embodiment of this application; Figure 3 This is a schematic diagram of data types in an embodiment of this application; Figure 4 This is a flowchart illustrating heterogeneous data processing in an embodiment of this application; Figure 5 This is a structural diagram of the feature extraction network for risk factors in an embodiment of this application; Figure 6 This is a schematic diagram of the multi-time series joint prediction logic in an embodiment of this application; Figure 7 This is a flowchart of the training steps in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of the chronic disease risk prediction method and related device according to an embodiment of this application; Figure 9 This is a schematic diagram of the electronic device structure according to an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0021] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0022] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.

[0023] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.

[0024] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0025] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0026] As described in the background section, existing methods for predicting the risk of chronic diseases are still insufficient to meet the needs of predicting the progression of chronic diseases in patients during actual medical practice.

[0027] In the process of developing this application, the applicant discovered that the main problem with the relevant methods for predicting the risk of chronic diseases is that, although previous studies have revealed many risk factors for chronic diseases, it is difficult to accurately and individually predict whether a cardiovascular event will occur in the near future. In other words, clinicians still find it difficult to give an accurate quantitative prediction of the mortality risk for a particular individual within a certain period of time. The statistical methods used based on existing observational cohort studies have many limitations when applied to risk prediction in people with chronic diseases.

[0028] Specifically, statistical methods typically analyze the linear correlation between predictor variables, i.e., potential risk factors and outcome variables, i.e., the probability of death, such as Pearson correlation analysis, logistic regression and Cox regression analysis, or assume a certain functional relationship to analyze nonlinear correlation, such as spline regression analysis. However, in the real world, predictor variables such as blood pressure and risk and probability are difficult to describe with simple linear or nonlinear relationships.

[0029] Furthermore, existing methods are not ideal for handling time series variables. Whether using baseline, time average, or time-dependent variables, each has its advantages and disadvantages, making it difficult to reflect the cumulative effect of a predictor variable on the outcome in a dynamic process.

[0030] Based on this, one or more embodiments in this application provide a method for predicting the risk of chronic diseases.

[0031] The embodiments of this application are described in detail below with reference to the accompanying drawings.

[0032] refer to Figure 1 One embodiment of the chronic disease risk prediction method of this application includes the following steps: Step S101: Using the mean and standard deviation of the preset patient data, the patient data is filtered and the dimension of the patient data is unified to obtain initial data and input into the preset deep neural network.

[0033] In the embodiments of this application, such as Figure 2 As shown, by collecting relevant patient data and processing baseline and follow-up data differently, heterogeneous data can be integrated, and the integrated initial data is then input into a deep neural network.

[0034] In this embodiment, chronic disease patients and their data are used as a specific example. For each patient, the number of patients can be labeled according to the category of their outcome practice, which is the category of the patient data, such as persistent chronic disease, conversion to hemodialysis, and death, and these can be used as the label of the patient. The patient data of chronic disease patients with labels are used as the training dataset for training the deep neural network in this application.

[0035] Among them, outcome events include changes in the patient's condition or progression to another stage of the condition. For example, the data of patients whose outcome event is death is labeled as 1, and the data of patients whose outcome event is not death is labeled as 0.

[0036] Furthermore, in patient data, such as Figure 3 As shown, it includes a large amount of data with different structures and types, such as patients' demographic information, disease characteristics, various biochemical test data, nutritional data, and chronic disease treatment information.

[0037] Furthermore, the data can be divided into baseline variables, or baseline data, and follow-up variables, or follow-up data. Baseline data is data that is collected once and does not change during multiple collections, such as the patient's gender and height. Follow-up variables include data that changes with the condition and needs to be collected each time, such as various biochemical test data.

[0038] Furthermore, since the time intervals of the patients' original follow-up records are irregular at the time of collection, in order to ensure that the time series intervals of the data input into the neural network are the same, it is necessary to follow a certain time interval t. step The original follow-up data were sampled.

[0039] Specifically, such as Figure 4 As shown, for example, for the raw follow-up variables collected, the data is taken from the start time t of their recording. start That is, the time when the patient enters the data into the platform or the first test is counted as a time interval t every three months. step Data is selected by choosing a single data point from the three months closest to the selected time point. If no record is found within three months, blank values ​​are filled in. This results in a follow-up variable consisting of a data vector with three-month intervals, up to the time t when the patient experiences a transitional event. end .

[0040] In this embodiment, the data at the starting time is the patient's first sample value r1, and after collection using the above sampling method, the collection results of the follow-up variables are obtained. , where n represents the sequence length of the patient data.

[0041] Furthermore, to unify the dimensions of patient data, a uniform sequence length w is set. For data with a sequence length less than w, null values ​​are padded to length w. For data with a sequence length greater than w, the last w data points are selected with the time of the outcome event as the endpoint. Based on the collection results of the above follow-up variables, the follow-up variables are as follows:

[0042] Furthermore, for the baseline variable, if only one data point is recorded, the baseline variable is filled with null values ​​to the same vector dimension as the follow-up variable.

[0043] Specifically, the null values ​​of the baseline variables are padded with a vector of length w, and then merged with the follow-up variables to obtain a vector of dimension w. The patient data matrix, in which The number of baseline variables, This represents the number of follow-up variables.

[0044] Furthermore, since patient data contains categorical variables that cannot be used directly, such as gender, it is necessary to value these categorical variables and represent different categorical information using numerical encoding.

[0045] In this embodiment, due to non-standard operations during the data recording process, there is abnormal data in the patient data obtained above. It is necessary to filter and remove the abnormal data to ensure accuracy.

[0046] Specifically, taking laboratory test indicators as an example, we calculate their mean. and standard deviation and based on The rule applies to values ​​outside the range. Patient data that is considered potentially outlier will have its range of values ​​limited. Patient data within this range is considered normal data.

[0047] Furthermore, based on the judgment results, normal data is retained, abnormal data is removed, and null values ​​are replaced for abnormal data. The normal data retained after filtering is used as the initial data.

[0048] In this embodiment, based on the initial data obtained above, it can be input into a preset deep neural network.

[0049] Step S102: In the deep neural network, the initial data is mapped to an input matrix. Based on the multiple coefficient matrices assigned to the input matrix, self-attention calculation operations are performed on each feature head and output. After combining the outputs of each feature head, a linear transformation is performed to obtain a self-attention score matrix. Residual connection operations and layer normalization operations are set on the input matrix and the self-attention score matrix to construct a feature extraction network, so as to propagate the gradient forward and output local feature information.

[0050] In the embodiments of this application, such as Figure 2 As shown, the initial data can be input into a deep neural network through encoding mapping, and a feature extraction network can be constructed based on the self-attention mechanism to extract the correlation features between various variables in the initial data.

[0051] In this embodiment, as Figure 5 As shown, the initial data mentioned above is used as the training sample for the deep neural network, and each variable in the initial data is regarded as a potential risk factor. The constructed deep neural network is then used to extract multi-level feature information of the risk factors.

[0052] In a specific example, the initial data The time length is set to w as described above, and includes m = b + v different variables, that is, each variable The sequence length is w. , where x t Let t represent the t-th variable.

[0053] Furthermore, for each variable Normalization is performed, and the mean and standard deviation of the entire initial data are calculated. For each dimension of the data, the mean is subtracted and then the result is divided by the standard deviation.

[0054] Furthermore, variables can be... Linear projection to In a dimensional vector space, we obtain u t and u t As the input vector, where It is the dimension of each element in the sequence in the self-attention mechanism, that is, the dimension of the deep neural network.

[0055] Furthermore, for deep neural networks, the parameters and input vectors have the following relationship:

[0056] in, These are all learnable parameters in deep neural networks. , represents the input vector of the deep neural network, and is expressed in terms of . This represents the input matrix composed of the input vectors.

[0057] Furthermore, such as Figure 5 As shown, since the self-attention architecture lacks the ability to perceive the order of input data, positional encoding needs to be added to enable deep neural networks to learn the sequential features of time series.

[0058] Specifically, the input matrix Add position encoding W pos Make ,in, This represents the input matrix after position encoding.

[0059] In some other embodiments, the position encoding can be selected in multiple ways. In this embodiment, the position encoding is set to a matrix of all learnable parameters.

[0060] In this embodiment, for the position-encoded input matrix, a self-attention mechanism can be used to extract deep semantic information and correlation relationships. The expression for its self-attention calculation operation is as follows:

[0061] Among them, matrix Both are learnable weight matrices, which can be obtained by transforming the input matrix. Multiply by the three coefficient matrices respectively to obtain the feature matrices to be matched. Feature query matrix and eigenvalue matrix .

[0062] Furthermore, in the aforementioned self-attention computation operation In the middle, based on the self-attention matrix From the expression, it can be seen that the value of each element in the self-attention matrix records the computational result of the correlation between the corresponding two input vectors, such as Q and K; where, Representing the feature query matrix Dimensions This represents the matrix concatenation operation. For normalized exponential functions, This represents the i-th feature header.

[0063] Furthermore, based on the self-attention calculation results of each feature head, the calculation results of multiple feature heads can be combined. Different feature heads can extract features at different levels of the input data, thereby improving the robustness of the network.

[0064] Specifically, establish Each feature header, based on the above The computational operation involves concatenating the outputs of all feature heads end-to-end, followed by a linear transformation to obtain the final self-attention score matrix. .

[0065] Linear transformation can be achieved by multiplying by the weight matrix. This is achieved in the following way.

[0066] In this embodiment, since there are missing values ​​in the input matrix, that is, a certain variable has no recorded value or a certain time point has no recorded value, the empty values ​​filled in the aforementioned process can also be regarded as missing values.

[0067] Furthermore, a missing value mask can be established during the self-attention computation process, and a mask matrix can be constructed. Specifically, the mask matrix... It consists of elements 0 or 1, where 0 represents that the value at that position is missing, and 1 represents that the value at that position is present.

[0068] Furthermore, by performing dot product on the corresponding elements of the input matrix and the mask matrix, the self-attention score matrix can be obtained. ,in, For Hadama accumulation.

[0069] In this embodiment, after obtaining the self-attention score, the deep neural network also needs to use the self-attention score in the forward propagation process. The method of combining residual connection operation and layer normalization operation can effectively improve the forward propagation performance of the deep neural network. The calculation process is shown in the following formula:

[0070] Among them, based on the aforementioned input matrix and self-attention score matrix, when calculating the residual, and These represent the input and output of the self-attention computation, respectively. The residual connection process involves adding the input and output of the self-attention computation together to enhance gradient propagation.

[0071] Furthermore, Presentation layer normalization operation, This indicates a feedforward neural network, also known as a gradient forward propagation neural network, in which gradients can be used... It is used as an activation function for linear transformations.

[0072] In this embodiment, as Figure 5 As shown, the four main operations—self-attention computation, residual connection operation and layer normalization operation, forward propagation, and then performing residual connection operation and layer normalization operation again—can be executed in series and regarded as a self-attention feature extraction layer.

[0073] Furthermore, after the encoded input matrix is ​​input into the self-attention feature extraction layer, it will produce an output of the same dimension. Therefore, multiple self-attention feature extraction layers can be connected end to end to obtain a feature extraction network for multi-level feature information extraction, and then enter the risk prediction stage after the feature information is extracted.

[0074] Step S103: In the deep neural network, a local risk prediction network and a global risk prediction network are set up. According to the time length covered by the initial data, the local feature information output by the feature extraction network corresponding to the time length is input into the corresponding local risk prediction network, and the local feature information output by the extraction layer of each feature is concatenated into the global feature information input into the global risk prediction network.

[0075] In the embodiments of this application, the follow-up data includes data information from multiple time points from the start of recording to the outcome event. The data information at different time points has varying degrees of impact on the outcome prediction results. Therefore, as... Figure 2 As shown, feature extraction networks can be constructed using data of different time lengths to extract feature information. The features extracted by different feature extraction networks are then concatenated, and the concatenated data is fed into a risk prediction network to obtain the predicted risk probability.

[0076] In this embodiment, the feature extraction network is based on a self-attention mechanism, focusing primarily on the relationships between variables, but its ability to extract time-series relationships within variables is relatively weak. Therefore, as... Figure 6 As shown, multiple feature extraction networks with different time series lengths can be set up to extract features from the input data of the corresponding time series lengths, and then the output results are concatenated and fed into the risk prediction network.

[0077] Specifically, K sequence lengths are set respectively. This yields the corresponding input data in terms of time length, enabling the construction of K feature extraction networks. .

[0078] in, The network is responsible for processing baseline variables and follow-up variables that only take one time point. The processing time is The follow-up variables.

[0079] In a specific example, the possible values ​​are, for example, .

[0080] Furthermore, three of the aforementioned feature extraction networks are constructed, and their respective output local feature information is represented separately. For each feature extraction network, a corresponding local risk prediction network is set up: .

[0081] Furthermore, the three output local feature information are concatenated as shown below to obtain the global feature information:

[0082] And as a global risk prediction network Input.

[0083] Each local risk prediction network, and the global risk prediction network, consists of a single fully connected neural network layer, which transmits the output results through... The function yields the risk probability for the corresponding category.

[0084] Step S104: Based on the pre-training of the deep neural network, predict the risk probability of the global feature information input to the global risk prediction network and the local feature information input to the corresponding local risk prediction network, and obtain the prediction result.

[0085] In the embodiments of this application, based on the deep neural network constructed above, the parameter settings of each layer of the network can be determined by training it, and then saved for prediction of patient data.

[0086] In this embodiment, parameters need to be initialized before training the deep neural network. The self-attention feature extraction network uses transfer learning to speed up the training and reduce training overhead, while other networks use random initialization. Based on this, the error between the result and the label is calculated using a loss function, and the network parameters are updated based on the gradient descent algorithm and backpropagation principle until the network converges, resulting in a trained network.

[0087] In specific examples, such as Figure 7 As shown, a feature extraction network based on a self-attention mechanism Transfer learning can be used to pre-set network parameters, while the parameters of other neural networks are randomly initialized.

[0088] Furthermore, as mentioned above, the outcome events of each patient's chronic disease data are used as labels. When training a neural network, a loss function is used to calculate the error between the network's risk prediction result and the label. :

[0089] in, Indicates the first in the network Input data for each patient, , For the total number of patients in the dataset, Indicates network parameters as At that time, the prediction results of the neural network. This represents the loss function, which calculates the error between the neural network risk prediction result and the label.

[0090] In the specific example of this embodiment, the fully connected neural networks in the local risk prediction network and the global risk prediction network... and As the last layer of the overall deep neural network, it can output the prediction results and directly calculate the network error with the label.

[0091] Specifically, cross-entropy is used as the loss function, and the calculation formula is as follows:

[0092] in, For the first Loss function for each patient; For the first One category; The number of categories in the sample; Representing a symbolic function, for example, if the patient The true category equals If the value is 1, then the value is 0; otherwise, the value is 0. The network outputs the predicted probability of risk outcomes, that is, the patient's... Category The probability of.

[0093] Furthermore, the network loss was calculated using the double loss function. The total loss L of the network can be determined according to the following formula:

[0094] in, All of these represent adjustable hyperparameters used to control the impact of local losses on the network.

[0095] Furthermore, by using gradient descent to minimize the aforementioned loss function, the network parameters are updated through the error backpropagation mechanism until the number of training iterations reaches a preset threshold, or the network error fluctuation is less than a preset error threshold. At this point, the network can be considered to have converged, and the parameter settings of each layer of the network are saved to obtain a trained deep neural network.

[0096] Furthermore, when using a trained deep neural network to predict the risk of patients with chronic diseases, patient data that was not used in the training process or other patient data to be predicted can be input into the deep neural network, and the predicted classification results and risk probabilities can be output.

[0097] Furthermore, network performance can be evaluated based on the obtained prediction results and various evaluation indicators such as their accuracy.

[0098] This method constructs a multi-time-series risk factor feature extraction network to extract the correlation and temporal features of chronic disease patient data. The output of the risk prediction network is calculated based on the loss function and labels, and fed back to the network through the gradient descent method, enabling the network to learn the professional knowledge of chronic disease clinicians and the medical connection between chronic disease data and outcomes based on the labels.

[0099] As can be seen, the chronic disease risk prediction method of the embodiments of this application solves the problem of heterogeneous data by screening patient data and using the same dimension of patient data, making the obtained data suitable for deep neural networks. When constructing the deep neural network, a feature extraction network for risk factors is constructed based on the self-attention mechanism, and the results of the self-attention calculation operations of each feature head are combined. In the constructed feature extraction network for risk factors, correlation features and time series features are comprehensively considered. Multiple information extraction modules are constructed according to different time lengths of data, and multiple time series risk factor features are combined to perform feature extraction, thereby realizing the prediction of the risk of chronic disease development in patients using a trained deep neural network.

[0100] It should be noted that the method of the embodiments of this application can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of the embodiments of this application, and the multiple devices will interact with each other to complete the method described.

[0101] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0102] Based on the same inventive concept, and corresponding to the methods of any of the above embodiments, the embodiments of this application also provide a risk prediction device for chronic diseases.

[0103] refer to Figure 8The chronic disease risk prediction device includes: a heterogeneous data processing module 801, a risk factor extraction module 802, a multi-time series joint prediction module 803, and a training and prediction module 804. The heterogeneous data processing module 801 is configured to filter the patient data using the mean and standard deviation of the preset patient data, unify the dimensions of the patient data, obtain initial data, and input it into a preset deep neural network. The risk factor extraction module 802 is configured to, in the deep neural network, map the initial data into an input matrix, perform self-attention calculation operations on each feature head based on multiple coefficient matrices allocated to the input matrix and output them, perform a linear transformation after combining the outputs of each feature head to obtain a self-attention score matrix, and set residual connection operations and layer normalization operations on the input matrix and the self-attention score matrix to construct a feature extraction network to propagate the gradient forward and output local feature information; The multi-time series joint prediction module 803 is configured to set up a local risk prediction network and a global risk prediction network in the deep neural network, and input the local feature information of the feature extraction network corresponding to the time series length to the corresponding local risk prediction network according to the time length covered by the initial data, and concatenate the local feature information output by the extraction layer of each feature to the global feature information input to the global risk prediction network. The training and prediction module 804 is configured to predict the risk probability based on the global feature information input to the global risk prediction network and the local feature information input to the corresponding local risk prediction network, and obtain the prediction result, based on the pre-training of the deep neural network.

[0104] For ease of description, the above apparatus is described in terms of its functions, divided into various modules. Of course, in implementing the embodiments of this application, the functions of each module can be implemented in one or more software and / or hardware.

[0105] The apparatus of the above embodiments is used to implement the risk prediction method for the corresponding chronic disease in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0106] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the risk prediction method for chronic diseases as described in any of the above embodiments.

[0107] Figure 9This embodiment illustrates a more specific hardware structure of an electronic device. The device may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0108] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0109] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this application are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0110] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0111] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0112] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0113] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this application, and not necessarily all the components shown in the figures.

[0114] The apparatus of the above embodiments is used to implement the risk prediction method for the corresponding chronic disease in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0115] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the chronic disease risk prediction method as described in any of the above embodiments.

[0116] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0117] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the chronic disease risk prediction method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0118] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0119] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0120] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0121] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A method for predicting the risk of chronic diseases, characterized in that, include: The patient data is filtered using the mean and standard deviation of pre-set patient data, and the dimensions of the patient data are unified to obtain initial data, which is then input into a pre-set deep neural network. The patient data includes baseline data and follow-up data. The baseline data is data that is collected once and does not change, while the follow-up data is data that changes with the condition and needs to be collected each time. In the deep neural network, the initial data is mapped to an input matrix. Based on multiple coefficient matrices assigned to the input matrix, self-attention calculations are performed on each feature head, and the results are output. The outputs of each feature head are then combined and linearly transformed to obtain a self-attention score matrix. Residual connection operations and layer normalization operations are applied to the input matrix and the self-attention score matrix to construct a feature extraction network, which propagates gradients forward and outputs local feature information. K sequence lengths are set respectively. The three feature extraction networks are constructed, and the local feature information output by each network is represented respectively. ; in , Indicates the duration of time and includes A different variable, The number of baseline variables, The number of follow-up variables; For each of the aforementioned feature extraction networks, a corresponding local risk prediction network is set up: ; In the deep neural network, a local risk prediction network and a global risk prediction network are set up. Based on the time length covered by the initial data, the local feature information output by the feature extraction network corresponding to the time series length is input into the corresponding local risk prediction network. The local feature information output by each feature extraction layer is then concatenated to form the global feature information input into the global risk prediction network. Specifically, the three output local feature information pieces are concatenated as follows to obtain the global feature information: And as a global risk prediction network Input; Each of the local risk prediction networks and the global risk prediction network consists of a single fully connected neural network layer, and the output results are transmitted through... The function yields the risk probability for the corresponding category; Based on the pre-training of the deep neural network, the global feature information input to the global risk prediction network and the local feature information input to the corresponding local risk prediction network are used to predict the risk probability and obtain the prediction result.

2. The method according to claim 1, characterized in that, The pre-training of the deep neural network includes: The network parameters of the deep neural network are pre-set using transfer learning; Construct a loss function using cross-entropy; Based on the preset categories of the patient data, the error between the category and the prediction results of the corresponding local risk prediction network and the global risk prediction network is determined using the loss function. The network parameters are updated by backpropagating the error. The training of the deep neural network is completed when the updated network parameters reduce the error of the deep neural network to a preset error threshold.

3. The method according to claim 1, characterized in that, The filtering of the patient data includes: Use the mean and the standard deviation to set the filtering range; Patient data with values ​​within the specified filtering range are retained.

4. The method according to claim 1, characterized in that, The self-attention calculation operation for each feature head is performed based on multiple coefficient matrices assigned to the input matrix, including: Set a first weight matrix, a second weight matrix, and a third weight matrix for the input matrix, and multiply them by the input matrix respectively; Obtain the feature matrix to be matched, the feature query matrix, and the eigenvalue matrix; For each feature head, a self-attention calculation operation is performed on the feature head using a preset self-attention activation function, and the output for the feature head is determined.

5. The method according to claim 1, characterized in that, Before obtaining the self-attention score matrix, the process also includes: Determine the missing values ​​in the input matrix; A missing value mask is set for the missing values ​​to obtain a mask matrix, wherein the missing value mask consists of 0 representing missing values ​​and 1 representing the presence of values; The self-attention score matrix is ​​obtained by linearly transforming the output of each feature head and multiplying the result by the corresponding element in the mask matrix.

6. The method according to claim 1, characterized in that, The step of constructing a feature extraction network by setting residual connection operations and layer normalization operations on the input matrix and the self-attention score matrix includes: The residual connection operation is performed by adding the input matrix and the self-attention score matrix; Perform layer normalization using the formula shown below: in, Represents the input matrix, Let H represent the self-attention score matrix, FFN represent the feedforward neural network, and H represent the result of the layer normalization operation. Furthermore, the self-attention calculation, the residual connection operation, the layer normalization operation, the gradient forward propagation, and the residual connection operation and the layer normalization operation are concatenated to obtain the feature extraction network.

7. The method according to claim 1, characterized in that, Before inputting the local feature information of the output of the feature extraction network corresponding to the time series length into the corresponding local risk prediction network, the process includes: Based on the time length covered by the initial data, different sequence lengths are configured for each initial data with different time series lengths; Multiple feature extraction networks are set up, and initial data of different sequence lengths are configured for each network.

8. A risk device for chronic diseases, characterized in that, include: Heterogeneous data processing module, risk factor extraction module, multi-time series joint prediction module, and training and prediction module; The heterogeneous data processing module is configured to filter the patient data using the mean and standard deviation of preset patient data, unify the dimensions of the patient data, obtain initial data, and input it into a preset deep neural network; wherein the patient data includes baseline data and follow-up data, the baseline data is data collected once and does not change, and the follow-up data is data that changes with the condition and needs to be collected each time; The risk factor extraction module is configured to, within the deep neural network, map the initial data into an input matrix, perform self-attention calculation operations on each feature head based on multiple coefficient matrices allocated to the input matrix, output the results, perform a linear transformation on the combined outputs of the feature heads to obtain a self-attention score matrix, and set residual connection operations and layer normalization operations on the input matrix and the self-attention score matrix to construct a feature extraction network to propagate gradients forward and output local feature information; wherein, K sequence lengths are respectively set. The three feature extraction networks are constructed, and the local feature information output by each network is represented respectively. ; in , Indicates the duration of time and includes A different variable, The number of baseline variables, The number of follow-up variables; For each of the aforementioned feature extraction networks, a corresponding local risk prediction network is set up: ; The multi-time-series joint prediction module is configured to include a local risk prediction network and a global risk prediction network in the deep neural network. Based on the time length covered by the initial data, it inputs the local feature information output by the feature extraction network corresponding to the time series length into the corresponding local risk prediction network, and concatenates the local feature information output by each feature extraction layer into global feature information input to the global risk prediction network. Specifically, the three output local feature information pieces are concatenated as follows to obtain the global feature information: And as a global risk prediction network Input; Each of the local risk prediction networks and the global risk prediction network consists of a single fully connected neural network layer, and the output results are transmitted through... The function yields the risk probability for the corresponding category; The training and prediction module is configured to predict the risk probability based on the global feature information input to the global risk prediction network and the local feature information input to the corresponding local risk prediction network, and obtain the prediction result, based on the pre-training of the deep neural network.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions for causing the computer to perform the method according to any one of claims 1 to 7.