Model training method, latent tuberculosis disease risk prediction method and device
Patent Information
- Application Number
- CN202610906291.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-20
AI Technical Summary
当前对潜伏性结核的控制,多是由医生进行主观判定,误诊率较高,不利于结核病的有效防治
本申请实施例通过获取样本患者的样本目标免疫疾病信息;其中,样本目标免疫疾病信息表征与潜伏性结核发病相关的免疫疾病信息;利用第一发病风险预测模型,基于样本目标免疫疾病信息,生成第一样本风险预测概率;基于第一样本风险预测概率和样本患者的真实发病标签,确定第一发病风险预测模型的第一模型损失值;基于模型损失值,调整第一样本风险预测模型的模型参数和超参数,得到目标发病风险预测模型;其中,目标发病风险预测模型用于基于目标患者的第一目标免疫疾病信息,确定目标患者的潜伏性结核发病预测风险,模型能够从真实临床标签中学习到与潜伏性结核发病高度相关的免疫模式,从而实现从样本到目标患者的泛化预测,提高了预测模型的准确性和鲁棒性,尤其在免疫抑制患者群体中能有效降低漏诊或误诊风险;通过参数和超参数的联合优化,使得模型在临床数据分布偏移时仍能保持稳定性能,提升了模型的稳定性和可靠性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning technology, and in particular to a model training method, a method and apparatus for predicting the risk of latent tuberculosis. Background Technology
[0002] Latent tuberculosis infection (LTBI) refers to infection with Mycobacterium tuberculosis (Mtb) without the presence of clinical symptoms, imaging abnormalities, or infectivity. The infected individual's immune system keeps the bacteria in a dormant state, but approximately 5%-10% of infected individuals may develop active tuberculosis in their lifetime (especially those with weakened immune systems, such as HIV-infected individuals, diabetic patients, children, or the elderly). Currently, the management of latent tuberculosis relies heavily on subjective assessment by doctors, leading to a high rate of misdiagnosis and hindering effective prevention and control of tuberculosis. Summary of the Invention
[0003] In view of the above problems, embodiments of this application provide a model training method, a method for predicting the risk of latent tuberculosis, an apparatus, an electronic device, and a readable storage medium to overcome or at least partially solve the above problems.
[0004] In a first aspect, embodiments of this application provide a model training method, the method comprising: Obtain target immune disease information from sample patients; among which, the target immune disease information represents immune disease information related to the pathogenesis of latent tuberculosis; Using the first disease incidence risk prediction model, the first sample risk prediction probability is generated based on the sample target immune disease information; Based on the risk prediction probability of the first sample and the actual disease label of the sample patients, determine the first model loss value of the first disease risk prediction model; Based on the model loss value, the model parameters and hyperparameters of the first sample risk prediction model are adjusted to obtain the target incidence risk prediction model; wherein, the target incidence risk prediction model is used to determine the latent tuberculosis incidence prediction risk of the target patient based on the first target immune disease information of the target patient.
[0005] Optionally, obtain sample target immune disease information from the sample patients, including: Obtain the sample immune disease information of the sample patients; wherein the number of immune diseases included in the sample immune disease information is greater than or equal to the number of immune diseases included in the sample target immune disease information; Based on knowledge graphs, sample immune disease association graph data related to sample immune disease information is generated; wherein, the first connection relationship between each immune disease in the immune disease association graph data is an unconfirmed connection relationship. Using a graph convolutional neural network model, a second sample risk prediction probability is generated based on the sample immune disease association graph data; Based on the risk prediction probability of the second sample and the actual incidence label, the second model loss value of the graph convolutional neural network model is determined. Based on the loss value of the second model, the model parameters of the graph convolutional neural network model are adjusted to obtain the target immune disease association model; Using a target immune disease association model, based on the sample immune disease information of sample patients, a target immune disease association graph data related to sample patients is generated; wherein, the second connection relationship of each immune disease self-examination in the target immune disease association graph data is a confirmed connection relationship; Information on the target immune diseases of the sample patients was obtained from the target immune disease association graph data.
[0006] Optionally, based on the knowledge graph, sample immune disease association graph data related to sample immune disease information is generated, including: Extract entity nodes and potential association edges related to each immune disease from the sample's immune disease information from a pre-defined medical knowledge graph. The extracted entity nodes are used as nodes in the graph, and potential associated edges are used as unconfirmed first connection relationships. Weights are initialized on the potential associated edges to obtain the sample immune disease association graph data.
[0007] Optionally, using a graph convolutional neural network model, based on the sample immune disease association graph data, a second sample risk prediction probability is generated, including: Input the sample immune disease association graph data into a graph convolutional neural network model; Node features and graph structure features are extracted through multi-layer graph convolution operations; The extracted features are pooled and fully connected to map, and the risk prediction probability of the second sample is output. The graph convolutional neural network model includes at least two graph convolutional layers and a graph attention mechanism module.
[0008] Optionally, the inputs to the first disease risk prediction model may also include at least one of the following auxiliary characteristics of the sample patients: age, sex, past medication history, and use of immunosuppressants.
[0009] Optionally, sample target immune disease information of the patients can be obtained from the target immune disease association graph data, including: Threshold filtering is performed on the second connectivity relationships in the target immune disease association graph data, retaining connectivity relationships with confidence levels higher than a preset threshold; Based on the screened connectivity relationships, core immune disease nodes that are highly correlated with the pathogenesis of latent tuberculosis were extracted; The information corresponding to the extracted core immune disease nodes is identified as the target immune disease information of the sample.
[0010] Optionally, based on the model loss value, the model parameters and hyperparameters of the first sample risk prediction model are adjusted to obtain the target incidence risk prediction model, including: The model parameters are iteratively updated using the Adam optimizer combined with a learning rate decay strategy; The model hyperparameters were optimized by cross-validation. An early stopping mechanism is introduced during training. When the validation set loss value no longer decreases for N consecutive epochs, training is stopped and the optimal target disease risk prediction model is saved.
[0011] Secondly, embodiments of this application provide a method for predicting the risk of latent tuberculosis, the method comprising: Obtain target immune disease information from target patients; among which, the target immune disease information represents immune disease information related to the onset of latent tuberculosis; Using a target disease incidence risk prediction model, a first risk prediction probability is generated based on information about target immune diseases; wherein, the target disease incidence risk prediction model is obtained based on any of the above model training methods; Based on the first risk prediction probability, the tuberculosis risk level of the target patient is determined.
[0012] Thirdly, embodiments of this application provide a model training apparatus, the apparatus comprising: The first acquisition module is used to acquire sample target immune disease information of sample patients; wherein, the sample target immune disease information represents immune disease information related to the onset of latent tuberculosis; The first generation module is used to generate the first sample risk prediction probability based on the sample target immune disease information using the first disease incidence risk prediction model. The first determining module is used to determine the first model loss value of the first disease risk prediction model based on the first sample risk prediction probability and the true disease label of the sample patients. The adjustment module is used to adjust the model parameters and hyperparameters of the first sample risk prediction model based on the model loss value to obtain the target incidence risk prediction model; wherein, the target incidence risk prediction model is used to determine the latent tuberculosis incidence prediction risk of the target patient based on the first target immune disease information of the target patient.
[0013] Fourthly, embodiments of this application provide a device for predicting the risk of latent tuberculosis, the device comprising: The second acquisition module is used to acquire target immune disease information of the target patient; wherein, the target immune disease information represents immune disease information related to the onset of latent tuberculosis; The second generation module is used to generate a first risk prediction probability based on the target immune disease information using the target disease risk prediction model; wherein the target disease risk prediction model is obtained based on the model training method mentioned above. The second determination module is used to determine the tuberculosis risk level of the target patient based on the first risk prediction probability.
[0014] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the model training method as described above, or the latent tuberculosis incidence risk prediction method.
[0015] Sixthly, embodiments of this application provide a readable storage medium storing a program or instructions, which, when executed by a processor, implement the model training method described above, or the latent tuberculosis incidence risk prediction method.
[0016] The specific beneficial effects are as follows: This application embodiment obtains sample target immune disease information from sample patients; wherein, the sample target immune disease information represents immune disease information related to the onset of latent tuberculosis; using a first disease risk prediction model, a first sample risk prediction probability is generated based on the sample target immune disease information; based on the first sample risk prediction probability and the sample patient's real disease label, a first model loss value of the first disease risk prediction model is determined; based on the model loss value, the model parameters and hyperparameters of the first sample risk prediction model are adjusted to obtain the target disease risk prediction model; wherein, the target disease risk prediction model is used to determine the latent tuberculosis onset prediction risk of the target patient based on the first target immune disease information of the target patient. The model can learn immune patterns highly correlated with the onset of latent tuberculosis from real clinical labels, thereby achieving generalized prediction from samples to target patients, improving the accuracy and robustness of the prediction model, especially in immunosuppressed patient groups, effectively reducing the risk of missed diagnosis or misdiagnosis; through joint optimization of parameters and hyperparameters, the model can still maintain stable performance when the clinical data distribution shifts, improving the stability and reliability of the model. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of a model training method provided in an embodiment of this application; Figure 2 A flowchart illustrating a method for predicting the risk of latent tuberculosis in an embodiment of this application; Figure 3 This is a loss value decrease curve provided in an embodiment of this application; Figure 4 This is a logic block diagram of a model training device provided in an embodiment of this application; Figure 5 This is a logic block diagram of a latent tuberculosis incidence risk prediction device provided in an embodiment of this application; Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0020] Reference Figure 1 , Figure 1 This is a flowchart illustrating a model training method provided in an embodiment of this application. The method may include: S101, Obtain sample target immune disease information from the sample patients; wherein, the sample target immune disease information represents immune disease information related to the onset of latent tuberculosis; S102, using the first disease incidence risk prediction model, based on the target immune disease information of the sample, to generate the first sample risk prediction probability; S103, Based on the first sample risk prediction probability and the actual disease label of the sample patients, determine the first model loss value of the first disease risk prediction model; S104. Based on the model loss value, adjust the model parameters and hyperparameters of the first sample risk prediction model to obtain the target incidence risk prediction model; wherein, the target incidence risk prediction model is used to determine the latent tuberculosis incidence prediction risk of the target patient based on the first target immune disease information of the target patient.
[0021] In the embodiments of this application, historical electronic medical record data of multiple sample patients are obtained from a clinical database. For each sample patient, their immune disease information is first collected, including but not limited to diagnostic records, disease activity scores, and durations of various immune-related diseases such as systemic lupus erythematosus, rheumatoid arthritis, ankylosing spondylitis, psoriasis, inflammatory bowel disease, and post-HIV immunosuppression. Subsequently, based on a pre-constructed medical knowledge graph, the sample immune disease information is mapped into a sample immune disease association graph data containing entity nodes and potential association edges. The knowledge graph predefines prior knowledge such as co-occurrence relationships between immune disease entities, shared immune pathway relationships, and overlapping drug targets. Further, a trained target immune disease association model (constructed based on a graph convolutional neural network (GCN) containing at least two graph convolutional layers and a graph attention mechanism) is used to process the association graph data to generate a second connectivity confidence matrix. By screening connections with confidence levels higher than preset thresholds (e.g., 0.75, 0.80, or 0.85), core immune disease nodes highly correlated with the pathogenesis of latent tuberculosis (e.g., TNF-α) are extracted. (Inhibitor-related immune disorder nodes, IL-6 pathway abnormal nodes, etc.) ultimately yield the target immune disease information of the sample. This information is represented in vector form, including one-hot encoding of disease subsets, association strength embedding vector (embedding dimension set to 128), and node importance weights.
[0022] In the embodiments of this application, the aforementioned sample target immune disease information can be used as the main feature input to the first disease risk prediction model. In this embodiment, the first disease risk prediction model is preferably constructed using the Random Forest ensemble learning algorithm. For example, specific parameters can be configured as: n_estimators=500, max_depth=12, min_samples_split=4, min_samples_leaf=2, bootstrap=True, and feature subsampling can be enabled.
[0023] Optionally, auxiliary clinical features such as patient age (normalized to [0,1]), gender (one-hot encoded), history of immunosuppressant use (quantified by cumulative dose and type), and baseline IFN-γ release assay (IGRA) results can be concatenated with the graph embedding vector output by GCN to form a high-dimensional input feature vector of dimension 256. The model outputs the first sample risk prediction probability P (range [0,1]) through an ensemble voting mechanism of multiple decision trees. This probability represents the risk of the sample patient progressing to active tuberculosis within a specific follow-up period.
[0024] In the embodiments of this application, binary cross-entropy loss can be used as the first model loss function: , where y is the true disease label of the sample patients (1 indicates disease, 0 indicates no disease). The average loss value is calculated for all samples in the training set to obtain the first model loss value.
[0025] In the embodiments of this application, the hyperparameter space of the random forest can be optimized by using grid search combined with 5-fold cross-validation based on the first model loss value. This optimization includes the number of trees, maximum depth, minimum number of samples per leaf node, and splitting criterion (Gini / Entropy). Simultaneously, feature importance is iteratively evaluated, and weakly correlated features with importance below 0.01 are dynamically removed.
[0026] Furthermore, an early stopping mechanism can be introduced during training: training stops when the AUROC metric on the validation set no longer improves for three consecutive iterations, and the parameter set of the model with the best performance on the validation set is saved, ultimately yielding the target disease risk prediction model. The model's performance metrics on the test set are: AUROC = 0.872, accuracy = 85.6%, sensitivity = 81.3%, and specificity = 88.7%.
[0027] Based on the embodiments disclosed in this application, the model can learn immune patterns highly correlated with the onset of latent tuberculosis from real clinical labels, thereby achieving generalized prediction from samples to target patients, improving the accuracy and robustness of the prediction model, and effectively reducing the risk of missed or misdiagnosis, especially in immunosuppressed patient groups; through joint optimization of parameters and hyperparameters, the model can still maintain stable performance when the distribution of clinical data shifts, improving the stability and reliability of the model.
[0028] Optionally, S101 includes: S201, Obtain the sample immune disease information of the sample patient; wherein the number of immune diseases included in the sample immune disease information is greater than or equal to the number of immune diseases included in the sample target immune disease information; S202, Based on the knowledge graph, generate sample immune disease association graph data related to sample immune disease information; wherein, the first connection relationship between each immune disease in the immune disease association graph data is an unconfirmed connection relationship. S203 uses a graph convolutional neural network model to generate the risk prediction probability of the second sample based on the sample immune disease association graph data; S204, Based on the risk prediction probability of the second sample and the actual incidence label, determine the second model loss value of the graph convolutional neural network model; S205, Based on the loss value of the second model, adjust the model parameters of the graph convolutional neural network model to obtain the target immune disease association model; S206, Using a target immune disease association model, based on the sample immune disease information of the sample patients, generate target immune disease association graph data related to the sample patients; wherein, the second connection relationship of each immune disease self-check in the target immune disease association graph data is a confirmed connection relationship; S207, Obtain sample target immune disease information from the target immune disease association graph data.
[0029] In the embodiments of this application, structured immune disease data from N=5000 sample patients can be collected from the Hospital Information System (HIS) and electronic medical record database. For each sample patient, complete sample immune disease information D is obtained, including disease name, ICD-10 code, diagnosis date, disease activity score (SLEDAI, BASDAI, DAS28, etc.), disease duration, complication records, and laboratory indicators (autoantibody profile, cytokine levels, etc.). The number of immune diseases included in the sample immune disease information is typically 15-30, which is much larger than the dimensionality of the subsequent target immune disease information.
[0030] In the embodiments of this application, a pre-trained large-scale medical knowledge graph G (with more than 80,000 nodes, including immune disease entities, immune pathways, cytokines, drug targets and literature co-occurrence relationships) can be constructed or invoked.
[0031] Then, each disease entity in the sample immune disease information D can be mapped to the corresponding node in the knowledge graph, and the one-hop and two-hop neighbor nodes can be extracted.
[0032] Then all potential associations can be defined as unconfirmed first connections and their weights initialized, as shown in Formula 1 below: (Formula 1); Formula 1 calculates immune disease entities by weighted fusion of prior knowledge from three different sources. and Initial weights of potential associated edges ∈ [0,1], providing high-quality graph structure priors for subsequent graph convolutional neural networks. The meaning of each parameter is explained in detail below: 1) Weight coefficient 0.4: This indicates the proportion of this semantic similarity component in the final weight (the sum is 1).
[0033] The cosine similarity function is used to calculate the cosine of the angle between two vectors. Its range is usually [-1, 1], but in this case it actually falls in [0, 1].
[0034] : Employing BERT (or pre-trained medical language models such as BioBERT, PubMedBERT, etc.) to analyze disease entities and The embedding vector (usually 768) is obtained by encoding the text description (including disease name, clinical manifestations, pathophysiological description, etc.).
[0035] Specifically, this means quantifying the semantic similarity between two disease entities. For example, "systemic lupus erythematosus" and "rheumatoid arthritis" would have a high cosine similarity because they are both autoimmune diseases with overlapping clinical manifestations. This item primarily captures the semantic associations within the text.
[0036] 2) Weighting coefficient 0.35: The proportion of this co-occurrence statistical component in the final weight.
[0037] Pointwise Mutual Information (PMMI) is a statistical measure of association strength.
[0038] The calculation formula is usually as follows: ,in This represents the probability of two diseases co-occurring in the same patient or the same article.
[0039] Specifically, it reflects the co-occurrence frequency of two immune diseases in real-world clinical data or medical literature. A higher PMI value indicates that the two diseases frequently appear together in patient records or the same research paper. This incorporates data-driven empirical associations to compensate for the limitations of purely semantic knowledge.
[0040] 3) Weighting coefficient 0.25: The proportion of the overlapping component of this biological pathway in the final weight.
[0041] KEGG (Kyoto Encyclopedia of Genes and Genomes) represents a measure of overlap between immune-related signaling pathways in a database. It is typically defined as the Jaccard similarity or overlap coefficient. ,in and Diseases and The associated set of KEGG pathways (e.g., TNF signaling pathway, IL-17 signaling pathway, Jak-STAT signaling pathway, etc.).
[0042] Specifically, this means quantifying the degree of sharing between two diseases at the biological mechanism level. A higher value indicates that both diseases affect the same immune signaling pathways or molecular targets. This factor incorporates prior biological knowledge, enhancing the biological interpretability of the graph data.
[0043] The weights of the three coefficients (0.4 + 0.35 + 0.25 = 1) were determined through empirical optimization or cross-validation. Semantic similarity had the highest weight (0.4), followed by clinical co-occurrence statistics, and finally biological pathway mechanisms, reflecting a multi-level knowledge fusion from text to data to mechanisms.
[0044] This weighted summation method ensures the initial weights are correct. It possesses semantic rationality, statistical reliability, and biological credibility, providing a solid graph topology foundation for the subsequent training of GCN models and avoiding the cold start problem of learning from scratch.
[0045] Finally, construct the sample immune disease association map data. ,in This represents the set of unconfirmed first connections.
[0046] In the embodiments of this application, it is possible to Input graph convolutional neural network model The specific architecture of this model includes: Input layer: Node features are initialized as a concatenation of disease clinical phenotype embeddings (dimension 256) and knowledge graph prior embeddings; Two GCN Conv layers (hidden dimensions 256→128), using residual connections and ReLU activation; A multi-head Graph Attention Layer (GAT, head=8) dynamically calculates neighbor attention weights; The graph readout layer (Global Mean Pooling + Max Pooling) is followed by two MLP layers (128→64→1), which output the risk prediction probability P2 ∈ [0,1] of the second sample.
[0047] In the embodiments of this application, for each sample, the true incidence label y (1 represents latent tuberculosis incidence, 0 represents no incidence) and the second sample risk probability output by the model are used. The cross-entropy loss for binary classification is calculated as shown in Formula 2 below: (Formula 2); The second model loss value is obtained by averaging all samples within the batch. It is used to guide model optimization.
[0048] In the embodiments of this application, the Adam optimizer is used (initial learning rate 0.0001, weight_decay = 5 × 10). -4 (Using Cosine Annealing LR scheduling) for All parameters are updated via backpropagation.
[0049] The training process consists of 150 epochs, each with a size of 32, and uses 5-fold cross-validation to select the optimal model. An early stopping strategy is also introduced: training stops if the validation set AUROC does not improve for 5 consecutive epochs.
[0050] After training, a converged target immune disease association model M_target is obtained, which has the ability to automatically discover highly correlated associations from raw immune disease information.
[0051] In embodiments of this application, the original immune disease information of each patient sample can also be mapped again as a graph. Then, input the trained data. Perform forward reasoning.
[0052] The model can output the confidence score of each potential connection. After normalization by the Softmax function, the edges with a confidence score greater than 0.75 are finally retained as confirmed second connections.
[0053] Finally, target immune disease association map data is generated. ), where the second connection is a high-confidence association confirmed by the model.
[0054] In the embodiments of this application, for The second connection relationship in the algorithm is filtered by a confidence threshold (θ=0.78), retaining only edges with high confidence. Based on the contribution of nodes to the TNF-α, IL-17, IFN-γ and TLR signaling pathways, the Top-K (K=8~12) core immune disease nodes and their associated features were extracted. The extracted core node information (such as node embedding vectors, edge weights, and clinical metadata) is aggregated through feature aggregation to form sample target immune disease information with fixed dimensions (dimensions 128~256), which serves as the core input feature for subsequent random forest models.
[0055] Based on the embodiments disclosed in this application, the graph embedding features extracted by GCN can serve as important input features for the random forest model. The technical effects of this solution are reflected in several aspects: First, it significantly reduces feature noise by automatically filtering out weakly correlated or irrelevant immune diseases through the evolutionary process from unconfirmed to confirmed connections, thus improving the quality of subsequent first-model inputs; second, it utilizes graph structure learning capabilities to capture potential causal or co-occurrence relationships between diseases, which is difficult to achieve with traditional flat features; third, it improves the interpretability of the entire pipeline. The association graph data output by GCN can intuitively show which combinations of immune diseases have the greatest impact on tuberculosis risk, providing doctors with auxiliary decision-making support, and ultimately enhancing the model's applicability and reliability in real-world clinical scenarios.
[0056] Optionally, step S202 includes: Step S301: Extract entity nodes and potential association edges related to each immune disease from the sample's immune disease information from the preset medical knowledge graph. Step S302: The extracted entity nodes are used as nodes in the graph, and the potential associated edges are used as unconfirmed first connection relationships. Step S303: Initialize the weights of the potential associated edges to obtain the sample immune disease association graph data.
[0057] In the embodiments of this application, a pre-defined large-scale medical knowledge graph can be invoked. This graph is constructed by integrating multiple authoritative data sources such as PubMed, DrugBank, KEGG, Reactome, TTD, and UMLS. For each sample patient, the disease entity set is located within the sample immune disease information D. } (m≥15), the following extraction operations can be performed: (1) Exact matching and semantic expansion mapping: using entity linking tools (e.g., entity recognition and linking models based on BioBERT) to Mapped to standard entity nodes in the knowledge graph (2) Neighbor expansion: extract each One-hop and two-hop neighbor nodes, including immune pathway nodes (TNF signaling pathway), cytokine nodes (IL-6, IFN-γ), drug target nodes (TNF inhibitors), and comorbidity-related disease nodes; (3) Potential association edge extraction: collect all edges that meet any of the following conditions as potential association edges. : 1) Direct edges (existing in G_base); 2) Indirect edges inferred through shared pathways or document co-occurrence; 3) Node pairs with semantic similarity higher than a preset threshold (cosine similarity > 0.65).
[0058] In embodiments of this application, an undirected weighted graph can also be constructed. ,include: 1) Node set Expand neighbor nodes (typical node size is 150~400); 2) Edge set That is, all the potential associated edges extracted above are considered as the first unconfirmed connection relationships; 3) Adjacency matrix Initially empty, to be filled later during weight initialization. This is an undirected weighted graph. The structure is complete and preserves the topological relationship between the original immune disease information and external medical knowledge.
[0059] In addition, the implementation details of weight initialization can be found in Formula 1 and its related embodiments, and will not be repeated here.
[0060] Based on the embodiments disclosed in this application, external domain knowledge can be injected into the graph construction stage to provide a high-quality prior structure for subsequent GCN training. In the overall scheme combined with random forest, these initial weights can guide the learning of feature importance, significantly improving the efficiency and quality of graph data construction and avoiding the cold start problem that may arise from learning relationships from scratch. Through the prior knowledge of the medical knowledge graph, the model can converge to a meaningful immune disease network more quickly. At the same time, the transferability of the model is improved, and even in medical scenarios with limited sample size, it can still achieve better feature representation with the help of external knowledge. Ultimately, this enhances the generalization ability of the target disease risk prediction model across different hospitals or different patient groups and reduces deployment costs.
[0061] Optionally, step S203 includes: Step S401: Input the sample immune disease association graph data into the graph convolutional neural network model; Step S402: Extract node features and graph structure features through multi-layer graph convolution operations; Step S403: Perform pooling and fully connected mapping on the extracted features to output the risk prediction probability of the second sample; The graph convolutional neural network model includes at least two graph convolutional layers and a graph attention mechanism module.
[0062] In the embodiments of this application, firstly, the previously constructed sample immune disease association map data is... (Contains a set of nodes) Unconfirmed first connection and initializing the weight matrix The input is fed into the graph convolutional neural network model M_gcn.
[0063] The graph convolutional neural network model The specific architecture design is as follows: The model includes at least two graph convolutional layers and a graph attention mechanism module. Specifically, the model includes: The first graph convolutional layer (Graph Convolutional Layer I) has an input feature dimension of 256 and an output hidden dimension of 256. It uses graph convolution with self-loops, the activation function is ReLU, and residual connections are introduced to alleviate the gradient vanishing problem. The second graph convolutional layer (Graph Convolutional Layer II) has an input dimension of 256 and an output hidden dimension of 128, which further aggregates multi-hop neighborhood information. The Graph Attention Network (GAT) module employs a multi-head attention mechanism (8 heads) to dynamically calculate the attention weight coefficients of each node to its neighboring nodes, thereby achieving adaptive weighting of the importance of associations with different immune diseases. The graph reading module includes concatenation operations for Global Mean Pooling and Global Max Pooling; The subsequent fully connected mapping layer consists of two multilayer perceptron (MLP) layers. The first layer maps the pooled feature dimension from 256 to 64, and the second layer further maps it to a 1-dimensional output. The second sample risk prediction probability P2 (0≤P2≤1) is generated through the sigmoid activation function.
[0064] During operation, node features and graph structure features are extracted sequentially through multi-layer graph convolution operations: the first layer of graph convolution mainly captures the features directly associated with immune diseases in the local neighborhood, and the second layer of graph convolution, combined with a graph attention mechanism, further extracts higher-order topological structure features and global contextual information. Subsequently, pooling operations are performed on the extracted multi-layer node embedding features to obtain a fixed-length graph-level representation, and a fully connected mapping layer is used to complete the non-linear transformation from graph features to risk prediction probability, finally outputting the risk prediction probability of the second sample.
[0065] Furthermore, during the training phase, the graph convolutional neural network model employs a binary classification cross-entropy loss function, calculates the second model loss value by combining the actual disease labels of sample patients in the aforementioned embodiment, and performs end-to-end parameter optimization through the Adam optimizer.
[0066] Based on the embodiments disclosed in this application, the oversmoothing problem common in graph neural networks can be effectively alleviated through multi-layer graph convolution and attention mechanisms, enabling the learning of more discriminative deep representations; compared with simple graph models, the confidence of the predicted probability is higher.
[0067] Optionally, the inputs to the first disease risk prediction model may also include at least one of the following auxiliary characteristics of the sample patients: age, sex, past medication history, and use of immunosuppressants.
[0068] In embodiments of this application, the input to the first disease risk prediction model may further include at least one, preferably multiple, of the following auxiliary clinical characteristics of the sample patients: 1) Age characteristics: Patient age is normalized to the [0,1] interval or binned and encoded into an age group vector; 2) Gender characteristics: One-hot encoding or embedding is used; 3) Past medication history: The cumulative dose, type, quantity, and duration of glucocorticoids, immunosuppressants, and other related drugs used by patients in the past 5 years are quantitatively statistically analyzed to form a multidimensional numerical feature vector; 4) Immunosuppressant usage: The usage status (binary / multi-classification), duration, and dose intensity of specific immunosuppressants such as TNF-α inhibitors, IL-6 inhibitors, and JAK inhibitors are extracted to generate dedicated embedding features.
[0069] The aforementioned auxiliary clinical features and sample target immune disease information are fused through the feature splicing or feature cross module to form the final input feature vector (total dimension 256~512).
[0070] Based on the embodiments disclosed in this application, auxiliary features are concatenated with the graph embedding output by GCN through feature engineering and then input into a random forest. This extension enriches the input dimensions of the model, enabling it to comprehensively consider demographic and clinical treatment factors, which can significantly improve the model's predictive performance (because age, immunosuppressant use, etc., are clinically recognized independent risk factors for latent tuberculosis). Random forests can automatically learn the nonlinear interactions between these features, further improving indicators such as AUC. At the same time, it maintains good interpretability (the contribution of each factor can be intuitively seen through feature importance ranking), making it easier for clinicians to understand and trust the model's output. Ultimately, it achieves more accurate individualized risk assessment.
[0071] Optionally, step S207 includes: Step S601: Threshold screening is performed on the second connection relationship in the target immune disease association graph data, and connection relationships with confidence scores higher than the preset threshold are retained; Step S602: Based on the screened connectivity relationships, extract core immune disease nodes that are highly correlated with the pathogenesis of latent tuberculosis; Step S603: The information corresponding to the extracted core immune disease nodes is determined as the target immune disease information of the sample.
[0072] In the embodiments of this application, the generated target immune disease association map data The second connection relationship in Perform threshold filtering. Specifically, for Each confirmed second connection relationship Obtain the confidence score output by the target immune disease association model. Set a preset threshold θ=0.78, and only retain values that meet the criteria. The second connection relationship forms the set of high-confidence connections after filtering. The threshold The signal-to-noise ratio can be dynamically optimized within the range of [0.65, 0.90] through grid search based on the performance of the validation set, so as to achieve the optimal balance.
[0073] Secondly, based on the high-confidence connectivity relationships after screening, core immune disease nodes highly correlated with the onset of latent tuberculosis were extracted. The extraction process specifically includes: (1) calculating each node exist (2) Combining domain knowledge, perform latent tuberculosis relevance scoring on nodes: , where TB_related_pathway includes TNF-α signaling pathway, IL-17 signaling pathway, IFN-γ signaling pathway, TLR signaling pathway and Jak-STAT pathway, etc.; (3) Arrange the correlation scores in descending order and extract the Top-K core immune disease nodes, where K is preferably 8 to 15, to form a core node set.
[0074] Finally, the information corresponding to the extracted core immune disease nodes is determined as the target immune disease information of the sample. Specifically, the following features are extracted for each core node in the core node set: node embedding vector (output by the last GCN layer of the target immune disease association model, dimension 128), association edge weight vector, and clinical metadata (disease activity score, disease duration, etc.). These features are then aggregated using attention pooling or weighted summation to generate fixed-dimensional target immune disease information for the sample (dimension 128~256). This target immune disease information for the sample is the core input feature of the weighted first-order disease risk prediction model. Based on the embodiments disclosed in this application, automatic dimensionality reduction from a fully associated graph to refined target features can be achieved. In the random forest scheme, this core node information constitutes the main input features of the model. Through threshold filtering, feature dimensionality can be effectively controlled, avoiding the curse of dimensionality while retaining the strongest signals; ensuring that the features input to the first model are highly relevant to the target task (latent nodules), thus improving the signal-to-noise ratio; this confidence-based filtering mechanism also has adaptability, allowing the threshold to be adjusted according to different datasets, enhancing the system's flexibility and robustness.
[0075] Optionally, step S104 includes: Step S701: The model parameters are iteratively updated using the Adam optimizer combined with a learning rate decay strategy; Step S702: Search and optimize the model hyperparameters using cross-validation. Step S703 introduces an early stopping mechanism during training. When the loss value of the validation set no longer decreases for N consecutive epochs, training is stopped and the optimal target disease risk prediction model is saved.
[0076] In the embodiments of this application, in order to improve the training stability, parameter optimization efficiency and final prediction performance of the first disease risk prediction model M1, the Adam (Adaptive Moment Estimation) optimization algorithm combined with the learning rate decay strategy can be used to iteratively update the model parameters.
[0077] Specifically, the first disease risk prediction model M1 can be constructed as a random forest ensemble model, a Transformer-based sequence prediction model, a time series risk prediction model based on Long Short-Term Memory (LSTM) networks, or other machine learning or deep learning models with risk prediction capabilities, depending on the application scenario.
[0078] When the first disease risk prediction model M1 is a deep learning model, the model is first forward-propagated using the training sample set to obtain the disease risk prediction result output by the model. Then, the loss function value is calculated based on the difference between the prediction result and the corresponding true label. The loss function can be set according to the task type. For example, for a binary disease risk prediction task, the cross-entropy loss function can be used; for a risk score regression task, the mean squared error (MSE), mean absolute error (MAE), or a combination thereof can be used.
[0079] Subsequently, the gradient information corresponding to the parameters of each layer is calculated using the backpropagation algorithm, and the model parameters are updated using the Adam optimizer. The Adam optimizer adaptively adjusts the update step size for different parameters by simultaneously estimating the first and second moments of the gradient. Its parameter update process includes: First, based on the gradient values of the current training batch Calculate the first moment estimate of the gradient. and the second moment estimate : ; ; in, This represents the first-order moment attenuation coefficient, which is preferably set to 0.9; This represents the second-order moment attenuation coefficient, which is preferably set to 0.999; This represents the gradient value of the corresponding parameter at the t-th iteration.
[0080] Since the moment estimation had bias in the early stage of training, further bias correction was performed, resulting in: ; .
[0081] Finally, the model parameters are updated based on the corrected first and second moments. : ; in, This represents the current learning rate. To avoid tiny constants with a denominator of zero, its preferred value is 10^-8.
[0082] Furthermore, to avoid excessive learning rate in the later stages of training causing the model to oscillate around the optimal solution, and to improve the model's convergence speed, this application introduces a learning rate decay strategy on the basis of the Adam optimizer to dynamically adjust the learning rate α.
[0083] In some embodiments, a cosine annealing learning rate decay strategy can be employed. A larger learning rate is maintained in the early stages of training to accelerate parameter search; as the training epochs increase, the learning rate gradually decreases according to the cosine function, allowing the model to approach local optima with smaller step sizes in later stages. The learning rate adjustment method can be expressed as: ; in, This represents the initial learning rate. This represents the minimum learning rate; This indicates the number of training rounds completed in the current decay phase; This indicates the total number of training rounds for the corresponding decay period.
[0084] In other embodiments, an exponential decay strategy may also be used for learning rate adjustment, i.e.: ; in, γ represents the initial learning rate; k represents the learning rate decay factor; and k represents the number of decay cycles or training phases completed. Preferably, the decay factor γ is set to 0.95 to 0.98, for example, 0.95, 0.96, 0.97, or 0.98, but is not limited to the above values.
[0085] Furthermore, to prevent model instability due to rapid changes in the learning rate during the initial training phase, this application includes a warmup mechanism before the formal entry into the learning rate decay phase. During the warmup phase, the learning rate is gradually increased from a small initial value to a preset initial learning rate. Once the training reaches a preset warmup epoch, a cosine annealing strategy or an exponential decay strategy is initiated to adjust the learning rate. The warmup epoch can be set based on the training sample size, model complexity, and hardware resources, for example, 5% to 10% of the total training epochs, but is not limited to this.
[0086] For the first disease risk prediction model M1 constructed using random forest, since random forest mainly completes parameter determination based on the ensemble learning mechanism of decision trees, it does not need to update tree structure parameters through gradient backpropagation during training. However, it can iteratively search and optimize hyperparameters such as the number of trees, maximum depth, minimum number of leaf node samples, and feature sampling ratio. In the process of hyperparameter optimization, a search strategy based on Adam's idea, exponential decay search step size, or other adaptive optimization methods can also be used to improve the efficiency of model hyperparameter optimization.
[0087] Through the synergistic effect of the Adam optimizer and the dynamic learning rate scheduling mechanism, on the one hand, the update magnitude of each parameter can be automatically adjusted according to the gradient history information, reducing the impact of gradient oscillation and local abnormal gradients on the training process; on the other hand, by adaptively changing the learning rate at different training stages, the model's ability to fit complex disease risk characteristics can be improved, the model convergence speed can be accelerated, the training time can be reduced, and the generalization performance and prediction accuracy of the model on the validation set and test set can be improved, thereby achieving a more stable and reliable prediction of the risk of target disease.
[0088] Furthermore, model hyperparameters can be optimized through cross-validation. Specifically, K-fold cross-validation (preferably K=5 or 10) is used, and grid search or Bayesian optimization is performed within a predefined hyperparameter search space. For the random forest model, the search space includes the number of trees n_estimators∈[300,800], the maximum depth max_depth∈[8,20], the minimum number of split samples min_samples_split∈[2,10], and the feature sampling ratio max_features∈['sqrt','log2',0.7], etc. In each fold of cross-validation, the average performance index (preferably AUROC and BCE Loss) is calculated based on the first model loss value on the validation set, and the hyperparameter combination that optimizes the overall performance of the validation set is selected.
[0089] In addition, an early stopping mechanism can be introduced during training. Specifically, an early stopping patience parameter N (preferably N=5~10) is set, and the first model loss value or AUROC metric on the validation set is monitored after each epoch of training. When the validation set loss value no longer decreases (or the AUROC no longer increases) for N consecutive epochs, training is immediately stopped, and the model parameters with the best performance on the current validation set are saved as the parameter set of the target disease risk prediction model. Simultaneously, a model checkpoint mechanism can be combined to periodically save intermediate models during training to ensure that the globally optimal solution is ultimately retained.
[0090] Based on the above embodiments disclosed in this application, Adam+ learning rate decay can accelerate convergence and avoid local optima; cross-validation can effectively prevent overfitting and improve the model's generalization ability on unseen data; early stopping mechanism can save training time and computing resources while preserving the best model state and improving the model's predictive performance.
[0091] Figure 2 This application provides a flowchart illustrating a method for predicting the risk of latent tuberculosis, as shown in the embodiments below. Figure 2 As shown, the method includes: Step S801: Obtain target immune disease information of the target patient; wherein, the target immune disease information represents immune disease information related to the onset of latent tuberculosis; Step S802: Using the target disease risk prediction model, a first risk prediction probability is generated based on the target immune disease information; wherein, the target disease risk prediction model is obtained based on the model training method of any of the above. Step S803: Based on the first risk prediction probability, determine the tuberculosis incidence risk level of the target patient.
[0092] In embodiments of this application, the target patient is classified into risk levels based on the first risk prediction probability P using a preset risk stratification threshold. Specifically, this includes: 1) When P < 0.30, it is determined to be a low-risk level; 2) When 0.30 ≤ P ≤ 0.70, it is determined to be a medium-risk level; 3) When P > 0.70, it is determined to be a high-risk level.
[0093] Furthermore, a structured risk assessment report can be generated that includes risk probability, key contributing features (such as the top-5 immune disease nodes in terms of feature importance), and clinical recommendations.
[0094] Based on the above embodiments disclosed in this application, information on target immune diseases closely related to latent tuberculosis can be used to predict the risk of developing latent tuberculosis in target patients. This can improve the controllability of latent tuberculosis to a certain extent and provide patients with disease prediction information with high reference value.
[0095] For example, embodiments of this application also provide a loss value decrease curve of the first sample risk prediction model during the training process, such as... Figure 3 As shown, the loss value is generally on a continuous downward trend, indicating that there is indeed an implicit correlation between the input and output features, and that this correlation can be implicitly learned by the model.
[0096] refer to Figure 4 , Figure 4 This application provides a logic block diagram of a model training device 400, which may include: The first acquisition module 401 is used to acquire sample target immune disease information of the sample patient; wherein, the sample target immune disease information represents immune disease information related to the onset of latent tuberculosis; The first generation module 402 is used to generate the first sample risk prediction probability based on the sample target immune disease information using the first disease incidence risk prediction model. The first determining module 403 is used to determine the first model loss value of the first disease risk prediction model based on the first sample risk prediction probability and the true disease label of the sample patients. The adjustment module 404 is used to adjust the model parameters and hyperparameters of the first sample risk prediction model based on the model loss value to obtain the target incidence risk prediction model; wherein, the target incidence risk prediction model is used to determine the latent tuberculosis incidence prediction risk of the target patient based on the first target immune disease information of the target patient.
[0097] Optionally, the first acquisition module 401 is further configured as follows: Obtain the sample immune disease information of the sample patients; wherein the number of immune diseases included in the sample immune disease information is greater than or equal to the number of immune diseases included in the sample target immune disease information; Based on knowledge graphs, sample immune disease association graph data related to sample immune disease information is generated; wherein, the first connection relationship between each immune disease in the immune disease association graph data is an unconfirmed connection relationship. Using a graph convolutional neural network model, a second sample risk prediction probability is generated based on the sample immune disease association graph data; Based on the risk prediction probability of the second sample and the actual incidence label, the second model loss value of the graph convolutional neural network model is determined. Based on the loss value of the second model, the model parameters of the graph convolutional neural network model are adjusted to obtain the target immune disease association model; Using a target immune disease association model, based on the sample immune disease information of sample patients, a target immune disease association graph data related to sample patients is generated; wherein, the second connection relationship of each immune disease self-examination in the target immune disease association graph data is a confirmed connection relationship; Information on the target immune diseases of the sample patients was obtained from the target immune disease association graph data.
[0098] Optionally, the first acquisition module 401 is also configured as follows: Extract entity nodes and potential association edges related to each immune disease from the sample's immune disease information from a pre-defined medical knowledge graph. The extracted entity nodes are used as nodes in the graph, and potential associated edges are used as unconfirmed first connection relationships. Weights are initialized on the potential associated edges to obtain the sample immune disease association graph data.
[0099] Optionally, the first generation module 402 is also configured as follows: Input the sample immune disease association graph data into a graph convolutional neural network model; Node features and graph structure features are extracted through multi-layer graph convolution operations; The extracted features are pooled and fully connected to map, and the risk prediction probability of the second sample is output. The graph convolutional neural network model includes at least two graph convolutional layers and a graph attention mechanism module.
[0100] Optionally, the inputs to the first disease risk prediction model may also include at least one of the following auxiliary characteristics of the sample patients: age, sex, past medication history, and use of immunosuppressants.
[0101] Optionally, the first acquisition module 401 is also configured as follows: Threshold filtering is performed on the second connectivity relationships in the target immune disease association graph data, retaining connectivity relationships with confidence levels higher than a preset threshold; Based on the screened connectivity relationships, core immune disease nodes that are highly correlated with the pathogenesis of latent tuberculosis were extracted; The information corresponding to the extracted core immune disease nodes is identified as the target immune disease information of the sample.
[0102] Optionally, adjustment module 404 can also be configured as follows: The model parameters are iteratively updated using the Adam optimizer combined with a learning rate decay strategy; The model hyperparameters were optimized by cross-validation. An early stopping mechanism is introduced during training. When the validation set loss value no longer decreases for N consecutive epochs, training is stopped and the optimal target disease risk prediction model is saved.
[0103] The model training device in this application embodiment can be integrated into an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices besides a terminal. For example, the electronic device can be a GPU box, a mobile phone, a robot, an ultra-mobile personal computer (UMPC), or a personal digital assistant (PDA), etc., and can also be a server, a personal computer (PC), etc. This application embodiment does not specifically limit the specific implementation.
[0104] The model training device in this application embodiment can be a device with an operating system. This operating system can be Android, Linux, Windows, or other possible operating systems; this application embodiment does not specifically limit it.
[0105] The model training device provided in this application embodiment can achieve... Figure 1The various processes implemented in the method embodiments will not be described again here to avoid repetition. Reference Figure 5 , Figure 5 This is a logic block diagram of a latent tuberculosis risk prediction device provided in an embodiment of this application. The latent tuberculosis risk prediction device 500 may include: The second acquisition module 501 is used to acquire target immune disease information of the target patient; wherein, the target immune disease information represents immune disease information related to the onset of latent tuberculosis; The second generation module 502 is used to generate a first risk prediction probability based on target immune disease information using a target disease risk prediction model; wherein the target disease risk prediction model is obtained based on the model training method of any one of claims 1 to 7. The second determining module 503 is used to determine the tuberculosis incidence risk level of the target patient based on the first risk prediction probability.
[0106] The latent tuberculosis incidence risk prediction device in this application embodiment can be integrated into an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices besides a terminal. For example, the electronic device can be a GPU BOX, mobile phone, tablet computer, laptop computer, PDA, robot, ultra-mobile personal computer (UMPC), or personal digital assistant (PDA), etc., and can also be a server, personal computer (PC), etc. This application embodiment does not specifically limit the device.
[0107] The latent tuberculosis risk prediction device in this application embodiment can be a device with an operating system. This operating system can be Android, Linux, Windows, or other possible operating systems; this application embodiment does not specifically limit it.
[0108] The latent tuberculosis risk prediction device provided in this application embodiment can achieve... Figure 3 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0109] This application provides an electronic device, see [link to relevant documentation] Figure 6The electronic device 60 includes: a processor 601, a memory 602, and a computer program 6021 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the program, it implements the model training method of the foregoing embodiments, or the latent tuberculosis incidence risk prediction method.
[0110] This application also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps in the model training method or the latent tuberculosis incidence risk prediction method disclosed in this application.
[0111] This application also provides a computer program product that, when run on an electronic device, enables the processor to implement the steps in the model training method or the latent tuberculosis incidence risk prediction method disclosed in this application.
[0112] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0113] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0116] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0117] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0118] The above provides a detailed description of the model training method, the latent tuberculosis incidence risk prediction method, and the apparatus provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A model training method, characterized in that, The method includes: Obtain sample target immune disease information from patient samples; wherein, the sample target immune disease information represents immune disease information related to the pathogenesis of latent tuberculosis; Using the first disease incidence risk prediction model, a first sample risk prediction probability is generated based on the target immune disease information of the sample. Based on the first sample risk prediction probability and the actual disease label of the sample patients, determine the first model loss value of the first disease risk prediction model; Based on the model loss value, the model parameters and hyperparameters of the first sample risk prediction model are adjusted to obtain the target disease risk prediction model; wherein, the target disease risk prediction model is used to determine the latent tuberculosis risk prediction of the target patient based on the first target immune disease information of the target patient.
2. The method according to claim 1, characterized in that, The acquisition of sample patient target immune disease information includes: Obtain the sample immune disease information of the patient; wherein the number of immune diseases included in the sample immune disease information is greater than or equal to the number of immune diseases included in the sample target immune disease information; Based on the knowledge graph, sample immune disease association graph data related to the sample immune disease information is generated; wherein, the first connection relationship between each immune disease in the immune disease association graph data is an unconfirmed connection relationship; Using a graph convolutional neural network model, a second sample risk prediction probability is generated based on the sample's immune disease association graph data; Based on the risk prediction probability of the second sample and the actual disease label, the second model loss value of the graph convolutional neural network model is determined; Based on the loss value of the second model, the model parameters of the graph convolutional neural network model are adjusted to obtain the target immune disease association model; Using the target immune disease association model, based on the sample immune disease information of the sample patients, target immune disease association graph data related to the sample patients is generated; wherein, the second connection relationship of each immune disease self-check in the target immune disease association graph data is a confirmed connection relationship; The target immune disease information of the sample patients is obtained from the target immune disease association map data.
3. The method according to claim 2, characterized in that, The step of generating sample immune disease association graph data based on knowledge graphs and related to the sample immune disease information includes: Extract entity nodes and potential association edges related to each immune disease from the sample's immune disease information from a pre-defined medical knowledge graph; The extracted entity nodes are used as nodes in the graph, and potential associated edges are used as unconfirmed first connection relationships. The potential associated edges are weighted to obtain the sample immune disease association graph data.
4. The method according to claim 2, characterized in that, The step of using a graph convolutional neural network model to generate a second sample risk prediction probability based on the sample immune disease association graph data includes: The sample immune disease association graph data is input into a graph convolutional neural network model; Node features and graph structure features are extracted through multi-layer graph convolution operations; The extracted features are pooled and mapped using a fully connected layer to output the risk prediction probability of the second sample. The graph convolutional neural network model includes at least two graph convolutional layers and a graph attention mechanism module.
5. The method according to claim 1 or 2, characterized in that, The input to the first disease risk prediction model also includes at least one auxiliary feature from the sample patients' age, gender, past medication history, and immunosuppressant use.
6. The method according to claim 2, characterized in that, The step of obtaining the sample target immune disease information of the sample patient from the target immune disease association map data includes: Threshold filtering is performed on the second connectivity relationships in the target immune disease association graph data, retaining connectivity relationships with confidence levels higher than a preset threshold; Based on the screened connectivity relationships, core immune disease nodes that are highly correlated with the pathogenesis of latent tuberculosis were extracted; The information corresponding to the extracted core immune disease nodes is determined as the target immune disease information of the sample.
7. The method according to claim 1, characterized in that, The step of adjusting the model parameters and hyperparameters of the first sample risk prediction model based on the model loss value to obtain the target incidence risk prediction model includes: The model parameters are iteratively updated using the Adam optimizer combined with a learning rate decay strategy; The model hyperparameters were optimized by cross-validation. An early stopping mechanism is introduced during training. When the loss value of the validation set no longer decreases for N consecutive epochs, training is stopped and the optimal target disease risk prediction model is saved.
8. A method for predicting the risk of latent tuberculosis, characterized in that, The method includes: Obtain target immune disease information of the target patient; wherein, the target immune disease information represents immune disease information related to the onset of latent tuberculosis; Using a target disease risk prediction model, a first risk prediction probability is generated based on the target immune disease information; wherein, the target disease risk prediction model is obtained based on the model training method described in any one of claims 1 to 7; Based on the first risk prediction probability, the tuberculosis incidence risk level of the target patient is determined.
9. A model training device, characterized in that, The device includes: The first acquisition module is used to acquire sample target immune disease information of the sample patient; wherein, the sample target immune disease information represents immune disease information related to the onset of latent tuberculosis; The first generation module is used to generate a first sample risk prediction probability based on the target immune disease information of the sample using a first disease incidence risk prediction model. The first determining module is used to determine the first model loss value of the first disease risk prediction model based on the first sample risk prediction probability and the true disease label of the sample patient. An adjustment module is used to adjust the model parameters and hyperparameters of the first sample risk prediction model based on the model loss value to obtain a target disease risk prediction model; wherein, the target disease risk prediction model is used to determine the latent tuberculosis disease prediction risk of the target patient based on the first target immune disease information of the target patient.
10. A device for predicting the risk of latent tuberculosis, characterized in that, The device includes: The second acquisition module is used to acquire target immune disease information of the target patient; wherein, the target immune disease information represents immune disease information related to the onset of latent tuberculosis; The second generation module is used to generate a first risk prediction probability based on the target immune disease information using a target disease risk prediction model; wherein the target disease risk prediction model is obtained based on the model training method according to any one of claims 1 to 7; The second determining module is used to determine the tuberculosis incidence risk level of the target patient based on the first risk prediction probability.
