Method and system for pre-emptive assessment of immunological pneumonia based on machine learning algorithms

By constructing a deep time-series model and a hierarchical progressive training algorithm, combined with specific HLA subtype screening and a multimodal fusion network, a highly specific and sensitive pre-risk assessment for immune pneumonia was achieved. This solves the problems of low prediction accuracy and data quality sensitivity in existing technologies, and improves the biological interpretability and robustness of the model.

CN122117375APending Publication Date: 2026-05-29CANCER INST & HOSPITAL CHINESE ACADEMY OF MEDICAL SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CANCER INST & HOSPITAL CHINESE ACADEMY OF MEDICAL SCI
Filing Date
2026-02-09
Publication Date
2026-05-29

Smart Images

  • Figure CN122117375A_ABST
    Figure CN122117375A_ABST
Patent Text Reader

Abstract

The application discloses an immune pre-pneumonia evaluation method and system based on a machine learning algorithm, and relates to the technical field of immune evaluation.The application constructs a machine learning algorithm model based on multiple specific HLA subtypes, captures the correlation between gene interaction and immune pathways through a time sequence network, combines multi-task loss and adversarial training to enhance robustness, and realizes high-precision pre-risk evaluation of immune pneumonia caused by immunotherapy.The scheme solves the problems of the prior art, such as dependence on lagging symptoms, insufficient generalization ability of prediction markers, and sensitivity to data noise, has good biological interpretability and clinical practicability, can be extended to other immune side reaction prediction, and provides reliable support for personalized treatment decisions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of immune assessment technology, and in particular to a method and system for pre-assessment of immune pneumonia based on machine learning algorithms. Background Technology

[0002] Currently, the prediction of adverse reactions to tumor immunotherapy mainly relies on clinical symptom observation, limited biomarker detection, and physician experience. For example, some studies infer the likelihood of adverse reactions by detecting the levels of certain inflammatory factors in patients' blood, but this method lacks a comprehensive consideration of the complex mechanisms of tumor immunotherapy. Changes in inflammatory factors are influenced by multiple factors, resulting in low specificity and accuracy. Regarding biomarkers, although some indicators such as PD-L1 expression and tumor mutational burden (TMB) are used to assess the efficacy of immunotherapy, their predictive value for adverse reactions is limited, and they cannot accurately predict the type and severity of adverse reactions that may occur in different individuals receiving immunotherapy. Furthermore, even when existing technologies involve HLA gene research, they are mostly general analyses, lacking in-depth research on the systematic relationship between specific HLA subtypes and adverse reactions to tumor immunotherapy, and failing to fully utilize the key role of specific HLA subtypes in immune responses to construct effective predictive models.

[0003] Meanwhile, current predictive models rely solely on the subtype itself, and existing technologies cannot accurately and comprehensively predict the side effects of tumor immunotherapy, making it difficult for clinicians to develop personalized prevention and treatment plans in advance. On the one hand, relying on clinical symptom observation is often delayed; by the time side effects appear, patients may have already suffered some damage, affecting the continuity of treatment and the patient's quality of life. On the other hand, detection methods based on limited biomarkers have poor specificity, with high false positive and false negative rates, which can easily mislead clinical decisions. For example, certain inflammatory factors may also be elevated in the absence of immunotherapy side effects, significantly reducing the reliability of judgments based solely on these indicators. Furthermore, existing research involving HLA genes does not focus on specific subtypes, failing to fully explore the rich genetic information of HLA genes and thus hindering the improvement of predictive accuracy. Consequently, the generalization ability and accuracy of existing predictive models need improvement, failing to meet the urgent clinical need for accurate prediction of the side effects of tumor immunotherapy. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for the preliminary assessment of immune pneumonia based on machine learning algorithms, so as to improve the technical problem that the existing technology relies only on the subtype itself and does not focus on specific subtypes, which fails to fully explore the rich genetic information of HLA genes and makes it difficult to improve the accuracy of prediction.

[0005] To achieve the above-mentioned objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A method for pre-assessment of immune-mediated pneumonia based on machine learning algorithms, comprising:

[0007] Peripheral blood samples were collected and analyzed using high-throughput sequencing technology to identify individual HLA subtypes;

[0008] We constructed a deep time series model and combined it with bioinformatics analysis methods to perform feature analysis on individual HLA subtypes, generating deep key features associated with immune pneumonia.

[0009] An initial pre-assessment model is constructed, and the initial pre-assessment model is trained using a hierarchical progressive medical deep learning training algorithm to generate a pre-assessment model.

[0010] The deep key features are input into the pre-evaluation model to generate evaluation results.

[0011] Furthermore, the individual HLA subtypes include the sequence information corresponding to DRB1 09:01:02-HLA subtype, DQA1 01:02:01-HLA subtype, DPB1 02:02:02-HLA subtype, DPB1 05:01:01-HLA subtype, DPB3 04:02:01-HLA subtype, and DQA101:04:01-HLA subtype.

[0012] In the above-mentioned scheme, this invention achieves highly specific and sensitive pre-risk assessment of immune pneumonia caused by immunotherapy by accurately screening multiple specific HLA subtypes and constructing a deep time series model for feature analysis. It solves key problems in existing technologies such as reliance on delayed clinical symptoms, insufficient generalization ability of predictive biomarkers, and susceptibility of models to data quality interference. Its advantages are: specific HLA subtype screening ensures the biological targeting and accuracy of the prediction; the deep time series model effectively captures gene interactions and immune pathway associations, improving the biological interpretability of the model; and the progressive training and adversarial learning mechanism enhances the robustness of the model to small sample noisy data.

[0013] Furthermore, the deep temporal model includes a cascaded CNN network and a temporal network; the temporal network employs an RNN network, an LSTM network, or a Transformer network.

[0014] Furthermore, the generation of deep key features associated with immune-mediated pneumonia includes:

[0015] Bioinformatics analysis methods were used to process different individual HLA subtypes and extract corresponding initial feature vectors;

[0016] Each initial feature vector is processed by a CNN network to generate the corresponding deep feature vector;

[0017] Each deep feature vector is input into a temporal network to analyze the correlation between deep features and the immune response pathways involved in tumor immunotherapy, thereby generating deep key features associated with immune pneumonia.

[0018] In the above scheme, this invention employs a cascaded CNN and RNN / LSTM / Transformer temporal network, combined with bioinformatics preprocessing, to construct a feature extraction architecture capable of deeply analyzing local patterns within HLA genes and dynamic interactions between genes. This design enables the model not only to extract high-dimensional local features from various HLA subtype sequences through CNN, but also to use temporal networks to model the synergistic or temporal relationships of multiple HLA genes in the immune response, thereby capturing information on specific immune pathways they participate in. This solves the problem that traditional prediction models cannot effectively integrate multi-gene interactions and lack the ability to explain the underlying immunological mechanisms.

[0019] Furthermore, the initial pre-evaluation model includes an input layer, a feature encoding layer, a fusion layer, and an output layer; the fusion layer includes a multimodal fusion network incorporating an attention mechanism; and the output layer includes a cascaded fully connected layer and an activation function layer.

[0020] Furthermore, the hierarchical progressive medical deep learning training algorithm includes:

[0021] An initial preliminary assessment model was constructed, and key historical features were collected and weights were set for clinical importance, time sensitivity, and data quality.

[0022] The weights of each training sample in the historical deep key features are calculated based on clinical importance weight, time sensitivity weight, and data quality weight.

[0023] Input the key historical features into the initial pre-evaluation model to generate training evaluation results;

[0024] Based on the training evaluation results and the weights of each training sample, the weighted cross-entropy loss and composite loss are calculated. The initial pre-evaluation model is then adjusted using the Adam optimizer to generate the first pre-evaluation model.

[0025] Medical data augmentation, feature loss enhancement, and data fusion are performed on key historical features to generate adversarial examples. The weights of the first pre-evaluation model are then adjusted using fast gradient sign method and projective gradient descent to generate a pre-evaluation model.

[0026] In the above scheme, this invention achieves highly robust and interpretable risk assessment of immune-mediated pneumonia by constructing an evaluation model with an attention mechanism fusion layer and combining it with a hierarchical progressive training algorithm. The attention mechanism enables the model to automatically focus on key HLA features, improving prediction accuracy and clinical interpretability. The hierarchical progressive training optimizes the learning efficiency of imbalanced samples through a weighted loss function (integrating clinical importance, time sensitivity, and data quality). Furthermore, medical data augmentation and adversarial training (fast gradient sign method and projective gradient descent) significantly enhance the model's resistance to data noise, missing data, and adversarial perturbations, effectively solving the problems of large prediction bias and weak generalization performance caused by traditional models ignoring differences in sample importance, sensitivity to data quality, and lack of anti-interference ability.

[0027] Further, the generation of the first preliminary evaluation model includes:

[0028] Based on the training evaluation results and the weights of each training sample, the weighted cross-entropy loss is calculated.

[0029] Based on weighted cross-entropy loss, the initial pre-evaluation model is fine-tuned using the Adam optimizer to generate the pre-evaluation model after initial tuning.

[0030] The initial evaluation model is used to process key historical features and generate the first training evaluation result.

[0031] Based on the first training evaluation results and the weights of each training sample, the composite loss is calculated;

[0032] Based on the composite loss, the initial pre-evaluation model is adjusted using the Adam optimizer to generate the first pre-evaluation model.

[0033] In the above scheme, the present invention first performs preliminary fine-tuning of the model through weighted cross-entropy loss, which alleviates the training bias caused by sample class imbalance and differences in clinical importance. Then, based on the preliminary tuning results, a composite loss integrating multi-objective constraints is calculated for fine optimization, so that the model can ensure classification accuracy while taking into account the rationality of sample ranking and the consistency of prediction results. This solves the problems of traditional single-stage training, such as difficulty in balancing multiple optimization objectives, susceptibility to noise samples, and insufficient convergence stability. It significantly improves the robustness and generalization ability of the model under complex clinical data and provides a reference framework for the training and optimization of other multi-task medical prediction models.

[0034] Furthermore, the generation of the pre-evaluation model includes:

[0035] Medical data augmentation is performed on key historical features to generate enhanced medical data features.

[0036] Perform feature enhancement on augmented medical data to generate missing feature vectors;

[0037] Randomly swap the missing feature vectors with the augmented features of the medical data, calculate the adversarial loss, and generate adversarial perturbations using the fast gradient sign method.

[0038] Based on adversarial perturbation, the weights of the first pre-evaluation model are adjusted by descent using the projection gradient method to generate the pre-evaluation model.

[0039] In the aforementioned process, this invention effectively improves the robustness and generalization ability of the pre-evaluation model by integrating medical data augmentation, feature missing value enhancement, and adversarial training (combining fast gradient signification and projective gradient descent). Medical data augmentation simulates reasonable variations in clinical sequencing, while feature missing value enhancement simulates scenarios with incomplete data, jointly enhancing the diversity of training data. Adversarial training forces the model to learn noise-insensitive feature representations by generating adversarial perturbations. The synergistic integration of medical data augmentation, feature missing value enhancement, and adversarial training solves the problems of weak clinical generalization ability and poor predictive stability caused by the limited training data, sensitivity to missing values, and susceptibility to minor perturbations in traditional models, ensuring the reliability and safety of the model in real and complex medical environments.

[0040] A machine learning-based pre-assessment system for immune-mediated pneumonia includes:

[0041] The data collection and analysis module is used to collect peripheral blood samples and detect and analyze them using high-throughput sequencing technology to identify individual HLA subtypes.

[0042] The feature construction module is used to build a deep time series model and combine bioinformatics analysis methods to perform feature analysis on individual HLA subtypes, generating deep key features associated with immune pneumonia;

[0043] The training module is used to build an initial pre-assessment model and train the initial pre-assessment model through a hierarchical progressive medical deep learning training algorithm to generate a pre-assessment model.

[0044] The evaluation module is used to input deep key features into the pre-evaluation model and generate evaluation results. Attached Figure Description

[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a flowchart of the method in an embodiment of the present invention;

[0047] Figure 2 This is a system structure diagram in an embodiment of the present invention. Detailed Implementation

[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0049] Please see Figure 1 This embodiment provides a method for the pre-assessment of immune pneumonia based on machine learning algorithms. Figure 1 The execution entity of the method shown can be a software and / or hardware device. The execution entity of this application can include, but is not limited to, at least one of the following: user equipment, network equipment, etc. User equipment can include, but is not limited to, computers, smartphones, personal digital assistants (PDAs), and the aforementioned electronic devices. Network equipment can include, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of computers or network servers. Cloud computing is a type of distributed computing, consisting of a super virtual computer composed of a group of loosely coupled computers. This embodiment does not impose any limitations on this.

[0050] A method for pre-assessment of immune-mediated pneumonia based on machine learning algorithms, comprising:

[0051] S1. Collect peripheral blood samples and perform high-throughput sequencing to detect and analyze the peripheral blood samples to identify the individual HLA subtype; the individual HLA subtype includes the sequence information corresponding to DRB1 09:01:02-HLA subtype, DQA1 01:02:01-HLA subtype, DPB1 02:02:02-HLA subtype, DPB1 05:01:01-HLA subtype, DPB3 04:02:01-HLA subtype and DQA1 01:04:01-HLA subtype.

[0052] S2. Construct a deep time series model and combine it with bioinformatics analysis methods to perform feature analysis on individual HLA subtypes, generating deep key features associated with immune pneumonia;

[0053] The deep temporal model includes a cascaded CNN network and a temporal network; the temporal network uses an RNN network, an LSTM network, or a Transformer network.

[0054] S2 includes:

[0055] S2-1. Process different individual HLA subtypes using bioinformatics analysis methods to extract the corresponding initial feature vectors;

[0056] Specifically, sequence features, structural features, functional features, and population genetic features are extracted from different individual HLA subtypes; these features are then integrated, with each individual HLA subtype corresponding to a feature vector. The multiple features corresponding to each individual HLA subtype are integrated and arranged according to a fixed locus order to generate an initial feature vector.

[0057] Taking any individual's HLA subtype as an example, the amino acid and nucleic acid sequences corresponding to that individual's HLA subtype are extracted, and their number and frequency of occurrence are calculated as sequence features of that individual's HLA subtype. Protein structure prediction tools (such as AlphaFold2 and SWISS-MODEL) are used to predict the three-dimensional structure of the HLA molecule, generating the geometric parameters of the antigen-binding groove, the spatial positions of key residues, and the proportion of secondary structure elements, which are used as structural features of that individual's HLA subtype. Based on known HLA-peptide binding databases, the antigen presentation preference of an individual's HLA subtype is annotated and used as a functional feature of that individual's HLA subtype. The frequency distribution of each allele of that individual's HLA subtype in different populations is obtained from population genetics databases (such as the 1000 Genomes Project), and the carrier rate of that allele in the target population is calculated as a population genetic feature of that individual's HLA subtype.

[0058] S2-2. Process each initial feature vector using a CNN network to generate the corresponding deep feature vector;

[0059] Specifically, taking any initial feature vector as an example, this initial feature vector is input into a CNN network. Multiple convolutional kernels of different sizes (e.g., 3, 5, 7) are set in the CNN network to perform convolution operations along the feature dimension on the initial feature vector. Each convolutional kernel captures local patterns at different scales in the feature vector, such as specific combinations of physicochemical properties or correlations of structural features. Then, a non-linear transformation is introduced using the ReLU activation function to transform the convolved features. Finally, a max-pooling layer is used to reduce the feature dimension while retaining the most salient features, generating a deep feature vector.

[0060] S2-3. Input each deep feature vector into a temporal network, analyze the correlation between each deep feature and the immune response pathway involved in tumor immunotherapy, and generate deep key features associated with immune pneumonia.

[0061] Specifically, when using RNN or LSTM networks for analysis, the deep feature vectors are input into the RNN / LSTM network in a biologically relevant order (such as the order of participation in antigen processing and presentation pathways). Each time step corresponds to an HLA subtype. The hidden states of the RNN / LSTM are passed between time steps, accumulating historical information. This mechanism simulates the cascade effects or temporal regulation of different HLA molecules in the immune response pathway. For example, in the antigen presentation pathway, HLA class II molecules and HLA class I molecules may play roles at different stages, and the LSTM captures this temporal dependence through its memory units.

[0062] The output of each time step contains information about the current HLA subtype and contextual information about all previous subtypes, generating deep key features associated with immune-mediated pneumonia. This allows the network to learn synergistic or antagonistic relationships between HLA subtypes; for example, certain combinations of HLA subtypes may collectively affect antigen presentation efficiency, thereby altering the strength of the immune response.

[0063] The hidden state change patterns learned using LSTM networks can be mapped to known immune response pathways. For example, the network might learn that when the characteristics of DRB1 09:01:02 are strong, the characteristics of DQA1 01:02:01 will subsequently be enhanced, corresponding to the synergistic upregulation of two types of molecules in the antigen processing and presentation pathways. This learned temporal pattern helps explain how HLA subtypes jointly influence the risk of developing immune-mediated pneumonia.

[0064] When using Transformer networks for analysis, all deep feature vectors are processed simultaneously, and the association weights between any two deep feature vectors are directly modeled through a self-attention mechanism. This parallel processing can capture complex, nonlinear interaction networks, is not restricted by order, and is more suitable for modeling complex pathways involving multiple molecules simultaneously in the immune system.

[0065] Then, a self-attention mechanism is used to calculate the association score between each deep feature vector and all other deep feature vectors. These scores can be interpreted as the strength of functional connectivity between different deep feature vectors in the immune response pathway. Through multiple attention heads, the Transformer can capture different types of association patterns from different subspaces. Each attention head can focus on different aspects of the immune response; for example, one head might capture feature interactions related to antigen binding, while another might capture feature interactions related to T cell receptor recognition, thus comprehensively analyzing the roles of HLA subtypes in multiple immune pathways (such as antigen presentation, T cell activation, and cytokine storm pathways). Finally, the output of the Transformer network is associated with key deep features of immune-mediated pneumonia.

[0066] S3. Construct an initial pre-assessment model and train it using a hierarchical progressive medical deep learning training algorithm to generate a pre-assessment model.

[0067] The initial pre-evaluation model comprises an input layer, a feature encoding layer, a fusion layer, and an output layer. The fusion layer includes a multimodal fusion network incorporating an attention mechanism. The output layer comprises a cascaded fully connected layer and an activation function layer (Sigmoid or Softmax). The input layer is configured to receive examination data from different HLA loci.

[0068] S3 includes:

[0069] S3-1. Construct an initial preliminary assessment model, collect historical key features, and assign clinical importance weights. Time-sensitive weights and data quality weight ;

[0070] Clinical importance weight Weighting coefficients are assigned to samples confirmed as severe immune-mediated pneumonia, with time-sensitive weighting. Weighting coefficients are assigned to samples that develop immune-mediated pneumonia in the early stages of treatment (e.g., within the first three months), based on data quality. Weighting coefficients are assigned to samples with high sequencing quality and complete data.

[0071] S3-2. Calculate the weight of each training sample in the historical deep key features based on clinical importance weight, time sensitivity weight, and data quality weight; the weight is the product of clinical importance weight, time sensitivity weight, and data quality weight.

[0072] S3-3. Input the key historical features into the initial pre-evaluation model to generate training evaluation results;

[0073] Specifically, the input layer arranges and standardizes the key historical features in a preset order to ensure data format uniformity. Subsequently, in the feature encoding layer, a multi-layer fully connected network or a one-dimensional convolutional network is used to independently encode the features of each key historical feature. The fully connected network maps the input features to a higher-dimensional latent space through weight matrices and non-linear activation functions (such as ReLU), capturing the complex non-linear relationships of the features. The one-dimensional convolutional network, on the other hand, extracts local feature patterns and preserves spatial structure information by sliding the convolutional kernel along the feature dimension. This layer outputs six deeply encoded feature vectors, fully mining the features of each HLA subtype. Deep feature representation avoids the loss of feature information. Next, in the fusion layer, the multimodal fusion network first concatenates the six encoded feature vectors to form a comprehensive feature vector. Then, a multi-head attention mechanism is introduced, which can automatically learn the importance weights of different features, improve the interpretability of the model, and enable clinicians to understand the basis of the model's decisions. By calculating the correlation weights between features of different HLA subtypes through linear transformations of query, key, and value, the model can automatically identify and amplify key features that contribute significantly to risk prediction, while suppressing the influence of redundant or noisy features. Attention weights are calculated using the scaled dot product attention formula, with residual connections and layer normalization added to ensure training stability. Finally, in the output layer, the attention-weighted fused features undergo further nonlinear transformation and dimensionality reduction through two fully connected layers. The first fully connected layer uses the ReLU activation function and Dropout regularization to prevent overfitting. The second fully connected layer maps the feature dimension to the output dimension, and then generates the training evaluation result, i.e., the risk probability or specific risk level of immune pneumonia, through either the Sigmoid activation function (used for binary risk probability prediction, outputting continuous probability values ​​between 0 and 1) or the Softmax activation function (used for multi-class risk classification, outputting the probability distribution of each risk level).

[0074] S3-4. Based on the training evaluation results and the weights of each training sample, calculate the weighted cross-entropy loss and composite loss, and adjust the initial pre-evaluation model using the Adam optimizer to generate the first pre-evaluation model.

[0075] It needs to be explained that, according to the formula:

[0076] ;

[0077] Calculate the weighted cross-entropy loss ;in, This represents a logarithmic function with the natural constant as its base. This represents the total number of training samples. This represents the summation function. Indicates the first The probability of occurrence for each training sample. Indicates the first The weights of each training sample. Indicates the first The true labels of the training samples (1 indicates that immune pneumonia occurred, and 0 indicates that it did not occur).

[0078] Based on weighted cross-entropy loss, the initial pre-evaluation model is fine-tuned using the Adam optimizer to generate the pre-evaluation model after initial tuning.

[0079] Using the same method as S3-3, the historical deep key features are processed through the pre-adjusted evaluation model to generate the first training evaluation result;

[0080] Then, according to the formula:

[0081] ;

[0082] ;

[0083] ;

[0084] ;

[0085] ;

[0086] Calculate composite loss ;in, , , , These represent the weighted loss weight, ranking loss weight, consistency loss weight, and clinical prior loss weight, respectively. , , , These represent weighted focusing loss, ranking loss, consistency loss, and clinical prior loss, respectively. Indicates the focus parameter, , They represent the first The first training evaluation results and true labels of each training sample. , These represent the first and second intermediate variables, respectively. Represents the maximum value function. , These represent the first training evaluation results for high-risk samples (true label is 1) and low-risk samples (true label is 0), respectively. Indicates the interval parameter. Indicates the number of HLA subtypes. Describing the L2 norm, This indicates that the calculation of the first term is performed using a radial basis function kernel (Gaussian kernel). The training sample and the first The similarity of the training samples They represent the first The first training evaluation result of each training sample Indicates the first One HLA subtype, , They represent the first Initial attention weights and ideal importance weights for each HLA subtype. Ideal importance weights can be preset based on the HLA subtype.

[0087] Then, based on the composite loss, the initial pre-evaluation model is adjusted using the Adam optimizer to generate the first pre-evaluation model. Since the parameter w used by the Adam algorithm to adjust the model is existing technology, it will not be elaborated upon further.

[0088] S3-5. Perform medical data augmentation, feature loss enhancement, and data fusion on key historical features to generate adversarial examples. Combine Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD) to adjust the weights of the first pre-evaluation model and generate a pre-evaluation model.

[0089] It should be noted that, according to the formula:

[0090] ;

[0091] Computational medical data augmentation features This helps improve the model's robustness to data noise and variation. Among these, It represents the key characteristics of the deep history. Indicates the activation indicator variable of the disturbance. This indicates that the mean is 0 and the variance is 0. Gaussian noise, Represents the identity matrix.

[0092] According to the formula:

[0093] ;

[0094] Calculate missing feature vectors .in, Represents the mask vector. This indicates element-wise multiplication.

[0095] Randomly swapping specific HLA feature combinations from different samples increases the diversity of training data and generates adversarial examples. The adversarial loss is calculated using the same method as for calculating the composite loss, and adversarial perturbations are generated using the Fast Gradient Sign Method (FGSM). The formula for counteracting disturbances:

[0096] ;

[0097] in, Represents a symbolic function. Indicates the strength of the resistance to the disturbance. Indicate adversarial examples The tag, Indicating resistance to loss, This represents the adversarial loss gradient.

[0098] Based on adversarial perturbation, the weights of the first pre-evaluation model are adjusted by projective gradient descent (PGD) to generate a pre-evaluation model.

[0099] In Projective Gradient Descent (PGD), adversarial perturbations are introduced as optimization variables. First, the adversarial perturbations are initialized. Then, in each iteration, the current perturbation is added to the original features, and the loss gradient is calculated. The perturbation is updated with a step size α based on the gradient sign and direction. A pruning operation projects the perturbation to an infinite norm constrained space, ultimately generating adversarial examples. These adversarial examples are then input into the model along with the original examples. The losses of both are calculated, and a weighted sum is obtained for backpropagation. This forces the model to maintain discriminative performance while resisting such directed adversarial perturbations. This process simulates sequencing errors and reasonable variances in clinical data, enabling the model to learn more robust feature representations, thereby improving its generalization ability and prediction reliability in the face of noise in real-world medical scenarios.

[0100] S4. Input the deep key features into the pre-assessment model to generate the assessment result. The assessment result is the probability of developing immune pneumonia.

[0101] In summary, this invention constructs a high-precision, highly generalizable, and clinically interpretable pre-assessment system for immune-mediated pneumonia by integrating multimodal features of six specific HLA subtypes, a deep feature extraction architecture combining CNN and temporal networks, and a hierarchical progressive training strategy. Its key features and corresponding advantages include: selection based on specific HLA subtypes improves the biological specificity and accuracy of predictions; the temporal modeling structure captures the interaction patterns between HLA genes and their association with immune pathways, enhancing the model's biological interpretability; and the multi-task loss function and adversarial training mechanism significantly improve the model's robustness to clinical data noise and small sample scenarios. This effectively solves key problems in existing technologies such as reliance on delayed clinical symptoms, insufficient generalization ability of predictive biomarkers, and model sensitivity to data quality. Furthermore, it can be horizontally extended to predict other immunotherapy-related side effects and vertically supports the optimization of personalized treatment plans, thereby achieving early warning, high reliability, and broad coverage of accurate risk assessment in real clinical scenarios.

[0102] like Figure 2 As shown, a machine learning algorithm-based pre-assessment system for immune-mediated pneumonia includes:

[0103] The data collection and analysis module is used to collect peripheral blood samples and use high-throughput sequencing technology to detect and analyze the peripheral blood samples to identify the individual's HLA subtype;

[0104] The feature construction module is used to build a deep time series model and combine bioinformatics analysis methods to perform feature analysis on individual HLA subtypes, generating deep key features associated with immune pneumonia;

[0105] The training module is used to build an initial pre-assessment model and train the initial pre-assessment model through a hierarchical progressive medical deep learning training algorithm to generate a pre-assessment model.

[0106] The evaluation module is used to input deep key features into the pre-evaluation model and generate evaluation results.

[0107] It should be noted that the specific methods by which each module performs operations in the system described in the above embodiments have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0108] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0109] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for pre-assessment of immune-mediated pneumonia based on machine learning algorithms, characterized in that, include: Peripheral blood samples were collected and analyzed using high-throughput sequencing technology to identify individual HLA subtypes; We constructed a deep time series model and combined it with bioinformatics analysis methods to perform feature analysis on individual HLA subtypes, generating deep key features associated with immune pneumonia. An initial pre-assessment model is constructed, and the initial pre-assessment model is trained using a hierarchical progressive medical deep learning training algorithm to generate a pre-assessment model. The deep key features are input into the pre-evaluation model to generate evaluation results.

2. The method for pre-assessment of immune pneumonia based on machine learning algorithm according to claim 1, characterized in that, The individual HLA subtypes include the sequence information corresponding to DRB1 09:01:02-HLA subtype, DQA1 01:02:01-HLA subtype, DPB1 02:02:02-HLA subtype, DPB1 05:01:01-HLA subtype, DPB3 04:02:01-HLA subtype, and DQA1 01:04:01-HLA subtype.

3. The method for pre-assessment of immune pneumonia based on machine learning algorithm according to claim 1, characterized in that, The deep temporal model includes a cascaded CNN network and a temporal network; the temporal network uses an RNN network, an LSTM network, or a Transformer network.

4. The method for pre-assessment of immune pneumonia based on machine learning algorithm according to claim 3, characterized in that, The key features for generating deep associations with immune-mediated pneumonia include: Bioinformatics analysis methods were used to process different individual HLA subtypes and extract corresponding initial feature vectors; Each initial feature vector is processed by a CNN network to generate the corresponding deep feature vector; Each deep feature vector is input into a temporal network to analyze the correlation between deep features and the immune response pathways involved in tumor immunotherapy, thereby generating deep key features associated with immune pneumonia.

5. The method for pre-evaluation of immune pneumonia based on machine learning algorithm according to claim 1, characterized in that, The initial pre-evaluation model includes an input layer, a feature encoding layer, a fusion layer, and an output layer; the fusion layer includes a multimodal fusion network with an attention mechanism; the output layer includes a cascaded fully connected layer and an activation function layer.

6. The method for pre-assessment of immune pneumonia based on machine learning algorithm according to claim 5, characterized in that, The hierarchical progressive medical deep learning training algorithm includes: An initial preliminary assessment model was constructed, and key historical features were collected and weights were set for clinical importance, time sensitivity, and data quality. The weights of each training sample in the historical deep key features are calculated based on clinical importance weight, time sensitivity weight, and data quality weight. Input the key historical features into the initial pre-evaluation model to generate training evaluation results; Based on the training evaluation results and the weights of each training sample, the weighted cross-entropy loss and composite loss are calculated. The initial pre-evaluation model is then adjusted using the Adam optimizer to generate the first pre-evaluation model. Medical data augmentation, feature loss enhancement, and data fusion are performed on key historical features to generate adversarial examples. The weights of the first pre-evaluation model are then adjusted using fast gradient sign method and projective gradient descent to generate a pre-evaluation model.

7. The method for pre-evaluation of immune pneumonia based on machine learning algorithm according to claim 6, characterized in that, The generation of the first preliminary evaluation model includes: Based on the training evaluation results and the weights of each training sample, the weighted cross-entropy loss is calculated. Based on weighted cross-entropy loss, the initial pre-evaluation model is fine-tuned using the Adam optimizer to generate the pre-evaluation model after initial tuning. The initial evaluation model is used to process key historical features and generate the first training evaluation result. Based on the first training evaluation results and the weights of each training sample, the composite loss is calculated; Based on the composite loss, the initial pre-evaluation model is adjusted using the Adam optimizer to generate the first pre-evaluation model.

8. The method for pre-assessment of immune pneumonia based on machine learning algorithm according to claim 5, characterized in that, The generation of the pre-evaluation model includes: Medical data augmentation is performed on key historical features to generate enhanced medical data features. Perform feature enhancement on augmented medical data to generate missing feature vectors; Randomly swap the missing feature vectors with the augmented features of the medical data, calculate the adversarial loss, and generate adversarial perturbations using the fast gradient sign method. Based on adversarial perturbation, the weights of the first pre-evaluation model are adjusted by descent using the projection gradient method to generate the pre-evaluation model.

9. A machine learning algorithm-based pre-assessment system for immune-mediated pneumonia, used to implement the machine learning algorithm-based pre-assessment method for immune-mediated pneumonia as described in any one of claims 1 to 8, characterized in that, include: The data collection and analysis module is used to collect peripheral blood samples and use high-throughput sequencing technology to detect and analyze the peripheral blood samples to identify the individual's HLA subtype; The feature construction module is used to build a deep time series model and combine bioinformatics analysis methods to perform feature analysis on individual HLA subtypes, generating deep key features associated with immune pneumonia; The training module is used to build an initial pre-assessment model and train the initial pre-assessment model through a hierarchical progressive medical deep learning training algorithm to generate a pre-assessment model. The evaluation module is used to input deep key features into the pre-evaluation model and generate evaluation results.