A method for predicting trait genetic variation sites that integrates transfer learning and explainable mechanisms

By integrating transfer learning with interpretability mechanisms, this study addresses the issues of insufficient model generalization ability and poor interpretability in SNP prediction, achieving high efficiency, accuracy, and biological interpretability in cross-species prediction, and improving the accuracy and interpretability of SNP site identification.

CN120895090BActive Publication Date: 2025-12-02ANHUI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511441071.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2025-12-02
Estimated Expiration
2045-10-10

AI Technical Summary

Technical Problem

In existing technologies, SNP prediction methods lack effective model generalization ability and model interpretability in cross-species prediction, making it difficult to accurately capture the functional dependence between candidate SNP sites and their neighboring bases, thus affecting the accuracy and biological interpretability of candidate variant site identification.

Method used

This study employs a method that integrates transfer learning and interpretability mechanisms. It extracts multidimensional features from DNA sequences using a dual-channel feature encoding strategy, constructs a deep learning network model, extracts multi-scale features using multi-layer convolution and a three-domain segmented position-aware attention mechanism, and pre-trains and fine-tunes the model using multi-species and multi-trait information. An interpretability mechanism is also introduced to quantitatively evaluate SNP mutations.

Benefits of technology

It significantly improves the model's adaptability to unknown species and data efficiency, solves the problems of species barriers and data heterogeneity, achieves cross-species generalization ability and intra-species prediction accuracy, and improves the systematic attribution of SNP functional effects by quantifying the differences in bioinformatics model output before and after mutation through a four-dimensional evaluation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120895090B_ABST
    Figure CN120895090B_ABST
Patent Text Reader

Abstract

This application provides a method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms. The method includes: extracting multidimensional features from DNA sequences based on a dual-channel feature encoding strategy to construct a tensor structure of sequence features; constructing a deep learning network model to model the complex relationship between SNPs and traits; in the deep learning network model, employing multi-layer convolution and a three-domain segmented position-aware attention mechanism to extract multi-scale features from the tensor structure, and performing feature integration and phenotypic prediction on these multi-scale features; pre-training, fine-tuning, and fusing the deep learning network model using multi-species, multi-trait information to obtain the final model; and introducing an interpretable mechanism based on the final model, constructing mutant types for individual samples with SNP mutations, inputting the sample groups into the fine-tuned model, and constructing a four-dimensional evaluation system to assess the impact of bases on the prediction results. This application can capture global genomic information and achieves high prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application belong to the field of bioinformatics technology, and more specifically, relate to a method for predicting trait genetic variation sites that integrates transfer learning and interpretable mechanisms. Background Technology

[0002] As modern agriculture develops towards high yield, stress resistance, and efficient resource utilization, genome prediction technology has gradually become a key tool in crop molecular breeding. Based on the association information between genetic variation sites widely distributed in the crop genome and important agronomic traits, potential trait-related sites can be predicted to promote future crop improvement.

[0003] Single nucleotide polymorphisms (SNPs), as the most common form of genomic variation, are abundant in the genome and are a key influencing factor on the genetic basis of phenotypic differences. They can affect protein structure and function (such as changes in enzyme activity) by altering the amino acid sequence of coding regions, or change gene expression levels by regulating gene transcription through non-coding regions (such as affecting promoter binding, mRNA stability, or miRNA binding). They may also affect adjacent functional sites through linkage disequilibrium. Ultimately, through changes in gene expression or protein function, they manifest as phenotypic differences such as yield and disease susceptibility at the cellular, tissue, or individual level. However, to date, the relevant roles and potential of SNPs in crop genomes have not been fully explored.

[0004] Therefore, SNP-based machine learning and deep learning methods have become a research hotspot in GP tasks.

[0005] In related technologies, regarding prediction methods for identifying key candidate SNP sites associated with target traits, while cross-species data integration has emerged in recent years in the identification of trait-related candidate genetic variation sites, most still remain at the data level of splicing or sharing shallow features, lacking effective mechanisms to support generalization and transfer from the perspectives of model structure and training strategies. Furthermore, regarding the interpretability analysis of model output results, existing studies largely rely on general interpretation methods such as SHAP and LIME. However, these methods often treat each site as an independent input feature, failing to reflect the biological structural information of the base's context in the original sequence. Especially at the nucleotide level, they cannot accurately capture the functional dependencies between candidate SNP sites and their neighboring bases. In phenotypic prediction tasks, this may lead to deviations between attribution results and actual functional regions, affecting the accuracy and biological interpretability of candidate variation site identification. Summary of the Invention

[0006] The purpose of this application is to provide a method for predicting trait genetic variation sites that integrates transfer learning and interpretable mechanisms, so as to at least solve the technical problems of insufficient model generalization ability and poor model interpretability in existing prediction technologies.

[0007] To achieve the above objectives, the embodiments of this application provide the following technical solutions.

[0008] According to one embodiment of this application, a method for predicting trait genetic variation sites that integrates transfer learning and interpretable mechanisms is provided, comprising the following steps:

[0009] Multidimensional features are extracted from DNA sequences based on a dual-channel feature encoding strategy, and a tensor structure of sequence features is constructed. The multidimensional features include DNA shape structure encoding features and one-hot encoding features, and biological prior knowledge of quantitative trait loci is incorporated into the one-hot encoding features.

[0010] A deep learning network model is constructed to model the complex relationship between SNPs and traits. In the deep learning network model, multi-layer convolution and a three-domain segmented position-aware attention mechanism are used to extract multi-scale features of tensor structures. Feature integration and phenotypic prediction are then performed on the multi-scale features.

[0011] This study utilizes multi-species, multi-trait information to pre-train, fine-tune, and fuse deep learning network models. The pre-training phase includes multi-species, multi-trait pre-training and single-species, full-trait pre-training, generating multi-species and single-species pre-trained models, respectively. The fine-tuning phase employs a parameter freezing strategy, keeping the parameters of the convolutional and attention layers in the encoder unchanged. For the two models generated in the pre-training phase, only the fully connected layers are retrained, generating a multi-species phenotypic prediction model (FT-MSP) for cross-species prediction and a fine-tuned intra-species prediction model (FT). In the fusion phase, the weights of the first convolutional layer of the FT-MSP model and the FT model are fused, and the remaining convolutional and fully connected layers are retrained to obtain the final model for identifying key candidate SNP sites associated with the target trait.

[0012] Based on the final model, an interpretive mechanism is introduced to construct mutants for individual samples with SNP mutations. The sample groups are then input into the finely tuned model to construct a four-dimensional evaluation system to assess the impact of bases on the prediction results.

[0013] Furthermore, the steps for extracting multidimensional features from DNA sequences based on a dual-channel feature encoding strategy include:

[0014] In the first channel, for an input sequence of length L First, a set of 5-mer fragments is generated by using a sliding window with a size of 5 and a step size of 1. , where the fragment at position i L represents the number of input sequences, and s represents the vector representation of the DNA sequence. Let represent the base at the i-th position in the sequence; F represents the set of 5-mer fragments. The fragment set is input into a pre-trained DNAshape model, which maps each 5-mer to . A real vector of dimension ; by concatenating the embedding representations of all segments, a vector of dimension is obtained. Feature matrix ;

[0015] In the second channel, each base The vectors are mapped to standard basis vectors in a four-dimensional vector space, resulting in a one-hot encoding matrix of dimension L×4. An indicator variable for the quantitative trait locus is then appended to obtain the final encoding matrix. .

[0016] Furthermore, in the multi-layer convolutions of deep learning network models:

[0017] Using two parallel convolutional neural network branches, the feature matrix of the first channel is processed respectively. Encoding matrix of the second channel Convolution processing is performed, and the outputs of the two convolution processes are weighted and fused to obtain the feature matrix H.

[0018] Furthermore, in the three-domain segmented position-aware attention mechanism of deep learning network models:

[0019] A three-domain segmented relative position bias strategy is introduced within a 41bp window, dividing the window into a core region, a middle region, and an outer edge region, and assigning different attention biases to each region.

[0020] Introducing a position embedding matrix ,in, For the set of real numbers, It is the length of the sequence after the convolution operation. This indicates the number of output channels of the convolutional layer;

[0021] Position Embedding Matrix Each position vector This represents the position information of the i-th position in the sequence;

[0022] Position embedding matrix Adding it to the feature matrix H yields the position-aware feature representation matrix. .

[0023] Furthermore, the three-domain segmented position-aware attention mechanism also includes:

[0024] An attention mechanism is used to model the dependencies between different positions in a sequence. For the query vector at position i... and the key vector at position j The query vector is calculated using the dot product. Key vector The similarity score between them, within a 41bp local window structure, is expressed as follows: A three-domain segmented relative position bias strategy is introduced.

[0025]

[0026] in, This represents the region between position i and position j. , Indicates the core area. Indicates the middle area. Indicates the outer edge region; This represents the similarity score between position i and position j. This represents the Gaussian kernel maximum value control term; This indicates the control of the Gaussian decay rate; This represents the baseline value of mid-range attention. Represents the baseline value of remote attention, relative to the similarity score. Introducing an attention mechanism, it can be represented as:

[0027]

[0028] Among them, attention weight The query vector at position i represents the degree of attention given to position j by position i. The key vector at position j The key vector at position m ; and The weight matrix is ​​a learnable matrix. Let i be the input feature vector at position i. This represents the input feature vector at position j. The input feature vector at position m; The summation index is used to iterate through all positions considered by the attention mechanism. This indicates the number of positions considered by the attention mechanism; Indicates the scaling factor; This represents the relative positional offset score between position i and position j; This represents the relative positional offset score between position i and position m; This represents the transpose operation of a vector;

[0029] The value vector of all positions is aggregated by weighting. To obtain the context representation of position i ,in, It is a weight matrix. This represents the input feature vector at position j. Represented as:

[0030]

[0031] In the formula, The context representation of position i. For attention weights, The vector of values ​​representing position j. This indicates the number of locations considered by the attention mechanism.

[0032] Further steps for feature integration and phenotypic prediction of multi-scale features include:

[0033] The context representations of all positions are integrated into a fixed-length feature vector through a global average pooling operation;

[0034] Phenotypic prediction is performed on the integrated feature vector using three fully connected layers. The first two fully connected layers are ReLU activated, and the last fully connected layer maps to the Sigmoid output, as shown below:

[0035]

[0036] in, , This is the weight matrix. , For bias vectors, This represents the number of output channels of the convolutional layer, where h is the dimension of the hidden layer. Let z represent the set of real numbers; z is the feature vector resulting from the concatenation and integration of attention and channels. Represents the Sigmoid function; This represents the predicted probability of the positive class.

[0037] Furthermore, during the pre-training phase, the model parameters are optimized using the binary cross-entropy loss function:

[0038]

[0039] Where N is the number of training samples, This is a real label;

[0040] During the fine-tuning phase, the loss function Represented as:

[0041]

[0042] In the formula, This represents the forward propagation function of the model. Represents the supervised loss function. This represents the number of training samples for the target species. These are the parameters of the feature extraction part, including the weight parameters of feature encoding networks such as convolutional layers and attention layers. These are the parameters of the prediction head. This represents the true label of the i-th sample of the target species; Represents the input feature tensor of the j-th sample of the target species;

[0043] The learning rate is dynamically adjusted during fine-tuning, as follows:

[0044]

[0045] In the formula, This represents the initial learning rate. The decay coefficient is represented by t, the current training step number is represented by t, and the total training steps are represented by T. This represents the dynamically adjusted learning rate.

[0046] Furthermore, the steps of constructing mutants for individual samples with SNP mutations include:

[0047] Select samples from the already trained model to construct an interpretive test set;

[0048] For the central site bases Replace them with the remaining three bases respectively Three perturbation sequences are generated; among them, These are the three bases excluding the input genotype bases;

[0049] The one-hot coding features and DNA shape coding features were calculated sequentially to obtain... , This represents the feature representation corresponding to the k-th input sample in the perturbation sample group;

[0050] The perturbation sample group S is represented as: ,in, Input genotype.

[0051] Furthermore, the steps of inputting the sample group into the self-fine-tuned model and constructing a four-dimensional evaluation system to assess the impact of bases on the prediction results include:

[0052] The perturbation sample group S is input into a pre-trained deep learning model to obtain the classification probability output for each sample; wherein, the model outputs the probability for wild-type sequences as follows: , indicating that the input is a wild-type sequence When the model predicts the probability of y=1, y=1 indicates that the prediction result is positive.

[0053] The output probabilities for the three mutant sequences are as follows: , , The effect value of the j-th base substitution is defined as: Effect size This is used to quantify the change in the probability of a deep learning model predicting the positive class after replacing wild-type bases with the j-th base; This represents the positive class prediction probability output by the deep learning model after the j-th mutant sequence is input into it;

[0054] Calculate the average effect and effect variance, where:

[0055] Average effect Represented as:

[0056]

[0057] effect variance Represented as:

[0058]

[0059] Construct a four-dimensional evaluation system that includes the maximum effect, average effect, effect variance, and attention mechanism weights;

[0060] The maximum effect is expressed as: ;

[0061] Based on weighted attribution, information from the four dimensions is integrated into a single comprehensive score S, denoted as:

[0062]

[0063]

[0064] In the formula, Indicates the maximum effect. Indicates the average effect. Indicates the variance of the effect. Indicates the position of the center of the sequence. Attention weights; This represents the weight of dimension k. These represent the weights of different dimensions, used to integrate multi-dimensional factors.

[0065] Compared with existing technologies, the technical advantages of the trait genetic variation site prediction method that integrates transfer learning and interpretable mechanisms in the embodiments of this application are reflected in the following aspects:

[0066] This application employs two types of models: cross-species general pre-training and single-species pre-training. This significantly improves the model's adaptability to unknown species and data efficiency, solving the species barrier and data heterogeneity problems inherent in traditional methods. Cross-species data fusion reduces the sample size required for the target task, laying a general representation foundation for subsequent transfer learning. The deep learning network model is pre-trained and fine-tuned using multi-species, multi-trait information. In the fine-tuning stage, for the two models generated in the pre-training stage, a parameter freezing strategy is used to retrain only the fully connected layers, generating a multi-species phenotypic prediction model FT-MSP for cross-species prediction and a fine-tuned intra-species prediction model FT. In the fusion stage, the two models are integrated with equal weights. The first convolutional layer outputs features, and after fixing this layer, subsequent convolutional layers and fully connected layers are retrained to ultimately form a model that combines cross-species generalization ability and intra-species prediction accuracy. This application's embodiments target a three-domain segmented position-aware attention mechanism for bases. Specifically, a three-domain segmented relative position bias is introduced to fuse local and long-range dependencies without requiring additional parameters. By performing targeted base mutations on candidate genetic variation sites for traits, the difference in bioinformatics model output before and after mutation is quantified, and weighted with attention weights to achieve a systematic attribution of SNP functional effects. Based on sequence perturbation theory, a four-dimensional evaluation system is constructed, and mathematical modeling is used to analyze the degree of influence of single nucleotide variations on the model's decision boundary. Attached Figure Description

[0067] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0068] In the attached diagram:

[0069] Figure 1 A flowchart illustrating the method for predicting trait genetic variation sites that integrates transfer learning and interpretable mechanisms, as provided in the embodiments of this application;

[0070] Figure 2 An architecture diagram of a deep learning network model provided in an embodiment of this application;

[0071] Figure 3 This is an architecture diagram of the pre-training stage in step S4 of an embodiment of this application;

[0072] Figure 4 This is a schematic diagram of the architecture of the fine-tuning stage in step S4 of an embodiment of this application;

[0073] Figure 5 This is a schematic diagram of the fusion stage in step S4 of the embodiment of this application. Detailed Implementation

[0074] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0075] According to the embodiments of this application, a method embodiment for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0076] like Figure 1 As shown, in one embodiment of this application, a method for predicting trait genetic variation sites that integrates transfer learning and interpretable mechanisms is provided, including the following steps:

[0077] Step S1: Construction and acquisition of multi-species data;

[0078] In step S1, a multi-species, multi-trait SNP-trait association dataset is first constructed;

[0079] Specifically, the latest research findings from Genome-Wide Association Study (GWAS) databases and literature covering 10 crops including rice, maize, wheat, soybean, sorghum, tomato, millet, barley, oats, and potato were collected to extract significantly associated SNP loci and their corresponding trait tags. Eight key agronomic traits, namely yield, stress tolerance, biological processes, plant growth and development, plant morphology, biochemical traits, plant vigor, and nutrient use efficiency, were prioritized as the core sample set for model training. Standardized training data suitable for multi-species, multi-trait joint modeling were constructed.

[0080] Step S1 also includes the step of extracting the region window sequence, wherein, with each candidate SNP site as the center, sequence fragments within ±20bp upstream and downstream of it are extracted according to a fixed length to form a sequence window of length 41bp; this window serves as the sequence basis for model input and retains the local sequence context information of the SNP.

[0081] Step S2: Data preprocessing and feature construction;

[0082] To construct a structured input suitable for deep neural networks, step S2 in this embodiment converts the original biological sequence and phenotypic data into a computable tensor representation through multi-dimensional feature engineering;

[0083] In this embodiment, step S2 includes a step of phenotypic label processing;

[0084] Specifically, the raw information of multimodal phenotypic data is collected and stored. In the data source integration, phenotypic tags of the target species are obtained from the publicly available GWAS database and relevant literature. In the structured storage, the phenotypic data is stored as a structured file with the sample ID and the genetic variation site matched one by one, ensuring that the index matches the genotype data.

[0085] Furthermore, in the dual encoding of sequence features in step S2, a dual-channel feature encoding strategy is constructed to capture precise base information and sequence functional semantics simultaneously, based on the molecular characteristics of the DNA sequence. The dual-channel feature encoding strategy includes one-hot discretization encoding with additional biological prior knowledge annotation and DNA shape structure encoding.

[0086] In one-hot discretization encoding, a base-specific binary vector is used to map the DNA sequence base by base. For example, adenine (A) is defined as [1,0,0,0], thymine (T) as [0,1,0,0], cytosine (C) as [0,0,1,0], and guanine (G) as [0,0,0,1]. For the 41bp sequence window extracted in step S1, a binary matrix is ​​generated, with each row corresponding to a one-hot vector of a base. A QTL (Quantitative Trait Locus) tag column is added after the one-hot encoding. QTL refers to chromosomal regions on the genome associated with quantitative traits. If an SNP site is located within a QTL region, it indicates that it is more likely to affect trait performance. Therefore, an additional QTL tag (with a value of 0 or 1) is set for each base to introduce this biological prior knowledge. The base composition and position-specific information of the sequence are fully preserved, providing low-level structural feature input for the model.

[0087] In DNAshape structural feature encoding, to address the lack of structural information in traditional sequence encoding, a pre-trained physicochemical parameter model is used to represent the three-dimensional structure of DNA. A sliding window approach is used to extract 5-mer sequences. Based on experimentally determined DNA structure data, the pre-trained DNAshape model maps each 5-mer to a 13-dimensional structural parameter vector. For a 41bp sequence window, a structural feature matrix is ​​generated. By parameterizing the structure of local regions, the conformational features of DNA are captured. This method reflects the physicochemical properties of DNA through structural parameters in multidimensional space. For example, sequence fragments with similar three-dimensional conformations exhibit a regular distribution in the structural parameter space, effectively improving the model's ability to analyze biological processes such as DNA-protein interactions.

[0088] This embodiment further constructs a modality tensor, converting each sample into a two-channel tensor structure containing DNA shape features, one-hot encoded features, and biological prior knowledge annotation features, which serves as the model input to meet the input format requirements of subsequent deep learning and attention mechanism modules.

[0089] Step S3: Dual-channel embedding and positional attention modeling;

[0090] Specifically, in step S3, multidimensional features are extracted from the DNA sequence based on a dual-channel feature encoding strategy to construct a tensor structure of sequence features; wherein, the multidimensional features include DNA shape structure encoding features and one-hot encoding features, and biological prior knowledge of quantitative trait loci is incorporated into the one-hot encoding features;

[0091] In the process of multimodal feature encoding and extraction, this embodiment of the invention employs a dual-channel feature encoding strategy to process DNA sequence data, thereby simultaneously preserving the semantic information and contextual features of the sequence.

[0092] Specifically, the steps for extracting multidimensional features from DNA sequences based on a dual-channel feature encoding strategy in this embodiment include:

[0093] In the first channel, for an input sequence of length L First, a set of 5-mer fragments is generated by using a sliding window with a size of 5 and a step size of 1. , where the fragment at position i L represents the number of input sequences, and s represents the vector representation of the DNA sequence. Let represent the base at position i in the sequence; F represents the set of 5-mer fragments, each fragment being a combination of consecutive bases. The sliding window mechanism uses a window size of to represent the number of bases selected each time, and a step size of 1 to represent the window moving one base position at a time, generating a total of L-4 fragments. The fragment set is then input into a pre-trained DNAshape model, which maps each 5-mer to . A real vector of dimension ; by concatenating the embedding representations of all segments, a vector of dimension is obtained. Feature matrix ;

[0094] In the DNAshape structural feature encoding of the first channel, to address the lack of structural information in traditional sequence encoding, a pre-trained physicochemical parameter model is used to represent the three-dimensional structure of DNA. A sliding window approach is used to extract 5-mer sequences, and the DNAshape model, pre-trained based on experimentally determined DNA structural data, maps each 5-mer to a 13-dimensional structural parameter vector. For a 41bp sequence window, a structural feature matrix is ​​generated, and the conformational features of DNA are captured through structural parameterization of local regions. This method reflects the physicochemical properties of DNA through structural parameters in multidimensional space. For example, sequence fragments with similar three-dimensional conformations exhibit a regular distribution in the structural parameter space, effectively improving the model's ability to analyze biological processes such as DNA-protein interactions.

[0095] In the second channel, each base The vectors are mapped to standard basis vectors in a four-dimensional vector space, resulting in a one-hot encoding matrix of dimension L×4. An indicator variable for the quantitative trait locus is then appended to obtain the final encoding matrix. .

[0096] Specifically, in the second channel, each base Mapped to standard basis vectors in a four-dimensional vector space, this yields a one-hot encoding matrix of dimension L×4, where A represents adenine, T represents thymine, C represents cytosine, and G represents guanine; for example, A is mapped to... T is mapped to And so on, and by adding a quantitative trait locus indicator variable, the final coding matrix is ​​obtained. This encoding method preserves the original information of the DNA sequence and, combined with prior biological knowledge, is of great significance for identifying local base variations and conserved regions; ultimately, a coding matrix of dimension L×4+1 is obtained. ;

[0097] The two encoding methods described above in this embodiment are complementary. The DNAshape encoding feature focuses on structural conformation features, while the One-hot encoding feature, which incorporates biological prior knowledge of quantitative trait sites, is good at preserving precise sequence structure.

[0098] Furthermore, in step S3 of this application embodiment, a deep learning network model is constructed to model the complex relationship between SNPs and traits. In the deep learning network model, multi-layer convolution and a three-domain segmented position-aware attention mechanism are used to extract multi-scale features of the tensor structure, and feature integration and phenotypic prediction are performed on the multi-scale features.

[0099] In one implementation of this embodiment, in order to extract meaningful feature patterns from dual-channel encoding in the multi-layer convolution of the deep learning network model, this embodiment utilizes two parallel convolutional neural network branches to process the feature matrix of the first channel respectively. Encoding matrix of the second channel Perform convolution processing, and then perform weighted fusion of the convolution outputs of the two channels to obtain the feature matrix H;

[0100] For the first channel, a set of one-dimensional convolution kernels is used. Each convolutional kernel has a size of K and a stride of 1. The matrix for the first channel... Perform convolution operations to obtain encoded features. ;in, k is the kernel size; similarly, for the second channel, use the kernel size. Matrix for the second channel Processing is performed to obtain encoded features. , Represents the set of real numbers. It is the length of the sequence after the convolution operation. This represents the number of output channels of the convolutional layer; the two types of encoded features are input into a three-layer 1D convolutional network, and the convolution operation is defined as:

[0101]

[0102]

[0103] In this embodiment of the invention, the kernel size K of each layer is 5, 3, and 3 respectively, and the number of filters is 8→16→32, so as to extract multi-scale local patterns step by step and suppress overfitting.

[0104] Furthermore, to enable the model to adaptively balance the importance of the two types of feature sources during the learning process, this embodiment of the invention introduces learnable parameters. And according to the formula The two outputs are weighted and fused, whereby... Initially set to 0.5, it was optimized during training to adapt to the varying dependencies of different crops or traits on sequence embeddings and raw base information. For example, when identifying SNP sites that depend on the precise structure of the sequence, the model might increase the weight of the second channel; while in tasks that require capturing semantic information, the weight of the DNAshap channel would be increased accordingly.

[0105] Furthermore, such as Figure 2 As shown, in the three-domain segmented position-aware attention mechanism of the deep learning network model: this application introduces a three-domain segmented relative position bias strategy within a 41bp window, dividing the window into a core region, a middle region, and an outer edge region, and assigning different attention biases to each; in order to fully utilize the positional information in the DNA sequence, this invention introduces a position embedding matrix. ,in, For the set of real numbers, It is the length of the sequence after the convolution operation (L'=L-k+1, where k is the size of the convolution kernel). Represents the number of output channels of the convolutional layer; position embedding matrix Each position vector This represents the position information of the i-th position in the sequence, including relative or absolute position information; the position embedding matrix is ​​used to represent this information. Adding it to the feature matrix H yields the position-aware feature representation matrix. , is represented as: This embodiment enables the model to distinguish functional differences at different positions in the sequence. For example, promoter regions are usually located upstream of the gene, while enhancer regions may be located upstream or downstream of the gene or in introns.

[0106] Based on this, embodiments of the present invention employ an attention mechanism to model the dependencies between different positions in a sequence, for the query vector at position i. and the key vector at position j The query vector is calculated using the dot product. Key vector The similarity score between them is modeled using a three-domain segmented relative position bias strategy in the 41bp local window structure: the ±20bp region around the center point is divided into three segments according to the relative distance: core, middle and outer edge, and modeled using Gaussian decay and fixed constant respectively.

[0107] Among them, the core region (±5bp) uses an exponential decay function to enhance local accuracy perception, the middle region (5-15bp) maintains a medium-intensity bias to retain next-neighbor information, and the outer region (15-beyond bp) is uniformly given a lower bias for noise control.

[0108] In this embodiment, the window is divided into a core area, a middle area, and an outer edge area, and different attention biases are applied to each area to capture both local and long-range dependencies simultaneously.

[0109] This embodiment effectively integrates local and global attention modeling capabilities without introducing complex learnable structures, thereby improving the recognition performance of candidate SNPs and the biological interpretability of attention weights.

[0110] The three-domain segmented relative offset provided in this embodiment includes:

[0111] Core region: For local concern, the core region uses a Gaussian kernel to simulate the physical proximity dependency of the structure;

[0112] Middle domain: Focus on the middle area;

[0113] Outer boundary: Assign a smaller value Reduce boundary effects;

[0114] Furthermore, the three-domain segmented relative position offset strategy introduced in this embodiment of the invention is expressed as:

[0115]

[0116] in, This represents the region between position i and position j. , Indicates the core area. Indicates the middle area. Indicates the outer edge region; This represents the similarity score between position i and position j. This represents the Gaussian kernel maximum value control term; This indicates the control of the Gaussian decay rate; This represents the baseline value of mid-range attention. Represents the baseline value of remote attention, relative to the similarity score. Introducing an attention mechanism, it can be represented as:

[0117]

[0118] Among them, attention weight The query vector at position i represents the degree of attention given to position j by position i. The key vector at position j The key vector at position m ; and The weight matrix is ​​a learnable matrix. Let i be the input feature vector at position i. This represents the input feature vector at position j. The input feature vector at position m; The summation index is used to iterate through all positions considered by the attention mechanism. This indicates the number of positions considered by the attention mechanism; This represents the scaling factor, used to divide by the square root of the query vector dimension to prevent the dot product value from being too large and causing gradient problems. This represents the relative positional offset score between position i and position j; This represents the relative positional offset score between position i and position m; This represents the transpose operation of a vector;

[0119] Furthermore, the value vectors of all positions are aggregated by weighting. , get location Context representation ,in, It is a weight matrix. This represents the input feature vector at position j. Represented as:

[0120]

[0121] In the formula, The context representation of position i. For attention weights, The vector of values ​​representing position j. This indicates the number of locations considered by the attention mechanism.

[0122] As can be seen, the three-domain segmented position-aware attention mechanism in this embodiment can capture long-distance dependencies in the sequence, such as the interaction between long-distance enhancers and promoters, thereby significantly improving the model's ability to model complex regulatory relationships.

[0123] Therefore, this application's embodiments introduce a three-domain segmented relative position bias for the three-domain segmented position-aware attention mechanism of bases, which integrates local and long-range dependencies without the need for additional parameters.

[0124] Furthermore, in step S3 of this embodiment, the steps of feature integration and phenotypic prediction for multi-scale features specifically include:

[0125] The context representations of all positions are integrated into a fixed-length feature vector z through a global average pooling operation, denoted as:

[0126]

[0127] In the formula, This indicates the number of positions considered by the attention mechanism. The context representation of position i;

[0128] This embodiment uses a global average pooling strategy to preserve the overall features of the sequence while reducing the number of model parameters and preventing overfitting.

[0129] Furthermore, three fully connected layers are used to predict the phenotypic distribution of the integrated feature vector. The first two layers are ReLU activated with Dropout (0.3), and the structure is 2048→256→32. The last fully connected layer maps to the Sigmoid output, as shown below: ,in, , This is the weight matrix. , For bias vectors, This represents the number of output channels of the convolutional layer, where h is the dimension of the hidden layer. Let z represent the set of real numbers; z is the feature vector resulting from the concatenation and integration of attention and channels. Represents the Sigmoid function; This represents the predicted probability of the positive class;

[0130] Through this architecture, the model in this embodiment of the invention can effectively integrate the local structure and global contextual information of the DNA sequence to achieve high-precision phenotypic prediction.

[0131] Please continue to refer to Figure 1 The prediction method in this application embodiment further includes the following steps:

[0132] Step S4: Multi-species, multi-trait pre-training and trait-specific fine-tuning;

[0133] To improve the generalization ability and adaptability of the SNP-trait prediction model, this embodiment of the invention adopts a pre-training-fine-tuning fusion strategy that combines multi-species and multi-trait information.

[0134] Specifically, this embodiment utilizes multi-species, multi-trait information to pre-train, fine-tune, and fuse deep learning network models;

[0135] like Figure 3 As shown, the pre-training stage of this embodiment includes multi-species multi-trait pre-training and single-species full-trait pre-training, which generate multi-species pre-trained models and single-species pre-trained models, respectively.

[0136] Specifically, the pre-training stage includes two modes: multi-species multi-trait pre-training and single-species full-trait pre-training. After training in each mode, two independent models are generated: a multi-species pre-trained model and a single-species pre-trained model. Specifically, the pre-training stage of this invention adopts a dual-channel architecture based on convolutional neural networks (CNNs). By integrating two feature encoding strategies, DNAshap and one-hot encoding with additional biological prior knowledge annotation, unsupervised learning is performed on the source task. Each feature channel independently extracts 41bp flanking sequences (centered on SNP ±20bp) of genetic variation sites. Multi-level sequence features are extracted through three 1D convolutional layers and finally spliced ​​and fused to form a comprehensive representation.

[0137] Among the two modes of pre-training, the multi-species, multi-trait pre-training is based on a large-scale GWAS dataset covering 10 crops and 8 agronomic traits, screening 96,424 candidate genetic variation sites. (MAF≥0.01), this model aims to capture genotype-phenotype association patterns shared across species, enhancing the model's general representation capabilities; for single-species full-trait pre-training, candidate genetic variation sites are integrated for a single species (e.g., rice). With a MAF ≥ 0.01 (163,448 records in rice), the modeling of species-specific sequence features was deepened. Two models were trained separately to generate independent models—a multi-species pre-trained model (PanCrop-PT) and a single-species pre-trained model (MonoSpecie-PT)—which served as the basis for subsequent tasks.

[0138] During the pre-training phase, the binary cross-entropy loss function is used to optimize the model parameters:

[0139]

[0140] Where N is the number of training samples, For real labels, This represents the binary cross-entropy loss function. This indicates the predicted label.

[0141] like Figure 4 As shown, in the fine-tuning stage, a parameter freezing strategy is adopted to keep the parameters of the convolutional and attention layers in the encoder unchanged. For the two models generated in the pre-training stage, only the fully connected layers are retrained to generate the multi-species phenotypic prediction model FT-MSP for cross-species prediction and the fine-tuned model FT for intra-species prediction.

[0142] Specifically, the fine-tuning stage is used to ensure that the model has strong generalization ability and task adaptability. The model is fine-tuned for the specific traits of the target species. The goal of the fine-tuning stage is to adapt to the specific data distribution and phenotypic features of the target species while retaining the general knowledge obtained from pre-training.

[0143] During the fine-tuning phase, this invention employs a parameter freezing strategy: the parameters of the convolutional layers and their attention layers in the encoder remain unchanged, and only the fully connected layers (2048→256→32 nodes) are retrained. This strategy can effectively prevent the model from overfitting on small sample data, while utilizing the biological knowledge learned in the pre-training phase to fully inherit general features. The fully connected layers are retrained using labeled data of the target crop and target traits to enhance the predictive performance of trait specificity.

[0144] In this embodiment, the loss function during the fine-tuning stage is... Represented as:

[0145]

[0146] In the formula, This represents the forward propagation function of the model. Represents the supervised loss function. The number of training samples for the target species These are the parameters of the feature extraction part, including the weight parameters of feature encoding networks such as convolutional layers and attention layers. These are the parameters of the prediction head. This represents the true label of the i-th sample of the target species; Represents the input feature tensor of the j-th sample of the target species;

[0147] To further improve the fine-tuning effect, this invention dynamically adjusts the learning rate during the fine-tuning process, as shown below:

[0148]

[0149] in, The initial learning rate, The attenuation coefficient is... This represents the current number of training steps. Total training steps; This represents the dynamically adjusted learning rate; this learning rate decay strategy allows the model to quickly adapt to the target data in the early stages of fine-tuning, and then make fine adjustments in the later stages, thereby achieving better generalization performance.

[0150] This process generates two types of fine-tuned models: FT-MSP-species-trait: fine-tuned based on a multi-species pre-trained model, suitable for cross-species prediction. FT-species-trait: fine-tuned based on a single-species pre-trained model, focusing on intra-species tasks.

[0151] Furthermore, such as Figure 5 As shown, in the fusion stage, the weights of the first convolutional layer of the FT-MSP model and the FT model are fused, and the remaining convolutional layers and fully connected layers are retrained to obtain the final model for identifying key candidate SNP sites associated with the target trait.

[0152] The fusion stage of this invention integrates the advantages of two types of fine-tuned models to form a final prediction framework. Feature layer fusion: The weights of the first convolutional layer of the FT-MSP and FT models are extracted and merged by weighted averaging to retain cross-species generality and intraspecific features. Upper layer retraining: The weights of the first convolutional layer after fusion are fixed, and the subsequent second and third convolutional layers and fully connected layers are retrained using target trait data to further optimize task adaptability. Output generation: The fused model predicts the association probability between SNPs and traits through the Sigmoid output layer. The model fusion in this embodiment of the invention can significantly improve generalization ability.

[0153] This application employs two types of models: cross-species universal pre-training (PanCrop-PT) and species-specific pre-training (MonoSpecie-PT). These models significantly improve the model's adaptability to unknown species and data efficiency, solving the species barrier and data heterogeneity problems in traditional methods. By fusing cross-species data, the sample size required for the target task is reduced, laying a universal representation foundation for subsequent transfer learning.

[0154] This application embodiment utilizes multi-species, multi-trait information to pre-train and fine-tune the deep learning network model. In the fine-tuning stage, for the PanCrop-PT and MonoSpecie-PT pre-trained models, a parameter freezing strategy is adopted to retrain only the fully connected layers, generating a cross-species-adapted FT-MSP-species-trait model and an intra-species-specific FT-species-trait model, respectively. In the fusion stage, the output features of the first convolutional layer of the two models are integrated with equal weights. After fixing this layer, subsequent convolutional layers and fully connected layers are retrained, ultimately forming a model that combines cross-species generalization ability and intra-species prediction accuracy. This significantly improves AUC and ACC in low-sample scenarios and effectively suppresses overfitting.

[0155] For further details, please refer to [link / reference]. Figure 1 The method for predicting trait genetic variation sites that integrates transfer learning and interpretable mechanisms, as described in this application, further includes the following steps:

[0156] Step S5: Interpretability attribution and candidate SNP identification;

[0157] In step S5, this embodiment introduces an interpretability mechanism based on the final model. Mutant types are constructed for individual samples with SNP mutations, and the sample groups are input into the self-fine-tuned model to construct a four-dimensional evaluation system to assess the impact of bases on the prediction results. Specifically, the data is first preprocessed. In order to achieve interpretable attribution analysis of candidate SNPs, samples with stable prediction results and significant trait labels are selected from the trained model to construct an interpretability test set.

[0158] Specifically, priority is given to selecting positive samples that have a high prediction confidence level (e.g., output probability > 0.8) in the validation set, i.e., sequence fragments predicted as trait-related SNPs. These samples are more likely to contain functional mutations and are suitable as target regions for attribution analysis;

[0159] The steps in this embodiment for constructing mutant types for individual samples with SNP mutations include:

[0160] Select samples from the already trained model to construct an interpretive test set;

[0161] For the central site bases Replace them with the remaining three bases respectively. Three perturbation sequences are generated; among them, These are the three bases excluding the input genotype bases;

[0162] The one-hot coding features and DNA shape coding features were calculated sequentially to obtain... , This represents the feature representation corresponding to the k-th input sample in the perturbation sample group;

[0163] The perturbation sample group S is represented as: ,in, Input genotype.

[0164] Specifically, in mutant construction, to quantify the impact of specific SNP sites on the phenotype, this invention employs a systematic base perturbation experiment, wherein, for the central site... (bases) Replace them with the remaining three bases respectively. This generates three perturbation sequences. For example, if the wild-type base is A, then three mutants, T, C, and G, are generated respectively. This comprehensive perturbation strategy can cover all possible base substitutions, ensuring a comprehensive assessment of SNP function.

[0165] Furthermore, in this embodiment, the step of inputting the sample group into the self-adjusted model and constructing a four-dimensional evaluation system to assess the impact of bases on the prediction results includes:

[0166] The perturbation sample group S is input into a pre-trained deep learning model to obtain the classification probability output for each sample;

[0167] For binary classification tasks, the main focus is on the positive class probability P(y=1|I);

[0168] Specifically, the model outputs the probability of wild-type sequences as follows: , indicating that the input is a wild-type sequence When the model predicts the probability of y=1, y=1 indicates that the prediction result is positive.

[0169] The output probabilities for the three mutant sequences are as follows: , , The effect value of the j-th base substitution is defined as: , The effect size represents the positive class prediction probability output by the deep learning model after the j-th mutant sequence is input into it; This is used to quantify the change in the probability of positive class prediction by a deep learning model after replacing wild-type bases with the j-th base. A positive value indicates that the replacement increases the probability of positive class, a negative value indicates that the replacement decreases the probability of positive class, and the larger the absolute value, the stronger the effect.

[0170] Furthermore, in order to more comprehensively assess the functional impact of SNPs, the average effect and effect variance were calculated;

[0171] The average effect is expressed as:

[0172] ;

[0173] The effect variance is expressed as:

[0174] .

[0175] Furthermore, this invention constructs a four-dimensional evaluation system based on multi-dimensional attribution evaluation and weighted fusion to comprehensively assess the functional importance of SNPs from different perspectives; specifically, this invention constructs a four-dimensional evaluation system that includes maximum effect, average effect, effect variance, and attention mechanism weight values.

[0176] The average effect reflects the overall strength of the influence of the locus on the phenotype, and is not affected by the specific substitution type;

[0177] The variance of the effect reflects the consistency of the effects produced by different substitutions; the smaller the variance, the more robust the function.

[0178] The maximum effect is expressed as: The maximum effect captures the strongest functional perturbation, reflecting the maximum functional potential of the site.

[0179] Biased attention mechanism This refers to the biased attention mechanism constructed in step S3.

[0180] Finally, this invention integrates the information from the four dimensions into a comprehensive score based on weighted attribution, expressed as:

[0181]

[0182]

[0183] In the formula, Indicates the maximum effect. Indicates the average effect. Indicates the variance of the effect. Indicates the position of the center of the sequence. Attention weights; This represents the weight of dimension k. These represent the weights of different dimensions, used to integrate multi-dimensional factors.

[0184] This application embodiment achieves systematic attribution of SNP functional effects by performing targeted base mutations on candidate genetic variation sites of traits, quantifying the difference in bioinformatics model output before and after mutation, and weighting with attention weights; based on sequence perturbation theory, a four-dimensional evaluation system is constructed, and the influence of a single nucleotide variation on the model decision boundary is analyzed through mathematical modeling.

[0185] Please continue to refer to Figure 1 The embodiments of this application also include:

[0186] Step S6: Use a five-fold cross-validation strategy to evaluate model quality;

[0187] In step S6, the first step is to prepare the five-fold cross-validation data.

[0188] In this invention, five-fold cross-validation randomly and uniformly divides the dataset into five disjoint subsets, each consisting of a chromosome, with the data size of each subset being as equal as possible. When validating model performance, four subsets are used as the training set to train the model each time, and the remaining subset is used as the test set to evaluate the model. This process is repeated five times to ensure that each subset has one opportunity to be used as the test set. Finally, the average of the five evaluation results is used as the final indicator of model performance.

[0189] Results summary: The average of the performance metrics obtained from the 5 validations was used as the overall evaluation of the model performance;

[0190] Furthermore, the AUC used in this embodiment of the invention is used to measure the classification ability of the binary classification model under different thresholds, specifically the area under the ROC curve (true positive rate vs false positive rate); the AUC value ranges from [0,1], and the higher the value, the stronger the model's ability to distinguish between positive and negative samples; in this invention, the predicted probability of a positive sample is higher than that of a negative sample by sorting the predicted probabilities of all samples.

[0191] Furthermore, the AUPR used in this embodiment of the invention focuses on the prediction performance of positive samples, reflecting the area under the precision-recall curve, and is suitable for imbalanced sample scenarios (such as rare disease detection). The higher the AUPR, the better the model's recognition effect on positive samples. Under different probability thresholds, the combination of precision and recall is calculated, and then the area under the curve is integrated.

[0192] Furthermore, the ACC measure used in this embodiment of the invention measures the overall accuracy of the model's predictions, calculating the proportion of correctly predicted samples across all samples. The formula is: Wherein, TP (True Positives) is the number of positive samples correctly predicted as positive, TN (True Negatives) is the number of negative samples correctly predicted as negative, FP (False Positives) is the number of negative samples incorrectly predicted as positive, and FN (False Negatives) is the number of positive samples incorrectly predicted as negative.

[0193] In step S6 of this embodiment of the invention, F1 score is also used. F1 score is used as a balancing index for precision and recall to resolve potential contradictions between the two (such as a low recall rate when precision is high).

[0194] The F1 score is expressed as: Among them, accuracy: Recall rate measures the accuracy of positive sample predictions. This measures the coverage of positive samples.

[0195] To accurately evaluate the effectiveness of cross-species transfer learning, especially performance improvement in data-scarce scenarios, this invention proposes the Transfer Efficacy Index (TEI), denoted as:

[0196]

[0197] in, To measure the accuracy of the transfer learning model on the target species test set, The accuracy of the baseline model trained using only target species data. The number of source materials used in the pre-training phase. The number of training samples for the target species; the TEI index has the following advantages: logarithmic transformation handles differences in sample size: through the logarithmic function Adjusting the target sample size amplifies the gain of transfer learning when the sample size is small, more accurately reflecting the transfer value in small data scenarios. The non-linear impact of the number of source species is also considered. This reflects the diminishing marginal benefit of the source species quantity on the migration effect, avoiding overestimation caused by simple linear accumulation.

[0198] The embodiments of the present invention are passed through Calculating relative gain makes the transfer performance comparable across different baseline levels. Compared to traditional transfer gain metrics, TEI can more accurately assess the actual effectiveness of cross-species transfer learning in data-scarce situations, providing a more reliable basis for model selection and optimization.

[0199] The following are systematic experimental results on six important crop phenotypic classification datasets (Rice-ST, Wheat-ST, Maize-ST, Sorghum-ST, Maize-YT, Rice-YT), demonstrating that the classification prediction method proposed in this invention outperforms existing mainstream machine learning and deep learning models in terms of accuracy (ACC).

[0200] Table 1. Performance of different methods on six datasets for the ACC index.

[0201]

[0202] In Table 1, ST represents the Stress Trait, and YT represents the Yield Trait dataset. As shown in Table 1, our method achieved the highest ACC score on all six datasets, demonstrating excellent and robust cross-species generalization ability. Particularly on the Sorghum-ST dataset, our method achieved a highest ACC score of 0.7351, representing a 9.93% performance improvement compared to the strongest baseline model on this dataset (DeepGS, 0.6687); on the Maize-ST dataset, the performance improvement reached as high as 22.14% compared to the strongest baseline model (XGBoost, 0.5157). These results fully demonstrate the unique advantages and effectiveness of our transfer learning strategy in feature extraction and modeling of complex agricultural genomic data.

[0203] In one embodiment, a computer device is provided, the computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the trait genetic variation site prediction method that integrates transfer learning and interpretable mechanisms provided in the above embodiments.

[0204] In another embodiment, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the trait genetic variation site prediction method that integrates transfer learning and interpretable mechanisms provided in the above embodiments.

[0205] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0206] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the trait genetic variation site prediction method that integrates transfer learning and interpretable mechanisms as described above.

[0207] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0208] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

[0209] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting trait genetic variation sites that integrates transfer learning and explainable mechanisms, characterized in that... ; Includes the following steps: Multidimensional features are extracted from DNA sequences based on a dual-channel feature encoding strategy, and a tensor structure of sequence features is constructed. The multidimensional features include DNA shape structure encoding features and one-hot encoding features, and biological prior knowledge of quantitative trait loci is incorporated into the one-hot encoding features. A deep learning network model is constructed to model the complex relationship between SNPs and traits. In the deep learning network model, multi-layer convolution and a three-domain segmented position-aware attention mechanism are used to extract multi-scale features of tensor structures. Feature integration and phenotypic prediction are then performed on the multi-scale features. This study utilizes multi-species, multi-trait information to pre-train, fine-tune, and fuse deep learning network models. The pre-training phase includes multi-species, multi-trait pre-training and single-species, full-trait pre-training, generating multi-species and single-species pre-trained models, respectively. The fine-tuning phase employs a parameter freezing strategy, keeping the parameters of the convolutional and attention layers in the encoder unchanged. For the two models generated in the pre-training phase, only the fully connected layers are retrained, generating a multi-species phenotypic prediction model (FT-MSP) for cross-species prediction and a fine-tuned intra-species prediction model (FT). In the fusion phase, the weights of the first convolutional layer of the FT-MSP model and the FT model are fused, and the remaining convolutional and fully connected layers are retrained to obtain the final model for identifying key candidate SNP sites associated with the target trait. Based on the final model, an interpretive mechanism is introduced to construct mutants for individual samples with SNP mutations. The sample groups are then input into the finely tuned model to construct a four-dimensional evaluation system to assess the impact of bases on the prediction results.

2. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 1, characterized in that, The steps for extracting multidimensional features from DNA sequences based on a dual-channel feature encoding strategy include: In the first channel, for an input sequence of length L First, a set of 5-mer fragments is generated by using a sliding window with a size of 5 and a step size of 1. , where the fragment at position i L represents the number of input sequences, and s represents the vector representation of the DNA sequence. Let represent the base at the i-th position in the sequence; F represents the set of 5-mer fragments. The fragment set is input into a pre-trained DNAshape model, which maps each 5-mer to . A real vector of dimension ; by concatenating the embedding representations of all segments, a vector of dimension is obtained. Feature matrix ; In the second channel, each base The vectors are mapped to standard basis vectors in a four-dimensional vector space, resulting in a one-hot encoding matrix of dimension L×4. An indicator variable for the quantitative trait locus is then appended to obtain the final encoding matrix. .

3. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 2, characterized in that, In multi-layer convolutions of deep learning network models: Using two parallel convolutional neural network branches, the feature matrix of the first channel is processed respectively. Encoding matrix of the second channel Convolution processing is performed, and the outputs of the two convolution processes are weighted and fused to obtain the feature matrix H.

4. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 3, characterized in that, In the three-domain segmented position-aware attention mechanism of deep learning network models: A three-domain segmented relative position bias strategy is introduced within a 41bp window, dividing the window into a core region, a middle region, and an outer edge region, and assigning different attention biases to each region. Introducing a position embedding matrix ,in, For the set of real numbers, It is the length of the sequence after the convolution operation. This indicates the number of output channels of the convolutional layer; Position Embedding Matrix Each position vector This represents the position information of the i-th position in the sequence; Position embedding matrix Adding it to the feature matrix H yields the position-aware feature representation matrix. .

5. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 4, characterized in that, The three-domain segmented position-aware attention mechanism also includes: An attention mechanism is used to model the dependencies between different positions in a sequence. For the query vector at position i... and the key vector at position j The query vector is calculated using the dot product. Key vector The similarity score between them, within a 41bp local window structure, is expressed as follows: A three-domain segmented relative position bias strategy is introduced. ; in, This represents the region between position i and position j. , Indicates the core area. Indicates the middle area. Indicates the outer edge region; This represents the similarity score between position i and position j. This represents the Gaussian kernel maximum value control term; This indicates the control of the Gaussian decay rate; This represents the baseline value of mid-range attention. Represents the baseline value of remote attention, relative to the similarity score. Introducing an attention mechanism, it can be represented as: ; Among them, attention weight The query vector at position i represents the degree of attention given to position j by position i. The key vector at position j The key vector at position m ; and The weight matrix is ​​a learnable matrix. Let i be the input feature vector at position i. This represents the input feature vector at position j. The input feature vector at position m; The summation index is used to iterate through all positions considered by the attention mechanism. This indicates the number of positions considered by the attention mechanism; Indicates the scaling factor; This represents the relative positional offset score between position i and position j; This represents the relative positional offset score between position i and position m; This represents the transpose operation of a vector; The value vector of all positions is aggregated by weighting. To obtain the context representation of position i ,in, It is a weight matrix. This represents the input feature vector at position j. Represented as: ; In the formula, The context representation of position i. For attention weights, The vector of values ​​representing position j. This indicates the number of locations considered by the attention mechanism.

6. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 5, characterized in that, The steps for feature integration and phenotypic prediction of multi-scale features include: The context representations of all positions are integrated into a fixed-length feature vector through a global average pooling operation; Phenotypic prediction is performed on the integrated feature vector using three fully connected layers. The first two fully connected layers are ReLU activated, and the last fully connected layer maps to the Sigmoid output, as shown below: ; in, , This is the weight matrix. , For bias vectors, This represents the number of output channels of the convolutional layer, where h is the dimension of the hidden layer. Let z represent the set of real numbers; z is the feature vector resulting from the concatenation and integration of attention and channels. Represents the Sigmoid function; This represents the predicted probability of the positive class.

7. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 6, characterized in that, During the pre-training phase, the binary cross-entropy loss function is used to optimize the model parameters: ; Where N is the number of training samples, For real labels, This represents the binary cross-entropy loss function. Indicates the predicted label; During the fine-tuning phase, the loss function Represented as: ; In the formula, This represents the forward propagation function of the model. Represents the supervised loss function. This represents the number of training samples for the target species. These are the parameters of the feature extraction part, including the weight parameters of feature encoding networks such as convolutional layers and attention layers. These are the parameters of the prediction head. This represents the true label of the i-th sample of the target species; Represents the input feature tensor of the j-th sample of the target species; The learning rate is dynamically adjusted during fine-tuning, as follows: ; In the formula, This represents the initial learning rate. The decay coefficient is represented by t, the current training step number is represented by t, and the total training steps are represented by T. This represents the dynamically adjusted learning rate.

8. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 7, characterized in that, The steps for constructing mutants for individual samples with SNP mutations include: Select samples from the already trained model to construct an interpretive test set; For the central site bases Replace them with the remaining three bases respectively. Three perturbation sequences are generated; among them, These are the three bases excluding the input genotype bases; The one-hot coding features and DNA shape coding features were calculated sequentially to obtain... , This represents the feature representation corresponding to the k-th input sample in the perturbation sample group; The perturbation sample group S is represented as: ,in, Input genotype.

9. The method for predicting trait genetic variation sites by integrating transfer learning and interpretable mechanisms according to claim 8, characterized in that, The steps for inputting the sample group into the self-fine-tuned model and constructing a four-dimensional evaluation system to assess the impact of bases on the prediction results include: The perturbation sample group S is input into a pre-trained deep learning model to obtain the classification probability output for each sample; wherein, the model outputs the probability for wild-type sequences as follows: , indicating that the input is a wild-type sequence When the model predicts the probability of y=1, y=1 indicates that the prediction result is positive. The output probabilities for the three mutant sequences are as follows: , , The effect value of the j-th base substitution is defined as: Effect size This is used to quantify the change in the probability of a deep learning model predicting the positive class after replacing wild-type bases with the j-th base; This represents the positive class prediction probability output by the deep learning model after the j-th mutant sequence is input into it; Calculate the average effect and effect variance, where: Average effect Represented as: ; effect variance Represented as: ; Construct a four-dimensional evaluation system that includes the maximum effect, average effect, effect variance, and attention mechanism weights; The maximum effect is expressed as: ; Based on weighted attribution, information from the four dimensions is integrated into a single comprehensive score S, denoted as: ; ; In the formula, Indicates the maximum effect. Indicates the average effect. Indicates the variance of the effect. Indicates the position of the center of the sequence. Attention weights; This represents the weight of dimension k. These represent the weights of different dimensions, used to integrate multi-dimensional factors.

Citation Information

Patent Citations

  • Primer group, probe group and kit for detecting high-frequency gene pathogenic variation

    CN113265461A

  • Method, device, equipment and medium for identifying key genes of biological complex characters

    CN120089193A