Image segmentation method for mass spectrum imaging image of ESI source

Through mass-to-charge ratio division and Bayesian optimization combined with random forest classifier, the problem of noise peak and peak position offset in ESI source mass spectrometry imaging map is solved, and the segmentation accuracy and model generalization ability of mass spectrometry imaging map are improved, and the system is simplified. The process of adjusting parameters.

CN119295477APending Publication Date: 2025-01-10CHINA INNOVATION INSTR CO LTD

Patent Information

Application Number
CN202411193897.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

When traditional mass spectrometry imaging technology processes ESI sources, data complexity increases due to noise peak and peak position offset, resulting in overfitting of stoichiometric algorithms, reducing the segmentation accuracy and generalization ability of mass spectrometry imaging maps, and adjusting parameters. Temporary and time-consuming.

Method used

Mass spectrometry imaging maps are divided by mass-to-charge ratio, peak area normalization and interval division are performed, and Bayesian optimization and random forest classifiers are combined to optimize stoichiometric algorithms and classifier parameters to reduce noise impact and improve model generalization capabilities.

Benefits of technology

The segmentation accuracy and model generalization ability of mass spectrometry imaging images are improved, the model parameter adjustment process is simplified, noise interference is reduced, and the segmentation performance of mass spectrometry peaks is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295477A_ABST
    Figure CN119295477A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of mass spectrum imaging, and particularly provides an image segmentation method for a mass spectrum imaging image of an ESI source, and the method comprises the steps: (S1) dividing the mass spectrum imaging image into a plurality of mass spectrum imaging channels according to a mass-to-charge ratio; (S2) selecting a mass spectrum imaging channel where target ions are located, and preprocessing each pixel; (S3) carrying out preliminary segmentation on the spectrogram data; (S4) performing interval division on the mass spectrum data of the channel where the target ions of each pixel are located, calculating the lower area of each interval, selecting the central mass-to-charge ratio of each interval as the abscissa of the intensity value of each interval, and setting the intensity value of the interval with the ratio of the central mass-to-charge ratio to the highest intensity value lower than a set value as 0; (S5) analyzing, training and optimizing the transformed mass spectrum data; and (S6) the optimal combination model obtained in the step (S5) is used for classification of other pixel points of the mass spectrum imaging image, and an image segmentation result is obtained. The method has the advantages of accurate segmentation and the like, and is applied to mass spectrum imaging of the ESI source.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to mass spectrometry imaging technology, and in particular to an image segmentation method for mass spectrometry imaging images of an ESI source. Background Art

[0002] Mass spectrometry imaging is an important imaging research technology based on mass spectrometry analysis. With the continuous improvement of mass spectrometry imaging technology, it has very broad application prospects in new drug development, in situ biomarker discovery, medical clinical pathology diagnosis, and precision medicine.

[0003] The main steps of mass spectrometry imaging data analysis are data preprocessing and chemometric segmentation of mass spectrometry images. Mass spectrometry data preprocessing is an important step in extracting compound information and subsequent analysis. In laboratory mass spectrometry analysis, samples are usually analyzed after chromatographic separation. The noise in the spectrum is small, and subsequent processing and analysis are relatively simple. However, due to differences in the working environment and samples, ESI will cause a large number of noise peaks and peak position shifts in the mass spectrometry data, increasing the complexity and nonlinearity of the data.

[0004] The intensity of some noise peaks in mass spectrometry data is greater than the target signal peak. If traditional analysis methods are used and only data preprocessing methods such as filtering, centering and normalization are used, the noise peak interference cannot be effectively eliminated, which will cause overfitting of chemometric algorithms such as PCA, PLS and OPLS, reduce the classification performance and generalization ability of the algorithm, and make the results of mass spectrometry imaging segmentation inaccurate.

[0005] In traditional chemometric analysis methods, the leave-one-out method and K-fold cross-validation are usually used to adjust the parameters of algorithms such as PCA, PLS, and OPLS. However, when the chemometric algorithm and machine learning classifier are used together, it is impossible to use the above two validation methods to simultaneously optimize and adjust the hyperparameters of the chemometric algorithm and the machine learning classifier, resulting in an overly cumbersome, time-consuming, and labor-intensive parameter adjustment process. Summary of the invention

[0006] In order to solve the deficiencies in the above-mentioned prior art solutions, the present invention provides an image segmentation method for mass spectrum imaging images of an ESI source.

[0007] The objective of the present invention is achieved through the following technical solutions: The image segmentation method for the mass spectrum imaging image of the ESI source comprises the following steps: (S1) dividing the mass spectrometry imaging image into a plurality of mass spectrometry imaging channels according to the mass-to-charge ratio; (S2) selecting the mass spectrometry imaging channel where the target ion is located, preprocessing each pixel, and obtaining spectrum data; (S3) performing preliminary segmentation on the spectrum data, searching for peaks in an interval centered on the mass-to-charge ratio of the target ion, and obtaining peak areas; The target peak intensity of all pixels is normalized and divided into multiple peak intensity intervals, and the pixels in each peak intensity interval are set to the same color; (S4) dividing the mass spectrum data of the channel where the target ion of each pixel is located into intervals, calculating the lower area of ​​each interval, selecting the central mass-to-charge ratio of each interval as the horizontal coordinate of the intensity value of each interval, and setting the interval intensity value whose ratio to the highest intensity value is lower than a set value to 0; The processed mass spectrometry data were subjected to natural logarithmic transformation so that the variance of each pixel data presented a quasi-normal distribution; (S5) analyzing, training and optimizing the transformed mass spectrometry data, wherein the pixels of different colors in step (S3) are selected for category labeling, and the transformed mass spectrometry data in step (S4) are selected as a training set and a test set respectively; (S6) The best combination model obtained in step (S5) is used to classify other pixel points of the mass spectrometry imaging image to obtain an image segmentation result.

[0008] Compared with the prior art, the present invention has the following beneficial effects: The present invention combines mass spectrometry imaging data analysis with machine learning, and optimizes the chemometric algorithm and RF classifier parameters through a Bayesian optimizer, thereby saving the time required for model parameter adjustment and obtaining a model combination with higher classification accuracy and better generalization, thereby improving the segmentation accuracy of mass spectrometry imaging images.

[0009] 1. When performing preliminary segmentation of mass spectrometry imaging, the peak area is used instead of the peak value of the target peak as the target peak intensity value to reduce the impact of peak offset on the preliminary segmentation of the image.

[0010] 2. Use preprocessing such as Gaussian filtering, background subtraction and airPLS baseline correction to reduce the impact of random noise and background noise on mass spectrometry peak picking.

[0011] The useless data below the set value is deleted by using the ratio, and the data dimension of each pixel in the MSI image is reduced. This not only reduces the data calculation overhead, but also retains the important nonlinear related information in the data, and correctly corrects the position of the offset target peak, thereby enhancing the model's segmentation performance for MSI images.

[0012] The RF classifier is used in conjunction with traditional chemometric algorithms such as PCA, PLS and OPLS to accurately segment mass spectrometry images: the RF classifier can process high-dimensional data, reduce the impact of improper setting of the component coefficients of the chemometric algorithm, and reduce the risk of model overfitting; the chemometric algorithm can also reduce the input dimension of the RF classifier, simplify the complexity of model establishment, and improve reasoning efficiency and accuracy.

[0013] The Bayesian optimization algorithm is used to optimize the parameters such as the chemometric algorithm component coefficient, the number of decision trees for the RF classifier, the decision tree depth, and the maximum number of leaf nodes. The Bayesian optimizer can automatically optimize multiple parameters at the same time, which can not only greatly save computing time, but also obtain the chemometric algorithm and RF classifier with the best performance.

[0014] When performing Bayesian optimization, 70% of the data set is randomly selected as the training set and 30% as the validation set to evaluate the model performance. After each iteration of the Bayesian optimizer, the training set and validation set are randomly redistributed to avoid the parameters from falling into the local optimal solution, improve the generalization ability and classification performance of the chemometric algorithm and RF classifier, and ensure the segmentation accuracy of the mass spectrometry imaging image. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The disclosure of the present invention will become easier to understand with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only used to illustrate the technical solution of the present invention and are not intended to limit the scope of protection of the present invention. In the drawings: Figure 1 is a simplified flowchart of an image segmentation method according to an embodiment of the present invention; Figure 2 It is a schematic diagram comparing the variance distribution of mass spectrometry data before and after natural logarithmic transformation; Figure 3 It is a comparison diagram of the data space after PCA dimensionality reduction before and after natural logarithmic transformation; Figure 4 It is a comparison diagram of the data space after PLS dimensionality reduction before and after natural logarithmic transformation; Figure 5 It is a comparison diagram of the data space after OPLS dimensionality reduction before and after natural logarithmic transformation; Figure 6 Is it a comparison chart of whether to remove useless data and the optimizer convergence speed? Figure 7 It is the mass spectrometry imaging ion current diagram and segmentation result. DETAILED DESCRIPTION

[0016] Figure 1-Figure 7The following description describes optional specific embodiments of the present invention to teach those skilled in the art how to implement and reproduce the present invention. In order to teach the technical solution of the present invention, some conventional aspects have been simplified or omitted. Those skilled in the art will understand that variations or replacements derived from these specific embodiments will be within the scope of the present invention. Those skilled in the art will understand that the following features can be combined in various ways to form multiple variations of the present invention. Thus, the present invention is not limited to the following optional specific embodiments, but is only limited by the claims and their equivalents.

[0017] Example 1

[0018] The image segmentation method of a mass spectrum imaging image of an ESI source according to embodiment 1 of the present invention is as follows: Figure 1 As shown, the following steps are included: (S1) dividing the mass spectrometry imaging image into a plurality of mass spectrometry imaging channels according to the mass-to-charge ratio; (S2) selecting the mass spectrometry imaging channel where the target ion is located, preprocessing each pixel, and obtaining spectrum data; (S3) performing preliminary segmentation on the spectrum data, searching for peaks in an interval centered on the mass-to-charge ratio of the target ion, and obtaining peak areas; The target peak intensity of all pixels is normalized and divided into multiple peak intensity intervals, and the pixels in each peak intensity interval are set to the same color; (S4) dividing the mass spectrum data of the channel where the target ion of each pixel is located into intervals, calculating the lower area of ​​each interval, selecting the central mass-to-charge ratio of each interval as the abscissa of the intensity value of each interval, and setting the intensity value of the interval whose ratio to the highest intensity value is lower than the set value to 0; The processed mass spectrometry data were subjected to natural logarithmic transformation so that the variance of each pixel data presented a quasi-normal distribution; (S5) analyzing, training and optimizing the transformed mass spectrometry data, wherein the pixels of different colors in step (S3) are selected for category labeling, and the transformed mass spectrometry data in step (S4) are selected as a training set and a test set respectively; (S6) The best combination model obtained in step (S5) is used to classify other pixel points of the mass spectrometry imaging image to obtain an image segmentation result.

[0019] In order to improve the processing effect, the preprocessing further includes Gaussian filtering, subtracting impurity background and airPLS baseline correction.

[0020] In order to improve the accuracy of useless data removal, further, in step (S4), Gaussian peak shape fitting is performed on the target ion of each pixel to correct the peak shape.

[0021] In order to eliminate the deviation phenomenon of the target peak, further, before the transformation, it is determined whether the peak value of the target peak of the mass spectrum data after the zeroing operation is within the expected interval of the target peak; If the result is yes, no correction is performed, if the result is no, a mass offset correction is performed on each data point.

[0022] In order to obtain the best combined model, further, in step (S5), unsupervised or supervised training is performed on multiple chemometric algorithms (such as PCA, PLS and OPLS) using the data of the training set to obtain a chemometric algorithm model and the training set data after dimensionality reduction; The random forest classifier is trained using the reduced dimensionality data.

[0023] The hyperparameters of the chemometrics algorithm and the random forest classifier were optimized to obtain the best combination model of the chemometrics algorithm and the RF classifier.

[0024] In order to improve the optimization effect, when training the chemometric algorithm and the RF classifier, the Bayesian optimizer is used to optimize the component coefficients of the chemometric algorithm and the number of decision trees, the depth of the decision tree, and the maximum number of leaf nodes of the RF classifier, and the F_score difference is used as feedback for the Bayesian classifier. After each iterative calculation, the training set and the test set are shuffled, and the combined model of the chemometric algorithm and the RF classifier with the best F_score is obtained according to the iterative calculation; F score=2TP / (2TP+FP+FN), TP, FP, and FN are the true positive rate, false positive rate, and false negative rate, respectively.

[0025] Example 2

[0026] An application example of the image segmentation method for mass spectrum imaging of an ESI source according to embodiment 1 of the present invention.

[0027] In this application example, Figure 1 As shown, the image segmentation method for the mass spectrum imaging image of the ESI source includes the steps of: (S1) Collecting mass spectrum data generated by an ESI source, and using each frame of mass spectrum data as each pixel point of a mass spectrum imaging image to generate a mass spectrum imaging image.

[0028] The mass spectrum data of each pixel of the mass spectrum imaging image is divided into multiple intervals according to the mass-to-charge ratio, each interval is 100Da long, and the mass spectrum data of each interval is used as the ion channel of each pixel of the mass spectrum imaging image.

[0029] (S2) Select the channel where the target ion is located, perform Gaussian filtering, subtract impurity background and airPLS baseline correction on the mass spectrometry data of the selected ion channel in sequence to obtain relatively neat spectral data.

[0030] (S3) Preliminary segmentation of each pixel of the mass spectrometry image is performed, specifically: After preprocessing, the peak area of ​​the target ion was obtained by searching and integrating the target ion mass-to-charge ratio within ±1Da (when the target ion is ≥500Da, the search interval is ±2Da). The peak areas of all pixels were normalized (the peak intensity range after normalization is (0, 1]), and the normalized peak intensity was divided into 5 intervals (0~0.2, ..., 0.8~1.0).

[0031] The pixels belonging to the same interval are set to the same color, and the pixels at the boundaries of each interval are colored with gradient colors to complete the preliminary segmentation of the mass spectrometry image.

[0032] (S4) Perform Gaussian peak shape fitting on the target ion peak.

[0033] The mass spectrometry data of the channel where the target ion of each pixel is fitted is divided into intervals, each interval is 0.3Da long, and the lower area of ​​each interval is calculated using the trapezoidal method. To ensure the consistency of the intensity position of each interval, the central mass-to-charge ratio of each interval is selected as the horizontal coordinate of the intensity value of each interval. The interval intensity value that is 5% lower than the highest intensity value is set to 0, thereby removing useless data and eliminating the interference caused by the background noise remaining in the baseline.

[0034] Determine whether the peak value of the target peak of the compressed mass spectrum data is within the expected interval of the target peak (interval with a length of 0.3 Da).

[0035] If the answer is yes, no correction is performed.

[0036] If the result is no, mass offset correction is performed on each data point to complete the dimensional compression of all pixel mass spectrum data and eliminate the offset phenomenon of the target peak.

[0037] The natural logarithm transformation is performed on the MSI pixel data after the above processing to make the variance of the mass spectrum data of each pixel normally distributed, thereby improving the performance of the mass spectrometry imaging segmentation model. Figure 2 shown.

[0038] (S5) Select some pixels in the mass spectrometry image in step (S3), classify and label them according to color, and obtain the data and labels of each pixel processed by step (S4) as a data set.

[0039] 70% of the labeled pixels in the data set are randomly removed of useless data and corrected mass spectrometry data as the training set, and the remaining 30% are used as the test set.

[0040] The training set is used to train the chemometric algorithms such as PCA, PLS, OPLS and the RF classifier used with them.

[0041] After each training session, the test set is used to evaluate the performance of the combined model of the chemometrics algorithm and the RF classifier to obtain the F1 score that reflects the overall performance of the model.

[0042] According to the feedback F1 score, the Bayesian optimizer is used to iteratively optimize the component coefficients of the chemometric algorithm, the number of decision trees of the RF classifier, the decision tree depth, and the maximum number of leaf nodes. After each hyperparameter optimization, the performance of the combined model of the chemometric algorithm and the RF classifier is evaluated using the test set for the next optimization iteration until the difference in the F1 score after the two optimizations is less than 0.001, then the optimization is stopped to prevent overfitting. The mass spectrometry imaging segmentation model with the best performance is obtained. Compared with the leave-one-out method and K-fold cross-validation, the use of the Bayesian optimizer can save a lot of time and manpower for hyperparameter tuning, and the F1 score can reach 0.96.

[0043] (S6) Using the obtained mass spectrometry imaging segmentation model, classify the remaining pixels of the mass spectrometry imaging image, set the pixels belonging to the same category to the same color, eliminate the gradient color of the boundaries of different substances in step (S3), and complete the accurate segmentation of the mass spectrometry imaging image, such as Figure 7 shown.

[0044] The experimental data is 400 pixels selected from the MSI image. 50% of the pixels are randomly selected as the training set and 50% as the test set. A 10-fold cross validation is performed to obtain the final performance comparison results, as shown in the following table.

[0045] .

Claims

1. An image segmentation method for a mass spectrum imaging image of an ESI source, comprising the following steps: (S1) dividing the mass spectrometry imaging image into a plurality of mass spectrometry imaging channels according to the mass-to-charge ratio; (S2) selecting the mass spectrometry imaging channel where the target ion is located, preprocessing each pixel, and obtaining spectrum data; (S3) performing preliminary segmentation on the spectrum data, searching for peaks in an interval centered on the mass-to-charge ratio of the target ion, and obtaining peak areas; The target peak intensity of all pixels is normalized and divided into multiple peak intensity intervals, and the pixels in each peak intensity interval are set to the same color; (S4) dividing the mass spectrum data of the channel where the target ion of each pixel is located into intervals, calculating the lower area of ​​each interval, selecting the central mass-to-charge ratio of each interval as the horizontal coordinate of the intensity value of each interval, and setting the interval intensity value whose ratio to the highest intensity value is lower than a set value to 0; The processed mass spectrometry data were subjected to natural logarithmic transformation so that the variance of each pixel data presented a quasi-normal distribution; (S5) analyzing, training and optimizing the transformed mass spectrometry data, wherein the pixels of different colors in step (S3) are selected for category labeling, and the transformed mass spectrometry data in step (S4) are selected as a training set and a test set respectively; (S6) The best combination model obtained in step (S5) is used to classify other pixel points of the mass spectrometry imaging image to obtain an image segmentation result.

2. The image segmentation method according to claim 1, characterized in that: The preprocessing includes Gaussian filtering, subtracting impurity background and airPLS baseline correction.

3. The image segmentation method according to claim 1, characterized in that: In step (S4), Gaussian peak fitting is performed on the target ion of each pixel to correct the peak shape.

4. The image segmentation method according to claim 1, characterized in that: Before the transformation, determining whether the target peak value of the mass spectrum data after the zeroing operation is within the target peak expected interval; If the result is yes, no correction is performed, if the result is no, a mass offset correction is performed on each data point.

5. The image segmentation method according to claim 1, characterized in that: In step (S5), unsupervised or supervised training is performed on a plurality of chemometric algorithms using the data of the training set to obtain a chemometric algorithm model and the training set data after dimensionality reduction; Use the reduced-dimensional data to train a random forest classifier; The hyperparameters of the chemometrics algorithm and the random forest classifier were optimized to obtain the best combination model of the chemometrics algorithm and the RF classifier.

6. The image segmentation method according to claim 5, characterized in that: Chemometric methods include PCA, PLS and OPLS.

7. The image segmentation method according to claim 5, characterized in that: When training the chemometric algorithm and RF classifier, the Bayesian optimizer is used to optimize the component coefficients of the chemometric algorithm and the number of decision trees, the depth of the decision tree, and the maximum number of leaf nodes of the RF classifier, and the F_score difference is used as feedback for the Bayesian classifier; After each iterative calculation, the training set and the test set are shuffled, and the combined model of the chemometric algorithm and the RF classifier with the best F_score is obtained according to the iterative calculation; Fscore=2TP / (2TP+FP+FN), TP, FP, and FN are the true positive rate, false positive rate, and false negative rate, respectively.

8. The image segmentation method according to claim 1, characterized in that: In step (S1), the length of each interval is 100; in step (S2), the interval is the target ion mass-to-charge ratio ±1Da; in step (S4), the interval length is 0.3Da, and the set value is 0.05.

Citation Information

Patent Citations

  • Mass spectrometry information-based biological characteristic image identification method

    CN105574474A

  • Spectrometric analysis

    CN107646089A

  • Mass spectrum imaging classification method based on multi-channel convolutional neural network

    CN112183677A

  • Interactive space segmentation method for mass spectrum imaging data

    CN114494175A

  • Mass spectrum imaging data processing method and device, equipment and storage medium

    CN118378071A

Cited By

  • Mass spectrum imaging data normalization method and system based on local space structure

    CN119992031A

  • Mass spectrometry imaging data normalization method and system based on local spatial structure

    CN119992031B

  • Original mass spectrum data classification method based on multi-channel embedded representation

    CN120524271A

  • A method for classification of raw mass spectrometry data based on multi-channel embedded representation

    CN120524271B