Mass spectrometry imaging data normalization method and system based on local spatial structure
By constructing a neighborhood set and spectral correlation matrix based on a mass spectrometry imaging data normalization method using local spatial structure, and optimizing the normalization coefficient using gradient descent, the influence of experimental operation and instrument response factors in mass spectrometry imaging data is resolved, improving data stability and resolution, enhancing the ability to preserve spatial structure, and making it suitable for subsequent statistical analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2026-03-27
AI Technical Summary
Existing mass spectrometry imaging data normalization methods cannot effectively eliminate the influence of experimental operation and instrument response factors, and cannot preserve the spatial heterogeneity of different regions in mass spectrometry images, resulting in reduced data comparability and difficulty in accurately analyzing biological differences.
A mass spectrometry imaging data normalization method based on local spatial structure is adopted. By constructing a neighbor set and spectral correlation matrix, the normalization coefficient is optimized using the gradient descent method to achieve localized normalization of mass spectrometry data while preserving spatial structure characteristics.
It improves the stability and reliability of data, enhances image contrast and resolution, and enables more accurate differentiation of different tissue types or pathological states, helping to discover potential key biomarkers.
Smart Images

Figure CN119992031B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mass spectrometry imaging (MSI) data analysis technology, specifically to a method and system for normalizing mass spectrometry imaging data based on local spatial structure. Background Technology
[0002] Mass spectrometry (MS), alongside spectroscopy, is a technique that combines high specificity and sensitivity. It's a method for identifying compounds by preparing, separating, and detecting ions in the gas or liquid phase, providing rich structural information in analysis, such as analyzing various types of biomolecules in complex biological matrices. Currently, MS is widely used to study biochemical changes associated with disease progression, and has achieved successful applications in the analysis of various biological samples, including serum, urine, saliva, and tissues. Mass spectrometry imaging (MSI) is a technique for acquiring spatially resolved mass spectrometry information from thin-layer surfaces such as biological tissues. It can obtain the molecular-level structure of substances, analyze their composition and distribution, and thus explore their potential roles in diagnosis or treatment. Therefore, spatial metabolomics methods using mass spectrometry imaging can directly observe the distribution of metabolites in tissues, providing in-depth understanding of disease-related changes in specific structures. In recent years, MSI research has been increasingly used to reveal metabolic reprogramming associated with disease development, enabling the discovery of key biomarkers with diagnostic potential. Therefore, the quality of MSI image data acquired by mass spectrometry and its preprocessing are of great significance for subsequent metabolite pathway analysis.
[0003] Mass spectrometry (MSI) is widely used in biomedical research; however, many potential systematic differences may exist in mass spectrometry data, including differences between pixels, regions, and slices. These differences are caused by many factors, such as sample storage and collection, differences in mass spectrometer equipment, and variations in laboratory environmental conditions (temperature, humidity), which can affect subsequent data analysis and hinder reliable comparisons in large-scale studies. In some cases, systematic differences in the data may even mask true biological differences.
[0004] Systemic differences between pixels are mainly introduced by sample preparation and instrument measurement. The chemical properties of different locations in the tissue affect the efficiency of solvent extraction and matrix crystallization, leading to uneven matrix coating, matrix-related ion suppression, and differences in signal intensity between pixels, affecting the overall measurement process. In previous drug MSI studies, Hamm et al. introduced tissue extinction coefficients (TECs) to quantify and correct for tissue-specific ion suppression. This method uniformly coats the target compound on the surface of the tissue, and by measuring the signal intensity difference of the target compound in different organs, TECs are determined. In subsequent experiments, the previously obtained TECs are used as organ-specific correction factors in the study of drug administration animals, in an attempt to reduce signal intensity differences caused by tissue-specific ion suppression and more accurately reflect the true content or distribution of the target compound in the tissue. However, this method of introducing TECs, while showing some effect in certain cases, also has limitations, such as not being suitable for discovery MSI. In discovery studies, each molecule responds differently to ionization and is affected differently by systemic differences between pixels, so TECs cannot be relied on to solve all ion suppression-related problems.
[0005] During measurement, different locations on the slide may also be affected by different degrees of systemic differences, such as differences in thickness between different cross-sectional regions, which can affect ionization efficiency or molecular diffusion, resulting in differences in signal intensity. Moreover, due to differences in measurement order, there may be a gradual decrease in matrix sublimation or detector sensitivity as the measurement progresses, which can cause measurement results to deviate between different cross-sections. While using a random measurement order may reduce some of these effects during the measurement process, it cannot effectively compensate for the effects introduced during sample preparation, such as inconsistencies in slice thickness and artifacts.
[0006] Similarly, during slide preparation, subtle differences in operation (such as immersion time, different dates for mass spectrometric imaging, etc.) can introduce difficult-to-control systemic differences. These accumulated differences reduce the comparability of data between slides and pose challenges for accurate analysis and interpretation of mass spectrometric imaging data. Determining quality control standards during slide preparation can help solve some of these problems, but there is currently a lack of quality control standards that cover all aspects of slide preparation (such as cleaning, digestion, derivatization, matrix coating, drying, rehydration, and many other steps). Moreover, existing quality control standards can only help identify abnormal situations, and further exploration and improvement of related methods and standards are still needed to address systemic differences between cross-sections.
[0007] Therefore, it is necessary to study mass spectrometry normalization techniques to standardize mass spectrometry data of different samples, so as to eliminate the influence of experimental operation and instrument response on mass spectrometry data, and more accurately compare and analyze the differences between different samples. At present, the commonly used methods for mass spectrometry image data normalization are total ion current normalization (TIC), median normalization, root mean square normalization, etc. The TIC method adjusts the total ion current intensity of each mass spectrum in the image to the same value, and normalizes all ions uniformly, that is, the peak area or peak height value of each pixel is divided by the total area or total peak height value of all ion peaks in the pixel. In this way, different mass spectra have comparability in the overall signal intensity, and the differences caused by sample size, ionization efficiency, etc. are reduced. The median normalization method calculates the median of all ion intensities of each pixel, and finds a reference standard (usually the median of the median of all pixels as the reference), and takes the ratio between the median of each pixel and the reference median as the normalization factor. After the MSI data is corrected by the median normalization, the intensity differences between different pixel points are standardized to some extent, so as to be used for subsequent analysis. The root mean square normalization method regards all ion intensity values of each pixel point as a data sequence, calculates the root mean square value (RMS) of the sequence, that is, squares and averages the intensity values first, and then takes the square root, and then determines a reference RMS value, calculates a scaling factor for each pixel, so that the RMS values of all pixels tend to be consistent (that is, normalized to the reference RMS value). The advantage of root mean square normalization is that it gives more weight to stronger signals, which may help to preserve the real biological differences between samples, but this also makes it more sensitive to outliers.
[0008] In fact, there may be many significantly different tissue regions in mass spectrometry image data, which have certain heterogeneity between each other, but have certain similarity between the internal pixels. The above normalization methods do not consider that different pixels may belong to the same or different tissue regions, but only uniformly normalize all pixels under the same condition, which may weaken the spatial differences of pixels in different tissue regions (such as TIC, median normalization) or amplify the abnormal differences between all pixels caused by noise (such as RMS normalization). Therefore, a normalization method is needed which can normalize mass spectrometry data, eliminate the influence of experimental operation and instrument, and also preserve the spatial heterogeneity structure. SUMMARY
[0009] To solve the above problems, the application provides a mass spectrum imaging data normalization method based on local spatial structure, introduces the concept of neighbor set, determines the neighbor set (i.e. a pixel set that can be divided into a unified region in space) through pixel space adjacency and spectral correlation, and then finds the normalization coefficient that can minimize the distance between pixel neighbors after normalization based on the gradient descent method, applies the normalization coefficient to the original image data to realize normalization, realizes the classification of all pixels according to spatial position and spectral correlation, and realizes normalization in different standards, while ensuring the removal of systematic differences between truly similar pixels and the preservation of the heterogeneity between pixels in different regions or region boundaries.
[0010] Specific schemes are as follows:
[0011] In one aspect, the mass spectrum imaging data normalization method based on local spatial structure comprises:
[0012] S1, introducing the initial MSI data set and the spatial position information of each pixel in the MSI image;
[0013] S2, constructing the spatial adjacency matrix of the MSI image pixels based on the spatial position information of each pixel, calculating the spectral correlation between each two pixels in the MSI image, constructing the spectral correlation matrix between the pixels based on the spectral correlation, and multiplying the spatial adjacency matrix and the spectral correlation matrix to obtain the adjacency matrix between the MSI image pixels;
[0014] S3, reducing the dimension of the initial MSI data set to obtain the data set after dimension reduction;
[0015] S4, performing logarithmic transformation on the data set after dimension reduction, calculating the L1 norm distance between the spectra of neighbor pixels based on the adjacency matrix, accumulating the L1 norm distance between all neighbor pixel spectra to obtain the accumulation sum, introducing a penalty coefficient, and constructing a target function based on the accumulation sum;
[0016] S5, minimizing the target function by the gradient descent method, and iteratively updating the normalization coefficient of all pixels in the MSI image until convergence to obtain the final normalization coefficient;
[0017] S6, multiplying the final normalization coefficient by the initial MSI data set to obtain the normalized MSI data set.
[0018] Further, in S2, the calculation formula of the spatial adjacency matrix of the MSI image pixels is as follows:
[0019]
[0020] Wherein, W represents the spatial adjacency matrix of the MSI image pixels, w ijdenotes whether pixel i and pixel j are k-order neighbors in spatial position, and N is the number of pixels; the calculation formula of the spectral correlation matrix between the pixels is as follows:
[0021]
[0022] wherein H denotes the spectral correlation matrix between the pixels of the MSI image; h ij denotes the spectral correlation coefficient of pixel i and pixel j; T is a given threshold; the calculation formula of the adjacency matrix between the pixels of the MSI image is as follows:
[0023] I = (I ij ) N×N = (w ij · h ij ) N×N ;
[0024] wherein I denotes the adjacency matrix between the pixels of the MSI image; I ij denotes whether pixel i and pixel j are adjacent pixels, that is, whether they are a pixel pair adjacent in spatial position and having a spectral correlation coefficient higher than a given threshold.
[0025] Further, the S4 specifically comprises:
[0026] initializing the normalized coefficients of the pixels wherein, denotes the initial normalized coefficient of pixel i, and N is the number of pixels;
[0027] performing logarithmic transformation on the reduced dimension data set, and the calculation formula is as follows:
[0028]
[0029] wherein x i is the intensity vector of pixel i before logarithmic transformation, has the same meaning as the foregoing, is the intensity vector of pixel i before and after logarithmic transformation;
[0030] calculating the L1 norm distance between the spectra of the two adjacent pixels, and the calculation formula is as follows:
[0031]
[0032] wherein, and denote the intensity vectors of the adjacent pixels i and j after logarithmic transformation, and d ij denotes the L1 norm distance between the spectra of the adjacent pixels i and j;
[0033] calculating the sum of the weighted L1 norm distances between the spectra of all the adjacent pixels, and the calculation formula is as follows:
[0034]
[0035] wherein, l1 represents the sum of the weighted L1 norm distance between all neighboring pixel spectra;
[0036] A penalty coefficient is introduced to obtain the objective function L, and the calculation formula is as follows:
[0037]
[0038] wherein, N I is the number of all neighboring pixel pairs, and λ is the penalty coefficient for the normalization coefficient α.
[0039] Further, the S5 specifically comprises:
[0040] The gradient descent method is used to update the pixel normalization coefficient, and the calculation formula is as follows:
[0041]
[0042] wherein, t and t-1 respectively represent the tth and (t-1)th round of iteration, and respectively represent the normalization coefficient of the ith pixel at the tth and (t-1)th round, η (t) represents the learning rate of the tth round of iteration;
[0043]
[0044] wherein, η0 is the initial learning rate, R is the learning rate decay factor, τ is the decay step number, and floor(*) represents the down rounding operation in the bracket;
[0045] When the following conditions are met, the objective function converges, and the iteration is stopped:
[0046]
[0047] wherein, median(*) represents the median operation, and ε represents the convergence standard;
[0048] The optimal normalization coefficient obtained is subjected to exponential transformation to obtain the final normalization coefficient:
[0049] α′=e α ;
[0050] wherein, α′ is the normalized coefficient obtained by conversion.
[0051] Further, in S6, the normalization coefficient of each pixel is multiplied by the MSI initial data to obtain the normalized MSI data set, and the formula is as follows:
[0052]
[0053] wherein, is the vector of the i-th pixel in the initial MSI dataset.
[0054] In another aspect, the mass spectrometry imaging data normalization system based on local spatial structure comprises:
[0055] A data import module is configured to import an initial MSI dataset and spatial position information of each pixel in an MSI image.
[0056] An adjacency matrix construction module is configured to construct a spatial adjacency matrix of pixels in the MSI image based on the spatial position information of each pixel, calculate spectral correlation between each pair of pixels in the MSI image, construct a spectral correlation matrix between the pixels based on the spectral correlation, and multiply the spatial adjacency matrix and the spectral correlation matrix to obtain an adjacency matrix between the pixels in the MSI image.
[0057] A data dimension reduction module is configured to reduce the dimension of the initial MSI dataset to obtain a reduced dataset.
[0058] A target function construction module is configured to perform logarithmic transformation on the reduced dataset, calculate L1 norm distance between neighbor pixel spectrums based on the adjacency matrix, accumulate the L1 norm distance between all neighbor pixel spectrums to obtain an accumulated sum, introduce a penalty coefficient, and construct a target function based on the accumulated sum.
[0059] A normalization coefficient convergence module is configured to minimize the target function by a gradient descent method and iteratively update the normalization coefficient of all pixels in the MSI image until convergence to obtain a final normalization coefficient.
[0060] A data normalization module is configured to multiply the final normalization coefficient by the initial MSI dataset to obtain a normalized MSI dataset.
[0061] The present application adopts the above technical solution and has the following beneficial effects:
[0062] (1) The mass spectrometry imaging data normalization method based on local spatial structure can normalize and correct the data while better preserving the local spatial structure, so that the spatial boundaries between different tissue regions are clearer and easier to distinguish.
[0063] (2) The present application minimizes the objective function by introducing gradient descent optimization and uses a penalty coefficient to prevent overfitting, which greatly improves the stability and reliability of the corrected data. Compared with other normalization methods, the influence of this method on the Moran's I value of ions with strong spatial autocorrelation before and after correction is more stable, which shows that it not only reduces the influence of noise, but also better preserves the real biological differences in the data, providing a solid foundation for subsequent statistical analysis;
[0064] (3) The present application enhances the image contrast and resolution by reducing the difference in pixel intensity within the same tissue region, making the details in the image more obvious. For mass spectrometry imaging, this means that different tissue types or pathological states can be more accurately distinguished, helping researchers more easily find potential key biomarkers. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 A flow chart of the mass spectrometry imaging data normalization method based on local spatial structure of the embodiment of the present application;
[0066] Figure 2 A visualization grayscale map obtained by using different methods for normalization and then performing UMAP dimension reduction of the embodiment of the present application;
[0067] Figure 3 A comparison chart of ion images under different normalization processing methods of the embodiment of the present application;
[0068] Figure 4 A chart showing the change in Moran's I value of different pixels after normalization using different methods of the embodiment of the present application;
[0069] Figure 5 A structure block diagram of the mass spectrometry imaging data normalization device based on local spatial structure of the embodiment of the present application. DETAILED DESCRIPTION
[0070] The present application will be further described in detail below in conjunction with the embodiments and drawings, but the embodiments of the present application are not limited thereto.
[0071] As shown in Figure 1 A mass spectrometry imaging data normalization method based on local spatial structure, comprising:
[0072] S1, importing an initial MSI data set and spatial position information of each pixel in the MSI image.
[0073] Specifically, the verification data set used in the present embodiment is a brain MSI data, with a total of 36523 pixels and 1309 ions.
[0074] S2, constructing a spatial adjacency matrix of the MSI image pixels based on the spatial position information of each pixel, calculating the spectral correlation between each pair of pixels in the MSI image, constructing a spectral correlation matrix between the pixels based on the spectral correlation, multiplying the spatial adjacency matrix and the spectral correlation matrix to obtain an adjacency matrix between the MSI image pixels.
[0075] Specifically, the calculation formula of the spatial adjacency matrix of the MSI image pixels is as follows:
[0076]
[0077] wherein W represents the spatial adjacency matrix of the MSI image pixels, w ij represents whether the pixel i and the pixel j are k-order neighbors in the spatial position, and N is the number of pixels; the calculation formula of the spectral correlation matrix between the pixels is as follows:
[0078]
[0079] wherein H represents the spectral correlation matrix between the MSI image pixels; h ij represents the spectral correlation coefficient of the pixel i and the pixel j; and T is a given threshold; the calculation formula of the adjacency matrix between the MSI image pixels is as follows:
[0080] I = (I ij ) N×N = (w ij · h ij ) N×N ;
[0081] wherein I represents the adjacency matrix between the MSI image pixels; I ij represents whether the pixel i and the pixel j are adjacent pixels, that is, whether they are a pair of pixels adjacent in the spatial position and having a spectral correlation coefficient higher than a given threshold.
[0082] Specifically, the dimension reduction of the embodiment is to rearrange the variables from large to small according to the non-missing rate of each variable before filling in the missing values. Starting from the variable with the largest non-missing rate, the subsequent variables are sequentially included. If the cumulative non-missing rate (i.e., the proportion of pixels without missing on at least one variable) is greater than 80%, the variable is stopped from being included. At this time, the variables that have been included are divided into a variable block. From the next variable, the above steps are repeated until all variables are divided into variable blocks. The variable values in each variable block are added to become a new variable, thereby reducing the number of variables and obtaining a reduced dataset. The number of variables of the reduced dataset is denoted as q, and the pixel i therein is denoted as a vector x i = {x i1 , x i2 , …, x iq}.
[0083] S3 reduces the dimensionality of the initial MSI dataset to obtain the dimensionality-reduced dataset.
[0084] S4. Perform a logarithmic transformation on the dimensionality-reduced dataset, calculate the L1 norm distance between neighboring pixel spectra based on the adjacency matrix, sum the L1 norm distances between all neighboring pixel spectra to obtain the sum, introduce a penalty coefficient, and construct the objective function based on the sum.
[0085] S4 specifically includes:
[0086] Initialize the normalization coefficients for each pixel. in, Represents the initial normalization coefficient of pixel i, where N is the number of pixels;
[0087] The logarithmic transformation is performed on the dimensionality-reduced dataset, and the calculation formula is as follows:
[0088]
[0089] Where, x i Let i be the intensity vector of pixel i before logarithmic transformation. The meaning is consistent with the previous text. The intensity vector of pixel i before and after logarithmic transformation;
[0090] The L1 norm distance between any two neighboring pixel spectra is calculated using the following formula:
[0091]
[0092] in, and d represents the intensity vector of neighboring pixels i and j after logarithmic transformation. ij This represents the L1 norm distance between the spectra of neighboring pixels i and j;
[0093] The sum of weighted L1 norm distances between all neighboring pixel spectra is calculated using the following formula:
[0094]
[0095] Where l1 represents the sum of weighted L1 norm distances between all neighboring pixel spectra;
[0096] Introducing a penalty coefficient, we obtain the objective function L, calculated using the following formula:
[0097]
[0098] Where, N I Let λ be the number of all neighboring pixel pairs, and λ be the penalty coefficient for the normalization coefficient α.
[0099] S5, minimizing the objective function by a gradient descent method and iteratively updating the normalization coefficients of all pixels in the MSI image until convergence to obtain final normalization coefficients.
[0100] Specifically, the S5 specifically comprises:
[0101] The pixel normalization coefficient is updated using a gradient descent method, and the calculation formula is as follows:
[0102]
[0103] Where t and t-1 represent the tth and (t-1)th iterations, respectively, And The normalization coefficient of the ith pixel at the tth and (t-1)th iterations, respectively, η (t) Indicates the learning rate of the tth iteration;
[0104]
[0105] Where η0 is the initial learning rate, R is the learning rate decay factor, τ is the decay step, and floor(*) represents rounding down the number in the parentheses;
[0106] When the following conditions are met, the objective function converges and the iteration stops:
[0107]
[0108] Where median(*) represents the median operation, and ε represents the convergence standard;
[0109] The optimal normalization coefficient obtained is exponentially transformed to obtain the final normalization coefficient:
[0110] α' = e α ;
[0111] Where α' is the normalized coefficient obtained by conversion.
[0112] S6, multiplying the final normalization coefficient by the initial MSI data set to obtain the normalized MSI data set.
[0113] Specifically, the normalization coefficient of each pixel is multiplied by the MSI initial data to obtain the normalized MSI data set, and the formula is as follows:
[0114]
[0115] Where, is the vector of the ith pixel in the MSI initial data set.
[0116] Specifically, the specific parameter settings in the embodiment are shown in Table 1.
[0117] Table 1
[0118]
[0119] Specifically, the normalization method verification comparison of the embodiment is as follows:
[0120] (1) UMAP dimensionality reduction visualization: the maximum-minimum value normalization is performed on each ion of the data, and then the UMAP method is used to reduce the data to three dimensions, the mean value of the three-dimensional data is input to the R, G and B channels, and a grayscale image is obtained;
[0121] (2) Single ion image visualization: the selected ion is maximum-minimum value normalized, and the normalized value is input to the G channel to obtain a single channel image;
[0122] (3) Moran's index calculation: a measure of spatial autocorrelation index, Moran's index, is selected, which is calculated as shown below:
[0123]
[0124] Wherein, N is the number of all pixel points, x i and x j respectively represent the intensity of a certain ion at pixel i and j, and the mean value of the intensity of the ion at all pixel points; if the pixel points i and j are neighbors, w ij = 1, otherwise w ij = 0. The value range of Moran's index is -1 to 1, and the value closer to 1 indicates a more significant spatial aggregation pattern.
[0125] Specifically, as shown in Figure 2 the visualization grayscale image obtained after the MSI data is normalized by using different methods and then subjected to UMAP dimensionality reduction. The normalization methods used from left to right are no normalization, total ion current normalization, median normalization, root mean square normalization and normalization based on local spatial structure. The results show that the total ion current normalization reduces the difference between regions of the entire image, the median normalization makes it difficult to distinguish different regions, the root mean square normalization seems to retain a lot of details, but in fact different regions are completely mixed together and difficult to distinguish. After normalization based on local spatial structure, the spatial boundary of the MSI data is clearer and different regions are easier to distinguish. In summary, the total ion current, median and root mean square normalization methods will eliminate some structural differences to some extent, and the mass spectrometry imaging data normalization method based on local spatial structure proposed in the present application can retain more spatial structural differences while normalizing.
[0126] Specifically, as shown inFigure 3 The image shows the comparison of ion images with a mass-to-charge ratio of 229.9384 under different normalization methods. The normalization methods compared are the same as above. The image below each column shows the distribution of the ion after correction by the corresponding method, and the green intensity represents the concentration of the ion. The Moran index above the image reflects the spatial autocorrelation of each ion under different normalization methods. The higher the value, the stronger the spatial autocorrelation of the ion. The results show that after correction using total ion current normalization, median normalization and root mean square normalization, the Moran index decreases to a certain extent, i.e. the normalized spatial structure decreases; while after correction using the normalization method based on local spatial structure, the Moran index increases to a certain extent, i.e. the spatial structure can be preserved or even highlighted after normalization.
[0127] Specifically, as shown in Figure 4 The image shows the change of Moran index values of different pixels after normalization using different methods. The horizontal axis represents the Moran index value before normalization, and the vertical axis represents the change value of the Moran index after normalization. For all ions with a Moran index greater than 0.5 before correction (i.e. with strong spatial structure), only 45.71% of the ions have an increased Moran index after total ion current normalization, with an average increase of 0.038, and the remaining ions have an average decrease of 0.072; 51.43% of the ions have an increased index (an average of 0.0097) after median normalization, and the remaining ions have an average decrease of 0.024; only 4.76% of the ions have an increased index (an average of 0.034) after root mean square normalization, and the remaining ions have an average decrease of 0.16; and 93.33% of the ions have an increased Moran index after normalization based on local spatial structure, with an average increase of 0.0033, and the remaining ions have an average decrease of 0.0014. In summary, there are obvious differences in the influence of different methods on the Moran index value, among which the normalization method based on local spatial structure performs outstandingly for ions with a Moran index greater than 0.5 before correction, with an increased Moran index for most ions and relatively small fluctuations, proving that it preserves or even highlights the spatial structure of the image data with high stability.
[0128] In summary, the normalization method based on local spatial structure for mass spectrometry imaging data can preserve the spatial structure characteristics while correcting the data, and to a certain extent, enhance the similarity of pixels within the same tissue region. And compared with other normalization correction methods, it performs more stably, better and is more suitable for subsequent statistical analysis.
[0129] As shown in Figure 5 The embodiment also discloses a mass spectrometry imaging data normalization system based on local spatial structure, which comprises:
[0130] The data importing module 51 is configured to import the initial MSI data set and the spatial position information of each pixel in the MSI image.
[0131] The adjacency matrix constructing module 52 is configured to construct a spatial adjacency matrix of the pixels in the MSI image based on the spatial position information of each pixel, calculate the spectral correlation between each pair of pixels in the MSI image, construct a spectral correlation matrix between the pixels based on the spectral correlation, multiply the spatial adjacency matrix and the spectral correlation matrix, and obtain an adjacency matrix between the pixels in the MSI image.
[0132] The data dimension reduction module 53 is configured to reduce the dimension of the initial MSI data set and obtain a reduced data set.
[0133] The objective function constructing module 54 is configured to perform logarithmic transformation on the reduced data set, calculate the L1 norm distance between the spectral of adjacent pixels based on the adjacency matrix, accumulate the L1 norm distance between all the spectral of adjacent pixels, obtain an accumulated sum, introduce a penalty coefficient, and construct an objective function based on the accumulated sum.
[0134] The normalized coefficient converging module 55 is configured to minimize the objective function by using the gradient descent method, iteratively update the normalized coefficient of each pixel in the MSI image until convergence, and obtain a final normalized coefficient.
[0135] The data normalization module 56 is configured to multiply the final normalized coefficient by the initial MSI data set, and obtain a normalized MSI data set.
[0136] The specific implementation of the mass spectrometry imaging data normalization system based on local spatial structure is the same as the mass spectrometry imaging data normalization method based on local spatial structure, and thus no repeated description is given herein.
[0137] Although the present application is specifically shown and described in connection with the preferred embodiments, those skilled in the art should understand that various changes in form and details can be made to the present application without departing from the spirit and scope of the present application as defined in the appended claims, and all such changes are intended to be within the protection scope of the present application.
Claims
1. A method for normalizing mass spectrometry imaging data based on local spatial structure, characterized in that, include: S1, Import the initial MSI dataset and the spatial location information of each pixel in the MSI image; S2, construct the spatial proximity matrix of MSI image pixels based on the spatial location information of each pixel, calculate the spectral correlation between pairs of pixels in the MSI image, construct the spectral correlation matrix between pixels based on the spectral correlation, and multiply the spatial proximity matrix and the spectral correlation matrix to obtain the adjacency matrix between MSI image pixels. S3, reduce the dimensionality of the initial MSI dataset to obtain the dimensionality-reduced dataset; S4. Perform a logarithmic transformation on the dimensionality-reduced dataset, calculate the L1 norm distance between neighboring pixel spectra based on the adjacency matrix, sum the L1 norm distances between all neighboring pixel spectra to obtain the sum; introduce a penalty coefficient, and construct an objective function based on the sum. S5 minimizes the objective function using the gradient descent method and iteratively updates the normalization coefficients of all pixels in the MSI image until convergence, thus obtaining the final normalization coefficients. S6. Multiply the final normalization coefficients by the initial MSI dataset to obtain the normalized MSI dataset. S4 specifically includes: Initialize the normalization coefficients for each pixel. ,in, Represents the initial normalization coefficient of pixel i, where N is the number of pixels; The logarithmic transformation is performed on the dimensionality-reduced dataset, and the calculation formula is as follows: ; in, pixels before logarithmic transformation The intensity vector, The meaning is consistent with the previous text. Pixels before and after logarithmic transformation The intensity vector; The L1 norm distance between any two neighboring pixel spectra is calculated using the following formula: ; in, and This represents the intensity vector of neighboring pixels i and j after logarithmic transformation. This represents the L1 norm distance between the spectra of neighboring pixels i and j; The sum of weighted L1 norm distances between all neighboring pixel spectra is calculated using the following formula: ; in, This represents the sum of weighted L1 norm distances between all neighboring pixel spectra; Introducing a penalty coefficient, we obtain the objective function. The calculation formula is as follows: ; in, The number of all neighbor pixel pairs. For the normalization coefficient The penalty coefficient.
2. The mass spectrometry imaging data normalization method based on local spatial structure according to claim 1, characterized in that, In S2, the formula for calculating the spatial proximity matrix of the MSI image pixels is as follows: ; in, Represents the spatial proximity matrix of pixels in an MSI image. Represents pixels With pixels Is it spatially located? Neighbors, The number of pixels; the formula for calculating the spectral correlation matrix between the pixels is as follows: ; in, This represents the spectral correlation matrix between pixels in an MSI image. Represents pixels With pixels The spectral correlation coefficient; T is a given threshold; the formula for calculating the adjacency matrix between pixels in the MSI image is as follows: ; in, This represents the adjacency matrix between pixels in an MSI image. Represents pixels With pixels Whether they are neighboring pixels, that is, whether they are spatially adjacent pixel pairs with a spectral correlation coefficient between them that is higher than a given threshold.
3. The mass spectrometry imaging data normalization method based on local spatial structure according to claim 1, characterized in that, S5 specifically includes: The pixel normalization coefficients are updated using the gradient descent method, calculated as follows: ; in, and They represent the first and Round iteration, and They represent in and The normalization coefficient of the i-th pixel during round-robin. Indicates the iteration number The learning rate of the round; ; in, The initial learning rate, This is the learning rate decay factor. The number of decay steps, This means rounding the number in parentheses down to the nearest integer. The objective function converges and iteration stops when the following conditions are met: ; in, This indicates the operation of finding the median. Indicates the convergence criterion; The obtained optimal normalized coefficients are then subjected to an exponential transformation to obtain the final normalized coefficients: ; in, The normalization coefficients obtained after the transformation are denoted as .
4. The mass spectrometry imaging data normalization method based on local spatial structure according to claim 3, characterized in that, In S6, the normalization coefficient of each pixel is multiplied by the initial MSI data to obtain the normalized MSI dataset, as shown in the following formula: ; in, It is the vector of the i-th pixel in the initial MSI dataset.
5. A mass spectrometry imaging data normalization system based on local spatial structure, characterized in that, Based on the method according to any one of claims 1 to 4, the system comprises: The data import module is used to import the initial MSI dataset and the spatial location information of each pixel in the MSI image; The adjacency matrix construction module is used to construct the spatial proximity matrix of MSI image pixels based on the spatial location information of each pixel, calculate the spectral correlation between pairs of pixels in the MSI image, construct the spectral correlation matrix between pixels based on the spectral correlation, and multiply the spatial proximity matrix and the spectral correlation matrix to obtain the adjacency matrix between MSI image pixels. The data dimensionality reduction module is used to reduce the dimensionality of the initial MSI dataset to obtain a dimensionality-reduced dataset. The objective function construction module is used to perform a logarithmic transformation on the dimensionality-reduced dataset, calculate the L1 norm distance between neighboring pixel spectra based on the adjacency matrix, accumulate the L1 norm distances between all neighboring pixel spectra to obtain the sum, introduce a penalty coefficient, and construct the objective function based on the sum. The normalization coefficient convergence module is used to minimize the objective function using the gradient descent method and iteratively update the normalization coefficients of all pixels in the MSI image until convergence, thus obtaining the final normalization coefficients. The data normalization module is used to multiply the final normalization coefficients by the initial MSI dataset to obtain the normalized MSI dataset.
Citation Information
Patent Citations
Image segmentation method for mass spectrum imaging image of ESI source
CN119295477A