A method for rapid processing of HPV viral gene sequence data
By combining reinforcement learning-based bee colony optimization algorithms with deep learning, and employing an unstable attention mechanism and a weighted joint loss function, the high-dimensional redundancy and dynamic instability problems in HPV virus gene sequence data processing were solved. This enabled simultaneous and accurate identification of HPV subtype typing and mutation detection, improving the efficiency and accuracy of data processing.
Patent Information
- Application Number
- CN202511573963.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-10-31
AI Technical Summary
Existing technologies for processing HPV viral gene sequence data suffer from high-dimensional redundancy, dynamic instability, and low task coupling, failing to effectively address the issues of low feature screening efficiency, dynamic instability, and low task coupling, thus failing to meet clinical needs.
By combining reinforcement learning-based bee colony optimization algorithm with deep learning, and through an unstable attention mechanism and a weighted joint loss function, we can achieve simultaneous and accurate identification of HPV subtype typing and variant detection.
It enables a rapid, efficient, and interpretable processing workflow for HPV viral gene sequence data, improves feature screening, attention modeling, and multi-task optimization capabilities, and enhances the accuracy of molecular diagnosis and risk prediction for HPV-related tumors.
Smart Images

Figure CN121034415B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a rapid processing method for HPV virus gene sequence data. BACKGROUND
[0002] Human papillomavirus (HPV) is a class of DNA viruses with high genetic heterogeneity, which is closely related to the occurrence of various reproductive system tumors. Among them, high-risk types 16 and 18 HPV are considered to be the main pathogenic factors of cervical cancer. With the development of high-throughput sequencing technology, researchers can obtain HPV virus whole genome sequence, host transcriptome expression profile and its clinical pathological information, which provides rich data basis for virus typing, variation detection and infection mechanism research. However, HPV virus and host gene data have problems such as high dimension, strong heterogeneity and obvious dynamic non-stationarity. Traditional analysis methods have the following limitations:
[0003] (1) Low efficiency of feature selection and weak biological correlation: Traditional feature selection algorithms such as ReliefF and recursive feature elimination can select key variables through feature importance ranking, but they have low search efficiency and are prone to local optimization in high-dimensional space. For example, the traditional ReliefF algorithm needs to iterate for several hours to complete the screening of HPV-host joint features containing 50,000 dimensions, and the screening results often miss the functional features of key oncogenes such as E6 / E7, which greatly reduces the biological interpretability of subsequent modeling.
[0004] (2) Insufficient dynamic non-stationary mutation signal capture ability: Traditional attention mechanism (such as self-attention in Transformer) adopts a fixed weight allocation strategy, which can only capture the global association between sequences statically and cannot adapt to the dynamic changes of mutation signals: When E6 / E7 genes have short-term mutation peaks, the model cannot timely increase the attention weight of this area, resulting in key mutation signals being overwhelmed by stable signals in the conserved region; while in the conserved region, minor variations (such as synonymous mutations in L1 gene) are prone to over-attention to non-pathogenic signals, causing false positive detection results. This "static attention" mechanism is seriously mismatched with the "dynamic non-stationarity" characteristics of HPV mutations, which is a core obstacle to the accuracy of variation detection.
[0005] (3) The tasks of typing and variation detection are fragmented: HPV subtype identification and variation detection are two highly related tasks. However, existing models generally adopt a "task-fragmented" modeling approach: subtype typing models such as BLAST-based sequence alignment methods and support vector machine classification models only focus on global features of the virus genome (such as whole sequence homology), ignoring local variation information, which leads to the inability to distinguish the pathogenicity difference within the same subtype (such as HPV16 type, the carcinogenic risk of the strain containing E6 mutation is significantly higher than that of the wild type). Variation detection models: such as GATK, VarScan and other tools, need to rely on known subtype information to pre-limit the detection range. If the subtype information is not accurate, it will lead to an increase in the false positive rate of mutation detection (such as misjudging the unique sequence of HPV18 type as a mutation of HPV16 type). This "fragmented modeling" approach not only causes insufficient feature sharing during training (such as the virus genome features learned by the subtype typing model cannot be used for variation detection), but also produces redundant predictions (such as two models need to process the same batch of sequence data), ultimately leading to difficulty in improving the overall performance of the model (such as typing accuracy, variation detection sensitivity), and failing to meet the clinical demand for "subtype-variation" joint analysis.
[0006] Therefore, there is an urgent need for a HPV virus gene sequence rapid processing method that combines intelligent feature screening, dynamic attention, and task collaboration to achieve efficient extraction of high-dimensional features and accurate multi-task recognition. SUMMARY
[0007] The present application proposes a rapid processing method based on deep learning and reinforcement optimization fusion to address the problems of high-dimensional redundancy, dynamic instability, and low task coupling in existing HPV virus gene sequence data processing, aiming to improve the accuracy and biological interpretability of virus typing and variation detection.
[0008] To achieve the above-mentioned purpose, the following technical solutions are implemented:
[0009] The present application provides a rapid processing method for HPV virus gene sequence data, comprising the following steps:
[0010] Obtain HPV virus sequence data, host transcriptome data, and clinical association data and integrate them to form a comprehensive input matrix;
[0011] Perform feature screening on the comprehensive input matrix using a reinforcement learning-based bee colony optimization algorithm to obtain an optimal feature subset; wherein the bee colony optimization algorithm combines the global search of the bee colony algorithm with the dynamic decision mechanism of reinforcement learning, and uses virus subtype classification performance and mutation prediction accuracy as reward feedback to dynamically adjust the feature selection strategy;
[0012] The HPV subtype accurate typing and variation detection model based on multi-task deep learning is constructed, the optimal feature subset is deeply encoded and weighted fused through an unstable attention mechanism, and global feature representation capable of sensitively reflecting the key mutation region of the HPV sequence is generated; based on the global feature, the HPV subtype typing task and the virus variation detection task are simultaneously performed, and finally two key prediction results of subtype probability and mutation site probability are output.
[0013] Further, the swarm optimization algorithm based on reinforcement learning is specifically:
[0014] Each feature subset is regarded as a swarm search direction;
[0015] In each iteration, the performance of each feature subset is evaluated according to a fitness function, and the fitness function comprehensively considers the classification accuracy of the validation set, the mutation prediction error, and the biological correlation score based on the importance of biological pathways;
[0016] According to the fitness ranking, the feature subsets with low fitness are eliminated, the neighborhood around the feature subsets with high search fitness is copied and strengthened, and the retention or non-retention of the features is dynamically decided through the Q-learning strategy of reinforcement learning, and finally the optimal feature subset that maximizes the fitness function is output.
[0017] Further, the structure of the HPV subtype accurate typing and variation detection model comprises:
[0018] a feature encoder for encoding the input optimal feature subset;
[0019] an unstable attention mechanism module that receives the output of the feature encoder and dynamically adjusts the feature weights of different sequence positions, and by introducing a time stationarity control variable that is adaptively adjusted according to the fluctuation degree of the sliding window, the attention focus on the key gene fragment is automatically enhanced when the mutation peak value appears in the region;
[0020] a dual-task output layer that receives the global fused feature representation processed by the unstable attention mechanism module to simultaneously perform the HPV subtype typing task and the virus variation detection task.
[0021] Further, the working mode of the unstable attention mechanism module is:
[0022] The Prompt feature is calculated according to the optimal feature subset as the input of Query in the attention mechanism;
[0023] The time stationarity control variable and the offset correction vector are introduced to calculate the similarity between Query and Key; wherein the time stationarity control variable is obtained by calculating the average value of sequence signal fluctuations under different sizes of sliding windows;
[0024] The similarity after adjustment is normalized by a Softmax function to calculate attention weights, thereby realizing adaptive capture of non-stationary mutation signals.
[0025] The Value vector is weighted and summed according to the attention weights to calculate a weighted output feature, and the attention-weighted output features of all positions are averaged and pooled to form a global fusion feature representation, which is used for subsequent double-task prediction.
[0026] Further, the Prompt feature is calculated according to the optimal feature subset as the input of Query in the attention mechanism, comprising:
[0027] After normalizing the optimal feature subset to remove overall offset and capture sequence signal fluctuations, the Query input of the unstable attention is generated by combining the learnable scaling and offset parameters to adapt the dynamic distribution of different samples.
[0028] Further, the double-task output layer shares the global fusion feature, comprising:
[0029] The subtype typing head is composed of a fully connected layer connected with a Softmax function, and a Softmax classifier is used to predict the subtypes of HPV samples, outputting the probability distribution of all preset HPV subtypes and calculating the subtype classification loss.
[0030] The variant detection head is composed of a fully connected layer connected with a Sigmoid function, and a Sigmoid function is used to predict the position and type of gene mutation, outputting the probability of mutation at each site and calculating the variant detection loss.
[0031] Further, in the model training stage, the HPV subtype precise typing and variant detection model are optimized end-to-end by a weighted joint loss function to ensure that the two tasks promote each other and improve performance together.
[0032] The weighted joint loss function is the weighted sum of the subtype typing task loss, the variant detection task loss and the regularization term to realize the joint optimization of the two tasks.
[0033] Further, the weighted joint loss function is represented as:
[0034]
[0035] wherein, is the loss of the subtype typing task, is the loss of the variant detection task, L2 regularization term for model parameters, , and are corresponding weight coefficients, respectively.
[0036] The final optimization target is:
[0037]
[0038] wherein, is the optimal parameter set obtained after joint task optimization.
[0039] Further, the HPV virus sequence data includes whole genome sequences and gene fragment sequences, and is formed into an initial virus feature matrix through k-mer frequency coding and base physicochemical feature vectorization.
[0040] Further, the host transcriptome data is derived from RNA-Seq sequencing results of cervical tissue, and significant differential genes are screened through differential expression analysis to construct a host expression matrix.
[0041] Compared with the prior art, the present application has the following beneficial effects:
[0042] 1. The present application proposes a bee colony optimization algorithm (Bee-Q) based on reinforcement learning, which combines the global distributed search of the bee colony algorithm with the dynamic decision mechanism of reinforcement learning to realize intelligent exploration of the high-dimensional virus-host joint feature space. The Bee-Q algorithm introduces the Q-learning strategy and the reward feedback function, takes the virus subtype classification performance and the mutation prediction accuracy as the reward indicators, dynamically adjusts the feature selection strategy, thereby obtains the optimal feature subset, and realizes the rapid screening and biological significance enhancement of the feature subset.
[0043] 2. The present application designs an unstable attention mechanism, which is designed for the non-stationary mutation characteristics of HPV gene sequences. By introducing a time stationarity control variable and an offset correction vector in the similarity calculation, the attention weight is adaptively adjusted according to the fluctuation degree of the sliding window. When the E6 / E7 key gene fragment appears a mutation peak, the τ value automatically increases, and the model enhances the attention focus in this area, thereby effectively capturing the non-stationary genetic pattern and suppressing noise interference.
[0044] 3. The present application constructs a double-task output layer and designs a weighted joint optimization mechanism, constructs a double-task output layer composed of a subtype typing head and a variation detection head, uses a shared encoder to extract a unified feature representation, and respectively completes virus subtype identification and mutation type prediction. At the same time, a weighted joint loss function is designed to realize the joint optimization of the typing task and the mutation task, so that the model guarantees the classification accuracy while considering the mutation detection sensitivity and parameter stability.
[0045] Through the above-mentioned innovative design, the application realizes a fast, efficient and interpretable processing flow of HPV virus gene sequence data, has a breakthrough advantage in feature screening, attention modeling and multi-task optimization, and provides a new technical path for molecular diagnosis and risk prediction of HPV related tumors.
[0046] It should be understood that the content described in the summary section is not intended to define key or important features of the embodiments of the application, nor is it intended to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0047] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent by describing in detail the following embodiments with reference to the attached drawings. The attached drawings are intended to better understand the present application and do not limit the present application. In the drawings, the same or similar reference numerals refer to the same or similar elements, and:
[0048] Figure 1 is a flowchart of a fast processing method for HPV virus gene sequence data according to an embodiment of the present application;
[0049] Figure 2 is a flowchart of feature screening of a comprehensive input matrix by using a bee colony optimization algorithm based on reinforcement learning according to an embodiment of the present application;
[0050] Figure 3 is a structural diagram of an HPV subtype accurate typing and variation detection model according to an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0052] In addition, the term "and / or" herein is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0053] Figure 1 is a flowchart of a fast processing method for HPV virus gene sequence data according to an embodiment of the present application. As shown inFigure 1 As shown, the present application provides a rapid processing method 100 for HPV virus gene sequence data, including the following steps:
[0054] S110: Obtain HPV virus sequence data, host transcriptome data and clinical correlation data and integrate to form a comprehensive input matrix;
[0055] To achieve efficient processing of HPV virus and host genome correlation characteristics, this step integrates three types of core data sources to construct a unified input data .
[0056] (1) The source of HPV virus sequence data includes the whole genome sequence and gene fragment sequence (FASTA / FASTQ format) of different subtypes of HPV (such as high-risk types 16, 18 and low-risk types 6, 11). The characteristics include E6, E7 oncogene mutation sites, CpG island methylation patterns, and L1 / L2 gene conservation region alignment scores. The initial virus feature matrix is formed by using k-mer (short sequence fragment) frequency coding and base physicochemical feature vectorization (such as GC content, entropy) . Among them, the k value in k-mer frequency coding is an integer between 3 and 7, preferably k = 5.
[0057] (2) The host transcriptome data is derived from the RNA-Seq sequencing results (FPKM expression matrix) of cervical adenocarcinoma and normal tissues adjacent to the cancer. By differential expression analysis (DESeq2), significant differential genes (DEGs) are screened out to construct the host expression matrix . Among them, the differential expression analysis uses DESeq2 software package, and the standard for screening significant differential genes is: the adjusted p value is less than 0.05, and the absolute log2 fold change (|log2FoldChange|) is greater than 1.
[0058] (3) The clinical correlation data includes patient infection subtypes, pathological stages (Stage I-IV), treatment responses (PR, CR, PD), and follow-up survival periods, etc. clinical labels to construct a clinical feature matrix .
[0059] Then, the clinical feature matrix is mapped to the HPV sequence and host transcriptome data through unified sample ID mapping to form a comprehensive input matrix X:
[0060]
[0061] Among them, X is the input matrix; represents the feature splicing operation; is the initial virus feature matrix; is the host expression matrix; is a clinical feature matrix.
[0062] S120: The comprehensive input matrix is subjected to feature screening by using a bee colony optimization algorithm based on reinforcement learning to obtain an optimal feature subset; wherein the bee colony optimization algorithm combines global search of a bee colony algorithm and dynamic decision mechanism of reinforcement learning, and takes virus subtype classification performance and mutation prediction accuracy as reward feedback to dynamically adjust a feature selection strategy;
[0063] To cope with the characteristics of high dimension and strong correlation between HPV virus sequences and host transcriptome features, the bee colony optimization algorithm (Bee-Q) based on reinforcement learning is proposed in this step S120 to realize rapid screening and biological significance enhancement of the feature subset. Bee-Q combines the global distributed search capability of the bee colony algorithm and the dynamic decision and reward feedback mechanism of reinforcement learning. When searching in a high-dimensional biological feature space, each bee colony represents a feature subset search direction, which is continuously optimized by the Q-learning strategy of the agent to improve the screening efficiency and feature representativeness.
[0064] Figure 2 is a flowchart of the feature screening of the comprehensive input matrix by using the bee colony optimization algorithm based on reinforcement learning in the embodiment of the application. As shown in Figure 2 , specifically, the bee colony optimization algorithm based on reinforcement learning is specifically:
[0065] S121: Each feature subset is regarded as a bee colony search direction;
[0066] S122: In each iteration, the performance of each feature subset is evaluated according to an adaptability function, and the adaptability function comprehensively considers the classification accuracy of the validation set, the mutation prediction error, and the biological correlation score (BioScore) based on the importance of biological pathways;
[0067] Wherein, the agent selects an action (i.e. whether to retain the feature) in the tthiteration, and the bee colony with the lowest adaptability is eliminated in each iteration; the feature subset of the bee colony with the highest adaptability is copied; the search range of the neighborhood thereof is strengthened to ensure the diversity of feature distribution. The virus subtype classification performance is taken as reward feedback :
[0068]
[0069] Wherein, : reward feedback; : validation set classification accuracy, used to measure the subtype discrimination ability; : virus mutation frequency prediction error; : Biological relevance score, calculated based on the weights of pathways such as E6 / E7 and p53 corresponding to the feature; α, β, λ: weight hyperparameters, used to balance model performance and biological significance, and satisfy α + β + λ = 1, α, β, λ are all greater than 0. In the preferred embodiment, α = 0.5, β = 0.3, λ = 0.2.
[0070] The BioScore is the core reward that drives feature selection towards biologically significant aspects. The BioScore is calculated as follows: A database of gene pathways related to HPV carcinogenicity is pre-constructed, containing at least key pathways such as the E6 / p53 and E7 / pRb pathways, along with their respective gene sets. For the feature subset... For each feature, if the corresponding gene is located in any of the above pathways, it scores 1 point; otherwise, it scores 0 points. BioScore is a subset of features. The sum of scores of all features (i.e., feature subset) BioScore is the ratio of the number of features belonging to predefined critical pathways in the feature subset to the total number of features in that subset. Specifically, BioScore = (number of features belonging to predefined critical pathways in the feature subset) / .
[0071] In bee colony optimization algorithms, multiple candidate feature subsets are maintained and iterated simultaneously. (For example, there are C=20 feature subsets in total), where c represents different subsets, such as bee colony 1, bee colony 2, ..., bee colony C. The value of c is the number of bee colonies.
[0072] Each bee colony corresponds to a feature subset. Its colony adaptability Defined as:
[0073]
[0074] This represents the average reward for the subset in the classification task. A subset size penalty term (to encourage the simplification of feature sets); , These are weighting factors used to balance performance and size, typically... >> For example, preferred =0.8, =0.2.
[0075] In step S122, the specific implementation process of the Q-learning strategy for reinforcement learning is as follows: For each feature subset... binary representation, where 1 represents retaining the feature and 0 represents eliminating it as a state; the action of the agent is to flip the value of a bit in the state, i.e., to add or delete a feature; the Q-table is used to store the long-term value expectation of performing a specific action in a specific state.
[0076] S123: According to the fitness ranking, eliminate the feature subset with low fitness, copy and strengthen the neighborhood around the feature subset with high fitness, and dynamically decide whether to retain the feature through the Q-learning strategy of reinforcement learning, and finally output the optimal feature subset that maximizes the fitness function.
[0077] In this step S123, the search range of the neighborhood around it is strengthened, which specifically means that the binary representation of the feature subset with the highest fitness (leading bee) is randomly selected to flip a certain proportion (e.g., 10%-20%) of bits, generating a new candidate feature subset (following bee), thereby simulating the process of local exploration around the excellent solution.
[0078] The final output of the optimal feature subset maximize the performance of HPV subtype classification and variation detection, retain key virus-host interaction pathway features (such as the E6 / p53 pathway and the E7 / pRb pathway), and reduce redundant gene expression features, whose expression is:
[0079]
[0080] wherein, : The final output of the optimal feature subset, which comprehensively evaluates the performance of the feature set in terms of classification accuracy, stability, and biological interpretability. : Fitness of the bee colony.
[0081] S130: Construct a HPV subtype accurate typing and variation detection model based on multi-task deep learning, which encodes and weights the optimal feature subset through an unstable attention mechanism to generate a global feature representation that can sensitively reflect the key mutation regions of HPV sequences; based on this global feature, perform the HPV subtype classification task and virus variation detection task simultaneously, and finally output two key prediction results: subtype probability and mutation site probability.
[0082] After completing the feature selection in step S120, the high-dimensional optimal feature subset is input into the constructed HPV subtype accurate typing and variation detection model, wherein the optimal feature subset The k-mer structure characteristics of HPV virus sequences, host gene expression signals, and clinical state characteristics. This step S130 aims to establish a deep neural network with multi-task processing capability to realize simultaneous learning of subtype typing and variation detection.
[0083] Figure 3 is a structural diagram of the HPV subtype precise typing and variation detection model of the embodiment of the present application. As shown in Figure 3 , the structure of the HPV subtype precise typing and variation detection model based on multi-task deep learning includes:
[0084] (1) a feature encoder for encoding the input optimal feature subset;
[0085] In an embodiment of the present application, the feature encoder can be composed of a multi-layer perception. In a preferred embodiment, the feature encoder includes two fully connected layers, wherein the first layer uses a ReLU activation function and the second layer uses a linear activation. Its role is to map the input high-dimensional features to a more representative hidden space.
[0086] (2) an unstable attention mechanism module that receives the output of the feature encoder and dynamically adjusts the feature weights of different sequence positions, and by introducing a time stationarity control variable that is adaptively adjusted with the fluctuation degree of the sliding window, when a mutation peak occurs in a key gene fragment, the attention focus on this region is automatically enhanced.
[0087] To capture the non-stationary mutation signal in the HPV gene sequence (such as short-term fluctuations of E6 / E7 gene mutations), an unstable attention mechanism is introduced, which dynamically adjusts the feature weights of different sequence positions. The working mode of the unstable attention mechanism module is:
[0088] 2.1 Calculate Prompt features according to the optimal feature subset as the input of the attention mechanism Query;
[0089] Query generation: first, normalize the encoded feature sequence (Layer Normalization), and introduce learnable parameters γ and δ for scaling and shifting to generate dynamic Prompt features , and then obtain the Query vector Q through linear transformation.
[0090] Specifically, the Prompt features are calculated according to the optimal feature subset After normalization processing, removing overall offset and capturing sequence signal fluctuation, the Query input of unstable attention is generated by combining the learnable scaling and offset parameters to adapt the dynamic distribution of different samples. :
[0091]
[0092] : the optimal feature subset obtained after step S120; : the mean value in the sample sequence position dimension, used to remove overall offset; : sequence position variance, used to capture sequence signal fluctuation; : a small constant to prevent the denominator from being zero; 、 : learnable scaling and offset parameters, used to adapt the dynamic distribution of different samples; : the Prompt feature generated after normalization, used to construct the Query input of unstable attention , the expression of which is:
[0093]
[0094] 2.2 Introduce a time stationarity control variable and an offset correction vector to calculate the similarity of Query and Key; wherein the time stationarity control variable is obtained by calculating the average value of sequence signal fluctuation under different size sliding windows;
[0095] In the embodiment of the application, when calculating the similarity of Query and Key , a time stationarity control variable is introduced. Wherein, The calculation method is: taking position i as the center, respectively taking sliding windows with lengths of 5, 15 and 30 bases, calculating the standard deviation of features in each window 、 、 , and then calculating the arithmetic mean value. In this way, when the model detects that the volatility of a certain region (such as E6 / E7 gene) increases dramatically, the value of can be automatically increased, and the attention to the segment can be enhanced.
[0096] Specifically: the dynamic attention weight is calculated by adding a time stationarity control variable and an offset correction vector, so as to realize dynamic adjustment of attention with sequence position:
[0097]
[0098] Wherein, : These are the Query and Key vectors for the i-th and j-th sequence positions, respectively; The similarity metric between the query and the key is used to measure the degree of feature association between different sequence positions. Attention feature dimension; The offset correction term is a learnable scalar parameter whose initial value is based on the relative distance between sequence positions i and j. The settings are configured and optimized using gradient descent during model training to capture the positional offset of mutation points relative to the main sequence region. : Control variables, defined by stability indices for different windows, representing the mean volatility of the HPV gene sequence under different sliding windows (e.g., 5, 15, 30 base sliding windows). When a mutation peak occurs in the E6 / E7 gene segment, As the area increases, the system automatically enhances the attention response in that area.
[0099]
[0100] The standard deviation calculated using a 5-base sliding window is used to capture short-range mutations or minor structural variations. Standard deviation calculated using a 15-base window is used to reflect the mid-range mutation trend (such as local instability of repeat or deletion regions). The standard deviation calculated using a 30-base window characterizes the long-term fluctuation characteristics within larger gene segments (such as L1 and L2 regions).
[0101] Among them, in calculating the time stationarity control variables The sliding window moves across the sequence using a center-aligned method. For positions at the ends of the sequence that do not meet the full window size, zero-padding or repeated boundary values are used to fill the gaps, ensuring that the corresponding values at all positions i can be calculated. value.
[0102] According to the above embodiments of the present invention, a time stationarity control variable is introduced. Attention mechanisms can dynamically adapt to the non-stationary mutation characteristics of HPV gene sequences. When key gene segments such as E6 / E7 experience short-term mutation peaks, The value automatically increases, thereby significantly increasing the proportion of the region in the attention weight, effectively solving the technical problem in the background technology that "the static attention mechanism cannot increase the weight of key regions in time, resulting in the key mutation signal being submerged".
[0103] 2.3 Attention weights are calculated based on the adjusted similarity to achieve adaptive capture of non-stationary abrupt change signals.
[0104] Specifically, the similarity after adjustment is normalized by the Softmax function, and the attention weight is calculated by the following formula:
[0105]
[0106] wherein, : attention weight, which makes the model focus on the high volatility segment (such as mutation site) and suppress the response in the stable segment (such as the conservative area), thereby improving the sensitivity to non-stationary genetic characteristics, : normalization function, which maps the prediction result to probability distribution.
[0107] 2.4 According to the attention weight The weighted sum of the Value vector V is calculated to obtain the weighted output feature , which is the attention-weighted output feature of all positions After average pooling, the global fusion feature representation is formed , which is used for the subsequent step (3) of double-task prediction, wherein, The expression is:
[0108]
[0109] wherein, : attention-weighted output feature, representing the comprehensive biological characterization of the HPV gene sequence at the i-th position, which is used to capture local mutation signals and context-dependent relationships. : Value vector, corresponding to the feature representation of Key, containing local context information (such as base mutation pattern, GC content, segment stability, etc.) extracted by the encoder. L: total length of HPV gene sequence (i.e. number of bases in input sequence), used to control the range of attention weight and feature aggregation. : global fusion feature representation, obtained by averaging all , containing the comprehensive features of HPV sequence global structure and local mutation, which is used for subsequent subtype typing and variation detection double-task output layer.
[0110] (3) Double-task output layer, which receives the global feature representation processed by the unstable attention mechanism module, to simultaneously perform HPV subtype typing task and virus variation detection task.
[0111] wherein, the double-task output layer shares the global fusion feature , including: a subtype typing head composed of a fully connected layer connected with a Softmax function, which uses a Softmax classifier to predict the subtype of HPV sample, outputting the probability distribution of all preset HPV subtypes and calculate the subtyping loss; a variant detection head composed of a fully connected layer followed by a Sigmoid function, which predicts the location and type of gene mutation, outputs the probability of each site being mutated and calculate the variant detection loss. Both the subtyping head and the variant detection head share the fusion feature vector obtained above , realizing joint learning of HPV gene sequence subtyping and mutation prediction. Specifically:
[0112] 3.1 Constructing the subtyping head:
[0113] Using a Softmax classifier to predict the subtype of the HPV sample:
[0114]
[0115] wherein, : the global fusion feature vector after attention weighting and average pooling, containing high-dimensional semantic and fluctuation feature information of the HPV sequence; : the learnable weight matrix of the subtyping classification layer, which projects the feature space to the class probability space; : the bias term of the subtyping classification layer, used for offset adjustment after linear transformation; : the output HPV subtype probability distribution vector, such as HPV16, HPV18, HPV52, HPV58, etc.; its corresponding loss function is defined as cross-entropy loss:
[0116]
[0117] wherein, M: the number of subtypes (i.e. the number of HPV types); : one-hot encoding of the true label; : the probability of the mth class predicted by the model; : the classification error of the subtyping task, used to measure the difference between the model prediction and the true label.
[0118] 3.2 Constructing the variant detection head:
[0119] The variant detection head is constructed to predict the location and type (SNV / InDel) of gene mutation:
[0120]
[0121] wherein, : the weight matrix of the variant detection layer, which maps the fusion feature to the mutation detection space; : the bias term of the variant detection layer; : the Sigmoid function, which limits the output to interval, for multi-label mutation prediction; : predicted mutation probability vector, corresponding to the possibility of each site existing mutation (1) or non-mutation (0).
[0122] The loss function of variant detection is binary cross-entropy loss:
[0123]
[0124] Wherein, N: the number of mutation sites or the total number of samples; : the nth mutation label (0 or 1); : the mutation probability of the nth site predicted by the model; : mutation detection error, used to measure the accuracy of the model's mutation prediction.
[0125] Further, in the model training stage, a weighted joint loss function is used to optimize the HPV subtype accurate typing and variant detection model end-to-end, ensuring that the two tasks promote each other and improve the performance together.
[0126] Wherein, the weighted joint loss function is the weighted sum of the subtype typing task loss, the variant detection task loss and the regularization term, to realize the joint optimization of the two tasks. Specifically, the weighted joint loss function is represented as:
[0127]
[0128] Wherein, : total loss function, jointly optimizing the subtype typing and variant detection tasks; is the loss of the subtype typing task, is the loss of the variant detection task; : network parameters L2 norm penalty term of : the set of all trainable parameters in the model; : typing task weight coefficient, used to adjust the influence proportion of subtype classification in joint optimization; : variant detection task weight coefficient, used to balance the loss contribution of the two tasks; : L2 regularization coefficient, used to constrain the network parameter size to prevent overfitting. In a specific embodiment, the weight coefficients are set as = 0.6, = 0.4, = 0.001. By gradient descent algorithm to minimize the total loss, the model parameters are optimized, and finally the model that can complete typing and variant detection with high precision is obtained.
[0129] The final optimization goal is:
[0130]
[0131] wherein, is the optimal parameter set obtained after joint task optimization.
[0132] The optimization process is realized by gradient descent and back propagation algorithm, so that the model reaches the optimal performance in both HPV subtype identification and mutation detection.
[0133] According to the above-mentioned embodiment of the application, the method for rapid processing of HPV virus gene sequence data is realized by using the swarm optimization algorithm based on fusion reinforcement learning, intelligent exploration and efficient screening of high-dimensional virus-host joint feature space are realized, and the feature dimension is significantly reduced under the premise of ensuring biological significance. By designing an unstable attention mechanism, introducing a time stationarity control variable that is adaptively adjusted with sequence fluctuations, dynamic focusing on key gene fragment mutation peaks such as E6 / E7 is realized, and non-stationary genetic patterns are effectively captured. Through double-task joint optimization, shared coding features and weighted loss functions, synchronous and accurate identification of HPV subtype typing and variation detection is realized. Finally, the application realizes efficient processing of HPV virus data, sensitive detection of key mutation signals, and accurate implementation of typing-variation joint analysis, providing a new technical path for molecular diagnosis of HPV-related tumors.
[0134] It should be noted that the embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other.
[0135] It should also be noted that the relationship terms such as first and second in the embodiments of the present application are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or equipment including the element.
[0136] The above description of disclosed embodiments enables one of ordinary skill in the art to make or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for fast processing of HPV viral gene sequence data, characterized in that, The method comprises the following steps: integrate HPV virus sequence data, host transcriptome data and clinical correlation data to form a comprehensive input matrix; perform feature selection on the comprehensive input matrix by using a reinforcement learning-based bee colony optimization algorithm to obtain an optimal feature subset; wherein the bee colony optimization algorithm combines global search of a bee colony algorithm with dynamic decision mechanism of reinforcement learning, takes virus subtype classification performance and mutation prediction accuracy as reward feedback, and dynamically adjusts feature selection strategy; construct an HPV subtype accurate typing and variation detection model based on multi-task deep learning, perform deep coding and weighted fusion on the optimal feature subset through an unstable attention mechanism to generate global feature representation capable of sensitively reflecting key mutation regions of HPV sequence; simultaneously perform HPV subtype typing task and virus variation detection task based on the global feature, and finally output two key prediction results of subtype probability and mutation site probability; wherein the structure of the HPV subtype accurate typing and variation detection model comprises: a feature encoder for encoding the input optimal feature subset; an unstable attention mechanism module receiving output of the feature encoder and dynamically adjusting feature weights of different sequence positions, and introducing a time stationarity control variable adaptively adjusted according to sliding window fluctuation degree to automatically enhance attention focusing on the region when a mutation peak value occurs in the key gene fragment; a double-task output layer receiving global fusion feature representation processed by the unstable attention mechanism module to simultaneously perform HPV subtype typing task and virus variation detection task; wherein the working mode of the unstable attention mechanism module is: calculate Prompt features according to the optimal feature subset as input of Query in the attention mechanism, including: after normalizing the optimal feature subset to remove overall offset and capture sequence signal fluctuation, combining learnable scaling and offset parameters to adapt dynamic distribution of different samples to generate Query input of the unstable attention; introduce a time stationarity control variable and an offset correction vector to calculate similarity of Query and Key; wherein the time stationarity control variable is obtained by calculating average value of sequence signal fluctuation under different size sliding windows; normalize the adjusted similarity by using a Softmax function to calculate attention weight, thereby realizing adaptive capture of non-stationary mutation signals; weight sum Value vectors according to the attention weight to calculate weighted output features, and form global fusion feature representation by average pooling of all position attention weighted output features, which is used for subsequent double-task prediction.
2. The method of claim 1, wherein, wherein, the reinforcement learning-based bee colony optimization algorithm is specifically: regard each feature subset as a bee colony search direction; in each iteration, evaluate performance of each feature subset according to an adaptability function, which comprehensively considers validation set classification accuracy, mutation prediction error and biological correlation score based on biological pathway importance; According to the fitness ranking, the feature subset with low fitness is eliminated, the neighborhood around the feature subset with high fitness is copied and strengthened, and the retention or non-retention of the features is dynamically decided through the Q-learning strategy of reinforcement learning, and finally the optimal feature subset maximizing the fitness function is output.
3. The method of claim 1, wherein, Wherein, The dual-task output layer shares the global fusion features, and comprises: The subtype typing head is composed of a fully connected layer connected with a Softmax function, and a Softmax classifier is used to predict the subtypes of the HPV sample, and the probability distribution of all preset HPV subtypes is output and calculate the subtype classification loss. The variant detection head is composed of a full connection layer and a sigmoid function, the sigmoid function is used to predict the position and type of gene mutation, and the probability of mutation of each site is output and calculates the variant detection loss.
4. The method of claim 3, wherein, In the model training stage, the HPV subtype precise typing and variation detection model is optimized end-to-end through a weighted joint loss function, so as to ensure that the two tasks promote each other and improve the performance together. Wherein, the weighted joint loss function is a weighted sum of the subtype typing task loss, the variation detection task loss and the regularization term, so as to realize the joint optimization of the two tasks.
5. The method of claim 4, wherein, The weighted joint loss function is expressed as: wherein, is the loss for the subtyping task, is the loss for the variant calling task, is the L2 regularization term for the model parameters, , and are the corresponding weight coefficients, respectively. The final optimization goal is: wherein, is the optimal parameter set obtained after joint task optimization.
6. The method of claim 1, wherein, Wherein, The HPV virus sequence data includes whole genome sequence and gene fragment sequence, and is formed into an initial virus feature matrix through k-mer frequency coding and base physicochemical feature vectorization.
7. The method of claim 1, wherein, Wherein, The host transcriptome data is derived from the RNA-Seq sequencing result of cervical tissue, and the significantly differentially expressed genes are screened out through differential expression analysis to construct a host expression matrix.
Citation Information
Patent Citations
Method for improving evaluation accuracy of various indexes of non-neoplastic diseases of stomach in histopathological image based on multi-task learning model
CN120411019A
Pomegranate disease detection method based on deep learning
CN120853020A