Genome prediction method and system based on small sample adaptive deep learning
By employing a small-sample adaptive deep learning method, deeply fusing heterogeneous omics data and utilizing Gaussian diffusion and a multi-head self-attention Transformer encoder, the problems of feature interference and model overfitting in heterogeneous omics data are solved, achieving high-precision, robust genome prediction and interpretable analysis.
Patent Information
- Application Number
- CN202511615644.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-06
AI Technical Summary
Existing technologies suffer from problems such as feature interference, model overfitting, and insufficient robustness when processing heterologous omics data, especially in scenarios with small sample sizes where effective genome prediction is difficult to achieve.
We employ a few-sample adaptive deep learning approach, using a feature enhancement module trained by Gaussian diffusion and a multi-head self-attention Transformer encoder to deeply fuse SNP genotype data and gene expression data for feature extraction, fusion, and regularization. This is then combined with a multi-task prediction module for genome prediction.
It achieves high-precision and robust gene phenotype classification under small sample conditions, enhances the interpretability of prediction results, provides clues for biological mechanism analysis, overcomes the overfitting problem, and ensures the generalization ability of the model.
Smart Images

Figure CN121483368A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics and artificial intelligence, and in particular to a genome prediction method and system based on small-sample adaptive deep learning. Background Technology
[0002] With the development of high-throughput sequencing technology, genome prediction is gradually evolving from methods relying on pedigree and phenotypic data to more accurate multi-omics data modeling. Deep learning, due to its excellent ability to handle high-dimensional nonlinear data, has been widely developed for genome prediction in recent years, but it still faces the following challenges: 1. The Challenge of Effective Fusion of Heterogeneous Omics Data: Existing models typically employ simple feature concatenation when processing SNP sequences and gene expression levels, two omics data with vastly different scales and distributions. This approach ignores the heterogeneity of the data, leading to mutual interference between features and failing to achieve deep information complementarity and collaborative modeling, thus becoming the primary obstacle to improving prediction accuracy.
[0003] 2. Risk of overfitting in small sample scenarios: The scarcity of biological samples creates a sharp contradiction with the demand for large amounts of data in deep learning. Training complex network models on limited data can easily lead to overfitting, meaning the model only memorizes the training data and lacks the ability to generalize to new samples, severely limiting the practical application of the model.
[0004] 3. Insufficient robustness and interpretability of the model: Traditional "black box" models are sensitive to noise in the input data and have poor prediction stability. At the same time, their decision-making process is not transparent and it is difficult to trace the key biomarkers that affect the prediction results, which limits their value in scientific research and clinical scenarios that require high reliability and mechanistic insights. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a genome prediction method and system based on small sample adaptive deep learning, which has the advantages of being able to deeply integrate heterogeneous omics data, maintaining strong generalization ability under small sample conditions, and having good robustness and interpretability.
[0006] To address the aforementioned technical problems, the first aspect of this invention discloses a genome prediction method based on small-sample adaptive deep learning, the method comprising: Obtain the gene data to be predicted belonging to the same biological individual, and preprocess the gene data to be predicted to obtain SNP genotype data and gene expression data; Feature extraction was performed on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features; The SNP gene features and the gene expression features are fused to obtain fused features; The fused features are regularized using a feature enhancement module trained by Gaussian diffusion to obtain enhanced features; The enhanced features are input into a multi-head self-attention Transformer encoder to obtain deep feature representations; The deep feature representation is input into the multi-task prediction module to obtain the genome prediction results.
[0007] As an optional implementation, in the first aspect of the present invention, the step of acquiring the gene data to be predicted belonging to the same biological individual, and preprocessing the gene data to be predicted to obtain SNP genotype data and gene expression data, includes: The data of the gene to be predicted is grouped based on the prefix to obtain the grouped data; The grouped data is transposed so that the grouped data is arranged with samples as rows and features as columns, thus obtaining transposed data; The transposed data were standardized to zero mean and unit variance using StandardScaler to obtain SNP genotype data and gene expression data.
[0008] As an optional implementation, in the first aspect of the present invention, the step of extracting features from the SNP genotype data and the gene expression data to obtain SNP gene features and gene expression features includes: The SNP genotype data and the gene expression data are processed using the AttentionBlock attention mechanism. The input feature dimension is mapped to a preset embedding dimension, and high-dimensional feature representations of the SNP genotype data and the gene expression data are extracted respectively to obtain SNP gene features and gene expression features.
[0009] As an optional implementation, in the first aspect of the present invention, the feature fusion of the SNP gene features and the gene expression features to obtain fused features includes: The SNP gene features and the gene expression features are spliced together to obtain spliced features with an embedding dimension of 2 times the preset dimension. The dimensions of the spliced features are compressed back to the preset embedding dimension using a linear transformation layer to obtain compressed dimension features; The compressed dimensional features are nonlinearly transformed using the ReLU activation function to obtain fused features.
[0010] As an optional implementation, in the first aspect of the invention, the step of inputting the enhanced features into a multi-head self-attention Transformer encoder to obtain a deep feature representation includes: The attention weight of each feature vector in the augmented feature is calculated relative to other feature vectors in the augmented feature through a multi-head self-attention mechanism; Based on the attention weights, the information of all feature vectors is weighted and fused to generate a refined feature representation containing global context information for each feature vector. The refined feature representation is then subjected to a nonlinear transformation via a feedforward neural network to obtain a deep feature representation.
[0011] As an optional implementation, in the first aspect of the present invention, a preset embedding dimension is used as the model dimension of the multi-head self-attention Transformer encoder, and the number of attention heads in the multi-head self-attention mechanism is 4.
[0012] As an optional implementation, in the first aspect of the present invention, the step of inputting the deep feature representation into a multi-task prediction module to obtain genome prediction results includes: The deep feature representation is input into the multi-task prediction module, and the classification head in the multi-task prediction module outputs the gene phenotype classification result based on the deep feature representation. The gene phenotype classification result is used as the genome prediction result. The multi-task prediction module further includes a clustering head and a reconstruction head. The clustering head is used to output clustering features based on the deep feature representation; the reconstruction head is used to output reconstructed gene expression data based on the deep feature representation.
[0013] A second aspect of this invention discloses a genome prediction system based on small-sample adaptive deep learning, the system comprising: The acquisition module is used to acquire gene data to be predicted belonging to the same biological individual, and to preprocess the gene data to be predicted to obtain SNP genotype data and gene expression data. An extraction module performs feature extraction on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features; A fusion module performs feature fusion on the SNP gene features and the gene expression features to obtain fused features; A feature enhancement module is used to perform regularization processing on the fused features through a feature enhancement module trained by Gaussian diffusion to obtain enhanced features; An encoding module is used to input the enhanced features into a multi-head self-attention Transformer encoder to obtain deep feature representations; The prediction module inputs the deep feature representation into the multi-task prediction module to obtain the genome prediction result.
[0014] As an optional implementation, in a second aspect of the present invention, the acquisition module acquires gene data to be predicted belonging to the same biological individual, and preprocesses the gene data to be predicted to obtain SNP genotype data and gene expression data, including: The data of the gene to be predicted is grouped based on the prefix to obtain the grouped data; The grouped data is transposed so that the grouped data is arranged with samples as rows and features as columns, thus obtaining transposed data; The transposed data were standardized to zero mean and unit variance using StandardScaler to obtain SNP genotype data and gene expression data.
[0015] As an optional implementation, in a second aspect of the present invention, the extraction module performs feature extraction on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features, including: The SNP genotype data and the gene expression data are processed using the AttentionBlock attention mechanism. The input feature dimension is mapped to a preset embedding dimension, and high-dimensional feature representations of the SNP genotype data and the gene expression data are extracted respectively to obtain SNP gene features and gene expression features.
[0016] As an optional implementation, in a second aspect of the present invention, the fusion module performs feature fusion on the SNP gene features and the gene expression features to obtain fused features, including: The SNP gene features and the gene expression features are spliced together to obtain spliced features with an embedding dimension of 2 times the preset dimension. The dimensions of the spliced features are compressed back to the preset embedding dimension using a linear transformation layer to obtain compressed dimension features; The compressed dimensional features are nonlinearly transformed using the ReLU activation function to obtain fused features.
[0017] As an optional implementation, in a second aspect of the invention, the encoding module inputs the enhanced features into a multi-head self-attention Transformer encoder to obtain a deep feature representation, including: The attention weight of each feature vector in the augmented feature is calculated relative to other feature vectors in the augmented feature through a multi-head self-attention mechanism; Based on the attention weights, the information of all feature vectors is weighted and fused to generate a refined feature representation containing global context information for each feature vector. The refined feature representation is then subjected to a nonlinear transformation via a feedforward neural network to obtain a deep feature representation.
[0018] As an optional implementation, in a second aspect of the present invention, a preset embedding dimension is used as the model dimension of the multi-head self-attention Transformer encoder, and the number of attention heads in the multi-head self-attention mechanism is 4.
[0019] As an optional implementation, in a second aspect of the invention, the prediction module inputs the deep feature representation into a multi-task prediction module to obtain genome prediction results, including: The deep feature representation is input into the multi-task prediction module, and the classification head in the multi-task prediction module outputs the gene phenotype classification result based on the deep feature representation. The gene phenotype classification result is used as the genome prediction result. The multi-task prediction module further includes a clustering head and a reconstruction head. The clustering head is used to output clustering features based on the deep feature representation; the reconstruction head is used to output reconstructed gene expression data based on the deep feature representation.
[0020] A third aspect of this invention discloses a genome prediction device based on small-sample adaptive deep learning, the device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute some or all of the steps in the genome prediction method based on small-sample adaptive deep learning disclosed in the first aspect of the present invention.
[0021] A fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the genome prediction method based on small-sample adaptive deep learning disclosed in the first aspect of the present invention.
[0022] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: By deeply fusing heterogeneous omics data and applying diffusion-enhanced regularization, this approach enables more accurate and robust gene phenotype classification predictions for novel biological samples. It effectively overcomes the overfitting problem in small-sample scenarios and ensures the model's generalization ability when applied across datasets. Furthermore, the multi-dimensional outputs provided by this scheme, such as clustering features and data reconstruction, not only enhance the interpretability of the prediction results but also offer valuable clues for in-depth analysis of biological mechanisms, achieving a leap from simple prediction to interpretable analysis. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a genome prediction method based on small-sample adaptive deep learning disclosed in an embodiment of the present invention. Figure 2 This is a schematic diagram of a genome prediction system based on small-sample adaptive deep learning disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a genome prediction device based on small-sample adaptive deep learning disclosed in an embodiment of the present invention; Figure 4 is a ROC curve plotted based on experimental results from different biological genome datasets in an embodiment of the present invention; Detailed Implementation To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] This invention discloses a genome prediction method and system based on small-sample adaptive deep learning. Through deep fusion and diffusion-enhanced regularization of heterogeneous omics data, it can achieve higher accuracy and stronger robustness in gene phenotypic classification prediction for new biological samples, effectively overcoming the overfitting problem in small-sample scenarios and ensuring the model's generalization ability when applied across datasets. Simultaneously, the multi-dimensional outputs provided by this scheme, such as clustering features and data reconstruction, not only enhance the interpretability of the prediction results but also provide valuable clues for in-depth biological mechanism analysis, achieving a leap from simple prediction to interpretable analysis. These will be described in detail below.
[0028] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a genome prediction method based on small-sample adaptive deep learning disclosed in an embodiment of the present invention. Wherein, Figure 1 The described method is applied to a genome prediction device based on small-sample adaptive deep learning. This prediction device can be a prediction terminal, prediction equipment, or server, and the server can be a local server or a cloud server; this embodiment of the invention does not impose any limitations. Figure 1 As shown, this genome prediction method based on few-sample adaptive deep learning can include the following operations: 101. Obtain the gene data to be predicted belonging to the same biological individual, and preprocess the gene data to be predicted to obtain SNP genotype data and gene expression data.
[0029] 102. Perform feature extraction on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features.
[0030] 103. Perform feature fusion on the SNP gene features and the gene expression features to obtain fused features.
[0031] 104. The fused features are regularized using a feature enhancement module trained by Gaussian diffusion to obtain enhanced features.
[0032] In this embodiment of the invention, the fused features are input into a feature enhancement module trained by Gaussian diffusion. During the training phase, the module learns noise prediction through a forward diffusion process. During the prediction phase, it acts as a powerful regularizer to enhance the input features and output a more robust 64-dimensional enhanced feature.
[0033] 105. Input the enhanced features into a multi-head self-attention Transformer encoder to obtain deep feature representations.
[0034] 106. Input the deep feature representation into the multi-task prediction module to obtain the genome prediction results.
[0035] As can be seen, implementing this optional approach, through deep fusion of heterogeneous omics data and diffusion-enhanced regularization, enables more accurate and robust gene phenotype classification predictions for new biological samples. This effectively overcomes the overfitting problem in small-sample scenarios and ensures the model's generalization ability when applied across datasets. Furthermore, the multi-dimensional outputs provided by this approach, such as clustering features and data reconstruction, not only enhance the interpretability of the prediction results but also offer valuable clues for in-depth biological mechanism analysis, achieving a leap from simple prediction to interpretable analysis.
[0036] In an optional implementation, step 101, which involves acquiring gene data to be predicted belonging to the same biological individual and preprocessing the gene data to obtain SNP genotype data and gene expression data, includes: The data of the gene to be predicted is grouped based on the prefix to obtain the grouped data; The grouped data is transposed so that the grouped data is arranged with samples as rows and features as columns, thus obtaining transposed data; The transposed data were standardized to zero mean and unit variance using StandardScaler to obtain SNP genotype data and gene expression data.
[0037] In an optional implementation, step 102, which involves extracting features from the SNP genotype data and the gene expression data to obtain SNP gene features and gene expression features, includes: The SNP genotype data and the gene expression data are processed using the AttentionBlock attention mechanism. The input feature dimension is mapped to a preset embedding dimension, and high-dimensional feature representations of the SNP genotype data and the gene expression data are extracted respectively to obtain SNP gene features and gene expression features.
[0038] In this embodiment of the invention, the 64-dimensional embedding feature representations of SNP data and gene expression data are extracted respectively through the AttentionBlock attention mechanism. Each AttentionBlock contains a linear layer and a ReLU activation function.
[0039] In an optional implementation, step 103, which involves fusing the SNP gene features and the gene expression features to obtain fused features, includes: The SNP gene features and the gene expression features are spliced together to obtain spliced features with an embedding dimension of 2 times the preset dimension. The dimensions of the spliced features are compressed back to the preset embedding dimension using a linear transformation layer to obtain compressed dimension features; The compressed dimensional features are nonlinearly transformed using the ReLU activation function to obtain fused features.
[0040] In this embodiment of the invention, 64-dimensional SNP gene features and 64-dimensional gene expression features are concatenated into a 128-dimensional vector, and then the dimensionality is reduced to 64-dimensional features through a linear transformation layer. The ReLU activation function is then used to perform a nonlinear transformation on the compressed features to obtain fused features.
[0041] In an optional implementation, step 105, inputting the enhanced features into a multi-head self-attention Transformer encoder to obtain a deep feature representation, includes: The attention weight of each feature vector in the augmented feature is calculated relative to other feature vectors in the augmented feature through a multi-head self-attention mechanism; Based on the attention weights, the information of all feature vectors is weighted and fused to generate a refined feature representation containing global context information for each feature vector. The refined feature representation is then subjected to a nonlinear transformation via a feedforward neural network to obtain a deep feature representation.
[0042] In this embodiment of the invention, the core formula of the multi-head self-attention Transformer encoder includes a self-attention mechanism, multi-head attention, a feedforward neural network, residual connections, and layer normalization. The encoder layer is constructed using TransformerEncoderLayer, with a 64-dimensional embedding dimension as the model dimension. Residual connections and layer normalization operations are introduced in each sub-layer. The number of heads (nhead) in the multi-head attention mechanism is set to 4, the number of layers (num_layers) is set to 1, and the dropout probability is set to 0.1 to prevent overfitting. These parameters can also be optimized and adjusted according to specific task requirements.
[0043] In an optional implementation, step 106, inputting the deep feature representation into the multi-task prediction module to obtain the genome prediction result, includes: The deep feature representation is input into the multi-task prediction module, and the classification head in the multi-task prediction module outputs the gene phenotype classification result based on the deep feature representation. The gene phenotype classification result is used as the genome prediction result. The multi-task prediction module further includes a clustering head and a reconstruction head. The clustering head is used to output clustering features based on the deep feature representation; the reconstruction head is used to output reconstructed gene expression data based on the deep feature representation.
[0044] In this embodiment of the invention, the deep feature representation is simultaneously input into the three output heads of the multi-task prediction module: The classification head maps 64-dimensional features to the class probability space through a fully connected layer and a softmax function, and outputs the gene phenotype classification result as the final genome prediction result; Clustering head: Maps 64-dimensional features to a 32-dimensional clustering feature space; Reconstruction Head: Maps the 64-dimensional features back to the dimensions of the original gene expression data and outputs the reconstructed gene expression data.
[0045] Example 2 This embodiment is the training method of Embodiment 1, which may include the following steps: Step S1: Obtain training gene data from a public dataset and preprocess the training gene data to obtain training SNP genotype data and training gene expression data.
[0046] In this embodiment of the invention, actual SNP genotype data and gene expression level data from animal experiments were obtained from publicly available datasets. This included using a mouse dataset to evaluate three major phenotypes: Anx (anx-related behavioral phenotype measure), EMO (emotion-related behavioral phenotype measure), and Biochem (biochemical glucose level measure); and using a pig dataset to evaluate two growth traits (age and body fat) and three body shape traits (length, height, and girth). After inputting the data file, the original data matrix was separated into two independent omics datasets. Gene phenotype classification labels were constructed. Since the two omics datasets have different numerical ranges and distribution characteristics, independent standardization strategies were adopted. In this embodiment, StandardScaler was used to perform zero-mean, unit variance standardization on both omics datasets. Missing values and outliers were detected and processed before feature selection.
[0047] Step S2: Extract features from the training SNP genotype data and the training gene expression data respectively to obtain the training SNP gene features and the training gene expression features.
[0048] In this embodiment of the invention, two independent AttentionBlock modules are constructed to process the SNP data and gene expression data used for training, respectively. Each AttentionBlock module contains a linear transformation layer and a ReLU activation function. The linear transformation layer maps the input feature dimension to a preset embedding dimension, which is 64 dimensions by default. The ReLU nonlinear activation function extracts a high-dimensional representation of the omics features, preserving their respective biological significance and data characteristics. The embedding dimension (embed_dim) of the AttentionBlock module is adjustable, with a default value of 64, and the clustering dimension (cluster_dim) has a default value of 32. These can be flexibly adjusted according to data complexity and computational resources.
[0049] Step S3: Perform feature fusion on the SNP gene features and gene expression features used for training to obtain the fused features used for training.
[0050] In this embodiment of the invention, 64-dimensional training SNP gene features and 64-dimensional training gene expression features are concatenated into a 128-dimensional vector, and then the dimensionality is reduced to 64-dimensional training fusion features through a linear transformation layer.
[0051] Step S4: Introduce the GaussianDiffusion module to regularize the fused features used for training. Gaussian noise is added through the forward diffusion process, and the noise prediction network is trained to learn the denoising process, thereby enhancing the robustness of the feature representation.
[0052] In this embodiment of the invention, the Gaussian diffusion mechanism augments data by adding and predicting noise, forcing the model to learn more robust feature representations. During the forward diffusion process, the original data... Gaussian noise is gradually added at multiple time steps t = 1, 2, ..., T to generate a sequence. Until it becomes approximately pure noise ,in It is the cumulative retention coefficient related to the time step. It uses standard Gaussian noise. The diffusion step count T in the GaussianDiffusion module is adjustable, with a default value of 10. Adjusting the T value controls the complexity of the diffusion process and the regularization strength of the model. During the inverse denoising process, a neural network is trained. To predict the noise added in each step And based on this, the original data was reconstructed step by step. The training objective is to minimize the MSE loss between the predicted noise and the actual noise. .
[0053] Step S5: Input the diffused training fusion features into the multi-head self-attention Transformer encoder to obtain the deep feature representation for training.
[0054] In this embodiment of the invention, after obtaining the fused features for training through diffusion processing, a Transformer encoder based on a multi-head self-attention mechanism is used for deep feature learning and global context modeling. The Transformer encoder uses a TransformerEncoderLayer to construct the encoder layer, with the following core configuration: the embedding dimension output by the feature fusion module (default 64) is used as the model dimension; a 1-layer encoder (num_layers=1) and 4 attention heads (nhead=4) are used; and a Dropout probability of 0.1 is applied during training to prevent overfitting. This encoder first captures the long-range dependencies within the input feature sequence through a multi-head self-attention mechanism, achieving effective aggregation of global context information. Subsequently, a feedforward neural network is used to perform nonlinear transformations and dimension mapping on the vectors at each position to further enhance the model's representational ability. Throughout the forward propagation process, residual connections and layer normalization techniques are employed within the encoder, significantly improving training stability and convergence efficiency. Finally, this module outputs a deep, refined feature representation rich in global semantic information, providing a high-quality feature foundation for downstream multi-task prediction.
[0055] The multi-head self-attention Transformer model is a powerful sequence modeling tool based on the self-attention mechanism. Its core formula includes self-attention, multi-head attention, a feedforward neural network, residual connections, and layer normalization. The self-attention mechanism captures global dependencies by calculating the correlation between each element in the input sequence and other elements. The self-attention mechanism calculates attention weights and output through the following steps: 1. Calculate Query, Key, and Value: The input sequence X is transformed linearly to generate Query(Q), Key(K), and Value(V):
[0056] in It is a learnable weight matrix.
[0057] 2. Calculate attention score: The relevance between the query and the key is calculated using the dot product, and then normalized by scaling and softmax.
[0058] in It is the dimension of the key. It is a scaling factor used to prevent the dot product result from becoming too large.
[0059] Multi-head attention splits the input into multiple heads, calculates the attention for each head separately, and then concatenates the results.
[0060] in, , It is the output linear transformation matrix.
[0061] The feedforward neural network performs a nonlinear transformation on the output of the self-attention mechanism:
[0062] Residual connections and layer normalization are added after each sublayer (self-attention and feedforward network):
[0063] In this embodiment, the Transformer encoder maps the original input sequence into linear embeddings and incorporates positional encoding to introduce positional information of each element in the sequence. These positionally encoded embedding vectors are then fed into an encoder structure composed of multiple stacked layers. Each encoder layer mainly includes a multi-head self-attention mechanism and a feedforward neural network. First, the multi-head self-attention mechanism captures global dependencies between different positions in the input sequence by constructing similarities between queries, keys, and values. Then, the feedforward neural network performs nonlinear transformations on the vectors at each position to enhance feature representation. In each sub-layer, the Transformer introduces residual connections and layer normalization operations to alleviate the vanishing gradient problem and accelerate model convergence. After multiple stacks, the final output sequence representation can fully integrate the contextual information of the input data, providing a high-quality feature foundation for subsequent classification, regression, or decoding tasks.
[0064] Step S6: Construct a multi-task learning framework that simultaneously outputs clustering features, classification results, and reconstructed gene expression data to achieve end-to-end joint optimization. Use a weighted combination of classification loss, reconstruction loss, clustering loss, and diffusion loss functions to perform multi-task collaborative training of the model for classification prediction, omics reconstruction, feature clustering, and diffusion perturbation, enhancing generalization ability. Finally, update the parameters using the Adam optimizer.
[0065] In this embodiment of the invention, the multi-task learning framework specifically includes: Clustering Head: Maps the Transformer encoder output to the clustering feature space, with a default dimension of 32; Classification Header: Maps the Transformer encoder output to the classification probability space, with a total of 2 output categories; Reconstruction Head: Maps the Transformer encoder output back to the original gene expression data dimension, thus reconstructing the data.
[0066] Diffusion enhancement module: performs noise modeling and denoising learning on the fused features, while maintaining the feature dimension at 64.
[0067] The total loss function is a weighted sum of classification loss, reconstruction loss, clustering loss, and diffusion loss.
[0068] The overall network structure loss function includes the classification loss, which uses the classification output and the true labels to train the final classifier, and is expressed by the cross-entropy loss function. Where N is the number of samples in the batch and C is the number of categories. Let i be the true one-hot label of the i-th sample. The softmax probability predicted by the model is denoted as . The goal of reconstruction loss is to enable the model to reconstruct the input representation data, improving its understanding and memorization of the representation data, and is represented by mean squared error. ,in For the i-th expression data obtained from model reconstruction, The input is the original expression group; the clustering alignment loss maps the Transformer output z to oc, calculates the MSE with the one-hot labels, similar to making the clustering result as close as possible to the true class distribution. This loss is also expressed as mean squared error. ,in This is the output of the model cluster head (i.e., oc). One-hot encoding of the true label; diffusion loss is the process by which the diffusion model learns how to infer the original noise from the noisy representation, and the loss function is... The noise addition process is as follows Gaussian noise follows a normal distribution. The noise predicted by the model is .
[0069] In the total loss function, the classification loss uses the cross-entropy loss function to calculate the difference between the classification prediction and the true label; the reconstruction loss uses the mean squared error loss function to calculate the difference between the reconstructed data and the original gene expression data, with a weight of 0.2; the clustering loss uses the mean squared error loss function to calculate the difference between the clustering features and the one-hot encoded labels, with a weight of 0.1; and the diffusion loss measures the model's ability to recover the original noise from the diffused state, with a weight of 0.1. The expression for the total network structure loss function is:
[0070] During training, the Adam optimizer is used to optimize parameters, and the model is visualized by plotting AUC curves, which intuitively shows the training process and performance of the model.
[0071] Step S7: During training, K-fold cross-validation is used to evaluate the model's performance, calculate ACC, F1-score, and AUC, and plot the ROC curve.
[0072] In this embodiment of the invention, a K-fold cross-validation strategy is adopted during training, with a default setting of 5-fold cross-validation. Different random seeds are used for each fold of training to increase the stability and reliability of model evaluation.
[0073] Cross-validation evaluation specifically includes the following steps: The dataset is randomly divided into 5 subsets of similar size, with one fold serving as the test set and the other four folds serving as the training set.
[0074] In each epoch, the model is trained using the training set, and the model's accuracy, F1 score, and AUC value are evaluated on the test set after each training epoch. Calculate the average AUC, average ACC, and average F1 score of all analyses as the final performance metrics of the model.
[0075] The AUC measures a model's classification ability in multi-class problems, calculated as the area under the ROC curve of the model's predicted values. The ROC curve is a tool used to evaluate the performance of classification models. It illustrates the model's performance at different thresholds by plotting the relationship between the True Positive Rate (TPR) and the False Positive Rate (FPR). The closer the AUC value is to 1, the better the model's performance. (Refer to...) Figure 4a and Figure 4b As shown, in the pig dataset, the AUC values of the embodiments of the present invention trained at different stages are close to 1.
[0076] Step S8: Output the original logits values through the classification head, and then convert the logits into a class probability distribution through the Softmax function to achieve probabilistic prediction of biological phenotypes.
[0077] To verify the superiority of the genome prediction model based on few-sample adaptive deep learning disclosed in this embodiment of the invention over traditional machine learning, we adopted traditional machine learning methods such as multilayer perceptron neural network, XGBOOST gradient boosting, random forest, support vector machine, and logistic regression in this embodiment. The experimental results are shown in the table below.
[0078] Table 1 Comparison of results from different machine learning methods
[0079] Referring to Table 1, the AUC values of the method of this invention are higher than those of traditional machine learning methods on different datasets. In terms of feature extraction capability, this invention can automatically extract complex nonlinear feature relationships in multi-omics data through AttentionBlock and GaussianDiffusion. The diffusion module learns the latent distribution features of the data through noise prediction tasks, while AttentionBlock achieves effective feature mapping and alignment of SNP and gene expression data. This deep feature extraction capability far exceeds the manually designed features and simple linear transformations relied upon by traditional methods. In terms of global dependency modeling, this invention uses the Transformer module to model the global dependencies of the fused multi-omics features, effectively capturing the long-distance dependencies and complex interaction patterns between SNP variants and gene expression. In contrast, traditional methods such as SVM (AUC range 0.634-0.650) and logistic regression (AUC range 0.650-0.677) can only handle local features and cannot model the global correlations between omics data. In terms of generalization ability, K-fold cross-validation results show that the method of this invention exhibits strong and stable performance on multiple datasets, with AUC values remaining in a high range of 0.852-0.931. In particular, the excellent performance of 0.931 on the pig dataset demonstrates the method's cross-species generalization ability. In contrast, traditional methods show greater performance fluctuations across different datasets; for example, the AUC on RandomForest varies between 0.602 and 0.885, indicating that traditional methods are prone to overfitting or underfitting.
[0080] In the processing of high-dimensional, small-sample biomedical data, the method of this invention can effectively address the problems of dimensionality curse and sample scarcity through the regularization effect of the diffusion mechanism and the attention mechanism of Transformer.
[0081] Experimental results show that on all test datasets, the AUC performance of this method is significantly better than that of traditional machine learning methods, with an average improvement of more than 30%, which fully verifies the technical advantages of deep learning architecture in processing complex biological data.
[0082] Example 3 Please see Figure 2 , Figure 2 This is a schematic diagram of a genome prediction system based on small-sample adaptive deep learning disclosed in an embodiment of the present invention. Figure 2 The described system can be applied to corresponding prediction terminals, prediction devices, or servers, and the server can be a local server or a cloud server; this embodiment of the invention does not impose any limitations. Figure 2 As shown, the system may include: The acquisition module 201 is used to acquire the gene data to be predicted belonging to the same biological individual, and to preprocess the gene data to be predicted to obtain SNP genotype data and gene expression data. Extraction module 202 performs feature extraction on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features; Fusion module 203 performs feature fusion on the SNP gene features and the gene expression features to obtain fused features; Feature enhancement module 204 is used to perform regularization processing on the fused features through a feature enhancement module 204 trained by Gaussian diffusion to obtain enhanced features; In this embodiment of the invention, the fused features are input into the feature enhancement module 204 trained by Gaussian diffusion. During the training phase, the module learns noise prediction through a forward diffusion process. During the prediction phase, it acts as a powerful regularizer to enhance the input features and output a more robust 64-dimensional enhanced feature.
[0083] Encoding module 205, the encoding module 205 is used to input the enhanced features into a multi-head self-attention Transformer encoder to obtain deep feature representation; The prediction module 206 inputs the deep feature representation into the multi-task prediction module 206 to obtain the genome prediction result.
[0084] In an optional implementation, the acquisition module 201 acquires gene data to be predicted belonging to the same biological individual, and preprocesses the gene data to obtain SNP genotype data and gene expression data, including: The data of the gene to be predicted is grouped based on the prefix to obtain the grouped data; The grouped data is transposed so that the grouped data is arranged with samples as rows and features as columns, thus obtaining transposed data; The transposed data were standardized to zero mean and unit variance using StandardScaler to obtain SNP genotype data and gene expression data.
[0085] In an optional implementation, the extraction module 202 performs feature extraction on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features, including: The SNP genotype data and the gene expression data are processed using the AttentionBlock attention mechanism. The input feature dimension is mapped to a preset embedding dimension, and high-dimensional feature representations of the SNP genotype data and the gene expression data are extracted respectively to obtain SNP gene features and gene expression features.
[0086] In this embodiment of the invention, the 64-dimensional embedding feature representations of SNP data and gene expression data are extracted respectively through the AttentionBlock attention mechanism. Each AttentionBlock contains a linear layer and a ReLU activation function.
[0087] In an optional implementation, the fusion module 203 performs feature fusion on the SNP gene features and the gene expression features to obtain fused features, including: The SNP gene features and the gene expression features are spliced together to obtain spliced features with an embedding dimension of 2 times the preset dimension. The dimensions of the spliced features are compressed back to the preset embedding dimension using a linear transformation layer to obtain compressed dimension features; The compressed dimensional features are nonlinearly transformed using the ReLU activation function to obtain fused features.
[0088] In this embodiment of the invention, 64-dimensional SNP gene features and 64-dimensional gene expression features are concatenated into a 128-dimensional vector, and then the dimensionality is reduced to 64-dimensional features through a linear transformation layer. The ReLU activation function is then used to perform a nonlinear transformation on the compressed features to obtain fused features.
[0089] In an optional implementation, the encoding module 205 inputs the enhanced features into a multi-head self-attention Transformer encoder to obtain a deep feature representation, including: The attention weight of each feature vector in the augmented feature is calculated relative to other feature vectors in the augmented feature through a multi-head self-attention mechanism; Based on the attention weights, the information of all feature vectors is weighted and fused to generate a refined feature representation containing global context information for each feature vector. The refined feature representation is then subjected to a nonlinear transformation via a feedforward neural network to obtain a deep feature representation.
[0090] In this embodiment of the invention, the core formula of the multi-head self-attention Transformer encoder includes a self-attention mechanism, multi-head attention, a feedforward neural network, residual connections, and layer normalization. The encoder layer is constructed using TransformerEncoderLayer, with a 64-dimensional embedding dimension as the model dimension. Residual connections and layer normalization operations are introduced in each sub-layer. The number of heads (nhead) in the multi-head attention mechanism is set to 4, the number of layers (num_layers) is set to 1, and the dropout probability is set to 0.1 to prevent overfitting. These parameters can also be optimized and adjusted according to specific task requirements.
[0091] In an optional implementation, the prediction module 206 inputs the deep feature representation into the multi-task prediction module to obtain genome prediction results, including: The deep feature representation is input into the multi-task prediction module, and the classification head in the multi-task prediction module outputs the gene phenotype classification result based on the deep feature representation. The gene phenotype classification result is used as the genome prediction result. The multi-task prediction module further includes a clustering head and a reconstruction head. The clustering head is used to output clustering features based on the deep feature representation; the reconstruction head is used to output reconstructed gene expression data based on the deep feature representation.
[0092] In this embodiment of the invention, the deep feature representation is simultaneously input into the three output heads of the multi-task prediction module: The classification head maps 64-dimensional features to the class probability space through a fully connected layer and a softmax function, and outputs the gene phenotype classification result as the final genome prediction result; Clustering head: Maps 64-dimensional features to a 32-dimensional clustering feature space; Reconstruction Head: Maps the 64-dimensional features back to the dimensions of the original gene expression data and outputs the reconstructed gene expression data.
[0093] As can be seen, implementing this optional approach, through deep fusion of heterogeneous omics data and diffusion-enhanced regularization, enables more accurate and robust gene phenotype classification predictions for new biological samples. This effectively overcomes the overfitting problem in small-sample scenarios and ensures the model's generalization ability when applied across datasets. Furthermore, the multi-dimensional outputs provided by this approach, such as clustering features and data reconstruction, not only enhance the interpretability of the prediction results but also offer valuable clues for in-depth biological mechanism analysis, achieving a leap from simple prediction to interpretable analysis.
[0094] Example 4 Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a genome prediction device based on small-sample adaptive deep learning disclosed in an embodiment of the present invention. Figure 3 As shown, the device may include: Memory 301 storing executable program code; Processor 302 coupled to memory 301; The processor 302 calls the executable program code stored in the memory 301 to execute some or all of the steps in the genome prediction method based on small sample adaptive deep learning disclosed in Embodiment 1 of the present invention.
[0095] Example 5 This invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the genome prediction method based on small-sample adaptive deep learning disclosed in Embodiment 1 of this invention.
[0096] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0097] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0098] Finally, it should be noted that the genome prediction method and system based on small-sample adaptive deep learning disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A genome prediction method based on small-sample adaptive deep learning, characterized in that, The method includes: Obtain the gene data to be predicted belonging to the same biological individual, and preprocess the gene data to be predicted to obtain SNP genotype data and gene expression data; Feature extraction was performed on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features; The SNP gene features and the gene expression features are fused to obtain fused features; The fused features are regularized using a feature enhancement module trained by Gaussian diffusion to obtain enhanced features; The enhanced features are input into a multi-head self-attention Transformer encoder to obtain deep feature representations; The deep feature representation is input into the multi-task prediction module to obtain the genome prediction results.
2. The genome prediction method based on small-sample adaptive deep learning according to claim 1, characterized in that, The process of acquiring gene data to be predicted belonging to the same biological individual and preprocessing the gene data to obtain SNP genotype data and gene expression data includes: The data of the gene to be predicted is grouped based on the prefix to obtain the grouped data; The grouped data is transposed so that the grouped data is arranged with samples as rows and features as columns, thus obtaining transposed data; The transposed data were standardized to zero mean and unit variance using StandardScaler to obtain SNP genotype data and gene expression data.
3. The genome prediction method based on small-sample adaptive deep learning according to claim 1, characterized in that, The step of extracting features from the SNP genotype data and the gene expression data to obtain SNP gene features and gene expression features includes: The SNP genotype data and the gene expression data are processed using the AttentionBlock attention mechanism. The input feature dimension is mapped to a preset embedding dimension, and high-dimensional feature representations of the SNP genotype data and the gene expression data are extracted respectively to obtain SNP gene features and gene expression features.
4. The genome prediction method based on small-sample adaptive deep learning according to claim 1, characterized in that, The feature fusion of the SNP gene features and the gene expression features to obtain fused features includes: The SNP gene features and the gene expression features are spliced together to obtain spliced features with an embedding dimension of 2 times the preset dimension. The dimensions of the spliced features are compressed back to the preset embedding dimension using a linear transformation layer to obtain compressed dimension features; The compressed dimensional features are nonlinearly transformed using the ReLU activation function to obtain fused features.
5. The genome prediction method based on small-sample adaptive deep learning according to claim 1, characterized in that, The step of inputting the enhanced features into a multi-head self-attention Transformer encoder to obtain deep feature representations includes: The attention weight of each feature vector in the augmented feature is calculated relative to other feature vectors in the augmented feature through a multi-head self-attention mechanism; Based on the attention weights, the information of all feature vectors is weighted and fused to generate a refined feature representation containing global context information for each feature vector. The refined feature representation is then subjected to a nonlinear transformation via a feedforward neural network to obtain a deep feature representation.
6. The genome prediction method based on small-sample adaptive deep learning according to claim 5, characterized in that, The preset embedding dimension is used as the model dimension of the multi-head self-attention Transformer encoder, and the number of attention heads in the multi-head self-attention mechanism is 4.
7. The genome prediction method based on small-sample adaptive deep learning according to claim 1, characterized in that, The step of inputting the deep feature representation into the multi-task prediction module to obtain the genome prediction result includes: The deep feature representation is input into the multi-task prediction module, and the classification head in the multi-task prediction module outputs the gene phenotype classification result based on the deep feature representation. The gene phenotype classification result is used as the genome prediction result. The multi-task prediction module further includes a clustering head and a reconstruction head. The clustering head is used to output clustering features based on the deep feature representation; the reconstruction head is used to output reconstructed gene expression data based on the deep feature representation.
8. A genome prediction system based on small-sample adaptive deep learning, characterized in that, The system includes: The acquisition module is used to acquire gene data to be predicted belonging to the same biological individual, and to preprocess the gene data to be predicted to obtain SNP genotype data and gene expression data. An extraction module performs feature extraction on the SNP genotype data and the gene expression data respectively to obtain SNP gene features and gene expression features; A fusion module performs feature fusion on the SNP gene features and the gene expression features to obtain fused features; A feature enhancement module is used to perform regularization processing on the fused features through a feature enhancement module trained by Gaussian diffusion to obtain enhanced features; An encoding module is used to input the enhanced features into a multi-head self-attention Transformer encoder to obtain deep feature representations; The prediction module inputs the deep feature representation into the multi-task prediction module to obtain the genome prediction result.
9. A genome prediction device based on small-sample adaptive deep learning, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the genome prediction method based on small-sample adaptive deep learning as described in any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the genome prediction method based on small-sample adaptive deep learning as described in any one of claims 1-7.