Method and device for identifying ion fragment peak regions in mass spectra based on deep learning

Through the deep learning dual-branch convolutional neural network model, combining the charge state and added ion probability weight, the fragment peak recognition of mass spectrogram is optimized, and the fragment peak recognition problem is solved under complex background noise and artifact interference, and high-precision and high-confidence fragment peak extraction is achieved.

CN120068004BActive Publication Date: 2025-08-15TIANJIN ZHIPU INSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510543595.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-15
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

It is difficult for the prior art to effectively identify fragment peaks in mass spectra, especially under the influence of complex background noise and artifact interference, charge state and additive ions. It is difficult for traditional methods to take into account both local details and global information.

Method used

A two-branch convolutional neural network model based on deep learning is adopted, combining charge state limitation and added ion probability weights to construct a multi-task loss function, extract local and global features through one-dimensional and two-dimensional convolutional layers, and optimize fragment peak area recognition using multi-scale information fusion technology.

Benefits of technology

It improves the accuracy and chemical rationality of fragment peak recognition, reduces pseudo-peak recognition, significantly reduces the misjudgment rate, and enhances the quality of the identification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068004B_ABST
    Figure CN120068004B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of fragment peak region identification, and more specifically, to a method and apparatus for identifying ion fragment peak regions in mass spectra based on deep learning. The method comprises the following steps: collecting mass spectrum data and preprocessing the mass spectrum data; constructing a two-branch convolutional neural network model based on the preprocessed mass spectrum data and in combination with charge state restrictions and adduct ion probability weights to identify fragment peak regions in the mass spectrum; and optimizing the process of constructing the two-branch convolutional neural network model by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching to construct a multi-task loss function; and extracting the optimal fragment peak region from the output of the two-branch convolutional neural network model. The present invention design, by adopting a two-branch convolutional neural network model (including one-dimensional and two-dimensional convolutional layers), can effectively extract local and global features in the mass spectrum, thereby improving the accuracy of fragment peak identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fragment peak region identification, and in particular to a method and device for identifying ion fragment peak regions in a mass spectrum based on deep learning. Background Art

[0002] Mass spectra often contain complex background noise and non-target signals (artifacts), which makes it difficult to accurately identify true ion fragment peaks from the raw data. Traditional denoising and baseline correction methods are not sufficient to completely eliminate these interfering factors. Due to variations in instruments and sample preparation processes, there are significant intensity range differences between different samples. This variation can lead to deviations in analytical results and affect subsequent data comparison and interpretation. In mass spectrometry, ions carry different charges and can bind to different adduct ions. Correctly identifying the charge states of these ions and the adduct ions they form is crucial for analyzing complex mixtures, but it is also a technical challenge. In order to accurately identify fragment peaks in mass spectra, it is necessary to consider both local details (such as fine structural changes near a specific mass number) and global information (such as features across multiple adjacent mass numbers). Traditional methods often find it difficult to simultaneously meet these two requirements. Therefore, a method and device for identifying ion fragment peak regions in mass spectra based on deep learning are provided. Summary of the Invention

[0003] The purpose of the present invention is to provide a method and device for identifying ion fragment peak regions in mass spectra based on deep learning, so as to solve the problems raised in the above-mentioned background technology of complex background noise and artifact interference, charge state and adduct ion influence, and effective extraction of local and global features.

[0004] To achieve the above object, the present invention provides a method for identifying ion fragment peak regions in a mass spectrum based on deep learning, comprising the following steps:

[0005] S1. collecting mass spectrum data and preprocessing the mass spectrum data;

[0006] S2. Construct a two-branch convolutional neural network model based on the preprocessed mass spectrum data and combined with charge state constraints and adduct ion probability weights to identify fragment peak regions in the mass spectrum. A multi-task loss function is constructed to optimize the process of constructing the two-branch convolutional neural network model by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching.

[0007] S3. Extract the optimal fragmentation peak region from the output of the two-branch convolutional neural network model.

[0008] As a further improvement of the present technical solution, in S2, identifying the fragment peak region in the mass spectrum based on a two-branch convolutional neural network model includes the following steps:

[0009] S2.1. receiving preprocessed mass spectrum data as input data, and embedding charge state and adduct ion rule information into the input data to generate bimodal input data;

[0010] S2.2. Construct one-dimensional convolutional layers and two-dimensional convolutional layers in a two-branch convolutional neural network model.

[0011] Among them, the one-dimensional convolution layer is used to capture local peak details;

[0012] The 2D convolutional layer is used to capture the global noise distribution pattern;

[0013] S2.3. Jointly optimize peak region segmentation, charge state prediction, and adduct ion matching to construct a multi-task loss function.

[0014] S2.4. Use bimodal input data to pre-train a two-branch convolutional neural network model. After training, the two-branch convolutional neural network model outputs a probability heat map, a charge state, and an adduct ion matching score matrix.

[0015] As a further improvement of the present technical solution, in S2.1, receiving the preprocessed mass spectrum data as input data, and embedding the charge state and adduct ion rule information in the input data to generate bimodal input data, includes the following steps:

[0016] S2.11. Predict the charge state of candidate peaks based on the isotope peak spacing in the mass spectrometry signal;

[0017] S2.12. For each candidate peak, calculate the mass-to-charge ratio of the resulting adduct ion based on its mass-to-charge ratio, assign a probability value to each formation result using a Gaussian distribution, and construct an adduct ion probability weight matrix;

[0018] S2.13. For each candidate peak, calculate the probability that its mass-to-charge ratio matches the theoretical adduct ion mass-to-charge ratio;

[0019] S2.14. The original mass spectrum signal is combined with the adduct ion matching probability and charge state as the input of the two-branch convolutional neural network model.

[0020] As a further improvement of this technical solution, in S2.2, constructing a one-dimensional convolutional layer includes the following steps:

[0021] S2.21. Select the convolution kernel, which includes small-scale kernel, medium-scale kernel, and large-scale kernel.

[0022] S2.22, use convolution kernels of different scales in parallel to extract local features of different ranges;

[0023] S2.23. Concatenate the convolution results at the three scales along the channel dimension to form a multi-channel feature representation, and introduce skip connections to optimize the multi-channel feature representation to retain the original signal characteristics.

[0024] As a further improvement of this technical solution, in S2.2, constructing a two-dimensional convolutional layer includes the following steps:

[0025] S2.24, use multiple levels of 2D convolutional layers to gradually expand the receptive field and capture the global noise pattern;

[0026] S2.25. Use dilated convolution in deep layers to expand the receptive field without increasing the number of parameters.

[0027] S2.26. Use pooling windows of different sizes in parallel to capture multi-scale noise distribution and concatenate the multi-scale pooling results into a fixed-length feature vector;

[0028] S2.27, add a spatial attention module to make the network focus on high-frequency noise areas;

[0029] S2.28, use a high-pass filter to preprocess the spectrum to highlight the noisy areas;

[0030] S2.29. Generate a two-dimensional probability map and mark the high noise confidence areas.

[0031] As a further improvement of the present technical solution, in S2.3, the multi-task loss function is constructed by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching, including the following steps:

[0032] S2.31. Construct a multi-task loss function to simultaneously optimize the three subtasks of fragment peak region segmentation, charge state prediction, and adduct ion matching;

[0033] The weighted Dice loss function is used as the main loss term for the fragment peak region segmentation task; the cross entropy loss function is used for the charge state prediction task; and the adduct ion matching task adopts the adduct ion contrast loss function based on contrastive learning, and optimizes the adduct ion matching based on the feature space distance.

[0034] S2.32. For each candidate peak, a weight factor is constructed based on the probability of matching it with the theoretical isotope distribution and the adduct ion offset. The isotope spacing matching and adduct similarity are used as differentiable gradient adjustment factors to automatically enhance the response of peak regions that meet the rules during backpropagation. At the same time, a continuous penalty is applied to predictions that conflict between the charge state and the isotope spacing.

[0035] S2.33. Adopt an adaptive task weighting method based on uncertainty modeling to dynamically adjust the weight of each task loss according to the uncertainty of the prediction results of each subtask; and use the LSTM network to dynamically generate task weights, update the main model parameters with conventional multi-task losses, and generate chemical rule-driven meta-gradients through a small-scale MLP to maximize the compliance of the verification set rules.

[0036] As a further improvement of the present technical solution, in S3, extracting the optimal fragment peak region from the output of the dual-branch convolutional neural network model and optimizing the output result include the following steps:

[0037] S3.1. Set the confidence threshold m;

[0038] S3.2. Traverse each pixel in the segmentation probability map and mark the area with a probability value higher than the confidence threshold m as a "high confidence fragmentation peak area". For areas with a probability value lower than the confidence threshold m, consider them as background and exclude them.

[0039] S3.3. Combine the segmentation probability map, charge state prediction, and adduct ion matching probability to define a comprehensive confidence scoring formula to further optimize the selection of high-confidence fragment peak regions;

[0040] S3.4. Re-evaluate the confidence of each fragment peak region based on the comprehensive confidence score;

[0041] S3.5. Output a list of all fragment peaks with a confidence score greater than m;

[0042] S3.6. Sort the fragment peak list according to the comprehensive confidence score, and give priority to displaying the fragment peaks with a confidence score greater than m.

[0043] As a further improvement of the present technical solution, in S3.3, the segmentation probability map, charge state prediction, and adduct ion matching probability are combined to define a comprehensive confidence scoring formula, including the following steps:

[0044] S3.31. Utilize the peak region probability heatmap output by the two-branch convolutional neural network model and directly use the probability value output by the two-branch convolutional neural network model;

[0045] S3.32. Calculate the matching score matrix of the candidate peaks using the preset adduct ion template and select the maximum matching score;

[0046] S3.33. Calculate the charge consistency score based on the deviation between the measured isotope spacing and the theoretical value;

[0047] S3.34. Multiply the probability value, the maximum matching score, and the consistency score to obtain a comprehensive confidence score.

[0048] On the other hand, the present invention provides a mass spectrum ion fragment peak region identification device based on deep learning, comprising a sensor, a storage, a processor, and a computer program stored in the storage and executable on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned mass spectrum ion fragment peak region identification methods based on deep learning are implemented;

[0049] On the other hand, the mass spectrum ion fragment peak region recognition device based on deep learning includes a mass spectrum data acquisition module, a model building and recognition module, and a fragment peak extraction module;

[0050] The mass spectrum data acquisition module is used to collect mass spectrum data and pre-process the mass spectrum data;

[0051] The model building and recognition module is used to build a two-branch convolutional neural network model based on the preprocessed mass spectrum data and combined with charge state constraints and adduct ion probability weights to identify the fragment peak area in the mass spectrum;

[0052] The fragment peak extraction module is used to extract the optimal fragment peak region from the output of the two-branch convolutional neural network model.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] 1. This deep learning-based method and device for identifying ion fragment peak regions in mass spectra utilizes a two-branch convolutional neural network model (comprising one-dimensional and two-dimensional convolutional layers) to effectively extract both local and global features from mass spectra, thereby improving the accuracy of fragment peak identification. Furthermore, by combining charge state constraints and adduct ion probability weights, and utilizing a deep fusion of a differentiable chemical rule engine (DCR) and meta-gradient optimization to achieve multi-task joint optimization, this method not only improves the accuracy of fragment peak identification but also enhances the chemical rationality of the identification results, avoiding the identification of spurious peaks without physical significance.

[0055] 2. This deep learning-based method and device for identifying ion fragment peak regions in mass spectra utilizes multi-scale information fusion technology, including the parallel use of convolution kernels of different scales, the application of a spatial attention module (CBAM), and high-pass filter preprocessing. This enables the model to better understand and process complex mass spectrometry data. Furthermore, by setting a confidence threshold to screen for high-confidence fragment peak regions, and further optimizing the selection by combining segmentation probability maps, charge state predictions, and adduct ion matching probabilities, this method effectively reduces interference from background noise or artifacts and improves the quality of the output results. This approach significantly reduces the false positive rate while maintaining detection sensitivity. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 The figure is a flow chart of the overall method of the present invention. DETAILED DESCRIPTION

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0058] Example 1: Please refer to Figure 1 As shown, this embodiment provides a method for identifying ion fragment peak regions in a mass spectrum based on deep learning, comprising the following steps:

[0059] S1. Collect mass spectrum data and preprocess the mass spectrum data, perform denoising, baseline correction and normalization on the raw mass spectrum data to eliminate instrument noise and background interference and unify the intensity range of different samples;

[0060] S2. Construct a two-branch convolutional neural network model based on the preprocessed mass spectrum data and combined with charge state constraints and adduct ion probability weights to identify fragment peak regions in the mass spectrum. A multi-task loss function is constructed to optimize the process of constructing the two-branch convolutional neural network model by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching.

[0061] In this embodiment, the fragment peak region in the mass spectrum is identified based on a two-branch convolutional neural network model, including the following steps:

[0062] S2.1. receiving preprocessed mass spectrum data as input data, and embedding charge state and adduct ion rule information into the input data to generate bimodal input data;

[0063] The method includes receiving the preprocessed mass spectrum data as input data, embedding charge state and adduct ion rule information in the input data to generate bimodal input data, and comprising the following steps:

[0064] S2.11, according to the isotope peak spacing in the mass spectrometry signal ( , For each candidate peak, we search for nearby isotopic peaks and calculate their mass differences. Based on these mass differences, we use a predefined threshold or an algorithm to automatically determine the most likely charge state.

[0065] S2.12. For each candidate peak, calculate the mass-to-charge ratio of the resulting adduct ion based on its mass-to-charge ratio, assign a probability value to each formation result using a Gaussian distribution, and construct an adduct ion probability weight matrix;

[0066] Specifically, for each candidate peak, the mass-to-charge ratio of the adduct ion is calculated based on its mass-to-charge ratio, and a probability value based on Gaussian distribution is assigned to each possibility to form an adduct ion probability weight matrix;

[0067] S2.13. For each candidate peak, calculate the probability that its mass-to-charge ratio matches the theoretical adduct ion mass-to-charge ratio (e.g., Gaussian kernel similarity);

[0068] S2.14. Combine the raw mass spectrometry signal with the adduct ion matching probability and the charge state (e.g., charge state encoding, adduct ion matching probability) as input to a two-branch convolutional neural network model;

[0069] S2.2. Construct one-dimensional and two-dimensional convolutional layers in the two-branch convolutional neural network model to effectively extract local and global features from the mass spectrum, improve the accuracy of fragment peak identification, and combine the local features output by the one-dimensional convolutional layer with the global features obtained by the two-dimensional convolutional layer to form a more comprehensive feature representation;

[0070] Among them, one-dimensional convolutional layers are used to capture local peak shape details. These layers can effectively identify fine structural changes near specific mass numbers in the mass spectrum and help locate potential fragment peaks.

[0071] The two-dimensional convolutional layer is used to capture the global noise distribution pattern. Although the mass spectrum is inherently a one-dimensional signal, by converting it to a two-dimensional representation (e.g., time series to image conversion), the two-dimensional convolutional layer can be used to more effectively extract features across multiple neighboring mass numbers, thereby helping to distinguish true fragmentation peaks from background noise or artifacts;

[0072] Furthermore, constructing a one-dimensional convolutional layer includes the following steps:

[0073] S2.21. Select convolution kernels. Convolution kernels include small-scale kernels (kernel size = 3): detect sharp peak edges (such as rising and falling edges); medium-scale kernels (kernel size = 5): identify peaks of medium width; and large-scale kernels (kernel size = 9): capture the overall outline of broad or overlapping peaks.

[0074] S2.22. Use convolution kernels of different scales in parallel to extract local features of different ranges. Configure an appropriate number of filters for each scale (for example, 16 or 32 filters for each scale) to ensure rich feature representation at all scales.

[0075] S2.23. Concatenate the convolution results at the three scales along the channel dimension to form a multi-channel feature representation. This step allows subsequent layers to integrate information from different scales, thereby enhancing the model's ability to understand complex patterns. A 1x1 convolution is used to reduce the number of channels (i.e., dimensionality reduction) to reduce computational cost and prevent overfitting. This step also helps fuse multi-scale information, producing a more compact feature representation. Skip connections are introduced to optimize the multi-channel feature representation, preserving the original signal characteristics and avoiding the vanishing gradient problem.

[0076] Furthermore, constructing a two-dimensional convolutional layer includes the following steps:

[0077] S2.24, use multiple levels of 2D convolutional layers to gradually expand the receptive field and capture the global noise pattern;

[0078] S2.25. Use convolution with a dilation ratio (2 in this example) in deep layers to expand the receptive field without increasing the number of parameters. Introducing dilated convolution in deep layers with a dilation ratio of 2 allows each convolution kernel to cover a larger area without increasing the number of parameters. Dilated convolution allows the network to capture a wider range of information without reducing resolution, making it particularly suitable for tasks that require considering larger neighborhood relationships.

[0079] S2.26, use pooling windows of different sizes (4x4, 8x8, 16x16) in parallel to capture multi-scale noise distribution and concatenate the multi-scale pooling results into a fixed-length feature vector;

[0080] S2.27. Add a spatial attention module (CBAM) to focus the network on high-frequency noise areas. (CBAM is introduced as a spatial attention module. This module consists of two parts: channel attention and spatial attention. CBAM first generates a channel attention map through global average pooling, then uses convolution operations to generate a spatial attention map. Finally, these two attention maps are multiplied with the original feature map to strengthen the feature representation of key areas.)

[0081] S2.28. Use a high-pass filter (Laplacian operator) to preprocess the spectrogram to highlight noisy areas (before the input data enters the convolutional neural network, apply the Laplacian operator as a high-pass filter to preprocess the spectrogram. The Laplacian operator can detect rapid changes (i.e., high-frequency components) in the image, thereby highlighting noise and other subtle structures, and improving the model's sensitivity to noise).

[0082] S2.29. Generate a two-dimensional probability map and mark areas with high noise confidence. (Use the feature map processed in the above steps to generate a two-dimensional probability map through a fully connected layer or an additional convolutional layer. Assign a noise confidence score to each pixel position to form a complete noise probability map. Mark areas with high noise where the confidence score exceeds the threshold n.)

[0083] S2.3. Jointly optimize peak region segmentation, charge state prediction, and adduct ion matching to construct a multi-task loss function ;

[0084] S2.4. Use dual-modal input data (including charge state and mass spectrum of adduct ions) to pre-train a two-branch convolutional neural network model. After training, the two-branch convolutional neural network model outputs a probability heat map, charge state, and adduct ion matching score matrix.

[0085] The multi-task loss function is constructed by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching, including the following steps:

[0086] This multi-task loss function combines the Differentiable Chemical Rule Engine (DCR) with meta-gradient optimization;

[0087] S2.31. Construct a multi-task loss function to simultaneously optimize the three subtasks of fragment peak region segmentation, charge state prediction, and adduct ion matching;

[0088] The fragment peak region segmentation task uses the weighted Dice loss function as the main loss term to optimize the accuracy of predicting the fragment peak region; the charge state prediction task uses the cross entropy loss function to train the model to correctly classify the charge state of each candidate peak; the adduct ion matching task uses the adduct ion contrast loss function based on contrastive learning and optimizes the adduct ion matching based on the feature space distance, measuring the matching degree between the candidate peak and the theoretical mass-to-charge ratio of the adduct ion, thereby enhancing the model's ability to model the adduct pattern;

[0089] Weighted Dice loss function for: ;

[0090] Where, represents the weight factor; represents the true label of the i-th sample (0 or 1); represents the predicted probability of the i-th sample;

[0091] Cross Entropy Loss Function for: ;

[0092] Where, Indicates the The true charge state labels of the samples; Indicates the The probability distribution of the predicted charge state for samples; Indicates the sample index;

[0093] Optimizing adduct ion matching based on feature space distance for:

[0094] ;

[0095] Where, The feature vector representing the anchor point (the true adduct peak), Represents the feature vector of positive samples (peaks of the same type), Feature vector representing negative samples (noise peaks); Represents the boundary value, which controls the minimum distance difference between positive and negative samples;

[0096] S2.32. For each candidate peak, according to its difference with the theoretical isotope distribution (isotope spacing), , adduct offset +21.9819 Da) and the adduct ion offset to construct a weight factor, which is used to amplify the contribution of the peak in the loss function, making the model more inclined to learn chemically reasonable fragmentation peak patterns;

[0097] Among them, based on the matching probability between it and the theoretical isotope distribution and adduct ion offset, the weight factor is constructed as follows (the weight factor amplifies the contribution of these peaks with high chemical rationality in the loss function, guides the model to prioritize areas that conform to chemical rules, and avoids learning pseudo-peaks that have no physical meaning. In multi-task learning, the loss functions of different subtasks (such as peak region segmentation, charge state prediction, and adduct ion matching) need to be optimized together. The role of the weight factor is to dynamically adjust the importance of each candidate peak in the loss function; for candidate peaks with high chemical rationality (such as isotope peaks or adduct ion peaks with high matching degrees), a larger weight is given to them, so that they have a greater impact on the model during training; by introducing the weight factor, the model can more accurately locate the true fragment peak area while suppressing the interference of background noise and artifacts):

[0098] ;

[0099] Where, It represents the isotope spacing matching degree (Gaussian kernel calculation, differentiable), reflecting the consistency between the candidate peak and its theoretical isotope distribution. If the candidate peak highly matches the theoretical isotope distribution, it means that it is more likely to be a real fragment peak. It represents the convolution similarity of the adduct ion template (differentiable), reflecting the matching degree between the candidate peak and the known adduct ion pattern. A high similarity indicates that the peak may be formed by a common adduct ion. Represents an adjustable coefficient, which is used to control the impact of different matching degrees on the weight;

[0100] The isotope spacing matching and additive similarity are used as differentiable gradient adjustment factors to automatically enhance the response of peak regions that meet the rules during back propagation. (Using these differentiable gradient adjustment factors for back propagation allows the model to place greater emphasis on data points that meet the expected chemical pattern during training. This means that when updating the model parameters, the algorithm will tend to increase the confidence of predictions near the correct peak position while reducing the influence of background noise or irrelevant signals. This allows for more accurate positioning and identification of true fragment peak regions.)

[0101] At the same time, a continuous penalty is imposed on predictions that contradict the charge state and isotope spacing. , forcing the model to output structural features that conform to the mass spectrometry fragmentation law, avoiding the occurrence of pseudo-peak identification results that have no physical meaning, and making the prediction results more consistent with the mass spectrometry fragmentation mechanism by explicitly constraining the physical rationality of the model output, and continuously punishing Negatively constrain the model from the physical rule level to avoid the contradiction between charge state and peak distance. By fixing the coefficient It acts independently on the total loss, emphasizing the non-compromise of physical rules, while the weights of other tasks are dynamically adjusted to optimize the multi-task balance;

[0102] ;

[0103] Where, represents the measured isotopic spacing; represents the observed charge state; represents the predicted state of charge; represents the penalty intensity coefficient;

[0104] S2.33. Adopt an adaptive task weighting method based on uncertainty modeling, and dynamically adjust the weight of each task loss according to the uncertainty of the prediction results of each subtask. In the initial stage, set the peak segmentation task as the main task (such as the initial weight is 0.6), and the charge state and adduct ion matching tasks each have a secondary weight (such as 0.2 each). As the training progresses, the weight of each subtask is automatically adjusted according to the prediction confidence and loss convergence, so that the optimization direction is more balanced and a single task does not dominate the model learning; and use the LSTM network to dynamically generate task weights, and update the main model parameters with conventional multi-task loss. The chemical rule-driven meta-gradient is generated through a small-scale MLP to maximize the validation set rule compliance (in multi-task learning, the difficulty and convergence speed of different subtasks (such as peak segmentation, charge state prediction, adduct ion matching) may be different. If the loss function value of some tasks is too large or too small, it may cause these tasks to dominate the training process. The learning of other tasks is neglected. The initial task weight allocation (0.6 for peak segmentation and 0.2 for charge state and adduct ion matching) ensures that the model prioritizes learning the primary task (such as peak segmentation) while also taking into account secondary tasks. As training progresses, the weights are dynamically adjusted based on the prediction confidence and loss convergence of each task, allowing the model to optimize all tasks more evenly and avoid excessive influence of a single task on the overall learning process. The LSTM network is used to dynamically generate task weights, which can quantify the difficulty of each task in real time (such as the segmentation task's Intersection of Union, charge classification error, and mean contrast loss), and automatically adjust the task weights based on these metrics. This dynamic adjustment mechanism allows the model to flexibly adapt to changes in task difficulty and maintain a balanced optimization direction. By introducing chemical rule-driven meta-gradients (generated by a small-scale MLP), the model's understanding of mass spectrometry fragmentation patterns can be further strengthened based on multi-task learning.

[0105] Among them, the LSTM network is used to dynamically generate task weights:

[0106] ;

[0107] in, Indicates the difficulty of the segmentation task (1-batch average IoU); represents the charge classification error; represents the mean contrast loss; Indicates the The first iteration The weight of each task;

[0108] Introducing task discriminator Optimize shared features (In multi-task learning, different tasks may conflict with shared features. The peak segmentation task may focus more on local details, while the charge state prediction task may rely on global information. This conflict may make it difficult for the model to optimize multiple tasks simultaneously. By introducing an adversarial task discriminator , the shared feature representation can be optimized so that the shared features can meet the needs of a single task while taking into account the overall goals of multiple tasks. This can effectively alleviate the conflict between tasks and improve the overall performance of the model):

[0109] ;

[0110] Where, Represents shared features;

[0111] Among them, the main model parameters updated by conventional multi-task loss are:

[0112] ;

[0113] Where, Represents the weight of each subtask loss; represents the weight of the adversarial loss; It means fighting against loss;

[0114] Chemical rule-driven meta-gradient generation via small-scale MLP , maximize the verification set rule compliance:

[0115] ;

[0116] Parameter update: ;

[0117] Where, Represents the multi-task loss with respect to model parameters gradient; Represents the current model parameters; represents the learning rate;

[0118] Training process:

[0119] Phase 1 (rule pre-training): Pre-train the DCR module on synthetic data to enforce learning of chemical rules;

[0120] Phase 2 (dynamic course learning): gradually increase the complexity of adduct ion types, and LSTM dynamically adjusts task weights;

[0121] Phase 3 (meta-gradient fine-tuning): Optimize the meta-learner based on real data to improve rule generalization.

[0122] This method realizes multi-task joint optimization by deeply integrating the differentiable chemical rule engine (DCR) with meta-gradient optimization. Specifically, first, a ternary loss function of weighted Dice loss (main task), cross entropy loss (charge classification) and contrast loss (additive matching) is constructed, where the weight factor of weighted Dice loss is Dynamically integrate isotope spacing matching (Gaussian kernel calculation) and additive template convolution similarity to enhance peak region responses that conform to chemical rules through back propagation; at the same time, design continuous penalty terms The charge state prediction is constrained to be physically consistent with the isotope spacing. Secondly, a dynamic curriculum learning mechanism is introduced: based on the LSTM network, the segmentation task difficulty (1-IoU), charge classification error and contrast loss mean are quantified in real time to generate adaptive task weights, and the adversarial task discriminator is used to optimize shared features to avoid multi-task conflicts. Furthermore, a two-layer meta-learning framework is adopted, and the inner layer is trained through conventional multi-task loss. Update the main model parameters, and the outer layer generates meta-gradients through MLP Maximize the conformity of the chemical rules in the validation set to achieve global alignment of the gradient direction and the mass spectrometry fragmentation mechanism; finally, the training is divided into three stages: rule pre-training (multimodal data forces learning of isotope / adduct rules), dynamic curriculum learning (gradually increasing the complexity of adduct ions and adjusting weights), and meta-gradient fine-tuning (real data optimizes generalization). This method improves the accuracy of fragment peak identification and chemical rationality simultaneously through differentiable encoding of chemical rules, dynamic task collaboration and meta-learning optimization.

[0123] S3, extracting the optimal fragmentation peak region from the output of the two-branch convolutional neural network model;

[0124] In this embodiment, extracting the optimal fragment peak region from the output of the dual-branch convolutional neural network model and optimizing the output result include the following steps:

[0125] S3.1. Set the confidence threshold m to filter the high-confidence fragment peak regions;

[0126] S3.2. Traverse each pixel in the segmentation probability map and mark the area with probability value higher than the confidence threshold m as "high confidence fragment peak area". For areas with probability value lower than the confidence threshold m, treat them as background or noise and exclude them.

[0127] S3.3. Define a comprehensive confidence scoring formula by combining the segmentation probability map, charge state prediction, and adduct ion matching probability to further optimize the selection of high-confidence fragment peak regions. For a region with a high segmentation probability but a low corresponding charge state prediction and adduct ion matching probability, lower its confidence score.

[0128] Furthermore, the segmentation probability map, charge state prediction, and adduct ion matching probability are combined to define a comprehensive confidence scoring formula, which includes the following steps:

[0129] S3.31. Utilize the peak region probability heatmap output by the two-branch convolutional neural network model and directly use the probability value output by the two-branch convolutional neural network model. The probability value directly reflects the model's ability to segment the peak region and is the basic indicator for the comprehensive confidence score.

[0130] S3.32. Calculate a matching score matrix for candidate peaks using the preset adduct ion templates and select the maximum matching score. Specifically, for each candidate peak, calculate its matching score with each adduct ion template to form a matching score matrix. Select the maximum matching score to indicate the most likely adduct type.

[0131] S3.33. Calculate the charge consistency score based on the deviation between the measured isotope spacing and the theoretical value;

[0132] S3.34. The probability value, maximum matching score and consistency score are multiplied and fused to calculate the comprehensive confidence score. By multiplying and fusion the probability value, the additive matching score and the charge consistency score, the comprehensive confidence score is designed to strictly screen the fragment peaks that conform to the model prediction, the additive rule and the charge physics law at the same time. Its advantage is that the false detection rate is significantly reduced through the nonlinear penalty mechanism to ensure that high-confidence peaks meet multidimensional chemical constraints.

[0133] The overall confidence score is:

[0134] ;

[0135] in, Indicates the The comprehensive confidence score of the candidate peaks, represents the probability value; represents the maximum matching score; represents the charge consistency score, represents the normalized isotopic spacing (i.e., the mass difference between adjacent isotopic peaks divided by the charge state);

[0136] S3.4. Re-evaluate the confidence of each fragment peak region based on the comprehensive confidence score;

[0137] S3.5. Output a list of all fragment peaks with a confidence score greater than m. Information about each peak includes: mass-to-charge ratio (peak center position), intensity (peak height or integrated area), charge state (predicted value), adduct ion type (match result), and overall confidence score;

[0138] S3.6. Sort the fragment peak list according to the comprehensive confidence score, and give priority to displaying the fragment peaks with a confidence score greater than m.

[0139] Example 2: This example provides a mass spectrum ion fragment peak region identification device based on deep learning, comprising a sensor, a storage, a processor, and a computer program stored in the storage and runnable on the processor. When the processor executes the computer program, the steps of the mass spectrum ion fragment peak region identification method based on deep learning are implemented.

[0140] This embodiment provides a mass spectrum ion fragmentation peak region identification device based on deep learning, including a mass spectrum data acquisition module, a model building and identification module, and a fragmentation peak extraction module;

[0141] The mass spectrum data acquisition module is used to collect mass spectrum data and pre-process the mass spectrum data;

[0142] The model building and recognition module is used to build a two-branch convolutional neural network model based on the preprocessed mass spectrum data and combined with charge state constraints and adduct ion probability weights (isotope distribution, adduct ion rules) to identify the fragment peak region in the mass spectrum;

[0143] The fragment peak extraction module is used to extract the optimal fragment peak region from the output of the two-branch convolutional neural network model.

[0144] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and improvements fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for identifying ion fragment peak regions in mass spectra based on deep learning, characterized in that: The following steps are involved: S1. collecting mass spectrum data and preprocessing the mass spectrum data; S2. Construct a two-branch convolutional neural network model based on the preprocessed mass spectrum data and combined with charge state constraints and adduct ion probability weights to identify fragment peak regions in the mass spectrum. A multi-task loss function is constructed to optimize the process of constructing the two-branch convolutional neural network model by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching. In S2, identifying the fragment peak region in the mass spectrum based on a two-branch convolutional neural network model includes the following steps: S2.

1. receiving preprocessed mass spectrum data as input data, and embedding charge state and adduct ion rule information into the input data to generate bimodal input data; S2.

2. Construct one-dimensional convolutional layers and two-dimensional convolutional layers in a two-branch convolutional neural network model. Among them, the one-dimensional convolution layer is used to capture local peak details; The 2D convolutional layer is used to capture the global noise distribution pattern; S2.

3. Jointly optimize peak region segmentation, charge state prediction, and adduct ion matching to construct a multi-task loss function. S2.

4. Pre-training a two-branch convolutional neural network model using the bimodal input data. After training, the two-branch convolutional neural network model outputs a probability heat map, a charge state, and an adduct ion matching score matrix. S3, extracting the optimal fragmentation peak region from the output of the two-branch convolutional neural network model; In S3, the optimal fragment peak region is extracted from the output of the dual-branch convolutional neural network model, and the output result is optimized, including the following steps: S3.

1. Set the confidence threshold m; S3.

2. Traverse each pixel in the segmentation probability map and mark the area with a probability value higher than the confidence threshold m as a "high confidence fragmentation peak area". For areas with a probability value lower than the confidence threshold m, treat them as background and exclude them. S3.

3. Combine the segmentation probability map, charge state prediction, and adduct ion matching probability to define a comprehensive confidence scoring formula to further optimize the selection of high-confidence fragment peak regions; S3.

4. Re-evaluate the confidence of each fragment peak region based on the comprehensive confidence score; S3.

5. Output a list of all fragment peaks with a confidence score greater than m; S3.

6. Sort the fragment peak list according to the comprehensive confidence score, and give priority to displaying the fragment peaks with a confidence score greater than m.

2. The method for identifying ion fragment peak regions in mass spectra based on deep learning according to claim 1, characterized in that: In S2.1, the pre-processed mass spectrum data is received as input data, and charge state and adduct ion rule information are embedded in the input data to generate bimodal input data, including the following steps: S2.

11. Predict the charge state of candidate peaks based on the isotope peak spacing in the mass spectrometry signal; S2.

12. For each candidate peak, calculate the mass-to-charge ratio of the resulting adduct ion based on its mass-to-charge ratio, assign a probability value to each formation result using a Gaussian distribution, and construct an adduct ion probability weight matrix; S2.

13. For each candidate peak, calculate the probability that its mass-to-charge ratio matches the theoretical adduct ion mass-to-charge ratio; S2.

14. The original mass spectrum signal is combined with the adduct ion matching probability and charge state as the input of the two-branch convolutional neural network model.

3. The method for identifying ion fragment peak regions in mass spectra based on deep learning according to claim 2, characterized in that: In S2.2, constructing a one-dimensional convolutional layer includes the following steps: S2.

21. Select the convolution kernel, which includes small-scale kernel, medium-scale kernel, and large-scale kernel. S2.22, use convolution kernels of different scales in parallel to extract local features of different ranges; S2.

23. Concatenate the convolution results at the three scales along the channel dimension to form a multi-channel feature representation, and introduce skip connections to optimize the multi-channel feature representation to retain the original signal characteristics.

4. The method for identifying ion fragment peak regions in mass spectra based on deep learning according to claim 2, characterized in that: In S2.2, constructing a two-dimensional convolutional layer includes the following steps: S2.24, use multiple levels of 2D convolutional layers to gradually expand the receptive field and capture the global noise pattern; S2.

25. Use dilated convolution in deep layers to expand the receptive field without increasing the number of parameters. S2.

26. Use pooling windows of different sizes in parallel to capture multi-scale noise distribution and concatenate the multi-scale pooling results into a fixed-length feature vector; S2.27, add a spatial attention module to make the network focus on high-frequency noise areas; S2.28, use a high-pass filter to preprocess the spectrum to highlight the noisy areas; S2.

29. Generate a two-dimensional probability map and mark the high noise confidence areas.

5. The method for identifying ion fragment peak regions in mass spectra based on deep learning according to claim 2, characterized in that: In S2.3, the multi-task loss function is constructed by jointly optimizing peak region segmentation, charge state prediction, and adduct ion matching, including the following steps: S2.

31. Construct a multi-task loss function to simultaneously optimize the three subtasks of fragment peak region segmentation, charge state prediction, and adduct ion matching; The weighted Dice loss function is used as the main loss term for the fragment peak region segmentation task; the cross entropy loss function is used for the charge state prediction task; and the adduct ion matching task adopts the adduct ion contrast loss function based on contrastive learning, and optimizes the adduct ion matching based on the feature space distance. S2.

32. For each candidate peak, a weight factor is constructed based on the probability of matching it with the theoretical isotope distribution and the adduct ion offset. The isotope spacing matching and adduct similarity are used as differentiable gradient adjustment factors to automatically enhance the response of peak regions that meet the rules during backpropagation. At the same time, a continuous penalty is applied to predictions that conflict between the charge state and the isotope spacing. S2.

33. Adopt an adaptive task weighting method based on uncertainty modeling to dynamically adjust the weight of each task loss according to the uncertainty of the prediction results of each subtask; and use the LSTM network to dynamically generate task weights, update the main model parameters with conventional multi-task losses, and generate chemical rule-driven meta-gradients through a small-scale MLP to maximize the compliance of the verification set rules.

6. The method for identifying ion fragment peak regions in mass spectra based on deep learning according to claim 1, characterized in that: In S3.3, the segmentation probability map, charge state prediction, and adduct ion matching probability are combined to define a comprehensive confidence scoring formula, including the following steps: S3.

31. Utilize the peak region probability heatmap output by the two-branch convolutional neural network model and directly use the probability value output by the two-branch convolutional neural network model; S3.

32. Calculate the matching score matrix of the candidate peaks using the preset adduct ion template and select the maximum matching score; S3.

33. Calculate the charge consistency score based on the deviation between the measured isotope spacing and the theoretical value; S3.

34. Multiply the probability value, the maximum matching score, and the consistency score to obtain a comprehensive confidence score.

7. A device for identifying ion fragment peak regions in a mass spectrum based on deep learning, comprising a sensor, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for identifying ion fragment peak regions in a mass spectrum based on deep learning according to any one of claims 1 to 6 are implemented.

8. The device for identifying ion fragment peak regions in mass spectra based on deep learning according to claim 7, characterized in that: It includes mass spectrum data acquisition module, model building and recognition module and fragment peak extraction module; The mass spectrum data acquisition module is used to collect mass spectrum data and pre-process the mass spectrum data; The model building and recognition module is used to build a two-branch convolutional neural network model based on the preprocessed mass spectrum data and combined with charge state constraints and adduct ion probability weights to identify the fragment peak area in the mass spectrum; The fragment peak extraction module is used to extract the optimal fragment peak region from the output of the two-branch convolutional neural network model.

Citation Information

Patent Citations

  • Vocs mass spectrum ion fragment peak region identification method and device based on deep learning

    CN116500118A

  • Zero sample learning-based mass spectrum image super-resolution reconstruction method

    CN118014843A