A genome variation detection method and system based on few-shot learning
By combining the genome variation detection method of few-sample learning, adaptive memory module, supervised contrastive learning and orthogonal migration module, the problems of insufficient detection accuracy and robustness in the existing technology are solved, and efficient genome variation detection is achieved in the few-sample scenario.
Patent Information
- Application Number
- CN202510076029.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Existing genomic variation detection methods have difficulty in effectively incorporating external knowledge in few-shot learning scenarios, resulting in insufficient detection accuracy and robustness, especially when processing complex biomedical text data.
A genomic variation detection method that combines few-shot learning, adaptive memory module, supervised contrastive learning module and orthogonal migration module is adopted. Through data preprocessing, adaptive memory, supervised contrastive learning and orthogonal migration, the model is optimized to improve detection accuracy and robustness.
It significantly improves the accuracy and robustness of genomic variation detection under few-sample conditions, can effectively capture complex semantic information, and enhance the generalization ability and detection accuracy of the model.
Smart Images

Figure CN119993261B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing and biomedical information extraction and analysis, and in particular to a genome variation detection method and system based on few-sample learning. Background Art
[0002] The detection and analysis of genomic variation is a core issue in modern biomedical research and clinical diagnosis. With the rapid development of genomics, precision medicine, and big data technologies, especially the rapid growth of genomic data, clinical data, and academic literature, the efficient identification and processing of key information within this complex textual data has become a major challenge. The timely discovery and accurate detection of genomic variation is crucial for early disease diagnosis, personalized treatment plans, and patient prognosis assessment, helping to improve treatment outcomes and reduce treatment risks.
[0003] Early genomic variation detection relied on expert experience and manual analysis. Although this method can ensure a certain degree of accuracy, it is time-consuming and labor-intensive, and is easily affected by expert subjectivity and cannot handle massive amounts of genomic data.
[0004] In recent years, the rise of deep learning technology has brought new solutions to genomic variant detection. Models such as deep neural networks (DNNs), convolutional neural networks (CNNs), and recurrent neural networks (RNNs) can automatically learn and extract complex features from data, thereby capturing latent semantic connections within text and improving detection accuracy and efficiency. In particular, pre-trained language models based on self-attention mechanisms (such as BERT and BioBERT) have demonstrated remarkable capabilities in processing biomedical text. Through large-scale pre-training, these models are able to capture the complex relationships between genetic variants and relevant clinical information.
[0005] Although deep learning has made significant progress in genomic variant detection, several challenges remain. Existing models mostly focus on analyzing internal features in text, neglecting the inclusion and integration of external knowledge. However, genomic variant detection requires not only identifying entities within text but also understanding the relationships between these entities and their biomedical context. Therefore, relying solely on text data for detection is insufficient to fully improve detection accuracy and robustness, especially in few-shot learning scenarios.
[0006] Based on this, how to effectively combine external knowledge in genomic variation detection and use deep learning technology to comprehensively improve the model's understanding and reasoning ability of complex semantic information has become a technical problem that needs to be solved urgently in this field. Summary of the Invention
[0007] In view of this, the present invention provides a genome variation detection method and related system that combines few-shot learning, an adaptive memory module, a supervised contrastive learning module, and an orthogonal migration module. The method aims to improve the accuracy and robustness of genome variation detection through the optimization of supervised contrastive learning and orthogonal migration as well as deep learning technology, effectively combine external knowledge and efficient model optimization, and realize efficient and precise gene variation detection.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] A genome variation detection method based on few-shot learning includes the following steps:
[0010] Constructing a genome variation detection model for few-shot learning, the genome variation detection model comprising a data preprocessing module, an adaptive memory module, a supervised contrastive learning module, an orthogonal migration module, and a decoding module;
[0011] The data preprocessing module is used to extract the location information and span information of the genomic variation entities in the text related to the genomic variation to be analyzed, and map each word in the text into a vector representation of a fixed dimension through a pre-trained language model to generate a word embedding matrix;
[0012] The adaptive memory module is used to calculate and update the memory state by performing weighted summation on the input features, and output the adaptive memory update feature;
[0013] The supervised contrastive learning module is used to generate contrastive learning optimization features under few-sample conditions by using a contrastive learning strategy and based on the positive sample pairs and negative sample pairs in the adaptive memory update feature;
[0014] The orthogonal migration module is used to receive contrastive learning optimization features, optimize feature space through orthogonal constraints, and output orthogonal constraint optimization features;
[0015] The decoding module is used to fuse the contrastive learning optimization features output by the supervised contrastive learning module and the orthogonal constraint optimization features output by the orthogonal migration module to generate the final genome variation detection results;
[0016] The constructed genome variation detection model is trained, and the trained genome variation detection model is used to complete genome variation detection.
[0017] Preferably, the data preprocessing in the data preprocessing module specifically includes:
[0018] S11: Extract genomic variant entities from the text, mark their starting and ending positions in the text, and generate entity position span information [start i ,endi ], where start i and end i Represent the starting and ending indexes of the i-th entity respectively;
[0019] S12: Based on the marked entity positions, calculate the position span information of each entity and encode it; at the same time, assign relevant category information C to each entity i , where C i represents the category of the i-th entity;
[0020] S13: Convert the extracted entity position span information and category information into matrix representations respectively;
[0021] S14: Based on the entity position span information, the entities in the text are combined with their corresponding context information to generate the entity feature embedding matrix E.
[0022] Through the position span information, the preprocessing module in the genomic variation detection model can extract the corresponding entity vocabulary and its adjacent context information from the original text, thereby generating the entity feature embedding matrix E.
[0023] Preferably, the adaptive memory module outputs the adaptive memory update feature, specifically comprising the following steps:
[0024] S21: Input the entity embedding matrix E into the adaptive memory module and use the attention mechanism to generate the context vector c t ;
[0025] S22: Use a gating mechanism to control the dynamic update of new information and memory matrix;
[0026] S23: through the gate vector g t Update the memory matrix to get a new memory matrix M t+1 :M t+1 =g t c t +(1-g t )·M t ;
[0027] where · represents element-wise multiplication, g t is the gate control vector, c t is the context vector generated by the attention mechanism, M t ∈R m×d is the memory matrix at time step t;
[0028] S24: Using the updated memory matrix M t+1 The input embedding matrix E is refined to obtain the refined embedding feature E'=Attention(E,M t+1 ,θ'attn ), and as the adaptive memory update feature output by the adaptive memory module, where θ' attn Indicates the updated memory M t+1 Parameters of the attention mechanism integrated with the input embedding E, where E represents the embedding matrix.
[0029] The adaptive memory module strengthens the model's ability to handle long-distance dependencies by dynamically storing and updating contextual information, helping the model to retain key information in a few-sample learning environment.
[0030] Preferably, in the supervised contrastive learning module, a contrastive learning strategy is used to generate contrastive learning optimization features under few-sample conditions based on positive sample pairs and negative sample pairs in the genomic variation data to be analyzed, specifically including:
[0031] S31: Refine the embedding feature E i 'As input; each feature vector e' i For a labeled sample, use the label set Y = {y1,y2,…,y n} means, where y i is the category label of the i-th sample;
[0032] S32: For labeled samples e' i , define the same category label y i =y j Sample pairs (e' i ,e' j ) is a positive sample pair, and sample pairs of different categories are negative sample pairs;
[0033] Assume that the positive sample set is p(i) and the negative sample set is A(i), that is: P(i) = {j|y i =y j ,j≠i},A(i)={j|y i ≠y j}, where e' i Represents the feature vector of the i-th sample, which comes from the output of the adaptive memory module, y i is the category label of the i-th sample, p(i) is the positive sample set, including all i The sample index of the same category, A(i) is the negative sample set, including all samples with the same category as e' i Sample indexes of the same category;
[0034] S33: Construct a supervised contrast loss function to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs. The supervised contrast loss function is:
[0035]
[0036] Where I represents the sample set; sim() represents the cosine similarity function; τ is the temperature parameter, which is used to adjust the smoothness of the similarity distribution and is usually a positive value less than 1; exp is an exponential function, which is used to amplify the effect of similarity; |P(i)| usually represents the size of the positive sample set p(i), which is used to normalize the positive sample pairs;
[0037] S34: By minimizing the supervised contrast loss L SCL , optimize the feature representation and generate the feature embedding representation E' optimized by contrastive learning SCL , and as the contrastive learning optimization feature output by the supervised contrastive learning module, the feature embedding representation E' SCL The specific expression is:
[0038] E' SCL,i =Refine(e' i ,L SCL θ SCL );
[0039] Among them, θ SCL is the parameter of the supervised contrastive learning module, E' SCL It is the embedding representation optimized by contrastive learning, and Refine represents the function for optimizing features.
[0040] Preferably, the orthogonal transfer module in the method of the present invention can realize efficient cross-task knowledge transfer by utilizing the orthogonal constraint mechanism, specifically including:
[0041] S41: Embed the features optimized by contrastive learning into E' SCL As input, where E' SCL ={e' SCL,1 ,e' SCL,2 ,…,e' SCL,n};
[0042] S42: Embed the features optimized by contrastive learning into E' SCL Projected into the shared latent space, the orthogonal transformation matrix W is used for projection, and the transformed feature vector Z i The calculation formula is: i =We' SCL,i , where W is an orthogonal matrix with dimension d×d, d is the dimension of the eigenvector, satisfying WW T =I,Z i is the feature representation after projection, e' SCL,i represents the i-th eigenvector after supervised contrastive learning optimization;
[0043] In the above steps, the orthogonality constraint is maintained by the following regularization term:
[0044]
[0045] Among them, ||·|| F represents the Frobenius norm; L orth is the orthogonality constraint loss, used to constrain W to maintain orthogonality; I is the identity matrix with dimension d×d;
[0046] In the above steps, the total loss function L is defined, and the task-specific loss L task With the orthogonality constraint loss L orth Combination: L = L task +λL orth , where λ is a hyperparameter that balances the two losses; L is the total loss function, L task is a task-specific loss function; L orth It is an orthogonal constraint loss function that effectively transfers knowledge while maintaining feature independence by minimizing L.
[0047] S43: The feature Z after orthogonal projection i The orthogonal constrained optimization features are the output of the final orthogonal migration module.
[0048] The orthogonal transfer module ensures knowledge sharing between different tasks while avoiding interference between tasks by imposing orthogonal constraints.
[0049] Preferably, the decoding module is used to fuse the contrastive learning optimization features output by the supervised contrastive learning module and the orthogonal constraint optimization features output by the orthogonal transfer module, specifically including:
[0050] S51: Input the orthogonal constraint optimization feature Z obtained after processing by the orthogonal migration module into the joint learning framework; Z={z1,z2,…,z n}, where z i is the feature vector of the i-th entity;
[0051] S52: Use the joint learning framework to optimize the contrastive learning feature E' output by the supervised contrastive learning module SCL , fused into Z to comprehensively utilize the information learned from different modules. The fused feature representation F is calculated as follows:
[0052] F=Z+E' SCL ;
[0053] Where F represents the final entity feature vector, Z is the feature representation after processing by the orthogonal migration module, and E' SCL is the optimized feature obtained from the adaptive memory module and the supervised contrastive learning module
[0054] S53: Input the fused feature representation F into the linear classifier W cls In the example, the entity category label is predicted by the Softmax function Among them, W cls is the weight matrix of the classifier, b cls is the bias vector, is the predicted entity category, and F is the fused feature representation;
[0055] S54: Define the cross entropy loss function L for the classification task ent , used to optimize the accuracy of entity recognition: Among them, y i is the true label, is the predicted probability, N is the number of samples;
[0056] S55: By minimizing the loss function L ent , optimize the parameters of the entire model and finally output the predicted genomic variant entity category.
[0057] The decoding module in this paper integrates the output features of the adaptive memory module, the supervised contrastive learning module, and the orthogonal transfer module, using a joint learning strategy to simultaneously optimize the small-sample entity recognition task. Through collaborative optimization, the genomic variation detection model based on few-shot learning can ultimately generate genomic variation detection results.
[0058] Preferably, the text related to the genomic variation to be analyzed is obtained by the following steps:
[0059] Collect text data related to the genomic variation to be detected from genomic databases (such as tmVar, BRONCO, EMU, etc.) and public scientific research literature.
[0060] Preferably, the above method also includes a comprehensive testing and evaluation of the model after completing the training of the genomic variation detection model. The testing process uses an independent test set, and the evaluation indicators include accuracy, recall, F1 value and other evaluation indicators for comprehensive analysis. By adjusting the key hyperparameters in the model (such as the number of memory slots of the adaptive memory module, the temperature coefficient of the supervised contrastive learning module, the regularization coefficient of the orthogonal migration module, etc.), the model performance is optimized. Further combining the output features of the adaptive memory module, the supervised contrastive learning module and the orthogonal migration module, the detection accuracy and generalization ability of the model under the condition of few samples are improved.
[0061] The optimized model can accurately identify variant entities in complex genomic variation texts, providing reliable technical support for clinical diagnosis and genomics research.
[0062] Preferably, the specific rules for improving the model using the AdamW optimization algorithm are:
[0063]
[0064] Among them, m t 、v t are the estimated values of the first-order moment and the second-order moment respectively; β1 and β2 are the attenuation factors of the first-order moment and the second-order moment, usually β1 = 0.9 and β2 = 0.999; θ L(θ t ) represents the gradient of the loss function L with respect to the model parameter θ; η is the learning rate, which is usually set to a small value, such as η = 1e-4; and ε is a small constant to prevent division by zero, usually set to ε = 1e-8; θ t+1 The optimized model parameters are updated. This optimization algorithm adaptively adjusts the learning rate and combines first-order and second-order moment estimation to efficiently update parameters, ensuring stable training in few-shot learning scenarios and improving the model's convergence speed and prediction accuracy.
[0065] On the other hand, the present invention also discloses a genome variation detection system based on few-sample learning, comprising: a data preprocessing module, an adaptive memory module, a supervised contrastive learning module, an orthogonal migration module and a decoding module;
[0066] The data preprocessing module is used to extract the location information and span information of the genomic variation entities in the text related to the genomic variation to be analyzed, and map each word in the text into a vector representation of a fixed dimension through a pre-trained language model to generate a word embedding matrix;
[0067] The adaptive memory module is used to calculate and update the memory state by performing weighted summation on the input features, and output the adaptive memory update feature;
[0068] The supervised contrastive learning module is used to generate contrastive learning optimization features under few-sample conditions by using a contrastive learning strategy and based on the positive sample pairs and negative sample pairs in the adaptive memory update feature;
[0069] The orthogonal migration module is used to receive contrastive learning optimization features, optimize feature space through orthogonal constraints, and output orthogonal constraint optimization features;
[0070] The decoding module is used to fuse the output features of the supervised contrastive learning module and the orthogonal migration module to generate the final genome variation detection results.
[0071] It can be seen from the above technical solution that, compared with the prior art, the present invention provides a genome variation detection method and system based on few-sample learning. By introducing an adaptive memory module, a supervised contrastive learning module, and an orthogonal transfer module, a deep understanding and efficient detection of genome variation texts are achieved. Compared with traditional technologies that rely solely on rule-based methods or simple neural network architectures, the present invention exhibits stronger generalization capabilities and higher detection accuracy under few-sample conditions. The present invention adopts a multi-module collaboration strategy that fully combines the semantic embedding capabilities of pre-trained language models (such as BioBERT), the long-distance dependency modeling capabilities of the adaptive memory module, the feature differentiation capabilities of the supervised contrastive learning module, and the cross-task knowledge sharing advantages of the orthogonal transfer module. By comprehensively utilizing the global semantic information of the text and the local features of the genome variation entities, the present invention can effectively capture complex language patterns and biomedical background knowledge, significantly improving accuracy and robustness in the identification tasks of multiple types of genome variations. In addition, the dynamic memory update mechanism and the orthogonal constraint strategy can further optimize the adaptability and scalability of the model, making the present invention have strong application potential in genome variation detection tasks in real scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without inventive effort.
[0073] Figure 1 The accompanying figure is a schematic diagram of the overall framework topology structure of a genome variation detection method based on few-shot learning provided by the present invention;
[0074] Figure 2 The accompanying figure is a schematic diagram of the structure of the pre-trained language model BioBERT provided by the present invention;
[0075] Figure 3 The accompanying figure is a schematic diagram of the adaptive memory module, supervised contrastive learning module and orthogonal migration module provided by the present invention, showing how to integrate output features and simultaneously optimize small sample genome variation identification tasks. DETAILED DESCRIPTION
[0076] The following is a combination of the embodiments of the present invention Figure 1-3, providing a clear and complete description of the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0077] Example 1
[0078] The present invention discloses a genomic variation detection method based on few-shot learning. This method can effectively identify genomic variation entities and their categories in biomedical texts. Specifically, in a few-shot learning environment, it improves the accuracy and generalization of detection results, providing strong technical support for genomic research, personalized medicine, and clinical diagnosis. This method is implemented using a genomic variation detection model that can be trained using few-shot learning. In this embodiment, the method includes a data preprocessing module, an adaptive memory module, a supervised contrastive learning module, an orthogonal transfer module, and a decoding module.
[0079] The genome variation detection method of the present invention is described in detail below:
[0080] S1: Preprocess the genomic variation data to be analyzed, extract and annotate entity locations and span information in the text, which specifically includes:
[0081] S11: Before processing genomic variation data for analysis, preprocessing steps are required, including word segmentation and structured annotation of relevant text content.
[0082] The first step is to identify and extract genomic variation entities in the text, and record the starting and ending positions of these entities in the text.
[0083] Based on the marked entity positions, the position span information of each entity is calculated and encoded. This information is recorded as span i =[start i ,end i ], where start i and end i Indicates the start index and end index of any i-th entity, and the position span information i Specifies the scope of the entity within the text.
[0084] S12: Assign a specific category information C to each entity i , where C i Represents the category of the i-th entity, which may include gene type, mutation type, etc.
[0085] S13: Convert the extracted entity position span information and category information into a matrix representation. The entity span matrix S has dimensions N × 2, where N is the number of entities, and each row records the start and end positions of an entity. The category matrix C has dimensions N × 1 and is used to store the category label of each entity.
[0086] S14: For further processing, a feature embedding representation of the entity is generated. This step combines the entity in the text with its associated contextual information to construct the entity's feature embedding matrix E. At the same time, preliminary processing of the entity and its category information is performed to provide the necessary input data for subsequent model training.
[0087] By preliminarily processing the entity and its category information through the above steps, it is possible to prepare input data for subsequent model training.
[0088] S2: The preprocessed text features are fed into the adaptive memory module, which dynamically stores and updates contextual information to enhance the model's ability to handle long-range dependencies. This module uses a memory and forgetting mechanism to help the model retain key information in a few-shot learning environment.
[0089] S21: Input the entity position span information S and category information C extracted in S1 into the embedding layer, and use the pre-trained language model (such as BioBERT) to vectorize the text. The input text sequence is X = {x1.x2,…,x n}, where n is the length of the text, and each word x i , mapped to vector e through the embedding function i :e i =Embed(x i θ BioBERT ). Among them, θ BioBERT is the pre-training parameter of the BioBERT model, x i Represents the i-th word in the text sequence, and the generated vector representation matrix E has the dimension E=[e1,e2,…,e n ];
[0090] S22: Initialize the memory matrix M of the Adaptive Memory Module (AMM) t ∈R m ×d , where m is the number of memory slots and E is the embedding matrix.
[0091] The embedding matrix E is input into the adaptive memory module and the context vector c is generated using the attention mechanism. t , which summarizes the information of the current input sequence. The calculation formula is c t =Attention(E,Mt ,θ attn ), where θ attn is the parameter of the attention mechanism;
[0092] S23: Use the gating mechanism to control the dynamic update of new information and memory matrix. The gating vector g t Calculated by the following formula: g t =σ(W g c t +b g ), where σ is the Sigmoid activation function, w g and b g is a learnable parameter, c t It is the attention mechanism that generates the context vector.
[0093] S24: through the gate vector g t Update the memory matrix to get a new memory matrix M t+1 :M t+1 =g t c t +(1-g t )·M t . Where · represents element-by-element multiplication, g t is the gate control vector, c t is the context vector generated by the attention mechanism, M t ∈R m×d is the memory matrix at time step t. This update mechanism ensures that the memory matrix dynamically integrates new context information while retaining key information, thereby improving the generalization ability of the model in few-sample scenarios.
[0094] S25: Using the updated memory matrix M t+1 Refine the input embedding E. By recontextualizing the input sequence using the updated memory, we get the refined embedding E'=Attention(E,M t+1 ,θ' attn ). Among them, θ' attn Indicates the updated memory M t+1 Parameters of the attention mechanism integrated with the input embedding E, where E represents the embedding matrix.
[0095] S3: Combined with the output of the adaptive memory module, supervised contrastive learning is used to optimize feature representation and enhance the semantic distinction between entities of different categories. By constructing positive and negative sample pairs, the similarity between entities of the same category is maximized and the similarity between entities of different categories is minimized.
[0096] S31: The feature representation E updated by the S2 adaptive memory module i'As input, E'={e'1,e'2,…,e' n} is the embedding representation optimized by the adaptive memory module, where n is the length of the text. Each feature vector e' i For a labeled sample, use the label set Y = {y1,y2,…,y n} means, where y i is the category label of the i-th sample.
[0097] S32: Construct positive and negative sample pairs. For sample e' i , define the same category label y i =y j Sample pairs (e' i ,e' j ) is a positive sample pair, and a sample pair of different categories is a negative sample pair. Let the positive sample set be p(i) and the negative sample set be A(i), that is: P(i) = {j|y i =y j ,j≠i},A(i)={j|y i ≠y j}, where e' i The feature vector of the i-th sample comes from the output of the adaptive memory module, y i is the category label of the i-th sample, p(i) is the positive sample set, including all i The sample index of the same category, A(i) is the negative sample set, including all samples with the same category as e' i Sample indexes of the same category;
[0098] S33: Define the supervised contrast loss function, which aims to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs. The supervised contrast loss function is:
[0099]
[0100] Where I represents the sample set; τ is the temperature parameter, which is used to adjust the distribution of similarity and is usually a positive value less than 1; exp is an exponential function, which is used to amplify the effect of similarity; |P(i)| usually represents the size of the positive sample set p(i), which is used to normalize the positive sample pairs;
[0101] sim() represents the cosine similarity function. In the embodiment of the present invention, the similarity between feature vectors is calculated, and cosine similarity is used as a metric. For two samples e' i and e' j The similarity formula can be expressed as: Among them, sim(e' i ,e'j ) means e' i and e' j The cosine similarity between them is in the range of [-1,1], · is the dot product operation of the vector, ||e' i ||、||e' j || represent e' respectively i and e' j The L2 norm of , used to normalize the vector;
[0102] S34: By minimizing the supervised contrast loss L SCL , optimize the feature representation E' and generate the embedding representation E' optimized by contrastive learning SCL :E' SCL,i =Refine(e' i ,L SCL θ SCL ). Among them, θ SCL is the parameter of the supervised contrastive learning module, E' SCL It is the embedding representation optimized by contrastive learning, Refine represents the process function of updating feature representation through back propagation and gradient descent, combined with L SCL For feature e' i Backpropagation and gradient updates are performed. This optimization process enhances the model's ability to distinguish between different categories of samples, helping to more accurately detect genomic variations in small sample sizes.
[0103] S4: Introducing the orthogonal transfer module, which uses the orthogonal constraint mechanism to achieve efficient cross-task knowledge transfer. This module ensures knowledge sharing between different tasks by imposing orthogonal constraints;
[0104] S41: The feature representation E' optimized by supervised contrastive learning in S3 SCL As input, where E' SCL ={e' SCL,1 ,e' SCL,2 ,…,e' SCL,n These feature vectors contain entity representations after contrastive learning, aiming to improve the model's ability to distinguish different categories;
[0105] S42: Characteristic representation E' SCL Projected into a shared latent space to achieve effective transfer of cross-task knowledge. Use the orthogonal transformation matrix W for projection, and the transformed feature vector Z i The calculation formula is: i =We' SCL,i , where W is an orthogonal matrix with dimension d×d, d is the dimension of the eigenvector, satisfying WW T =I,Z i is the feature representation after projection, e'SCL,i represents the i-th eigenvector after supervised contrastive learning optimization;
[0106] In the above steps, orthogonal constraints are introduced to ensure the independence of feature space during knowledge transfer and prevent the knowledge of auxiliary tasks from interfering with the target task. The orthogonal constraints are maintained by the following regularization terms:
[0107]
[0108] Among them, ||·|| F represents the Frobenius norm; L orth is the orthogonality constraint loss, used to constrain W to maintain orthogonality; I is the identity matrix with dimension d×d;
[0109] In the above steps, the total loss function L is defined, and the task-specific loss L task ; and the orthogonality constraint loss L orth Combination: L = L task +λL orth , where λ is a hyperparameter that balances the two losses; L is the total loss function, L task is a task-specific loss function; L orth It is an orthogonal constraint loss function. By minimizing L, knowledge transfer is effectively performed while maintaining feature independence.
[0110] S43: The feature Z after orthogonal projection i As the final representation, it is provided to the subsequent prediction layer for the classification task of genomic variation. Orthogonal projection ensures the stability and generalization ability of feature representation, which helps improve model performance under few-sample conditions.
[0111] S5: Integrate the output features of the supervised contrastive learning module and the orthogonal transfer module, and adopt a joint learning strategy to simultaneously optimize the small-sample entity recognition task;
[0112] S51: Input the feature representation Z processed by the orthogonal migration module into the joint learning framework. Let Z = {z1, z2, ..., z n}, where z i is the feature vector of the i-th entity. These feature vectors are used for the final classification task of the entity category;
[0113] S52: Using the optimized features E' obtained from the supervised contrastive learning module SCL , further integrated into Z to comprehensively utilize the information learned from different modules. The fused feature representation F is calculated as follows: F = Z + E' SCL Where F represents the final entity feature vector, Z is the feature representation after being processed by the orthogonal migration module, and E' SCLIt is the optimized feature obtained from the adaptive memory module and the supervised contrastive learning module;
[0114] S53: Input the fused feature representation F into the linear classifier W cls In the example, the entity category label is predicted by the Softmax function Among them, W cls is the weight matrix of the classifier, b cls is the bias vector, is the predicted entity category, and F is the fused feature representation;
[0115] S54: Define the cross entropy loss function L for the classification task ent , used to optimize the accuracy of entity recognition: Among them, y i is the true label, is the predicted probability, N is the number of samples;
[0116] S55: By minimizing the loss function L ent , optimize the parameters of the entire model and finally output the predicted genomic variant entity category.
[0117] The final output contains the category prediction results of all genomic variation entities. Through the comprehensive features output by the adaptive memory module, the supervised contrastive learning module, and the orthogonal transfer module, the model can effectively identify genomic variation entities in the text and predict the category label of each entity and its classification probability. This joint learning strategy optimizes the expression of entity features under the condition of few samples, and improves the accuracy and generalization ability of entity recognition. With the help of the joint prediction layer, the model can accurately classify entities in genomic variation text based on the integration of multi-module feature information. The output results include the category label and corresponding confidence of each entity, providing efficient and reliable technical support for subsequent biomedical research, clinical diagnosis and genomic variation detection;
[0118] S6: Steps S1-S5 jointly construct a genome variation detection model for few-shot learning. By inputting the text to be detected, it finally outputs the genome variation entity detection results.
[0119] S61: Collect text data related to the genomic variants to be detected from genomic databases (such as tmVar, BRONCO, EMU, etc.) and public scientific research literature. This data includes information related to diseases, mutation types, gene mutation locations, etc. The collected text data is standardized, including noise removal, word segmentation, extraction of location information and category labels of genomic variant entities, and generation of embedded vector representations to provide high-quality input data for model training;
[0120] S62: The collected genomic variant text is input into the genomic variant detection model trained in steps S1 to S5 for processing. The model uses a joint learning strategy to integrate features from the adaptive memory module, the supervised contrastive learning module, and the orthogonal transfer module to identify and classify genomic variant entities in the text. The model accurately identifies the variant type, location, and associated gene information in the text, and generates entity category labels and classification probabilities.
[0121] S63: Outputs the prediction results of the genomic variant detection model, including the category label and corresponding confidence score of each genomic variant entity identified in the text. This result provides a reliable reference for biomedical research and clinical diagnosis, helping researchers and clinicians quickly locate and analyze genomic variants associated with diseases.
[0122] After S6, the model was further tested and evaluated. Model performance was analyzed using commonly used evaluation metrics, including accuracy, recall, and F1 score, to comprehensively measure the model's performance on entity recognition tasks. Furthermore, optimization was performed by adjusting the model's hyperparameters (such as those of the pre-trained language model BioBERT, the adaptive memory module, the supervised contrastive learning module, and the orthogonal transfer module) to improve the accuracy, robustness, and generalization capabilities of genomic variant entity detection.
[0123] To further implement the above technical solution, the model is optimized using the Adam optimizer, and its rules are as follows:
[0124]
[0125]
[0126] Among them, m t 、v t are the estimated values of the first-order moment and the second-order moment respectively; β1 and β2 are the attenuation factors of the first-order moment and the second-order moment, usually with values of β1 = 0.9 and β2 = 0.999; represents the gradient of the loss function L with respect to the model parameter θ; η is the learning rate, which is usually set to a small value, such as η = 1e-4; and ε is a small constant to prevent division by zero, usually set to ε = 1e-8; θ t+1 are the model parameters after optimization and update.
[0127] After each training phase, the model will use the back-propagation mechanism to update the weight parameters based on the gradient information of the loss function, thereby gradually improving the performance of the model.
[0128] In the process of model performance evaluation, we use accuracy, recall rate and F1 value as core indicators to comprehensively measure the performance of the model in the entity recognition task.
[0129] The accuracy is expressed as:
[0130]
[0131] The recall rate is expressed as:
[0132]
[0133] The F1 score corresponding to the F value is:
[0134]
[0135] Among them, TP represents the number of true positives, FP represents the number of false positives, and FN represents the number of false negatives.
[0136] In this embodiment, the genomic variant text to be detected is processed by a pre-trained language model (such as BioBERT). First, the text is segmented and normalized, and the entity position information and span information in the text are extracted and converted into an index form. Then, in the embedding layer, each word in the text is embedded as a vector representation to generate the word embedding matrix E of the text, where E = {e1, e2, ..., e n}, n is the text length, and E is the embedded vector.
[0137] These embedding vectors, along with the entity's position and span information, are fed into the adaptive memory module. Through a dynamic storage and update mechanism, the adaptive memory module effectively captures contextual information and long-range dependencies in the text, strengthening its ability to model key information.
[0138] The feature representation processed by the adaptive memory module is further input into the supervised contrastive learning module. This module optimizes the feature representation by constructing positive and negative sample pairs, enhancing the ability to distinguish between entities of different categories and improving the model's generalization performance in a few-sample environment.
[0139] Through the orthogonal transfer module, the model transfers knowledge between multiple tasks and introduces orthogonal constraints to avoid information interference between different tasks, thereby further improving the robustness and detection accuracy of the model.
[0140] Finally, the output feature representations from the adaptive memory module, the supervised contrastive learning module, and the orthogonal transfer module are integrated and input into the decoding layer. The decoding layer uses the combined feature representation to predict the category label for each entity using the softmax function, generating genomic variant detection results. The model is trained and fine-tuned using optimization algorithms (such as AdamW) to further improve its detection accuracy and robustness, ultimately achieving efficient identification and classification of genomic variant entities.
[0141] Example 2
[0142] Based on the above embodiments, in a specific embodiment, in order to verify the effectiveness of the model of the present invention, multiple groups of comparative experiments were conducted:
[0143] First, on public genomic variation detection datasets (such as tmVar and BRONCO&EMU), the performance of various models in the task of detecting genomic variation in a small number of samples was experimentally compared. These models include: a small number of sample learning model (GDPN) combined with a Gaussian distribution prototype network, a named entity recognition method based on model-independent meta-learning (DMetaNER), a cross-domain small number of sample model (MANNER) enhanced by variational memory, and a sequence annotation model (BioBERT-BiLSTM) combined with a pre-trained language model BioBERT and a bidirectional long short-term memory network (BiLSTM). The performance of the above baseline models was systematically compared and analyzed with the small number of sample genomic variation detection model based on a hybrid neural network proposed in the present invention to verify the effectiveness and advantages of the model of the present invention.
[0144] The proposed genomic variant detection model, based on the pre-trained language model BioBERT, combines an adaptive memory module, a supervised contrastive learning module, and an orthogonal transfer module to enhance the model's generalization and accuracy in detecting genomic variants with a small sample size. Specifically, the adaptive memory module dynamically stores and updates key contextual information, thereby improving the ability to model long-range dependencies; the supervised contrastive learning module optimizes the feature representation of entities of different categories, enhancing classification and differentiation capabilities; and the orthogonal transfer module effectively transfers cross-task knowledge through an orthogonal constraint mechanism, further improving the model's performance and stability.
[0145] To improve the performance and robustness of the model, we employed multiple optimization strategies. The training batch size (train_batch_size) was set to 8 to balance model training efficiency and hardware resource utilization; the evaluation batch size (eval_batch_size) was set to 1 to ensure high accuracy during the evaluation phase. The learning rate (learning_rate) was set to 3e-6, with a 10% warmup ratio (warmup_ratio) to achieve smooth training dynamics. AdamW was used as the optimizer, combined with weight decay (weight_decay = 1e-3) to reduce the risk of overfitting.
[0146] In terms of model design, the memory slot size (memory_size) of the adaptive memory module was set to 20 to ensure sufficient context storage capacity; the contrast loss temperature parameter (temperature) of the supervised contrastive learning module was set to 0.07 to ensure effective distinction between categories; and the orthogonal constraint weight (orthogonal_weight) in the orthogonal transfer module was set to 0.1 through cross-validation to balance feature independence and sharing. The model's hidden layer dimension (hidden_size) was 768, and the feedforward network dimension (feedforward_size) was set to 2048 to ensure the model's expressiveness and computational efficiency.
[0147] In the experiment, the model employed dropout technology to prevent overfitting. Specifically, the dropout ratio of the attention layer (attention_dropout) and the dropout ratio of the BioBERT embedding layer (bert_dropout) were both set to 0.1, balancing learning ability and model robustness. Furthermore, to optimize detection accuracy, the relation filtering threshold (relation_filter_threshold) was set to 0.4. This value was determined through multiple cross-validations to achieve the optimal balance between precision and recall.
[0148] All experiments were run on an Nvidia RTX 3090 GPU with 24GB of video memory, implemented in conjunction with the PyTorch framework, ensuring efficient training and evaluation on large-scale datasets. Experimental results show that the proposed model significantly outperforms existing methods in multiple few-shot tasks, demonstrating its superior capabilities in genomic variant detection.
[0149] Several comparative models were constructed for testing, and the experimental results on the public genomic tmVar dataset are shown in Table 1:
[0150] Table 1 tmVar comparison experiment results
[0151]
[0152] Several comparative models were constructed for testing. The experimental results on the public genome BRONCO & EMU dataset are shown in Table 2:
[0153] Table 2 BRONCO & EMU comparative experimental results
[0154]
[0155]
[0156] Tables 1 and 2 show the experimental results of different models on public genomic variation detection datasets. From the experimental data, it can be seen that the few-shot genomic variation detection model based on hybrid neural networks proposed in this invention has achieved significantly better performance than the baseline model in multiple task scenarios. Specifically, in the 6-shot-1-way scenario of the tmVar dataset, the model of this invention achieved an F1 score of 75.99%, significantly improving the detection capability under few-shot conditions compared to BioBERT-BiLSTM (64.01%) and MANNER (74.96%). In the more challenging 6-shot-3-way scenario, the model of this invention still maintained excellent performance, with an F1 score of 47.62%, significantly surpassing DMetaNER (31.86%) and GDPN (26.09%). In the 5-shot-1-way and 5-shot-2-way tasks of the BRONCO&EMU dataset, the model of this invention achieved F1 scores of 67.62% and 60.39%, respectively, which are also significantly better than other baseline models. Experimental results demonstrate that the proposed model exhibits superior performance in the task of detecting genomic variants in small samples. In particular, the model, when combined with the adaptive memory module and the supervised contrastive learning module, demonstrates exceptional ability in handling long-distance dependencies and complex entity relationships. Furthermore, the introduction of the orthogonal transfer module further enhances the model's cross-task generalization, enabling it to effectively address the challenges of data scarcity and uneven label distribution.
[0157] The impact of different contrastive learning weights on model performance is shown in Table 3.
[0158] Table 3 Experimental results of tmVar with different contrastive learning weights
[0159]
[0160]
[0161] The impact of different contrastive learning weights on model performance is shown in Table 4 on the experimental results of the BRONCO&EMU dataset:
[0162] Table 4 Experimental results of BRONCO&EMU with different contrastive learning weights
[0163] Different contrastive learning weights F1 score (%) F1 score (%) 5Shot-1Way 5Shot-2Way 0.10 64.59 52.39 0.15 67.62 60.39 0.20 59.61 53.03 0.25 56.65 53.79 0.30 57.48 51.86 0.40 55.26 52.62
[0164] To evaluate the impact of contrastive learning weights on model performance, experiments were conducted on publicly available genomic variant detection datasets (such as tmVar and BRONCO&EMU). The weight parameters in the contrastive learning module were adjusted to analyze their contribution to the few-shot genomic variant detection task. The contrastive learning weights control the degree of emphasis placed on the contrastive loss during optimization, thereby affecting the model's ability to distinguish features from different classes of entities.
[0165] The experimental results are shown in Tables 3 and 4. In the 6-Shot-1-Way scenario of the tmVar dataset, when the contrastive learning weight is set to 0.15, the model achieves an F1 score of 75.99%, outperforming the cases with weights of 0.1 (72.85%) and 0.2 (73.45%), demonstrating the positive effect of moderate weights on model performance. Similarly, in the 5-Shot-1-Way scenario of the BRONCO&EMU dataset, when the contrastive learning weight is set to 0.15, the model achieves the best F1 score of 67.62%.
[0166] However, when the weights are set too high or too low, the model performance deteriorates. This suggests that excessively high weights may lead to over-reliance on contrastive learning loss, inhibiting the optimization of other loss terms, while excessively low weights cannot fully utilize the role of contrastive learning in feature differentiation.
[0167] In summary, the experimental results confirm the significant impact of contrastive learning weights on model performance. By properly adjusting the weight parameter (e.g., 0.15), a balance can be achieved between feature discrimination and other optimization objectives, significantly improving the model's performance in the task of detecting genomic variants with a small sample size.
[0168] The impact of the number of memory slots of different adaptive memory modules on model performance is shown in Table 5.
[0169] Table 5 Experimental results of tmVar dataset with different numbers of memory slots
[0170] Different number of memory slots F1 score (%) F1 score (%) F1 score (%) 6shot-1Way 6shot-2Way 6shot-3Way 5 73.41 47.50 20.00 10 68.50 43.45 40.81 15 74.74 51.95 36.92 20 75.99 59.87 47.61 25 62.38 40.37 44.44 30 56.01 54.48 40.00
[0171] The impact of the number of memory slots of different adaptive memory modules on model performance is shown in Table 6 on the experimental results of the BRONCO&EMU dataset:
[0172] Table 6 Experimental results of different numbers of memory slots on the BRONCO&EMU dataset
[0173]
[0174]
[0175] To investigate the impact of memory size on model performance, experiments were conducted on publicly available genomic variant detection datasets (such as tmVar and BRONCO&EMU) to analyze the contribution of the adaptive memory module's memory size to the task of few-shot genomic variant detection. Memory size determines the model's ability to dynamically store and update key information, thus affecting its ability to model long-range dependencies.
[0176] The experimental results are shown in Tables 5 and 6. In the 6-Shot-1-Way scenario of the tmVar dataset, when the memory size is set to 20, the model achieves an F1 score of 75.99%, the best performance. A smaller memory size (such as 5) results in insufficient context capture, and the F1 score drops to 73.41%. A larger memory size (such as 15) may introduce redundant information, increase computational complexity, and cause performance to drop to 74.74%. Similarly, in the 5-Shot-1-Way scenario of the BRONCO&EMU dataset, when the memory size is set to 20, the model achieves the highest F1 score of 60.39%, indicating that appropriately increasing the memory size can capture more effective information when handling more complex tasks.
[0177] Experiments have shown that a moderate memory size is crucial for improving model performance. A smaller memory size limits the model's ability to retain context, while a larger memory size may introduce noise or computational overhead. By properly adjusting the memory size (e.g., 20 in the tmVar dataset and 20 in the BRONCO&EMU dataset), the adaptive memory module can more efficiently capture long-range dependencies, significantly improving the accuracy of few-shot genomic variant detection tasks.
[0178] The experimental results of the impact of different word representations on model performance on the tmVar dataset are shown in Table 7:
[0179] Table 7 Experimental results of different word representations on the tmVar dataset
[0180]
[0181]
[0182] The experimental results of the impact of different word representations on model performance on the BRONCO&EMU dataset are shown in Table 8:
[0183] Table 8 Experimental results of different word representations on the BRONCO&EMU dataset
[0184] Different word representation methods F1 score (%) F1 score (%) 5Shot-1Way 5Shot-2Way BERT 48.47 47.71 SciBERT 42.47 59.70 ALBERT 45.15 31.77 ClinicalBERT 51.26 51.26 BioBERT 67.62 60.39
[0185] To investigate the impact of different word representations on model performance, experiments were conducted on publicly available genomic variant detection datasets (such as tmVar and BRONCO&EMU) to analyze the performance of different pre-trained language models on the few-shot genomic variant detection task. These word representation models include general-purpose pre-trained language models (such as BERT), a pre-trained model for scientific text (SciBERT), a parameter-efficient language model (ALBERT), a model specifically designed for clinical text (ClinicalBERT), and a model for biomedical text (BioBERT).
[0186] Experimental results are shown in Tables 7 and 8. In the 6-Shot-1-Way scenario on the tmVar dataset, BioBERT significantly outperforms other word representation models with an F1 score of 75.99%. This demonstrates that BioBERT more effectively captures contextual semantic information and fine-grained features in the biomedical domain, adapting to the complexity of genomic variant detection tasks. In comparison, BERT's F1 score is 48.63%, reflecting its limitations in handling tasks specific to the biomedical domain. SciBERT performs slightly better in the 6-Shot-1-Way scenario, achieving an F1 score of 51.42%, but still lags behind BioBERT due to its focus on broad semantics in the scientific domain rather than the specialized semantics of biomedicine. In the 5-Shot-1-Way scenario on the BRONCO&EMU dataset, BioBERT also achieves the best performance, with an F1 score of 67.62%. In contrast, ClinicalBERT, while optimized for clinical text, lacks generalization capabilities to diverse genomic variant representations, achieving an F1 score of 51.26%. ALBERT achieved an F1 score of 45.15% in the 5Shot-1Way scenario thanks to its efficient parameter design, and its performance has improved, but it still has limited performance when processing complex biomedical texts.
[0187] Experimental results demonstrate that the choice of word representation significantly impacts model performance. BioBERT, leveraging its large-scale pre-training on biomedical text, is able to capture fine-grained domain features and demonstrates superior performance in the task of few-shot genomic variant detection. In contrast, general-purpose models and other domain-specific models have limitations when processing biomedical text. Therefore, selecting an appropriate word representation model, such as BioBERT, is crucial for achieving high accuracy and robustness in genomic variant detection.
[0188] Example 3
[0189] Based on the above embodiments, in a specific embodiment, the present invention proposes a genome variation detection system based on few-shot learning, comprising: a data preprocessing module, an adaptive memory module, a supervised contrastive learning module, an orthogonal migration module, and a decoding module;
[0190] The data preprocessing module is used to obtain and process input text related to genomic variation and perform basic text preprocessing operations. It extracts the position and span information of genomic variation entities in the text and uses the embedding layer to convert the text into a fixed-dimensional low-dimensional word vector representation. Specifically, this module uses a pre-trained language model (such as BioBERT) to perform semantic embedding on each word in the text, mapping it into a dense vector containing semantic information, and finally generating E∈R n×d The word embedding matrix is a , where n is the length of the text and d is the dimension of the word vector. This embedding matrix serves as the input of subsequent modules and provides deep semantic representation to support subsequent analysis.
[0191] The adaptive memory module is designed to improve the model's performance in handling long-range dependencies by dynamically storing and updating key contextual information. Through a memorization and forgetting mechanism, the adaptive memory module dynamically adjusts its memory state during training to retain important contextual information while forgetting irrelevant content. Input features interact with memory cells through an attention mechanism to generate weighted contextual representations and update the memory state, effectively modeling the long-range dependencies of the input data. The output memorized features provide enhanced contextual representations for subsequent modules, helping the model more accurately understand complex textual relationships in a few-shot learning environment.
[0192] The supervised contrastive learning module optimizes the input feature representation through contrastive learning and improves the model's ability to distinguish different categories of genomic variant entities. Based on the construction of positive and negative sample pairs, the supervised contrastive learning module uses a similarity measurement mechanism to enhance the similarity between samples of the same category while reducing the similarity between samples of different categories. By optimizing the contrastive loss function (such as cross-entropy loss), this module significantly improves the robustness of feature representation and classification performance, especially under low-sample conditions, and can effectively enhance the ability to identify genomic variant entity categories;
[0193] The Orthogonal Transfer Module aims to achieve cross-task knowledge transfer through orthogonal constraints while avoiding negative interference between tasks. In a multi-task learning environment, this module introduces an orthogonal transformation matrix to ensure orthogonality between feature subspaces shared by different tasks, thereby optimizing knowledge sharing and task-specific feature learning. By introducing orthogonal constraint regularization, this module promotes effective cross-task transfer and adaptability while maintaining the independence of feature spaces, further improving generalization performance in few-shot learning environments.
[0194] The decoding module is responsible for making the final classification prediction based on the features processed by each functional module to detect genomic variants. By fusing the output features of the supervised contrastive learning module and the orthogonal transfer module, the decoding module integrates this information using a joint feature encoding layer and extracts key information through a max-pooling operation. The classification layer then predicts the integrated features and outputs the class label of the genomic variant. Furthermore, by fine-tuning and optimizing model parameters, this module further improves the accuracy and reliability of variant detection, thereby achieving efficient identification of genomic variants.
[0195] This system organically integrates the functions of the aforementioned modules, forming a complete detection process, from input text preprocessing to final genomic variant detection. The data preprocessing module extracts key information, the adaptive memory module models contextual dependencies, the supervised contrastive learning module optimizes feature differentiation, and the orthogonal transfer module enables cross-task knowledge transfer. Finally, the decoding module completes feature fusion and outputs detection results. The system exhibits excellent robustness and adaptability, enabling effective genomic variant detection even with a small number of samples.
[0196] Each embodiment in this specification is described in a progressive manner, with the focus on describing the differences from other embodiments. Similar parts of each embodiment can be referenced across them. For the device portion disclosed in the embodiment, since it corresponds to the method portion disclosed in the embodiment, the relevant content can be referenced to the description of the method portion.
[0197] The detailed description of the above embodiments will enable those skilled in the art to implement and use the present invention. Modifications and variations of the present invention can be made by those skilled in the art based on practical applications without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments listed herein, but should be based on their broad applicability, consistent with the basic principles and technical innovations of the present invention.
Claims
1. A genome variation detection method based on few-shot learning, characterized in that: The following steps are involved: Constructing a genome variation detection model for few-shot learning, the genome variation detection model comprising a data preprocessing module, an adaptive memory module, a supervised contrastive learning module, an orthogonal migration module, and a decoding module; The data preprocessing module is used to extract the location information and span information of the genomic variation entities in the text related to the genomic variation to be analyzed, and map each word in the text into a vector representation of a fixed dimension through a pre-trained language model to generate a word embedding matrix; The adaptive memory module is used to calculate and update the memory state by performing weighted summation on the input features, and output the adaptive memory update feature; The supervised contrastive learning module is used to generate contrastive learning optimization features under few-sample conditions by using a contrastive learning strategy and based on the positive sample pairs and negative sample pairs in the adaptive memory update feature; The orthogonal migration module is used to receive contrastive learning optimization features, optimize feature space through orthogonal constraints, and output orthogonal constraint optimization features; The decoding module is used to fuse the contrastive learning optimization features output by the supervised contrastive learning module and the orthogonal constraint optimization features output by the orthogonal migration module to generate the final genome variation detection results; The constructed genome variation detection model is trained, and the trained genome variation detection model is used to complete genome variation detection.
2. The method for detecting genomic variation based on few-sample learning according to claim 1, characterized in that: The specific contents of data preprocessing in the data preprocessing module include: S11: Extract genomic variant entities from the text, mark their starting and ending positions in the text, and generate entity position span information [start i ,end i ], where start i and end i Represent the starting and ending indexes of the i-th entity respectively; S12: Based on the marked entity positions, calculate the position span information of each entity and encode it; at the same time, assign relevant category information C to each entity i , where C i represents the category of the i-th entity; S13: Convert the extracted entity position span information and category information into matrix representations respectively; S14: Based on the entity position span information, the entities in the text are combined with their corresponding context information to generate the entity feature embedding matrix E.
3. The method for detecting genomic variation based on few-sample learning according to claim 2, characterized in that: The adaptive memory module outputs the adaptive memory update feature, specifically comprising the following steps: S21: Input the entity embedding matrix E into the adaptive memory module and use the attention mechanism to generate the context vector c t ; S22: Use a gating mechanism to control the dynamic update of new information and memory matrix; S23: through the gate vector g t Update the memory matrix to get a new memory matrix M t+1 :M t+1 =g t c t +(1-g t )·M t ; where · represents element-wise multiplication, g t is the gate control vector, c t is the context vector generated by the attention mechanism, M t ∈R m×d is the memory matrix at time step t; S24: Using the updated memory matrix M t+1 The input embedding matrix E is refined to obtain the refined embedding feature E'=Attention(E,M t+1 ,θ' attn ), and as the adaptive memory update feature output by the adaptive memory module, where θ' attn Indicates the updated memory M t+1 Parameters of the attention mechanism integrated with the input embedding E, where E represents the embedding matrix.
4. The method for detecting genomic variation based on few-shot learning according to claim 3, characterized in that: In the supervised contrastive learning module, a contrastive learning strategy is used to generate contrastive learning optimization features under few-sample conditions based on positive and negative sample pairs in the genomic variation data to be analyzed, specifically including: S31: The refined embedding feature E i 'As input; each feature vector e' i For a labeled sample, use the label set Y = {y1,y2,…,y n } means, where y i is the category label of the i-th sample; S32: For labeled sample e' i , define the same category label y i =y j Sample pairs (e' i ,e' j ) is a positive sample pair, and sample pairs of different categories are negative sample pairs; S33: Construct a supervised contrast loss function to maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs. The supervised contrast loss function is: Where I represents the sample set; sim() represents the cosine similarity function; τ is the temperature parameter, which is used to adjust the smoothness of the similarity distribution and takes a positive value less than 1; exp is the exponential function, which is used to amplify the effect of similarity; |P(i)| represents the size of the positive sample set P(i), which is used to normalize the positive sample pairs; S34: By minimizing the supervised contrast loss L SCL , optimize the feature representation and generate the feature embedding representation E' optimized by contrastive learning SCL , and as the contrastive learning optimization feature output by the supervised contrastive learning module, the feature embedding representation E' SCL The specific expression is: AND' SCL,i =Refine(e' i ,THE SCL ;θ SCL ); Among them, θ SCL is the parameter of the supervised contrastive learning module, E' SCL It is the embedding representation optimized by contrastive learning, and Refine represents the function for optimizing features.
5. The method for detecting genomic variation based on few-sample learning according to claim 4, characterized in that: The orthogonal transfer module can achieve efficient cross-task knowledge transfer by using the orthogonal constraint mechanism, specifically including: S41: Embed the features optimized by contrastive learning into E' SCL As input, where E' SCL ={e' SCL,1 ,e' SCL,2 ,…,e' SCL,n }; S42: Embed the features optimized by contrastive learning into E' SCL Projected into the shared latent space, the orthogonal transformation matrix W is used for projection to obtain the transformed feature vector Z i , the calculation formula is: Z i =We' SCL,i , where W is an orthogonal matrix with dimension d×d, d is the dimension of the eigenvector, satisfying WW T =I,Z i is the feature representation after projection, e' SCL,i represents the i-th eigenvector after supervised contrastive learning optimization; S43: The feature Z after orthogonal projection i Orthogonal constrained optimization features as output of the final orthogonal migration module.
6. The method for detecting genomic variation based on few-shot learning according to claim 1, characterized in that: The decoding module is used to fuse the contrastive learning optimization features output by the supervised contrastive learning module and the orthogonal constraint optimization features output by the orthogonal transfer module. Specifically, it includes: S51: Input the orthogonal constraint optimization feature Z obtained after processing by the orthogonal migration module into the joint learning framework; Z={z1,z2,…,z n }, where z i is the feature vector of the i-th entity; S52: Use the joint learning framework to optimize the contrastive learning feature E' output by the supervised contrastive learning module SCL , fused into Z to comprehensively utilize the information learned from different modules. The fused feature representation F is calculated as follows: F=Z+E' SCL ; Where F represents the final entity feature vector, Z is the feature representation after processing by the orthogonal migration module, and E' SCL It is the optimized feature obtained from the adaptive memory module and the supervised contrastive learning module; S53: Input the fused feature representation F into the linear classifier W cls In the example, the entity category label is predicted by the Softmax function Among them, W cls is the weight matrix of the classifier, b cls is the bias vector, is the predicted entity category, and F is the fused feature representation; S54: Define the cross entropy loss function L for the classification task ent , used to optimize the accuracy of entity recognition: Among them, y i is the true label, is the predicted probability, N is the number of samples; S55: By minimizing the loss function L ent , optimize the parameters of the entire model, and finally output the predicted genomic variation entity category.
7. The method for detecting genomic variation based on few-shot learning according to claim 1, characterized in that: The text related to the genomic variation to be analyzed is obtained by the following steps: Collect text related to the genomic variants to be detected from biomedical databases and literature resources.
8. The method for detecting genomic variation based on few-shot learning according to claim 1, characterized in that: It also includes optimization evaluation of the constructed genomic variation detection model.
9. The method for detecting genomic variation based on few-shot learning according to claim 8, characterized in that: The AdamW optimization algorithm is used to optimize the performance of the model. The specific rules of the AdamW optimization algorithm are as follows: m t =β1m t-1 +(1-β1)▽ θ L(θ t ); v t =β2v t-1 +(1-β2)(▽ θ L(θ t )) 2 ; Among them, m t 、v t are the estimated values of the first-order moment and the second-order moment respectively; β1 and β2 are the attenuation factors of the first-order moment and the second-order moment respectively; ▽ θ L(θ t ) represents the gradient of the loss function L with respect to the model parameter θ; η is the learning rate; ε is a small constant to prevent division by zero, with a value of ε = 1e-8; θ t+1 are the model parameters after optimization and update.
10. A genome variation detection system based on few-shot learning, characterized in that: A genome variation detection method based on few-sample learning according to any one of claims 1 to 9 is applied, comprising: a data preprocessing module, an adaptive memory module, a supervised contrastive learning module, an orthogonal migration module, and a decoding module; The data preprocessing module is used to extract the location information and span information of the genomic variation entities in the text related to the genomic variation to be analyzed, and map each word in the text into a vector representation of a fixed dimension through a pre-trained language model to generate a word embedding matrix; The adaptive memory module is used to calculate and update the memory state by performing weighted summation on the input features, and output the adaptive memory update feature; The supervised contrastive learning module is used to generate contrastive learning optimization features under few-sample conditions by using a contrastive learning strategy and based on the positive sample pairs and negative sample pairs in the adaptive memory update feature; The orthogonal migration module is used to receive contrastive learning optimization features, optimize feature space through orthogonal constraints, and output orthogonal constraint optimization features; The decoding module is used to fuse the output features of the supervised contrastive learning module and the orthogonal migration module to generate the final genome variation detection results.
Citation Information
Patent Citations
Transfer learning method and device based on domain pair association
CN115983375A
Multi-modal pre-training model migration method based on self-supervised learning
CN118097685A