Mass spectrometry image recognition analysis method, apparatus, and computer program product

CN122949944APending Publication Date: 2026-10-20SHENZHEN HYMSON LASER INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610890475.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种质谱图谱图像识别分析方法、设备及计算机程序产品,旨在解决如何提升质谱图谱图像的识别分析准确性的技术问题

Benefits of technology

首先,通过将传统质谱一维信号映射为双通道的二维图谱图像,使卷积神经网络能够充分利用二维空间结构特征来捕捉特征信息,从而为后续高精度特征提取奠定数据基础;进一步地,调用轻量化多尺度特征融合卷积神经网络对二维图谱图像进行特征提取,提高复杂图谱中有效信号的识别精度;进一步地,对所述多尺度融合特征图施加质谱先验知识约束,强制输出符合质谱先验知识的多尺度融合特征图,抑制噪声和基质毛刺造成的假阳性,从而提升识别的准确性与可靠性;另外地,拆分修正后多尺度融合特征图的重叠峰区域并提取峰参数,从根本上解决难以处理重叠峰定量的问题,直接提升定量分析的准确性;最后,基于所述峰参数进行分类回归双分支识别得到识别分析结果,通过分类回归双分支识别实现定性识别与定量计算的一体化协同,避免流程割裂导致的误差累积,最终整体上提升质谱图谱图像的识别精度与定量分析准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This application discloses a mass spectrometry image recognition and analysis method, device, and computer program product, relating to the field of mass spectrometry analysis technology. The method includes: acquiring a raw one-dimensional mass spectrometry signal; converting the raw one-dimensional mass spectrometry signal into a two-dimensional mass spectrometry image with two channels; calling a pre-constructed lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional mass spectrometry image to obtain a multi-scale fusion feature map; applying mass spectrometry prior knowledge constraints to the multi-scale fusion feature map to obtain a corrected multi-scale fusion feature map; splitting the overlapping peak regions of the corrected multi-scale fusion feature map and extracting peak parameters; and performing classification regression bi-branch recognition based on the peak parameters to obtain the recognition and analysis results. This method improves the overall recognition accuracy and quantitative analysis accuracy of mass spectrometry images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mass spectrometry analysis technology, and in particular to mass spectrometry image recognition and analysis methods, equipment and computer program products. Background Technology

[0002] Mass spectrometry identification and analysis refers to acquiring the mass-to-charge ratio-ionic intensity sequence of sample ions using a mass spectrometer to form a one-dimensional or two-dimensional mass spectrum image, enabling the identification of unknowns, qualitative analysis of target substances, and quantitative analysis of concentrations. Currently, mass spectrometry identification and analysis mainly relies on manual annotation and experience-based judgment, which is insufficient to meet the needs of high-throughput batch detection. In complex matrices, it is difficult to accurately distinguish between effective signals and interference, resulting in low peak identification accuracy. Furthermore, due to its reliance on standard curves, it is greatly affected by instrument status, matrix effects, and ionization efficiency, leading to poor compatibility between different devices and samples, large quantitative errors, and ultimately impacting the accuracy of mass spectrometry identification and analysis.

[0003] Therefore, how to improve the accuracy of mass spectrometry image recognition and analysis has become a technical problem that this application urgently needs to solve. Summary of the Invention

[0004] The main objective of this application is to provide a method, device, and computer program product for mass spectrometry image recognition and analysis, aiming to solve the technical problem of how to improve the accuracy of mass spectrometry image recognition and analysis.

[0005] To achieve the above objectives, this application proposes a mass spectrometry image recognition and analysis method, the method comprising: Acquire raw one-dimensional mass spectrometry signal and convert the raw one-dimensional mass spectrometry signal into a two-dimensional spectral image with two channels; A pre-built lightweight multi-scale feature fusion convolutional neural network is invoked to extract features from the two-dimensional atlas image, resulting in a multi-scale fused feature map. Mass spectrometry prior knowledge constraints are applied to the multi-scale fused feature map to obtain a modified multi-scale fused feature map. The overlapping peak regions of the corrected multi-scale fused feature map are split and the peak parameters are extracted. Based on the peak parameters, a dual-branch classification and regression identification was performed to obtain the identification analysis results. In one embodiment, before the step of calling a pre-built lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional atlas image and obtain a multi-scale fused feature map, the method further includes: The basic framework of the model is built based on a pre-defined deep learning architecture; Define a composite loss function for the basic framework of the model and set a training strategy. The composite loss function includes a classification loss function, a regression loss function, and a prior knowledge loss function. Based on the training strategy and the pre-built training dataset, the basic framework of the model defining the composite loss function is iteratively trained to obtain the lightweight multi-scale feature fusion convolutional neural network.

[0006] In one embodiment, the step of converting the original one-dimensional mass spectrometry signal into a two-channel two-dimensional spectral image includes: The mass-to-charge ratio axis of the original one-dimensional mass spectrometry signal is calibrated using a linear correction formula to obtain the calibrated one-dimensional mass spectrometry signal. The baseline of the calibrated one-dimensional mass spectrometry signal is fitted and subtracted using the adaptive asymmetric least squares method to obtain the one-dimensional mass spectrometry signal with baseline drift subtracted. The mass spectrometry one-dimensional signal, after normalization to remove baseline drift, is used to obtain the mass-to-charge ratio intensity sequence. The mass-to-charge ratio intensity sequence is converted into grayscale feature maps and gradient feature maps respectively. The grayscale feature maps and gradient feature maps are then stitched together to obtain a two-dimensional spectral image with two channels.

[0007] In one embodiment, the step of extracting features from the two-dimensional atlas image to obtain a multi-scale fused feature map includes: The two-dimensional spectral image is input into the lightweight multi-scale feature fusion convolutional neural network for multi-scale parallel convolution, and mass spectral peak features are extracted based on the multi-scale parallel convolution. By splicing the mass spectrometry peak features, an initial multi-scale fused feature map is obtained; The initial multi-scale fused feature map is recalibrated using a channel attention mechanism to obtain the multi-scale fused feature map.

[0008] In one embodiment, the step of applying mass spectrometry prior knowledge constraints to the multi-scale fused feature map to obtain the corrected multi-scale fused feature map includes: The mass spectrometry prior knowledge constraint module of the lightweight multi-scale feature fusion convolutional neural network is invoked, and the mass spectrometry prior knowledge constraint module embeds mass spectrometry physicochemical rules and isotope distribution constraints. Based on the mass spectrometry physicochemical rules, the scale fusion feature map is subjected to prior constraints on mass-to-charge ratio and peak shape to obtain a preliminary constrained feature map. Based on the isotope distribution constraints, the preliminary constraint feature map is subjected to prior constraints on isotope abundance ratio to obtain the corrected multi-scale fusion feature map.

[0009] In one embodiment, the step of splitting and correcting the overlapping peak regions of the multi-scale fused feature map and extracting peak parameters includes: A Gaussian mixture model is used to split the overlapping peak regions of the modified multi-scale fused feature map, decoupling the overlapping peak regions into multiple single peaks; Extract the peak parameters of the single peak.

[0010] In one embodiment, the identification analysis results include quantitative analysis results and qualitative identification results. The step of performing classification regression bi-branch identification based on the peak parameters to obtain the identification analysis results includes: The peak parameters and the corrected multi-scale fusion feature map corresponding to the peak parameters are input into the qualitative classification branch of the lightweight multi-scale feature fusion convolutional neural network. The qualitative identification result is obtained by identifying the category probability distribution of the preset candidate substances through the qualitative classification branch. The peak parameters and the modified multi-scale fusion feature map corresponding to the peak parameters are input into the quantitative regression branch of the lightweight multi-scale feature fusion convolutional neural network. The concentration of the candidate substances was analyzed using the quantitative regression branch. Matrix background features are extracted from the corrected multi-scale fused feature map, and matrix interference compensation terms are calculated based on the matrix background features. The concentration of the substance is corrected based on the matrix interference compensation term to obtain quantitative analysis results.

[0011] In one embodiment, after the step of performing classification regression bi-branch identification based on the peak parameters to obtain the identification analysis results, the method further includes: Calculate quality control indicators based on the quantitative analysis results and the qualitative identification results; A standardized report is generated based on the quality control indicators and preset judgment criteria.

[0012] In addition, to achieve the above objectives, this application also proposes a mass spectrometry image recognition and analysis device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the mass spectrometry image recognition and analysis method described above.

[0013] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the mass spectrometry image recognition and analysis method described above.

[0014] One or more technical solutions proposed in this application have at least the following technical effects: First, by mapping the traditional one-dimensional mass spectrometry signal into a two-dimensional spectral image with two channels, the convolutional neural network can fully utilize the two-dimensional spatial structural features to capture feature information, thus laying a data foundation for subsequent high-precision feature extraction. Furthermore, a lightweight multi-scale feature fusion convolutional neural network is invoked to extract features from the two-dimensional spectral image, improving the recognition accuracy of effective signals in complex spectra. Further, mass spectrometry prior knowledge constraints are applied to the multi-scale fusion feature map, forcing the output of a multi-scale fusion feature map that conforms to mass spectrometry prior knowledge, suppressing false positives caused by noise and matrix spikes, thereby improving the accuracy and reliability of recognition. Additionally, overlapping peak regions in the corrected multi-scale fusion feature map are split and peak parameters are extracted, fundamentally solving the problem of difficult quantitative analysis of overlapping peaks, directly improving the accuracy of quantitative analysis. Finally, based on the peak parameters, classification and regression bi-branch recognition is performed to obtain the recognition analysis results. This bi-branch recognition achieves integrated coordination of qualitative recognition and quantitative calculation, avoiding error accumulation caused by process fragmentation, ultimately improving the overall recognition accuracy and quantitative analysis accuracy of the mass spectrometry image. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the first embodiment of the mass spectrometry image recognition and analysis method of this application. Figure 2 This is a flowchart illustrating the second embodiment of the mass spectrometry image recognition and analysis method of this application. Figure 3 This is a flowchart illustrating the third embodiment of the mass spectrometry image recognition and analysis method of this application. Figure 4 This is a flowchart illustrating the eighth embodiment of the mass spectrometry image recognition and analysis method of this application. Figure 5 This is a schematic diagram of the module structure of the mass spectrometry image recognition and analysis device according to an embodiment of this application; Figure 6 This is a schematic diagram of the hardware operating environment of the mass spectrometry image recognition and analysis method in the embodiments of this application.

[0018] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0019] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0020] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0021] The main solution of this application embodiment is as follows: acquire the original one-dimensional mass spectrometry signal, convert the original one-dimensional mass spectrometry signal into a two-dimensional image with dual channels; call a pre-constructed lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional image to obtain a multi-scale fusion feature map; apply mass spectrometry prior knowledge constraints to the multi-scale fusion feature map to obtain a corrected multi-scale fusion feature map; split the overlapping peak regions of the corrected multi-scale fusion feature map and extract peak parameters; perform classification regression bi-branch recognition based on the peak parameters to obtain the recognition analysis results.

[0022] In this embodiment, for ease of description, the following description uses a mass spectrometry image recognition and analysis system as the execution subject.

[0023] This application's embodiments take into account the following: Mass spectrometry identification and analysis refers to acquiring the mass-to-charge ratio-ionic intensity sequence of sample ions using a mass spectrometer to form a one-dimensional mass spectrum or a two-dimensional mass spectrum image, enabling the identification of unknowns, qualitative analysis of target substances, and quantitative analysis of concentrations. Currently, mass spectrometry identification and analysis mainly relies on manual annotation and experience-based judgment, which is difficult to meet the needs of high-throughput batch detection; in complex matrices, it is difficult to accurately distinguish between effective signals and interference, resulting in low peak identification accuracy; and because it relies on standard curves, it is greatly affected by instrument status, matrix effects, and ionization efficiency, leading to poor compatibility between different devices and samples, large quantitative errors, and thus affecting the accuracy of mass spectrometry identification and analysis.

[0024] Therefore, this application provides a solution. First, by mapping the traditional one-dimensional mass spectrometry signal into a two-dimensional spectral image with two channels, the convolutional neural network can fully utilize the two-dimensional spatial structural features to capture feature information, thus laying a data foundation for subsequent high-precision feature extraction. Further, a lightweight multi-scale feature fusion convolutional neural network is invoked to extract features from the two-dimensional spectral image, improving the recognition accuracy of effective signals in complex spectra. Further, mass spectrometry prior knowledge constraints are applied to the multi-scale fusion feature map, forcing the output of a multi-scale fusion feature map that conforms to mass spectrometry prior knowledge, suppressing false positives caused by noise and matrix spikes, thereby improving the accuracy and reliability of recognition. Additionally, the overlapping peak regions of the corrected multi-scale fusion feature map are split and peak parameters are extracted, fundamentally solving the problem of difficulty in quantifying overlapping peaks and directly improving the accuracy of quantitative analysis. Finally, based on the peak parameters, classification regression bi-branch recognition is performed to obtain the recognition analysis results. This classification regression bi-branch recognition achieves integrated collaboration between qualitative recognition and quantitative calculation, avoiding error accumulation caused by process fragmentation, ultimately improving the overall recognition accuracy and quantitative analysis accuracy of the mass spectrometry image.

[0025] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or mass spectrometry image recognition and analysis system capable of performing the above functions. The following description uses a mass spectrometry image recognition and analysis system as an example to illustrate this embodiment and the subsequent embodiments.

[0026] Based on this, embodiments of this application provide a method for mass spectrometry image recognition and analysis, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the mass spectrometry image recognition and analysis method of this application.

[0027] In this embodiment, the mass spectrometry image recognition and analysis method includes steps S10 to S50: Step S10: Acquire the original one-dimensional mass spectrometry signal and convert the original one-dimensional mass spectrometry signal into a two-dimensional spectral image with dual channels; The original one-dimensional mass spectrometry signal refers to the discrete data point sequence obtained directly by the mass spectrometer, with mass-to-charge ratio (m / z) as the abscissa and ion intensity as the ordinate.

[0028] A two-dimensional spectral image with two channels refers to a composite image that includes a grayscale feature map channel and a gradient feature map channel.

[0029] Specifically, the system first calibrates the mass-to-charge ratio axis of the original mass spectrum one-dimensional signal using a linear correction formula to eliminate the deviation caused by instrument drift; then, it uses an adaptive asymmetric least squares method to fit and subtract baseline drift; next, it normalizes the intensity using logarithmic compression and local normalization methods; finally, it maps the normalized mass-to-charge ratio-intensity sequence to a grayscale feature map, calculates the gradient to obtain a gradient feature map, and splices the two in the channel dimension to form a two-dimensional spectral image with two channels.

[0030] Step S20: Call the pre-built lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional atlas image to obtain a multi-scale fusion feature map; Lightweight multi-scale feature fusion convolutional neural networks refer to convolutional neural networks designed using strategies such as depthwise separable convolution and residual connections.

[0031] Specifically, the system first uses 1×1, 3×3 and 5×5 parallel convolutional kernels to extract features of isolated narrow peaks, regular single peaks and wide peaks or isotope clusters, respectively, and then splices them to form an initial multi-scale fusion feature map; then the channel attention module calculates the weights of each channel and recalibrates the feature map; finally, through depthwise separable convolution and residual connections, the multi-scale fusion feature map is output.

[0032] Step S30: Apply mass spectrometry prior knowledge constraints to the multi-scale fusion feature map to obtain the corrected multi-scale fusion feature map; Prior knowledge constraints in mass spectrometry include mass-to-charge ratio prior constraints, peak shape prior constraints, and isotope abundance ratio prior constraints.

[0033] Specifically, the system imposes a mass-to-charge ratio tolerance constraint on the multi-scale fused feature map, forces the peak shape to conform to a Gaussian or Lorentz distribution, and penalizes deviations between the isotope peak intensity ratio and the theoretical abundance ratio. Through joint optimization of the above constraints, the system outputs a corrected multi-scale fused feature map that conforms to the physical laws of mass spectrometry.

[0034] Step S40: Split the overlapping peak regions of the corrected multi-scale fused feature map and extract the peak parameters; Overlapping peak regions refer to the areas where the signal envelopes of two or more single peaks overlap due to their similar mass-to-charge ratios.

[0035] Specifically, the system first determines the number N of hidden single peaks and the initial centroid within the overlapping peaks using a heatmap; then, it uses a Gaussian mixture model to mathematically model the overlapping envelope and iteratively solves the parameters using the expectation-maximization algorithm; finally, it extracts peak parameters such as peak height, peak area, peak width, centroid position, and signal-to-noise ratio from each independent single peak after splitting.

[0036] Step S50: Based on the peak parameters, perform classification regression bi-branch identification to obtain the identification analysis results.

[0037] Dual-branch classification and regression identification refers to two parallel network branches that share underlying feature parameters. The identification and analysis results include quantitative analysis results and qualitative identification results. Specifically, the system simultaneously inputs peak parameters and corresponding multi-scale fusion feature maps into the qualitative classification branch and the quantitative regression branch: the classification branch outputs the probability distribution of preset candidate substances by category, and selects the category with the highest probability as the qualitative identification result; the regression branch outputs the predicted value of substance concentration, and extracts matrix background features from the corrected multi-scale fusion feature map to calculate compensation terms for concentration correction, thus obtaining the quantitative analysis results.

[0038] This embodiment provides a method for mass spectrometry image recognition and analysis. First, by mapping the traditional one-dimensional mass spectrometry signal into a two-dimensional image with two channels, the convolutional neural network can fully utilize the two-dimensional spatial structural features to capture feature information, thus laying a data foundation for subsequent high-precision feature extraction. Further, a lightweight multi-scale feature fusion convolutional neural network is invoked to extract features from the two-dimensional image, improving the recognition accuracy of effective signals in complex spectra. Further, mass spectrometry prior knowledge constraints are applied to the multi-scale fusion feature map, forcing the output of a multi-scale fusion feature map that conforms to mass spectrometry prior knowledge, suppressing false positives caused by noise and matrix spikes, thereby improving the accuracy and reliability of recognition. Additionally, overlapping peak regions of the corrected multi-scale fusion feature map are split and peak parameters are extracted, fundamentally solving the problem of difficult quantitative analysis of overlapping peaks, directly improving the accuracy of quantitative analysis. Finally, based on the peak parameters, classification and regression bi-branch recognition is performed to obtain the recognition and analysis results. This bi-branch recognition achieves integrated coordination of qualitative recognition and quantitative calculation, avoiding error accumulation caused by process fragmentation, ultimately improving the overall recognition accuracy and quantitative analysis accuracy of mass spectrometry images.

[0039] Based on the first embodiment of this application, a second embodiment of this application is proposed. In the second embodiment of this application, content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter.

[0040] Based on this, please refer to Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of this application, as shown below. Figure 2 As shown, before step S20, the mass spectrometry image recognition and analysis method further includes steps S01 to S03: Step S01: Build the basic framework of the model based on the preset deep learning architecture; Pre-defined deep learning architectures refer to pre-selected computing frameworks or development platforms used to build and train neural networks, such as PyTorch and TensorFlow, which provide basic functions such as automatic differentiation, GPU acceleration, and neural network layer encapsulation.

[0041] The basic framework of a model refers to an initial neural network model that has not yet been trained but whose network layer structure, connection methods, and forward propagation logic have been defined. This includes the organization of modules such as input layers, convolutional layers, pooling layers, and fully connected layers.

[0042] The system builds its basic model framework based on a pre-defined deep learning architecture (such as PyTorch or TensorFlow). First, the system defines a dual-channel input layer to receive grayscale-gradient dual-channel two-dimensional spectral images. Further, the system sequentially stacks a multi-scale parallel convolution module, a channel attention module, a depthwise separable convolution module, and a residual connection module to construct a feature extraction backbone network. Among them, the multi-scale parallel convolution module contains three types of convolution kernels: 1×1, 3×3, and 5×5, which are used to extract narrow-peak, regular single-peak, and wide-peak features, respectively.

[0043] The network branches into two parallel branches after the backbone: a qualitative classification branch and a quantitative regression branch. The qualitative classification branch ends with a fully connected layer and a Softmax activation function, and its output dimension equals the number of preset candidate substance categories. The quantitative regression branch ends with a fully connected layer and a linear activation function, used to output the concentration prediction value. Furthermore, the system embeds an interface for a mass spectrometry prior knowledge constraint module into the network, allowing subsequent integration of mass-to-charge ratio constraints, peak shape constraints, and isotope constraints into the loss function.

[0044] Step S02: Define a composite loss function for the basic framework of the model and set a training strategy. The composite loss function includes a classification loss function, a regression loss function, and a prior knowledge loss function. A composite loss function is a total loss function composed of a weighted combination of multiple loss terms of different properties. It is used to simultaneously optimize multiple learning objectives of a neural network. In this embodiment, it includes three components: classification loss, regression loss, and prior knowledge loss.

[0045] The classification loss function measures the difference between the probability distribution of substance categories predicted by the model and the true category labels; in this embodiment, the cross-entropy loss function is used. The regression loss function measures the difference between the concentration values ​​predicted by the model and the true concentration values; in this embodiment, a weighted joint loss of mean squared error and mean absolute error is used. The prior knowledge loss function embeds the physicochemical rules of mass spectrometry analysis (such as mass-to-charge ratio tolerance, peak shape distribution, and isotope abundance ratio) into the model as a loss term, constraining the network output to conform to the inherent laws of mass spectrometry.

[0046] Training strategy refers to a set of hyperparameter settings and optimization methods that guide the model training process, including optimizer type, learning rate, batch size, early stopping conditions, etc.

[0047] The system defines a composite loss function for the model's basic framework, which is a weighted fusion of three parts. The first part is the classification loss function, which uses cross-entropy loss, and its calculation formula is as follows:

[0048] in, For the first The true label of similar substances This part represents the probability of this type of substance predicted by the model, and is used to ensure the accuracy of qualitative identification.

[0049] The second part is the regression loss function, which uses a weighted joint loss of mean squared error and mean absolute error. The calculation formula is as follows:

[0050] in, and These are used to measure the squared deviation and absolute deviation between the predicted and actual concentration values, respectively, which are used to improve the accuracy of quantitative analysis. This is the weighting adjustment factor (usually set to 0.5).

[0051] The third part is the prior knowledge loss function, which includes the mass-to-charge ratio prior loss (applying a squared penalty when the deviation between the predicted mass-to-charge ratio and the theoretical value exceeds 5 ppm), the peak shape prior loss (forcing the output peak shape to conform to a Gaussian or Lorentz distribution), and the isotope abundance ratio prior loss (constraining the predicted isotope peak intensity ratio to be consistent with the theoretical abundance ratio). The weighted sum of these three constitutes the loss function. .

[0052] Among them, the mass-to-charge ratio prior constraint limits the allowable error range of the mass-to-charge ratio of the target material, and the mass-to-charge ratio prior loss for:

[0053] Incorporating isotope distribution constraints, matching the natural isotope abundance ratios, and reducing the prior loss of isotope abundance ratios. for:

[0054] Real mass spectrometry ion signals necessarily follow a Gaussian or Lorentz distribution in their physical morphology. By using the theoretical peak shape function as a regularization constraint term for the network output mask shape, we obtain the peak shape prior loss. .

[0055] in, : Corrected mass-to-charge ratio (m / z) true value.

[0056] The original mass-to-charge ratio measured by the instrument.

[0057] The network predicted the first k The intensity ratio of each isotope peak to the main peak.

[0058] Theoretical abundance ratios of natural isotopes calculated based on chemical elemental composition.

[0059] The total loss function weightedly integrates qualitative, quantitative, and prior constraints.

[0060] in, , , All of these are corresponding weights.

[0061] Furthermore, the system sets the training strategy as follows: the Adam optimizer is used for parameter updates, and the initial learning rate is set to 1×10⁻⁶. -4 The batch size was set to 32, and an early stopping strategy was adopted (training was stopped when the validation set loss did not decrease for 10 consecutive epochs) to prevent overfitting.

[0062] Step S03: Based on the training strategy and the pre-built training dataset, iteratively train the basic framework of the model that defines the composite loss function to obtain the lightweight multi-scale feature fusion convolutional neural network.

[0063] The training dataset refers to the set of samples used to train the neural network. Each sample contains input data (two-channel two-dimensional spectral image) and corresponding labels (substance category and concentration value), which can be divided into training set, validation set and test set in a ratio of 8:1:1.

[0064] The system first pre-constructs a training dataset, which can be derived from a public mass spectrometry database or self-built experimental data. Each sample includes a dual-channel two-dimensional spectrum image obtained by image conversion of the original one-dimensional mass spectrometry signal, the corresponding substance category label, and the concentration label.

[0065] The dataset is divided into training, validation, and test sets in an 8:1:1 ratio. The established model framework, combined with the defined composite loss function and training strategy, is used to iteratively train the model. In each training batch, the system inputs the dual-channel two-dimensional atlas images from the training set into the model. Forward propagation yields the predicted class probability distribution and concentration values. Classification loss, regression loss, and prior knowledge loss are calculated separately, and a weighted sum is obtained to obtain the total loss. Then, the gradient of each layer's parameters is calculated using the backpropagation algorithm, and the Adam optimizer is used at a 1×10⁻⁶ level. -4 The learning rate is used to update the network parameters.

[0066] After each epoch of training, the system evaluates the model's performance on the validation set. If the validation set loss does not decrease for 10 consecutive epochs, an early stopping strategy is triggered, terminating training and saving the current optimal model parameters. After training is complete, the system performs a final evaluation of the model on the test set to verify that its qualitative recognition accuracy and quantitative prediction error meet preset requirements (e.g., qualitative accuracy ≥ 95%, quantitative relative error ≤ 10%), thus obtaining a fully trained lightweight multi-scale feature fusion convolutional neural network.

[0067] In this embodiment, a basic network framework adapted for mass spectrometry feature extraction was built, and a composite loss function and training strategy integrating classification, regression, and prior mass spectrometry knowledge were defined. The network was iteratively optimized using the training dataset, ultimately resulting in a fully trained lightweight multi-scale feature fusion convolutional neural network. This enables the network to simultaneously learn substance classification, concentration regression, and the physical laws of mass spectrometry during end-to-end training, providing core model support for subsequent high-precision, fully automated mass spectrometry recognition and quantitative analysis.

[0068] Based on any of the above embodiments, a third embodiment of this application is proposed. In the third embodiment of this application, the same or similar content as any of the above embodiments can be referred to the above description, and will not be repeated hereafter.

[0069] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the process of the third embodiment of this application. Figure 3 As shown, step S10, which converts the original one-dimensional mass spectrometry signal into a two-dimensional spectral image with two channels, may include steps S11 to S14: Step S11: The mass-to-charge ratio axis of the original one-dimensional mass spectrometry signal is calibrated using a linear correction formula to obtain the calibrated one-dimensional mass spectrometry signal. The linear correction formula refers to the linear mapping function used to eliminate mass axis drift in a mass spectrometer.

[0070] Specifically, the system first acquires the raw one-dimensional mass spectrum signal, and then introduces one or more standards or internal standards with known precise mass numbers. The system collects the actual measured mass-to-charge ratio of these standards and calculates the deviation between the measured mass-to-charge ratio and the theoretical mass-to-charge ratio, as shown in the following formula:

[0071] in, : Corrected mass-to-charge ratio (m / z) true value.

[0072] The original mass-to-charge ratio measured by the instrument.

[0073] k The slope (scaling factor) of the linear correction is used to compensate for the mass axis drift of the instrument.

[0074] b: The intercept (translation coefficient) of the linear correction, used to compensate for fixed system errors.

[0075] The calculation logic involves introducing a standard (or internal standard) with a known precise mass number, calculating the deviation between its theoretical mass-to-charge ratio and the actual measured mass-to-charge ratio, and then using the least squares method to fit and solve for k and b, thereby performing a linear mapping of the entire spectrum to ensure that the mass accuracy is controlled within the allowable range (e.g., 5 ppm).

[0076] Step S12: Baseline fitting and subtraction are performed on the calibrated one-dimensional mass spectrometry signal according to the adaptive asymmetric least squares method to obtain the one-dimensional mass spectrometry signal with baseline drift subtracted. Baseline correction is performed using an adaptive asymmetric least squares method, which dynamically fits and subtracts baseline drift. The formula is as follows:

[0077] in, The objective function loss value that needs to be minimized.

[0078] : The original ion intensity of the i-th data point.

[0079] : The baseline intensity fitted to the i-th data point.

[0080] Asymmetric weighting coefficients The smoothing penalty parameter determines the degree of smoothness of the baseline.

[0081] The second difference of the baseline sequence represents the curvature of the baseline.

[0082] The above formula consists of two parts. The first part ensures that the fitted baseline fits the low-value region (background noise) in the original data points, while the second part uses a second-order difference penalty to ensure the smoothness of the baseline. By iteratively updating the weights, a clean baseline is finally extracted and subtracted from the original signal.

[0083] Step S13: Normalize the one-dimensional mass spectrometry signal after removing baseline drift to obtain the mass-to-charge ratio intensity sequence; During the normalization stage, mass spectrometry-specific intensity normalization is used to amplify low-intensity peak regions and compress high-intensity peak regions, avoiding the loss of low-concentration signals.

[0084] Parameter meaning: : Normalized relative intensity eigenvalues.

[0085] : The original absolute intensity after subtracting the baseline.

[0086] : The statistical mean of the intensity within the local sliding window of the mass-to-charge ratio.

[0087] : Standard deviation of the strength within the local sliding window of the mass-to-charge ratio.

[0088] Minimal constant (e.g., 10) -8 This prevents overflow caused by a zero denominator.

[0089] Because mass spectrometry signals have an extremely high dynamic range (strong peaks and weak peaks can differ by several orders of magnitude), we first use log10 for nonlinear compression to reduce the dominance of high-intensity peaks; then we use local mean and variance for standardization, thereby adaptively amplifying the weak peak characteristics of low-concentration substances while preserving the relative peak shape.

[0090] The system outputs a mass-to-charge ratio intensity sequence, with each data point containing the corrected mass-to-charge ratio. and normalized intensity value .

[0091] Step S14: Convert the mass-to-charge ratio intensity sequence into grayscale feature maps and gradient feature maps respectively, and stitch the grayscale feature maps and gradient feature maps together to obtain a two-dimensional spectral image with dual channels.

[0092] The system converts the normalized mass-to-charge ratio intensity sequence into a two-dimensional spectral image. First, the system maps the one-dimensional mass-to-charge ratio intensity sequence to a two-dimensional space: usually using the mass-to-charge ratio as the horizontal axis (x-direction), the intensity sequence is divided into multiple segments according to a fixed window length and arranged along the vertical axis (y-direction), or the retention time dimension in the liquid chromatography-mass spectrometry data is directly used as the vertical axis to form a two-dimensional intensity matrix.

[0093] Furthermore, the system linearly maps each intensity value in the two-dimensional intensity matrix to a grayscale range of 0-255, generating a grayscale feature map. The gradient of each pixel is calculated along the mass-to-charge ratio direction (x-direction) of the grayscale feature map.

[0094] in, : The pixel gradient value of the two-dimensional atlas image at coordinates (x,y).

[0095] : The pixel grayscale value at coordinates (x, y) (corresponding to local intensity).

[0096] x : Horizontal dimension (corresponding to the direction of m / z change).

[0097] By taking the first-order partial derivatives of the intensity sequence and calculating their absolute values, the rising and falling edges of mass spectral peaks are highlighted. Combining the original intensity channels to form a dual-channel image makes it easier for the convolutional network to capture the "peak contours and boundaries," and it is highly sensitive to the minute fluctuations of overlapping peaks.

[0098] Finally, the system stitches the grayscale feature map and gradient feature map together in the channel dimension (i.e., the third dimension of the image) to form a dual-channel two-dimensional spectral image.

[0099] In this embodiment, linear correction is used to eliminate instrument mass-to-charge ratio drift, ensuring mass accuracy; adaptive asymmetric least squares method is used to subtract baseline drift and suppress background interference; logarithmic compression and local normalization of intensity are used to enhance low-concentration weak peak signals; and intensity and gradient are stitched together into a dual-channel image to highlight peak boundaries. This transforms the original mass spectrometry signal into structured image features suitable for convolutional neural network processing, laying the foundation for subsequent high-precision feature extraction and quantitative identification.

[0100] Based on any of the above embodiments, a fourth embodiment of this application is proposed. In the fourth embodiment of this application, the same or similar content as any of the above embodiments can be referred to the above description, and will not be repeated hereafter.

[0101] In this embodiment, step S20, which involves extracting features from the two-dimensional atlas image to obtain a multi-scale fused feature map, may include steps S21 to S23: Step S21: Input the two-dimensional spectral image into the lightweight multi-scale feature fusion convolutional neural network to perform multi-scale parallel convolution, and extract mass spectrometry peak features based on the multi-scale parallel convolution; Step S22: Segment the mass spectrometry peak features to obtain an initial multi-scale fusion feature map; First, the system inputs the generated dual-channel 2D spectral image (H×W×2) into a lightweight multi-scale feature fusion convolutional neural network. In the first or multiple layers of the network, the system deploys three convolutional kernels with different receptive fields in parallel: a 1×1 kernel for extracting isolated narrow peak features, with the smallest receptive field, capable of capturing sharp peaks with drastic changes in mass-to-charge ratio; a 3×3 kernel for extracting regular single-peak features, covering typical mass spectrum peak width ranges; and a 5×5 kernel for extracting broad peaks and isotope cluster features, with a larger receptive field, capable of capturing broad peaks or matrix background interference patterns spanning multiple mass-to-charge ratio data points. The number of output channels for each convolutional kernel can be preset, and each convolutional operation is followed by a batch normalization layer and a ReLU activation function to accelerate convergence and introduce nonlinearity.

[0102] Furthermore, the system will perform a channel-dimension concatenation operation on the three sets of mass spectral peak feature maps extracted by three types of parallel convolution kernels: 1×1, 3×3, and 5×5. The specific formula is as follows:

[0103] in The output feature map after multi-scale fusion, i.e. the initial multi-scale fused feature map.

[0104] : Input feature map of the previous layer.

[0105] : Represents a convolution operation with a receptive field size of k*k.

[0106] Feature splicing operation in the channel dimension.

[0107] Due to the significant differences in peak widths in mass spectra (narrow peaks may span several m / z, while broad peaks or isotope clusters may span tens of m / z), a 1x1 array was used to extract isolated narrow peaks, while 3x3 and 5x5 arrays were used to extract broad peaks and matrix interference background. These were then stitched together along the channel dimension, enabling the network to adaptively process substances with different peak widths.

[0108] Step S23: The initial multi-scale fused feature map is recalibrated using a channel attention mechanism to obtain the multi-scale fused feature map.

[0109] The channel attention mechanism is introduced to enhance effective peak features and suppress noise. The feature recalibration formula is as follows:

[0110]

[0111] in, Global average pooling compresses spatial features into global channel features.

[0112] , Fully connected layer, used for learning the correlation between channels, dimensionality reduction and dimensionality enhancement.

[0113] The Sigmoid activation function normalizes the weights to a range of 0-1.

[0114] : The weight vector of importance of each channel calculated.

[0115] : Output feature map after attention recalibration; This indicates element-wise multiplication by channel.

[0116] Specifically, the system automatically evaluates which channels extract key peak features and which extract noise features through the network. By assigning different weights s, it amplifies the effective feature signals and suppresses interference from the baseline and spurious noise.

[0117] Additionally, it's worth noting that the system employs depthwise separable convolutions instead of standard convolutions in its lightweight multi-scale feature fusion convolutional neural network to reduce the number of model parameters. Specifically, depthwise separable convolutions can be applied to multi-scale parallel convolutional modules, feature transformation layers after channel attention modules, or other convolutional layers requiring reduced parameter counts. Compared to standard convolutions, depthwise separable convolutions can reduce the number of parameters by over 60%, thus meeting the real-time inference requirements of mobile or embedded devices. After processing with depthwise separable convolutions, a lightweight multi-scale fused feature map is output.

[0118] In this embodiment, narrow-peak, conventional single-peak, and wide-peak features are captured simultaneously through multi-scale parallel convolution. Features at different scales are concatenated along the channel dimension to form an initial fused feature map containing rich peak shape information. A channel attention mechanism is used to adaptively recalibrate each channel, enhancing effective peak features and suppressing noise interference. This allows the network to significantly improve its ability to distinguish different types of peaks in complex mass spectra while maintaining a lightweight design, providing high-quality feature representations for subsequent prior constraints and overlapping peak decomposition.

[0119] Based on any of the above embodiments, a fifth embodiment of this application is proposed. In the fifth embodiment of this application, the same or similar content as any of the above embodiments can be referred to the above description, and will not be repeated hereafter.

[0120] In this embodiment, step S30, which applies mass spectrometry prior knowledge constraints to the multi-scale fused feature map to obtain the corrected multi-scale fused feature map, may include steps S31 to S33: Step S31: Invoke the mass spectrometry prior knowledge constraint module of the lightweight multi-scale feature fusion convolutional neural network, wherein the mass spectrometry prior knowledge constraint module embeds mass spectrometry physicochemical rules and isotope distribution constraints. The system invokes the mass spectrometry prior knowledge constraint module in the pre-trained lightweight multi-scale feature fusion convolutional neural network. This module is pre-designed as part of the network, embedded between the network's feature extraction layer and output layer, or appended to the total loss function as an additional loss function term.

[0121] The module encapsulates three types of prior constraints: mass-to-charge ratio prior constraints (limiting the deviation between the predicted mass-to-charge ratio and the theoretical value to not exceed a preset threshold, such as 5 ppm), peak shape prior constraints (requiring the peak profile of the network output to conform to a Gaussian or Lorentz distribution), and isotope distribution constraints (requiring the isotope peak intensity ratio to be consistent with the theoretical abundance). During the network training phase, this module calculates the constraint loss and participates in backpropagation to guide the network parameter updates; during the inference phase, this module verifies and corrects the intermediate feature maps of the network output to ensure that the final output conforms to the physical laws of mass spectrometry.

[0122] Step S32: Based on the mass spectrometry physicochemical rules, apply prior constraints on mass-to-charge ratio and peak shape to the scale fusion feature map to obtain a preliminary constrained feature map; Based on the physicochemical rules of mass spectrometry, the system sequentially applies mass-to-charge ratio (MTR) and peak shape prior constraints to candidate peak regions in the scale-fused feature map. In the MTR prior constraint, the system extracts local regions with high response intensity in the scale-fused feature map, calculates the predicted MTR value corresponding to that region, and compares it with the theoretical MTR of the target substance. If the relative deviation is less than or equal to 5 ppm, it is considered a pass and no penalty is applied; if the relative deviation is greater than 5 ppm, the system calculates the square of the deviation (…). As a mass-to-charge ratio constraint loss, the characteristic response of this region is adjusted through backpropagation or forward correction.

[0123] In the peak shape prior constraint, the system extracts the intensity distribution vector of each candidate peak region, generates the corresponding theoretical Gaussian peak vector (or Lorentz peak vector), calculates the difference between the two (such as using cosine similarity or mean square error), and if the difference exceeds the preset threshold, the peak shape constraint loss is applied to force the peak output profile of the network to move closer to the theoretical distribution.

[0124] The Gaussian peak model is as follows:

[0125] The Lorentz peak model is as follows:

[0126] Parameter meaning: Peak intensity obtained from theoretical fitting.

[0127] : The highest amplitude of the peak (peak height).

[0128] : Center of mass location (i.e., the accurate mass-to-charge ratio of the target substance).

[0129] : The standard deviation of a Gaussian distribution reflects the peak width.

[0130] : The full width at half maximum of the Lorentz distribution is half of the full width at half maximum.

[0131] Step S33: Based on the isotope distribution constraint, apply the isotope abundance ratio prior constraint to the preliminary constraint feature map to obtain the corrected multi-scale fusion feature map.

[0132] The system identifies isotopic peak clusters in the preliminary constraint feature map: for each candidate main peak (M peak), it searches for local maxima within a fixed offset range to the right of its mass-to-charge ratio to determine the positions and intensities of sub-peaks such as M+1 and M+2. Furthermore, based on the chemical elemental composition of the target substance, the system pre-calculates the theoretical abundance ratios of its natural isotopes. The system extracts the intensity ratios of each isotope peak predicted by the network to the main peak. The system calculates the sum of the absolute deviations between the two. If the sum of the deviations exceeds a preset threshold, the system applies isotope constraint loss and adjusts the network's prediction output for the region through backpropagation or forward correction.

[0133] After the isotope abundance ratio prior constraint processing, the system outputs a corrected multi-scale fusion feature map. The intensity ratio of isotope peak groups in this feature map conforms to the natural abundance law, which can greatly reduce the false positive rate under complex matrices, especially for compounds containing characteristic elements such as chlorine and bromine.

[0134] In this embodiment, a constraint module embedding mass spectrometry physicochemical rules and isotope distribution conditions is invoked. Preliminary constraints are applied to the feature map based on mass-to-charge ratio and peak shape rules to ensure accurate peak positions and reasonable peak shapes. Further constraints on isotope abundance ratios are applied to ensure that the proportion of isotope peak groups conforms to natural abundance patterns. This significantly reduces the risk of noise spikes in complex matrices being misidentified as true peaks, effectively suppresses false positives, improves the accuracy of qualitative identification and the reliability of quantitative analysis, and ensures that the network output strictly conforms to the inherent physical laws of mass spectrometry.

[0135] Based on any of the above embodiments, a sixth embodiment of this application is proposed. In the sixth embodiment of this application, the same or similar content as any of the above embodiments can be referred to the above description, and will not be repeated hereafter.

[0136] In this embodiment, step S40, which involves splitting the overlapping peak regions of the corrected multi-scale fused feature map and extracting peak parameters, may include steps S41-S42: Step S41: Use a Gaussian mixture model to split the overlapping peak regions of the modified multi-scale fused feature map, and decouple the overlapping peak regions into multiple single peaks. The system adaptively splits overlapping peak regions in the corrected multi-scale fused feature map using a Gaussian mixture model. First, based on the response intensity distribution in the feature map, the system automatically locates overlapping peak regions using a heatmap and determines the number N of hidden single peaks within each region. Specifically, the system can estimate the value of N by performing second-order derivative analysis on the feature map (to find local maxima) or by using the peak density map output by a convolutional neural network. Then, the system uses a Gaussian mixture model to mathematically model the total signal envelope of the overlapping region. The model expression is:

[0137] Parameter meaning: : The total signal envelope of the overlapping region.

[0138] N The number of hidden single peaks contained in the overlapping region as predicted by the CNN.

[0139] : The weight magnitude of the kth single peak after splitting.

[0140] : The position of the center point m / z of the kth single peak.

[0141] : Peak width parameter of the kth single peak.

[0142] Step S42: Extract the peak parameters of the single peak.

[0143] Peak parameters refer to quantitative indicators that describe the characteristics of a single mass spectrometry peak, including at least peak height, peak area, peak width, centroid position, and signal-to-noise ratio.

[0144] Peak height: The highest intensity value of a single peak, i.e., the weighted magnitude of the corresponding component in the Gaussian mixture model. ; Peak area: The value obtained by integrating the single-peak curve, which reflects the total signal of the ions of the substance and is positively correlated with the concentration of the substance.

[0145] Peak width: usually refers to the full width at half maximum (FWHM), which is the peak width at half the peak height.

[0146] Location of the center of mass: the mass-to-charge ratio at the center of a single peak , which represents the characteristic mass-to-charge ratio of the ions in that substance.

[0147] Signal-to-noise ratio (SNR): The ratio of the absolute peak height of the target peak to the root mean square value of the noise around the peak, used to evaluate the reliability of the detected signal.

[0148] Specifically, after automatically decoupling overlapping peaks into N single peaks, the peak area is obtained by integration in the peak parameter calculation:

[0149] The formula for calculating the signal-to-noise ratio is:

[0150] Parameter meaning: : Absolute peak height of the target peak (after deducting the local baseline).

[0151] The root mean square value of noise within a certain range around the peak (the peakless interval).

[0152] Signal-to-noise ratio (SNR) is used to objectively assess the reliability of the detected signal, replacing subjective thresholds. When the SNR is consistently greater than or equal to 3, it is considered the effective lower limit of detection (LOD).

[0153] Finally, the system packages and outputs all extracted peak parameters, including: centroid position (m / z), peak height, peak area, full width at half maximum (FWHM), signal-to-noise ratio (SNR), and valid detection flag.

[0154] In this embodiment, a Gaussian mixture model and the expectation-maximization algorithm are used to decouple complex overlapping envelopes into multiple independent single peaks, effectively solving the technical problem that traditional methods struggle to handle shoulder peaks or severely encapsulated overlapping peaks. Key parameters such as peak height, peak area, centroid position, and signal-to-noise ratio are extracted from each separated single peak, providing accurate basic data for subsequent qualitative identification and concentration quantification. This significantly improves the separation capability and quantitative accuracy of overlapping peaks in complex matrices.

[0155] Based on any of the above embodiments, a seventh embodiment of this application is proposed. In the seventh embodiment of this application, the same or similar content as any of the above embodiments can be referred to the above description, and will not be repeated hereafter.

[0156] In this embodiment, the identification and analysis results include quantitative analysis results and qualitative identification results. The step S50, which involves performing classification and regression bi-branch identification based on the peak parameters to obtain the identification and analysis results, may include steps S51 to S56: Step S51: Input the peak parameters and the corrected multi-scale fusion feature map corresponding to the peak parameters into the qualitative classification branch of the lightweight multi-scale feature fusion convolutional neural network; The qualitative classification branch refers to a sub-network branch in a lightweight multi-scale feature fusion convolutional neural network specifically used for material category identification. It typically consists of fully connected layers and a Softmax activation function, and outputs the probability distribution of each candidate material.

[0157] The system inputs the extracted peak parameters and the corresponding multi-scale fusion feature maps (i.e., the local feature maps of the regions where these peaks are located) into the qualitative classification branch of the lightweight multi-scale feature fusion convolutional neural network.

[0158] Specifically, the system first crops the local feature regions corresponding to each peak from the multi-scale fused feature map (e.g., a rectangular region centered at the centroid and extending to the left and right by a certain number of pixels). Then, it performs global average pooling or flattening on this local feature map to convert it into a fixed-length feature vector. The system normalizes the extracted peak parameters (such as peak height, peak area, signal-to-noise ratio, etc.) to form another feature vector. The system concatenates the two feature vectors along the channel dimension to form a fused feature vector, which is then input into the fully connected layer of the qualitative classification branch for further feature transformation.

[0159] Step S52: Identify the category probability distribution of the preset candidate substances through the qualitative classification branch to obtain the qualitative identification result; The system identifies the probability distribution of preset candidate substances through a qualitative classification branch. The qualitative classification branch terminates with a fully connected layer whose output neurons have the same number as the total number of preset candidate substance categories (e.g., if the preset candidate substance list contains 50 targets, the output dimension is 50), followed by a Softmax activation function. The system inputs the generated fused feature vector into this branch. After linear transformation by the fully connected layer, the output value is converted into a probability distribution using the Softmax function. The system selects the category with the highest probability value as the final qualitative identification result and outputs the corresponding confidence score (i.e., the maximum probability value).

[0160] Step S53: Input the peak parameters and the corrected multi-scale fusion feature map corresponding to the peak parameters into the quantitative regression branch of the lightweight multi-scale feature fusion convolutional neural network; The system simultaneously inputs the extracted peak parameters and the corresponding multi-scale fused feature maps into the quantitative regression branch of a lightweight multi-scale feature fusion convolutional neural network. Similar to the qualitative classification branch, the system first crops the local feature regions corresponding to each peak from the multi-scale fused feature maps, forms feature vectors after pooling or flattening, and concatenates them with the normalized peak parameter vectors to obtain the quantitative fusion feature vector. Then, the system inputs this feature vector into the quantitative regression branch, which typically consists of multiple fully connected layers, each followed by a ReLU activation function to introduce nonlinearity, with the last layer being a linear fully connected layer (without an activation function), outputting a scalar value as the initial concentration prediction.

[0161] Step S54: Analyze the concentration of the candidate substances using the quantitative regression branch; The system analyzes and predicts the concentration of candidate substances through a quantitative regression branch. The quantitative regression branch outputs a scalar value representing the model's initial prediction of the target substance's concentration. This prediction is a direct output without considering matrix effect compensation. The output layer of the quantitative regression branch uses a linear activation function, therefore the output value can be any value within the real number range.

[0162] To ensure that the predicted concentration is always non-negative, the system can add a ReLU activation function or a Softplus activation function after the output layer for post-processing. The system compares the initial concentration prediction with the true concentration label, calculates the regression loss (a weighted sum of mean squared error and mean absolute error), and updates the network parameters through backpropagation.

[0163] Step S55: Extract matrix background features from the corrected multi-scale fusion feature map, and calculate matrix interference compensation term based on the matrix background features; The system extracts matrix background features from the corrected multi-scale fused feature map and calculates a matrix interference compensation term based on these features. Specifically, the system first identifies non-peak regions (i.e., background regions that do not contain any candidate peaks) in the corrected multi-scale fused feature map, and can obtain background feature vectors by random sampling or global pooling from these regions. Alternatively, the system subtracts the feature contributions of the peak regions from the entire corrected multi-scale fused feature map, and then performs global average pooling on the remaining background regions to obtain a fixed-dimensional background feature vector.

[0164] Furthermore, the system inputs the background feature vector into an independent compensation network (typically a two-layer fully connected network, with 4-8 neurons in the middle layer and 1 neuron in the output layer). This network calculates and outputs a scalar value through forward propagation, which is the matrix interference compensation term. .

[0165] Step S56: Correct the concentration of the substance according to the matrix interference compensation term to obtain the quantitative analysis results.

[0166] The quantitative analysis results were compensated for by matrix effects, and the final concentration was:

[0167] Parameter meaning: : The final output is the absolute concentration of the target substance.

[0168] : Mass spectrometry peak area extracted by network calculation.

[0169] k,b : Instrument response coefficients and intercepts fitted using external or internal standard methods.

[0170] : The matrix interference compensation term (suppression or enhancement effect) is automatically calculated after the matrix background features are extracted from the hidden layer.

[0171] Understandably, traditional quantitative formulas only consider... It is highly susceptible to matrix effects, leading to bias. This embodiment, however, uses deep learning of global background map information to dynamically assess the complexity of the matrix and output an adaptive compensation term. It can achieve accurate quantification across sample matrices without the need for frequent changes to the standard curve.

[0172] In this embodiment, the probability distribution of preset candidate substances is identified through a qualitative classification branch, and the substance name and confidence level are output; the initial concentration is predicted through a quantitative regression branch; and the matrix background features are extracted from the feature map to calculate the compensation term and correct the concentration deviation. Through the above steps, the qualitative identification and quantitative concentration of substances are completed in one step, and the matrix adaptive compensation mechanism is introduced, which significantly improves the accuracy and anti-interference ability of quantitative analysis in complex samples, realizing end-to-end fully automated analysis.

[0173] Based on any of the above embodiments, an eighth embodiment of this application is proposed. In the eighth embodiment of this application, the same or similar content as any of the above embodiments can be referred to the above description, and will not be repeated hereafter.

[0174] Based on this, please refer to Figure 4 , Figure 4 The eighth embodiment of this application is illustrated in the following flowchart: Figure 4 As shown, after step S50, which involves performing classification regression bibranch identification based on the peak parameters to obtain quantitative analysis results and qualitative identification results, steps S60-S70 are also included: Step S60: Calculate quality control indicators based on the quantitative analysis results and the qualitative identification results; Based on quantitative analysis and qualitative identification results, the system automatically calculates multiple quality control indicators. First, the system calculates the signal-to-noise ratio (SNR), which assesses the significance of the target peak's signal intensity relative to background noise; a higher SNR indicates more reliable detection. Second, the system calculates the matching degree: the confidence score output by the qualitative classification branch is used as the qualitative matching degree, reflecting the consistency between the predicted substance category and theoretical parameters (such as mass-to-charge ratio and isotope abundance ratio). For scenarios where the same sample contains an internal standard, the system can also calculate the matching degree between the measured response and the theoretical response of the internal standard.

[0175] Furthermore, if the user provides the measured and theoretical spiked concentrations of the spiked sample, the system calculates the spike recovery rate, which is used to assess the accuracy of the quantitative analysis and the degree of matrix interference. Finally, if the system performs multiple repeated tests on the same sample, it calculates the relative standard deviation (RSD), which is used to assess the precision of the quantitative analysis.

[0176] In one possible implementation, the system can also calculate the limit of detection (LOD) and the limit of quantitation (LOQ) and automatically determine them based on the signal-to-noise ratio (typically LOD corresponds to SNR≈3 and LOQ corresponds to SNR≈10). For isotope dilution quantification scenarios, the system can also calculate the isotope ratio deviation as an additional quality control indicator.

[0177] Step S70: Generate a standardized report based on the quality control indicators and preset judgment criteria.

[0178] The system sets a threshold for each quality control indicator. Only when all key indicators meet the corresponding standards will the system determine the overall test result as "valid detection". If any indicator does not meet the standards, the system marks the result as "suspicious" or "invalid" and prompts for retesting or manual verification.

[0179] Furthermore, the system integrates the following information to generate a standardized report: sample information (sample number, collection time, instrument model, etc.), qualitative identification results (substance name, confidence score), quantitative analysis results (concentration value, unit, peak area), quality control indicators (SNR, recovery rate, RSD, matching degree) and their judgment conclusions, as well as visual spectra (original spectra, denoised spectra, peak labeling).

[0180] Finally, the system supports outputting reports in multiple formats, including CSV (structured data, easy for statistical analysis), PDF (complete document, easy for archiving and printing), and XML (compliant with laboratory information management system or instrument data exchange standards).

[0181] In one possible implementation, the system can also configure report templates, allowing users to customize report content and format (such as adding company logos, signature bars, remarks, etc.); for batch testing scenarios, the system can generate summary reports, integrating the test results of multiple samples into one document, and automatically calculate statistical information (such as detection rate, average value, standard deviation, etc.); the system also supports pushing reports directly to the laboratory information management system or cloud data platform through API interfaces to achieve automated data flow.

[0182] In this embodiment, quality control indicators such as signal-to-noise ratio, matching degree, recovery rate, and relative standard deviation are automatically calculated based on quantitative and qualitative results. The validity of the detection is automatically determined based on preset judgment criteria, and a standardized report containing spectral data, qualitative and quantitative results, and quality conclusions is generated. This achieves reliable quantification of detection results and automated output, ensuring traceability of the detection process and reproducibility of results.

[0183] This application also provides a mass spectrometry image recognition and analysis device; please refer to [reference needed]. Figure 5 The mass spectrometry image recognition and analysis device includes: The conversion module 10 is used to acquire the original one-dimensional mass spectrometry signal and convert the original one-dimensional mass spectrometry signal into a two-dimensional spectral image with two channels. Extraction module 20 is used to call a pre-built lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional atlas image and obtain a multi-scale fusion feature map; Constraint module 30 is used to apply mass spectrometry prior knowledge constraints to the multi-scale fusion feature map to obtain a corrected multi-scale fusion feature map; The splitting module 40 is used to split the overlapping peak regions of the corrected multi-scale fused feature map and extract the peak parameters; The identification and analysis module 50 is used to perform classification and regression bi-branch identification based on the peak parameters to obtain the identification and analysis results.

[0184] The mass spectrometry image recognition and analysis device provided in this application, employing the mass spectrometry image recognition and analysis method in the above embodiments, can solve the technical problems of mass spectrometry image recognition and analysis. Compared with the prior art, the beneficial effects of the mass spectrometry image recognition and analysis device provided in this application are the same as those of the mass spectrometry image recognition and analysis method provided in the above embodiments, and other technical features in the mass spectrometry image recognition and analysis device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0185] This application provides a mass spectrometry image recognition and analysis device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the mass spectrometry image recognition and analysis method in the above embodiment 1.

[0186] The following is for reference. Figure 6 This document illustrates a structural schematic diagram of a mass spectrometry image recognition and analysis device suitable for implementing embodiments of this application. The mass spectrometry image recognition and analysis device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The mass spectrometry image recognition and analysis device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0187] like Figure 6As shown, the mass spectrometry image recognition and analysis device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the mass spectrometry image recognition and analysis device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the mass spectrometry image recognition and analysis device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows mass spectrometry image recognition and analysis devices with various systems, it should be understood that it is not required to implement or possess all of the systems shown. More or fewer systems may be implemented alternatively.

[0188] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0189] The mass spectrometry image recognition and analysis device provided in this application, employing the mass spectrometry image recognition and analysis method described in the above embodiments, can solve the technical problems of mass spectrometry image recognition and analysis. Compared with the prior art, the beneficial effects of the mass spectrometry image recognition and analysis device provided in this application are the same as those of the mass spectrometry image recognition and analysis method provided in the above embodiments, and other technical features in this mass spectrometry image recognition and analysis device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0190] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0191] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0192] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the mass spectrometry image recognition and analysis method in the above embodiments.

[0193] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0194] The aforementioned computer-readable storage medium may be included in the mass spectrometry image recognition and analysis device; or it may exist independently and not be assembled into the mass spectrometry image recognition and analysis device.

[0195] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the mass spectrometry image recognition and analysis device, the mass spectrometry image recognition and analysis device performs the following actions: acquires the original one-dimensional mass spectrometry signal; converts the original one-dimensional mass spectrometry signal into a two-dimensional image with dual channels; invokes a pre-constructed lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional image to obtain a multi-scale fusion feature map; applies mass spectrometry prior knowledge constraints to the multi-scale fusion feature map to obtain a corrected multi-scale fusion feature map; splits the overlapping peak regions of the corrected multi-scale fusion feature map and extracts peak parameters; and performs classification regression bi-branch recognition based on the peak parameters to obtain the recognition and analysis results.

[0196] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0197] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0198] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0199] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described mass spectrometry image recognition and analysis method, thereby solving the technical problem of mass spectrometry image recognition and analysis. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the mass spectrometry image recognition and analysis method provided in the above embodiments, and will not be repeated here.

[0200] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the mass spectrometry image recognition and analysis method described above.

[0201] The computer program product provided in this application can solve the technical problem of mass spectrometry image recognition and analysis. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the mass spectrometry image recognition and analysis method provided in the above embodiments, and will not be repeated here.

[0202] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for recognizing and analyzing mass spectrometry images, characterized in that, The mass spectrometry image recognition and analysis method includes: Acquire raw one-dimensional mass spectrometry signal and convert the raw one-dimensional mass spectrometry signal into a two-dimensional spectral image with two channels; A pre-built lightweight multi-scale feature fusion convolutional neural network is invoked to extract features from the two-dimensional atlas image, resulting in a multi-scale fused feature map. Mass spectrometry prior knowledge constraints are applied to the multi-scale fused feature map to obtain a modified multi-scale fused feature map. The overlapping peak regions of the corrected multi-scale fused feature map are split and the peak parameters are extracted. Based on the peak parameters, a dual-branch classification regression was performed to obtain the identification analysis results.

2. The mass spectrometry image recognition and analysis method as described in claim 1, characterized in that, Before the step of calling a pre-built lightweight multi-scale feature fusion convolutional neural network to extract features from the two-dimensional atlas image and obtain a multi-scale fused feature map, the method further includes: The basic framework of the model is built based on a pre-defined deep learning architecture; Define a composite loss function for the basic framework of the model and set a training strategy. The composite loss function includes a classification loss function, a regression loss function, and a prior knowledge loss function. Based on the training strategy and the pre-built training dataset, the basic framework of the model defining the composite loss function is iteratively trained to obtain the lightweight multi-scale feature fusion convolutional neural network.

3. The mass spectrometry image recognition and analysis method as described in claim 1, characterized in that, The step of converting the original one-dimensional mass spectrometry signal into a two-channel two-dimensional spectral image includes: The mass-to-charge ratio axis of the original one-dimensional mass spectrometry signal is calibrated using a linear correction formula to obtain the calibrated one-dimensional mass spectrometry signal. The baseline of the calibrated one-dimensional mass spectrometry signal is fitted and subtracted using the adaptive asymmetric least squares method to obtain the one-dimensional mass spectrometry signal with baseline drift subtracted. The mass-to-charge ratio intensity sequence is obtained by normalizing the mass spectrometry one-dimensional signal after removing the baseline drift. The mass-to-charge ratio intensity sequence is converted into grayscale feature maps and gradient feature maps respectively. The grayscale feature maps and gradient feature maps are then stitched together to obtain a two-dimensional spectral image with two channels.

4. The mass spectrometry image recognition and analysis method as described in claim 1, characterized in that, The step of extracting features from the two-dimensional atlas image to obtain a multi-scale fused feature map includes: The two-dimensional spectral image is input into the lightweight multi-scale feature fusion convolutional neural network for multi-scale parallel convolution, and mass spectral peak features are extracted based on the multi-scale parallel convolution. By splicing the mass spectrometry peak features, an initial multi-scale fused feature map is obtained; The initial multi-scale fused feature map is recalibrated using a channel attention mechanism to obtain the multi-scale fused feature map.

5. The mass spectrometry image recognition and analysis method as described in claim 1, characterized in that, The step of applying mass spectrometry prior knowledge constraints to the multi-scale fused feature map to obtain the corrected multi-scale fused feature map includes: The mass spectrometry prior knowledge constraint module of the lightweight multi-scale feature fusion convolutional neural network is invoked, and the mass spectrometry prior knowledge constraint module embeds mass spectrometry physicochemical rules and isotope distribution constraints. Based on the mass spectrometry physicochemical rules, the scale fusion feature map is subjected to prior constraints on mass-to-charge ratio and peak shape to obtain a preliminary constrained feature map. Based on the isotope distribution constraints, the preliminary constraint feature map is subjected to prior constraints on isotope abundance ratio to obtain the corrected multi-scale fusion feature map.

6. The mass spectrometry image recognition and analysis method as described in claim 1, characterized in that, The steps of splitting and correcting the overlapping peak regions of the multi-scale fused feature maps and extracting peak parameters include: A Gaussian mixture model is used to split the overlapping peak regions of the modified multi-scale fused feature map, decoupling the overlapping peak regions into multiple single peaks; Extract the peak parameters of the single peak.

7. The mass spectrometry image recognition and analysis method as described in claim 1, characterized in that, The identification and analysis results include quantitative analysis results and qualitative identification results. The step of performing classification and regression bi-branch identification based on the peak parameters to obtain the identification and analysis results includes: The peak parameters and the corrected multi-scale fusion feature map corresponding to the peak parameters are input into the qualitative classification branch of the lightweight multi-scale feature fusion convolutional neural network. The qualitative identification result is obtained by identifying the category probability distribution of the preset candidate substances through the qualitative classification branch. The peak parameters and the modified multi-scale fusion feature map corresponding to the peak parameters are input into the quantitative regression branch of the lightweight multi-scale feature fusion convolutional neural network. The concentration of the candidate substances was analyzed using the quantitative regression branch. Matrix background features are extracted from the corrected multi-scale fused feature map, and matrix interference compensation terms are calculated based on the matrix background features. The concentration of the substance is corrected based on the matrix interference compensation term to obtain quantitative analysis results.

8. The mass spectrometry image recognition and analysis method as described in claim 7, characterized in that, The step of performing classification regression bi-branch identification based on the peak parameters to obtain the identification analysis results further includes: Calculate quality control indicators based on the quantitative analysis results and the qualitative identification results; A standardized report is generated based on the quality control indicators and preset judgment criteria.

9. A mass spectrometry image recognition and analysis device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the mass spectrometry image recognition and analysis method as described in any one of claims 1 to 8.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the mass spectrometry image recognition and analysis method as described in any one of claims 1 to 8.