Deep learning based mycotoxin non-targeted screening mass spectrometry data processing method
By using deep learning-based mass spectrometry structures and multi-scale wavelet transforms, the problems of accuracy in fungal toxin identification and discrimination of unknown toxins in existing technologies have been solved, achieving highly sensitive and specific toxin screening and improving the automation level of food safety monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN AGRICULTURAL PRODUCTS PROCESSING & QUALITY SAFETY RESEARCH INSTITUTE
- Filing Date
- 2025-12-03
- Publication Date
- 2026-07-24
AI Technical Summary
Existing non-targeted screening methods for fungal toxin identification suffer from insufficient ion peak correlation modeling and static judgment mechanisms that are difficult to reliably identify unknown toxins, resulting in low identification accuracy and high false positive or false negative rates.
A mass spectrum graph structure is constructed based on deep learning. By using ion peaks as nodes and mass spectrometry relationships as edges, graph-level feature vectors are generated. Combined with multi-scale wavelet transform and dynamic decision boundary, deep semantic modeling and high-sensitivity discrimination of mass spectrometry data are achieved.
It improves the accuracy of identifying known mycotoxins and the structural interpretability of unknown toxins, thereby enhancing the foresight and automation of food safety risk monitoring.
Smart Images

Figure CN121617459B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of foodborne toxin detection technology, and in particular to a deep learning-based method for non-targeted screening mass spectrometry data processing of fungal toxins. Background Technology
[0002] In recent years, with the rapid development of high-resolution mass spectrometry (HRMS) technology, non-targeted screening has become an important means of identifying trace harmful substances such as mycotoxins in food safety risk monitoring. Meanwhile, breakthroughs in deep learning technology, particularly in image recognition and natural language processing, have gradually penetrated the field of mass spectrometry data analysis, providing a new paradigm for the automatic interpretation and pattern recognition of complex spectra. In particular, graph neural networks (GNNs), due to their natural adaptability to structured data, have been explored for modeling fragmentation, isotopic relationships, and adsorption relationships between ion peaks in mass spectrometry, driving a paradigm shift from "data processing" to "semantic understanding."
[0003] However, existing non-targeted screening methods still face two major bottlenecks: First, most data processing procedures rely on fixed rules or shallow machine learning models, which makes it difficult to effectively model the complex mass spectrometry correlations between ion peaks, resulting in insufficient feature expression capabilities and limited sensitivity and specificity for distinguishing structurally similar toxins or novel derivatives; Second, existing classification or matching strategies usually use static thresholds or Euclidean distance metrics, ignoring the differences in distribution density of known fungal toxin categories in the feature space and the uncertainty of multi-scale features, which can easily lead to false positives or missed detections, especially when facing unknown or variant fungal toxins, lacking a reliable "unknown identification" mechanism. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a deep learning-based method for non-targeted screening of fungal toxins using mass spectrometry data processing to address the problems of insufficient ion peak correlation modeling leading to low identification accuracy and the difficulty of reliably identifying unknown toxins using static judgment mechanisms in existing technologies.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: This invention provides a deep learning-based method for non-targeted screening of mycotoxins using mass spectrometry data processing. The method includes: acquiring mass spectrometry data of a sample; generating a standardized peak list after peak detection and alignment; constructing a mass spectrum structure based on the standardized peak list, using ion peaks as nodes and mass spectrometric relationships between ion peaks as edges; identifying different mass spectrometric relationship types based on the connection relationships between nodes in the mass spectrum structure, and constructing different meta-paths from the starting ion peak to the ending ion peak to generate a graph-level feature vector characterizing the entire mass spectrum structure; performing multi-scale wavelet transform on the graph-level feature vector, and combining it with the distribution density values of known mycotoxin categories in the feature space to obtain a calibration distance matrix; extracting the multi-scale distance components corresponding to each known mycotoxin category and performing weighted fusion to obtain the minimum attribution distance; comparing the minimum attribution distance with a dynamic decision boundary to determine whether the sample contains known mycotoxins and suspected unknown mycotoxins.
[0007] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for fungal toxins described in this invention, the steps for acquiring the mass spectrometry data of the sample, performing peak detection and alignment processing, and generating a standardized peak list are as follows: The mass spectrometry data of the sample is acquired and denoised by parametric wavelet transform for signal-to-noise ratio estimation to obtain the denoised mass spectrometry data. A dynamic collaborative filtering algorithm is used to perform peak detection on the denoised mass spectrometry data to generate a preliminary peak list. Cross-sample peak alignment is performed on the preliminary peak list to generate a standardized peak list.
[0008] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for fungal toxins described in this invention, the specific steps for constructing a mass spectrum structure based on a standardized peak list, with ion peaks as nodes and mass spectrometric relationships between ion peaks as edges, are as follows. Based on the standardized peak list, a multi-dimensional node feature vector is constructed for each ion peak; Based on the rules of mass spectrometry, various types of ion peak relationships are defined, and the similarity score between any two ion peak nodes for each type of relationship is calculated based on the multi-dimensional node feature vector. Based on the probability of each relation type, add edges of the corresponding type to node pairs whose probability exceeds the edge creation threshold, and construct the mass spectrum graph structure.
[0009] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for fungal toxins described in this invention, the multidimensional node feature vector includes mass-to-charge ratio, retention time, intensity, and derived features.
[0010] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for fungal toxins described in this invention, the specific steps for identifying different mass spectrometry relationship types based on the connection relationships between nodes in the mass spectrum structure are as follows. Based on the connection relationships between nodes in the mass spectrum structure, a multi-head attention mechanism is used to aggregate neighbor node information and update the feature representation of each ion peak node. By identifying the mass-to-charge ratio difference between ion peak nodes in the mass spectrum structure using mass spectrometry rules and matching it with the theoretical fragment mass deviation table, different types of mass spectrometry relationships can be identified.
[0011] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for fungal toxins described in this invention, the different mass spectrometry relationship types include fragmentation relationships, isotope relationships, and adduction ion relationships.
[0012] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for mycotoxins described in this invention, the specific steps for constructing different meta-paths from the starting ion peak to the ending ion peak to generate a graph-level feature vector characterizing the entire mass spectrum structure are as follows. Based on the identified different mass spectrometry relationships, different meta-paths from the starting ion peak to the ending ion peak are constructed. Iterative feature transformation and information propagation are performed on the feature representation of each updated ion peak node along different meta-paths to generate higher-order node embeddings; Importance-weighted pooling is applied to the embeddings of higher-order nodes to generate graph-level feature vectors that characterize the structure of the entire mass spectrum.
[0013] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for mycotoxins described in this invention, the specific steps for obtaining the calibration distance matrix by performing multi-scale wavelet transform on the graph-level feature vectors and combining it with the known distribution density values of mycotoxin categories in the feature space are as follows. Multi-scale wavelet transform is performed on the graph-level feature vectors and the prototype vectors of all known fungal toxin categories to obtain the multi-scale feature representation of the sample to be tested and the set of multi-scale feature representations of known fungal toxin categories. Calculate the multimodal distance between the multi-scale feature representation of the sample to be tested and the multi-scale feature representation of each category in the set of multi-scale feature representations of known fungal toxin categories, and generate an initial distance matrix through multi-scale feature interaction integration; The initial distance matrix is corrected by local density inverse weighting, and the corrected distance matrix is obtained by combining the distribution density values of known fungal toxin categories in the feature space.
[0014] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for mycotoxins described in this invention, the specific steps for extracting the multi-scale distance components corresponding to each known mycotoxin category and performing weighted fusion to obtain the minimum attribution distance are as follows. Dynamic uncertainty calibration is performed on the calibration distance matrix to generate a calibrated distance set, and multi-scale distance components corresponding to each known fungal toxin category are extracted. Based on the variance inverse weighting strategy of multi-scale distance components, the multi-scale distance components of each known fungal toxin category are weighted and fused to obtain the comprehensive distance value of each category; The minimum value is selected from the comprehensive distance values of each category as the minimum belonging distance.
[0015] As a preferred embodiment of the deep learning-based non-targeted screening mass spectrometry data processing method for mycotoxins described in this invention, the specific steps for comparing the minimum attribution distance with the dynamic decision boundary to determine whether the sample contains known mycotoxins and suspected unknown mycotoxins are as follows. The minimum attribution distance and the comprehensive distance values of each category are calculated by fusing multiple criteria to generate the attribution probability value of the sample; Based on the distribution characteristics of the attribution probability value and the comprehensive distance value of each category, the degree of uncertainty in the decision is quantified. The judgment threshold is dynamically adjusted based on the degree of uncertainty to generate a dynamic decision boundary; If the minimum attribution distance is less than the dynamic decision boundary, the sample is determined to contain the corresponding known mycotoxin. If the minimum attribution distance is greater than or equal to the dynamic decision boundary, the sample is determined to contain a suspected unknown mycotoxin.
[0016] The beneficial effects of this invention are as follows: by constructing a mass spectrum structure with ion peaks as nodes and mass spectrometry relationships as edges, deep semantic modeling of complex mass spectrometry data is realized, thereby significantly improving the accuracy of known toxin identification and the structural interpretability of unknown toxins; by using multi-scale wavelet transform combined with dynamic decision boundaries for distance discrimination, high sensitivity and high specificity are synergistically optimized; and for the first time, a quantifiable unknown toxin determination mechanism is combined in non-targeted screening, improving the foresight and automation level of food safety risk monitoring. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1This is a flowchart of a deep learning-based mass spectrometry data processing method for non-targeted screening of fungal toxins.
[0019] Figure 2 A flowchart for constructing a mass spectrum structure.
[0020] Figure 3 The flowchart for generating graph-level feature vectors.
[0021] Figure 4 A flowchart for obtaining the minimum attribution distance. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides a deep learning-based method for processing mass spectrometry data for non-targeted screening of fungal toxins, comprising the following steps: S1. Obtain the mass spectrometry data of the sample, and generate a standardized peak list after peak detection and alignment.
[0026] The mass spectrometry data of the sample is acquired and denoised by parametric wavelet transform for signal-to-noise ratio estimation to obtain the denoised mass spectrometry data.
[0027] The specific process includes: in the mass spectrometry data processing for non-targeted screening of fungi in citrus samples, the signal-to-noise ratio (SNR) is estimated based on the local fluctuation characteristics of the mass spectrometry data of citrus samples; then, the threshold parameter of wavelet transform is dynamically set based on the SNR estimate; next, parametric wavelet transform is used to decompose the mass spectrometry data into multiple scales; noise components are filtered out at different scales based on the SNR estimate; and finally, the data is reconstructed through inverse wavelet transform to obtain the denoised mass spectrometry data.
[0028] A dynamic collaborative filtering algorithm was used to perform peak detection on the denoised mass spectrometry data to generate a preliminary peak list.
[0029] The specific process includes performing multi-scale sliding window analysis on the denoised mass spectrometry data, obtaining the local signal-to-noise ratio and peak shape characteristics of the mass spectrometry data within each window, and then using a dynamic collaborative filtering algorithm to comprehensively evaluate the peak continuity characteristics and background noise fluctuations of adjacent windows. When the collaborative judgment index of multiple adjacent windows exceeds the dynamic collaborative judgment threshold, the existence of a valid peak is confirmed. Finally, the mass-to-charge ratio center value, retention time, and peak intensity information of each confirmed peak are recorded to form a preliminary peak list containing all detected ion peaks.
[0030] It should be noted that the dynamic collaborative judgment threshold is preset based on the statistical characteristics of the signal intensity distribution and background noise distribution of known true peaks in historical mass spectrometry data, through ROC curve analysis.
[0031] Cross-sample peak alignment is performed on the preliminary peak list to generate a standardized peak list.
[0032] The specific process includes selecting a sample with a small retention time drift as a reference benchmark, for example, by analyzing the retention time standard deviation of internal standards or known high-abundance characteristic peaks in all samples and selecting the sample with the smallest standard deviation. Ion peaks in the preliminary peak lists of all other samples are matched and aligned according to the mass-to-charge ratio tolerance window and retention time drift curves. Ion peaks that fail to match are retained or removed based on their retention time regularity across multiple samples. Finally, the overall ion current is normalized and corrected for the intensity of all successfully aligned ion peaks, thereby generating a standardized peak list common to all samples.
[0033] It should be noted that the mass-to-charge ratio tolerance window is an allowable range of deviation in mass-to-charge ratio set based on the mass accuracy and measurement error of the mass spectrometer.
[0034] S2. Based on the standardized peak list, construct the mass spectrum structure with ion peaks as nodes and the mass spectrometric relationships between ion peaks as edges.
[0035] Based on the standardized peak list, a multi-dimensional node feature vector is constructed for each ion peak.
[0036] The specific process includes extracting the mass-to-charge ratio, retention time, intensity, and derived features of each ion peak from the standardized peak list as basic features, further obtaining the local signal-to-noise ratio, chromatographic peak shape symmetry coefficient, and binary identifier of whether the ion peak is triggered to fragment in the secondary mass spectrometer for each ion peak, and combining these basic features and derived features to form a fixed-dimensional multi-dimensional node feature vector to characterize the complete properties of the ion peak.
[0037] Based on mass spectrometry rules, various types of ion peak relationships are defined, and the similarity score for each type of relationship between any two ion peak nodes is calculated based on multi-dimensional node feature vectors. The expression is as follows: ; Among them, at the ion peak node and ion peak nodes Types of mass spectrometry relationships that exist between them Similarity score, This represents an ion peak node. Indicates another ion peak node. Indicates the type of mass spectrometry relationship. This represents a weighting coefficient used to adjust the importance of the squared mass-to-charge ratio difference term in the overall similarity calculation. Indicates ion peak node With ion peak nodes The measured difference in mass-to-charge ratio between the ion peaks they represent. This represents the theoretical mass-to-charge ratio difference defined for a specific type of mass spectrometry relationship. This represents the weighting coefficient for the retention time difference term. Indicates ion peak node With ion peak nodes The absolute value of the measured difference in retention time between the ion peaks they represent. This represents the coefficient used to adjust the weights of the interaction between the mass-to-charge ratio difference and the retention time difference.
[0038] The specific process involves clearly defining the possible fragmentation relationships, isotopic relationships, and adduct ion relationships between ion peaks according to mass spectrometry rules. Then, for any two ion peak nodes, a similarity score is calculated using a composite function that comprehensively considers the degree of agreement between the measured and theoretical mass-to-charge ratio differences, the closeness of the measured retention time differences, and the interaction between the two. The similarity score directly reflects the probability that two ion peak nodes conform to a certain mass spectrometry relationship.
[0039] It should be noted that mass spectrometry rules are empirical laws summarized through induction and theoretical deduction of experimental phenomena such as fragment ions, isotope peak clusters and adduct ions produced by a large number of known compounds in a mass spectrometer.
[0040] The mass spectrometry relationship type uses the corresponding theoretical mass-to-charge ratio difference as a specific numerical parameter, which is substituted into the similarity score expression for calculation.
[0041] Based on the similarity scores of each relation type, add edges of the corresponding type to node pairs whose probability exceeds the edge creation threshold, and construct the mass spectrometry graph structure.
[0042] The specific process includes comparing the similarity score of each mass spectrometry relationship type between any two ion peak nodes with the edge creation threshold. When the similarity score of a certain relationship type exceeds the edge creation threshold, an edge representing that relationship type is added between the corresponding ion peak node pairs. By traversing all possible ion peak node pairs and all mass spectrometry relationship types, all added edges and ion peak node sets are finally combined to form a complete mass spectrum structure.
[0043] It should be noted that the edge creation threshold is preset based on the similarity score distribution of verified ion peak relationship pairs in historical mass spectrometry data, through statistical quantile analysis.
[0044] S3. Based on the connection relationship between nodes in the mass spectrum structure, identify different mass spectrometry relationship types, construct different meta-paths from the starting ion peak to the ending ion peak, and generate graph-level feature vectors characterizing the entire mass spectrum structure.
[0045] Based on the connectivity between nodes in the mass spectrum structure, a multi-head attention mechanism is used to aggregate neighbor node information and update the feature representation of each ion peak node.
[0046] The specific process includes determining the set of neighboring nodes for each ion peak node based on the connection relationship between ion peak nodes in the mass spectrum structure; then using a multi-head attention mechanism to obtain the attention weight between the ion peak node and each neighbor node; performing a weighted summation of the feature representations of the neighbor nodes based on the attention weight to obtain the aggregated neighbor information; and finally fusing the feature representation of the ion peak node itself with the aggregated neighbor information to generate an updated feature representation of the ion peak node.
[0047] By identifying the mass-to-charge ratio difference between ion peak nodes in the mass spectrum structure using mass spectrometry rules and matching it with the theoretical fragment mass deviation table, different types of mass spectrometry relationships can be identified.
[0048] The specific process involves identifying the mass-to-charge ratio differences between ion peak nodes in the mass spectrum structure using mass spectrometry rules and matching them with the theoretical fragment mass deviation table. This allows for the determination of different types of mass spectrometry relationships present in the mass spectrum. Specifically, the process involves subtracting the mass-to-charge ratio values of each ion peak in the mass spectrum to obtain the difference, and then comparing these differences with known mass shifts listed in the theoretical fragment mass deviation table. This allows for the inference of possible mass spectrometry relationships between ion peaks, such as broken chemical bonds or lost functional groups.
[0049] It should be noted that the tolerance range is the allowable mass deviation range determined through experimental statistics and empirical calibration based on the mass measurement accuracy of the mass spectrometer and the theoretical mass fluctuation range of different mass spectrometry relationships.
[0050] Based on the identified different mass spectrometry relationships, different metapaths from the starting ion peak to the ending ion peak are constructed.
[0051] The specific process includes selecting the starting ion peak node from the identified mass spectrometry relationship types, and then expanding the path along the edges of the mass spectrum structure according to connection rules such as fragmentation relationship, isotope relationship and adduction relationship. Each time the expansion is performed, the adjacent node with a verified mass spectrometry relationship with the current node is selected as the next hop node. This process is repeated until the terminating ion peak node is reached or the expansion cannot continue, ultimately forming multiple meta-paths from the starting ion peak to the terminating ion peak connected by different mass spectrometry relationship types.
[0052] Iterative feature transformation and information propagation are performed on the feature representation of each updated ion peak node along different meta-paths to generate higher-order node embeddings.
[0053] The specific process includes: selecting a meta-path from the starting ion peak to the ending ion peak, and sequentially visiting each ion peak node on the path according to the order defined by the meta-path; in each iteration, performing linear transformation and nonlinear activation operations on the feature representation of the currently visited ion peak node, and passing the transformed feature information along the meta-path direction to the next adjacent ion peak node; repeating this feature transformation and information propagation step until the entire meta-path is traversed; performing the above operations on all different constructed meta-paths respectively; and finally concatenating or aggregating the final feature representations of each ion peak node obtained after multiple iterations on different meta-paths to generate a high-order node embedding containing complex semantic information.
[0054] It should be noted that the order of the metapath definition is based on the known mass spectrometry fragmentation rules and the logical sequence of reactions occurring in the biotransformation pathway.
[0055] Importance-weighted pooling is applied to the embeddings of higher-order nodes to generate graph-level feature vectors that characterize the structure of the entire mass spectrum.
[0056] The specific process includes: embedding importance weights for higher-order nodes of each ion peak node, which reflect the importance of the ion peak node in the mass spectrum structure; performing a weighted summation of the higher-order node embeddings of each ion peak node based on the obtained importance weights, and using the weighted summation result as the graph-level feature vector of the entire mass spectrum structure; this graph-level feature vector integrates the feature information of all ion peak nodes in the mass spectrum structure, and highlights the contribution of key ion peak nodes through importance weighting, thereby characterizing the entire mass spectrum structure.
[0057] It should be noted that the importance weights of higher-order node embeddings for each ion peak node are determined by aggregating the feature information of multi-hop neighbor nodes through a graph attention network.
[0058] S4. Perform multi-scale wavelet transform on the graph-level feature vectors, and combine it with the distribution density values of known fungal toxin categories in the feature space to obtain the correction distance matrix. Extract the multi-scale distance components corresponding to each known fungal toxin category and perform weighted fusion to obtain the minimum attribution distance.
[0059] Multi-scale wavelet transform is performed on the graph-level feature vectors and the prototype vectors of all known fungal toxin categories to obtain the multi-scale feature representation of the sample to be tested and the set of multi-scale feature representations of known fungal toxin categories.
[0060] The specific process includes performing a multi-scale wavelet transform on the graph-level feature vectors, decomposing the graph-level feature vectors into sub-band coefficients at different scales. These sub-band coefficients together constitute the multi-scale feature representation of the sample to be tested. At the same time, the same multi-scale wavelet transform is performed on the prototype vectors of all known mycotoxin categories, decomposing the prototype vector of each known mycotoxin category into sub-band coefficients at different scales. The multi-scale sub-band coefficients of all known mycotoxin categories together constitute the multi-scale feature representation set of the known mycotoxin categories.
[0061] Calculate the multimodal distance between the multi-scale feature representation of the test sample and the multi-scale feature representation of each category in the set of known fungal toxin categories. Generate an initial distance matrix through multi-scale feature interaction integration, expressed as: ; in, Indicates the sample to be tested and the first The comprehensive multimodal distance between known fungal toxin categories Index identifier representing scale. Indicates the total number of scales. Indicates the assignment to the first in multiscale analysis Weighting coefficients for each scale This represents the natural exponential function. This indicates that the mass spectrometry data of the sample under test is in the 1st... Eigenvector representation at each scale Indicates the first The known fungal toxin categories in the 1st Eigenvector representation at each scale Indicates the use of adjusting the first The bandwidth parameter that determines the degree to which feature distance affects similarity calculation at each scale.
[0062] The specific process includes: for each known mycotoxin category, the squared Euclidean distance between the feature vector representation of the test sample at each scale and the feature vector representation of the known mycotoxin category at the same scale is calculated. After proportional adjustment based on the squared bandwidth parameter of the corresponding scale, the natural exponential function is applied for transformation, and then multiplied by the weight coefficient of the corresponding scale to obtain the similarity component of that scale. Then, the similarity components of all scales are accumulated, and a negative natural logarithm operation is applied to the accumulated result to obtain the comprehensive multimodal distance between the test sample and the known mycotoxin category. After this process traverses all known mycotoxin categories, an initial distance matrix containing the comprehensive multimodal distances corresponding to each known mycotoxin category is formed.
[0063] The initial distance matrix is corrected by local density inverse weighting, and the corrected distance matrix is obtained by combining the distribution density values of known fungal toxin categories in the feature space.
[0064] The specific process includes estimating the feature vector distribution of all known mycotoxin categories using a kernel density estimation algorithm to obtain the distribution density value of the known mycotoxin categories in the feature space. This distribution density value reflects the degree of clustering of the known mycotoxin categories in the feature space. Then, based on the distribution density value, a local density inverse weighted correction is performed on each distance value in the initial distance matrix. Specifically, the distance value in the initial distance matrix is multiplied by the reciprocal of the distribution density value of the corresponding region where the known mycotoxin category is located. Finally, the weighted distance values are recombined into a corrected distance matrix.
[0065] Dynamic uncertainty calibration is performed on the calibration distance matrix to generate a calibrated distance set, and multi-scale distance components corresponding to each known fungal toxin category are extracted.
[0066] The specific process includes: obtaining the prediction variance of the graph-level feature vector based on the results of multiple forward propagations during the inference phase of the graph neural network model, and using the prediction variance as a dynamic uncertainty measure; then using this dynamic uncertainty measure to scale and adjust each distance value in the calibration distance matrix to generate a calibrated distance set; finally, separating the distance components corresponding to each known fungal toxin category at different scales from the calibrated distance set to form a multi-scale distance component set for each known fungal toxin category.
[0067] Furthermore, in constructing the graph neural network model, a data representation of the graph structure is defined, encoding node features and edge relationships. A message-passing mechanism is then established, updating node representations by aggregating neighbor node information. Appropriate graph convolutional layers or attention layers are then selected to construct the network architecture, and multiple layers are configured to capture dependencies of varying scopes. During the training phase of the graph neural network model, gradient descent is used to optimize the loss function, and finally, forward propagation achieves node or graph-level prediction tasks. The entire construction process must consider the model's expressive power.
[0068] Based on the variance inverse weighting strategy of multi-scale distance components, the multi-scale distance components of each known fungal toxin category are weighted and fused to obtain the comprehensive distance value of each category.
[0069] The specific process includes: statistically analyzing the dispersion of all samples belonging to the same known mycotoxin category across the multi-scale distance components of that known mycotoxin category; obtaining the variance of the multi-scale distance component of each known mycotoxin category among different samples; taking the reciprocal of the variance as the weight coefficient of the corresponding multi-scale distance component; and finally, weighting and summing the multi-scale distance component of each known mycotoxin category with the corresponding weight coefficient to obtain the comprehensive distance value of the known mycotoxin category.
[0070] The minimum value among the comprehensive distance values of each category is selected as the minimum belonging distance.
[0071] The specific process includes comparing the magnitudes of the comprehensive distance values of all known fungal toxin categories, selecting the comprehensive distance value with the smallest value, and using the smallest comprehensive distance value as the minimum belonging distance between the sample to be tested and the set of known fungal toxin categories.
[0072] S5. Compare the minimum attribution distance with the dynamic decision boundary to determine whether the sample contains known mycotoxins and suspected unknown mycotoxins.
[0073] The minimum attribution distance and the comprehensive distance values for each category are calculated by fusing multiple criteria to generate the attribution probability value of a sample. The expression is as follows: ; in, This represents the probability value of a test sample belonging to a known mycotoxin category. Represents the Gaussian error function. This represents the minimum combined distance value between the sample being tested and all known classes of mycotoxins. This represents the arithmetic mean of the combined distance values for all known fungal toxin categories. This represents the standard deviation of the combined distance values for all known fungal toxin categories.
[0074] The specific process includes: calculating a standardized score based on the combined distance values between the test sample and all known mycotoxin categories, combined with the arithmetic mean and standard deviation of the combined distance values of all known mycotoxin categories; then, substituting this standardized score into a Gaussian error function for transformation; finally, based on the transformation result, obtaining the probability value of the test sample belonging to a known mycotoxin category through linear adjustment. This probability value reflects the relative positional relationship of the test sample with the known categories in the overall distance distribution.
[0075] It should be noted that the Gaussian error function is a special function used to calculate the probability of a normal distribution, which maps the distance difference of the input to a probability value between zero and one.
[0076] Based on the distribution characteristics of the attribution probability value and the comprehensive distance value of each category, the degree of uncertainty in the decision is quantified.
[0077] The specific process includes constructing an information entropy function based on the distribution characteristics of the attribution probability value and the comprehensive distance value of each category, identifying the information entropy of the attribution probability value on the probability interval to measure the degree of uncertainty of the decision; the larger the information entropy value, the higher the degree of uncertainty of the decision, and the smaller the information entropy value, the higher the degree of certainty of the decision.
[0078] The decision threshold is dynamically adjusted based on the degree of uncertainty to generate a dynamic decision boundary.
[0079] The specific process includes: nonlinearly mapping the basic judgment threshold and the degree of uncertainty using a hyperbolic tangent function to convert the degree of uncertainty into an adjustment coefficient; then multiplying the basic judgment threshold and the adjustment coefficient to obtain the dynamic judgment threshold; this dynamic judgment threshold is the dynamic decision boundary. When the degree of uncertainty is high, the dynamic decision boundary will automatically increase to reduce the risk of misjudgment; when the degree of uncertainty is low, the dynamic decision boundary will decrease accordingly to improve detection sensitivity.
[0080] It should be noted that the specific range of the basic judgment threshold is usually set between 0.5 and 0.9. The basic judgment threshold is the optimal classification critical point determined by ROC curve analysis based on the distribution of the comprehensive distance values of known positive and negative samples in historical mass spectrometry data.
[0081] If the minimum attribution distance is less than the dynamic decision boundary, the sample is determined to contain the corresponding known mycotoxin. If the minimum attribution distance is greater than or equal to the dynamic decision boundary, the sample is determined to contain a suspected unknown mycotoxin.
[0082] The specific process involves comparing the minimum attribution distance with the dynamic decision boundary. If the minimum attribution distance is less than the dynamic decision boundary, the sample is determined to contain a known mycotoxin corresponding to the minimum attribution distance. If the minimum attribution distance is greater than or equal to the dynamic decision boundary, the sample is determined to contain a suspected unknown mycotoxin. This determination mechanism achieves accurate identification of known toxins and effective early warning of unknown toxins.
[0083] This embodiment also provides a computer device applicable to the case of a deep learning-based method for non-targeted screening mass spectrometry data processing of fungal toxins, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the deep learning-based method for non-targeted screening mass spectrometry data processing of fungal toxins as proposed in the above embodiment.
[0084] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0085] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the deep learning-based mass spectrometry data processing method for non-targeted screening of fungal toxins as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0086] In summary, this invention achieves deep semantic modeling of complex mass spectrometry data by constructing a mass spectrum structure with ion peaks as nodes and mass spectrometry relationships as edges, thereby significantly improving the accuracy of known toxin identification and the structural interpretability of unknown toxins. Furthermore, by combining multi-scale wavelet transform with dynamic decision boundaries for distance discrimination, it achieves synergistic optimization of high sensitivity and high specificity. For the first time, it incorporates a quantifiable unknown toxin determination mechanism in non-targeted screening, enhancing the foresight and automation level of food safety risk monitoring.
[0087] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A deep learning-based method for non-targeted screening mass spectrometry data processing of fungal toxins, characterized in that: include, The mass spectrometry data of the sample is acquired, and after peak detection and alignment, a standardized peak list is generated. Based on a standardized peak list, a mass spectrum structure is constructed with ion peaks as nodes and mass spectrometric relationships between ion peaks as edges. Based on the connection relationships between nodes in the mass spectrum structure, different types of mass spectrometry relationships are identified. The following steps are taken to construct different meta-paths from the starting ion peak to the ending ion peak, and generate a graph-level feature vector characterizing the entire mass spectrum structure: Based on the identified different mass spectrometry relationships, different meta-paths from the starting ion peak to the ending ion peak are constructed. Iterative feature transformation and information propagation are performed on the feature representation of each updated ion peak node along different meta-paths to generate higher-order node embeddings; The importance-weighted pooling process for higher-order node embeddings generates a graph-level feature vector characterizing the entire mass spectrum structure. This involves assigning importance weights to the higher-order node embeddings of each ion peak node, summing the weighted sums based on these weights, and using the sum as the graph-level feature vector for the entire mass spectrum structure. The importance weights of higher-order node embeddings for each ion peak node are determined by aggregating the feature information of multi-hop neighbor nodes through a graph attention network. The graph-level feature vectors are subjected to multi-scale wavelet transform, and the corrected distance matrix is obtained by combining the known distribution density values of fungal toxin categories in the feature space. The specific steps are as follows: Multi-scale wavelet transform is performed on the graph-level feature vectors and the prototype vectors of all known fungal toxin categories to obtain the multi-scale feature representation of the sample to be tested and the set of multi-scale feature representations of known fungal toxin categories. Calculate the multimodal distance between the multi-scale feature representation of the sample to be tested and the multi-scale feature representation of each category in the set of multi-scale feature representations of known fungal toxin categories, and generate an initial distance matrix through multi-scale feature interaction integration; The initial distance matrix is corrected by local density inverse weighting, and the corrected distance matrix is obtained by combining the distribution density values of known fungal toxin categories in the feature space. Extract the multi-scale distance components corresponding to each known fungal toxin category and perform weighted fusion to obtain the minimum attribution distance; The minimum attribution distance is compared with the dynamic decision boundary to determine whether the sample contains known mycotoxins and suspected unknown mycotoxins.
2. The method for processing mass spectrometry data for non-targeted screening of fungal toxins based on deep learning as described in claim 1, characterized in that: The mass spectrometry data of the acquired sample, after peak detection and alignment processing, generates a normalized peak list. The specific steps are as follows: The mass spectrometry data of the sample is acquired and denoised by parametric wavelet transform for signal-to-noise ratio estimation to obtain the denoised mass spectrometry data. A dynamic collaborative filtering algorithm is used to perform peak detection on the denoised mass spectrometry data to generate a preliminary peak list. Cross-sample peak alignment is performed on the preliminary peak list to generate a standardized peak list.
3. The method for processing non-targeted screening mass spectrometry data for fungal toxins based on deep learning as described in claim 2, characterized in that: The mass spectrum structure is constructed based on a standardized peak list, with ion peaks as nodes and mass spectrometric relationships between ion peaks as edges. The specific steps are as follows. Based on the standardized peak list, a multi-dimensional node feature vector is constructed for each ion peak; Based on the rules of mass spectrometry, various types of ion peak relationships are defined, and the similarity score between any two ion peak nodes for each type of relationship is calculated based on the multi-dimensional node feature vector. Based on the probability of each relation type, add edges of the corresponding type to node pairs whose probability exceeds the edge creation threshold, and construct the mass spectrum graph structure.
4. The method for processing mass spectrometry data for non-targeted screening of fungal toxins based on deep learning as described in claim 3, characterized in that: The multidimensional node feature vector includes mass-to-charge ratio, retention time, intensity, and derived features.
5. The method for processing mass spectrometry data for non-targeted screening of fungal toxins based on deep learning as described in claim 4, characterized in that: The specific steps for identifying different mass spectrometry relationship types based on the connection relationships between nodes in the mass spectrum structure are as follows. Based on the connection relationships between nodes in the mass spectrum structure, a multi-head attention mechanism is used to aggregate neighbor node information and update the feature representation of each ion peak node. By identifying the mass-to-charge ratio difference between ion peak nodes in the mass spectrum structure using mass spectrometry rules and matching it with the theoretical fragment mass deviation table, different types of mass spectrometry relationships can be identified.
6. The method for processing mass spectrometry data for non-targeted screening of fungal toxins based on deep learning as described in claim 5, characterized in that: The different types of mass spectrometry relationships include fragmentation relationships, isotopic relationships, and adduction ion relationships.
7. The method for processing mass spectrometry data for non-targeted screening of fungal toxins based on deep learning as described in claim 6, characterized in that: The process involves extracting multi-scale distance components corresponding to each known fungal toxin category, weighting and fusing them to obtain the minimum attribution distance. The specific steps are as follows: Dynamic uncertainty calibration is performed on the calibration distance matrix to generate a calibrated distance set, and multi-scale distance components corresponding to each known fungal toxin category are extracted. Based on the variance inverse weighting strategy of multi-scale distance components, the multi-scale distance components of each known fungal toxin category are weighted and fused to obtain the comprehensive distance value of each category; The minimum value is selected from the comprehensive distance values of each category as the minimum belonging distance.
8. The method for processing mass spectrometry data for non-targeted screening of fungal toxins based on deep learning as described in claim 7, characterized in that: The step of comparing the minimum attribution distance with the dynamic decision boundary to determine whether the sample contains known mycotoxins and suspected unknown mycotoxins is as follows. The minimum attribution distance and the comprehensive distance values of each category are calculated by fusing multiple criteria to generate the attribution probability value of the sample; Based on the distribution characteristics of the attribution probability value and the comprehensive distance value of each category, the degree of uncertainty in the decision is quantified. The judgment threshold is dynamically adjusted based on the degree of uncertainty to generate a dynamic decision boundary; If the minimum attribution distance is less than the dynamic decision boundary, the sample is determined to contain the corresponding known mycotoxin. If the minimum attribution distance is greater than or equal to the dynamic decision boundary, the sample is determined to contain a suspected unknown mycotoxin.