Uncertainty-aware graphical attention neural network for mass spectrometry imaging data interpolation

By employing a two-stage framework of uncertainty-aware graph attention neural network, we can accurately distinguish between technical deficiencies and biological deficiencies, thus solving the problems of over-interpolation and noise interference in existing mass spectrometry imaging data interpolation, and improving data quality and the reliability of downstream analysis.

CN123115609APending Publication Date: 2026-11-17FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611247932.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing mass spectrometry imaging data interpolation methods fail to accurately distinguish between technical defects and biological defects, leading to over-interpolation and computational artifacts, which affect data quality and biological interpretation.

Method used

An uncertainty-aware graph attention neural network is used to identify technical and biological deficiencies through a two-stage framework. The graph attention network is used to adaptively reduce the weight of unreliable signals, and a semi-synthetic training dataset is constructed to train a fully connected neural network for interpolation.

Benefits of technology

High-fidelity signal recovery was achieved, avoiding over-interpolation and noise interference, thus improving the quality of mass spectrometry imaging data and the reliability of downstream analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115609A_ABST
    Figure CN123115609A_ABST
Patent Text Reader

Abstract

This invention proposes a mass spectrometry imaging data interpolation method based on an uncertainty-aware graph attention neural network. First, the raw MSI data collected by the mass spectrometer at the two-dimensional dot matrix of the sample is processed to obtain the missing MSI expression matrix to be interpolated. Then, a semi-synthetic training dataset is constructed on the MSI expression matrix using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. An interpolation model is then trained to distinguish between technical and biologically real missing data on the MSI expression matrix. For the identified technical missing data, the trained interpolation model is used for interpolation. The graph topology adaptively aggregates the spectral information of neighboring pixels, and uncertainty learning reduces the weight of unreliable observation signals, achieving high-fidelity signal recovery. This invention can accurately identify technical and biologically real missing data and adaptively reduce the weight of unreliable signals during interpolation, improving the quality of mass spectrometry imaging data and the reliability of downstream analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mass spectrometry imaging data processing technology, and in particular to a mass spectrometry imaging data interpolation method based on an uncertainty perceptual graph attention neural network, specifically a method for interpolating missing values ​​in mass spectrometry imaging data based on an uncertainty perceptual graph attention neural network. Background Technology

[0002] Mass spectrometry (MSI) is a powerful label-free molecular imaging technique capable of resolving the spatial distribution of thousands of metabolites in tissues in situ. By combining tissue architecture information with molecular maps, MSI provides crucial insights into spatial heterogeneity analysis and has become an important analytical tool in clinical research, drug discovery, and environmental science. A typical MSI acquisition process involves scanning along a pixel coordinate grid on a tissue slice, generating a high-dimensional dataset where each spatial pixel corresponds to a discrete mass spectrum containing thousands of specific mass-to-charge ratios (m / z).

[0003] In recent years, advancements in hardware technology have enabled modern MSI instruments to achieve high spatial resolution, even down to the single-cell level. However, this introduces a physical trade-off: as pixel size decreases, the local molecular abundance within each pixel drops sharply. Consequently, the generated MSI datasets often suffer from severe data sparsity, with missing values ​​reaching as high as 50%. This high proportion of missing values ​​significantly impacts subsequent downstream analysis and biological interpretation, making the development of MSI data imputation methods crucial for improving data quality and interpretability.

[0004] Currently, various data imputation frameworks have been developed, some of which are directly applicable to the MSI dataset. Based on different feature extraction strategies, these frameworks can be broadly categorized into three paradigms: spatially driven, spectrally driven, and integrated spatial-spectral methods. Spatially driven methods assume that missing values ​​are correlated with pixels in adjacent spatial coordinates and impute using local spatial context, such as Gaussian filtering and bilateral filtering. These methods are widely integrated into MSI data processing platforms such as SCiLS Lab, MSiReader, and Cardinal due to their computational simplicity and efficiency. Spectrally driven methods utilize stoichiometric correlations within the spectral domain, such as the spatial co-localization of isotopic ions, isotopic clusters, and substitution adduct ions of individual molecules, to impute missing values. Representative methods include random forests and OmicNMF. To further leverage the multidimensional topological structure of MSI data, integrated spatial-spectral methods simultaneously fuse spatial and spectral information. Low-rank matrix approximation (LRMA) is a typical example, achieving robust imputation by extracting shared low-dimensional latent structures. In recent years, the rapid development of artificial intelligence has driven the emergence of deep learning imputation frameworks, such as GAIN which utilizes generative adversarial networks and STForte, a graph neural network designed specifically for spatial transcriptomics. These methods, with their deep contextual representation capabilities, are expected to provide better imputation performance.

[0005] However, existing methods still suffer from two key bottlenecks when applied to MSI data interpolation, resulting in suboptimal performance. Firstly, current methods typically employ the same interpolation strategy for all zero-value features, failing to distinguish between technical missing values ​​(false zeros caused by insufficient instrument sensitivity, requiring interpolation) and biologically true missing values ​​(true zeros where specific molecules are not actually expressed in the tissue, and should remain unchanged). This indiscriminate interpolation not only easily leads to overly smoothed interpolation results but, more seriously, blurs the true biological boundaries, introducing a large number of spurious molecular signals, violating the biological nature of MSI data. Secondly, traditional methods usually assume that all observed non-missing signals have absolute fidelity. However, in practice, MSI acquisition is often affected by random noise and technical artifacts introduced during sample preparation and data acquisition. Using unreliable observed signals as a reference propagates reconstruction errors, introducing severe computational artifacts during interpolation.

[0006] Therefore, there is an urgent need for a robust method that can accurately distinguish between technical and biologically real missing values ​​and adaptively reduce the weight of unreliable signals during the imputation process to improve the quality of MSI data and the reliability of downstream analysis. This invention addresses this need by proposing a missing value imputation method for mass spectrometry imaging data based on an uncertainty-aware graph attention neural network, achieving high-fidelity missing signal recovery through a two-stage framework. Summary of the Invention

[0007] This invention proposes a mass spectrometry imaging data interpolation method based on an uncertainty-aware graph attention neural network. Addressing the shortcomings of existing technologies, this method, based on the uncertainty-aware graph attention neural network, can accurately identify technical and biological deficiencies and adaptively reduce the weight of unreliable signals during the interpolation process, thereby improving the quality of mass spectrometry imaging data and the reliability of downstream analysis.

[0008] The present invention adopts the following technical solution.

[0009] An uncertainty-aware graph attention neural network-based mass spectrometry imaging data interpolation method is proposed to interpolate and repair missing data values ​​in the mass spectrometry imaging process. The interpolation method first performs peak detection, peak alignment, peak screening, peak merging, abnormal hotspot removal, and signal intensity normalization on the raw MSI data collected by the mass spectrometer at the sample's two-dimensional dot matrix to obtain the missing MSI expression matrix to be interpolated. A semi-synthetic training dataset is constructed on the MSI expression matrix to be interpolated using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. Then, a fully connected neural network interpolation model is trained to distinguish between technical and biologically real missing values ​​on the MSI expression matrix. For the identified technical missing values, the trained uncertainty-aware graph attention network interpolation model is used for interpolation. The graph topology adaptively aggregates the spectral information of neighboring pixels, and uncertainty learning reduces the weight of unreliable observation signals to achieve high-fidelity signal recovery. This invention avoids biological artifacts caused by over-interpolation by distinguishing zero-value types, and at the same time uses uncertainty mechanisms to suppress noise propagation, which helps to improve the data quality and reliability of MSI data in downstream tasks such as single-cell metabolomics and tumor heterogeneity analysis.

[0010] The interpolation method includes the following steps;

[0011] Step 1: MSI data acquisition and preprocessing: Mass spectrometry data of the tissue slices to be analyzed on a two-dimensional array are acquired using a mass spectrometer. Peak detection, peak alignment, peak screening, peak merging, abnormal hot spot removal, and signal intensity normalization are performed on the acquired raw mass spectrometry data to obtain the MSI expression matrix X of the tissue slices to be analyzed.

[0012] Step 2: Construction of Semi-synthetic Training Dataset and Zero-Value Type Identification: For the MSI expression matrix X to be interpolated obtained in Step 1, a semi-synthetic training dataset is constructed from the expression matrix X using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. A fully connected neural network is trained based on the semi-synthetic training dataset to perform binary classification on all missing positions in the expression matrix X, distinguishing between technical missing and biologically real missing, and outputting a label matrix M, where technical missing is marked as the position to be imputed and biologically real missing is marked as the position to retain zero value.

[0013] Step 3: Spatial graph topology construction: Using each pixel in the MSI image as a node, construct an adjacency graph based on the spatial coordinates of the pixels. The neighborhood of each node consists of its eight neighboring pixels and itself.

[0014] Step 4: Construction and training of the uncertainty-aware interpolation model: Construct an interpolation model based on a graph attention network. The interpolation model includes a three-layer graph attention network as the feature extraction backbone, followed by a parallel dual-branch structure to output the prediction mean matrix Y and the uncertainty parameter matrix S respectively. The non-zero observations in the expression matrix X are used as supervision signals. The parameters of the interpolation model are optimized using an uncertainty loss function. Zero-value positions are excluded during training so that the model adaptively reduces the weight of unreliable signals.

[0015] Step 5: Imputation and Output of Missing Signals: Using the trained imputation model, predict all positions marked as technically missing, fill the corresponding positions with the predicted mean, and retain the zero values ​​marked as biologically true missing values ​​from Step 2, as well as the original non-zero observations of the MSI expression matrix X, to obtain the final high-fidelity imputed data matrix. .

[0016] Step one specifically includes the following steps;

[0017] Step A1, Sample freezing sectioning and fixation: The tissue sample to be analyzed (mouse kidney tissue sample) was rapidly frozen in liquid nitrogen and stored in an environment of −80 ℃. The tissue sample was prepared into tissue sections with a thickness of 10 μm using a cryostat and the tissue sections were placed on an indium tin oxide (ITO) coated conductive glass slide.

[0018] Step A2, Matrix Spraying: A 1,5-diaminonaphthalene (DAN) methanol solution with a concentration of 5 mg / mL is used as the matrix and is uniformly sprayed onto the surface of the tissue section using an electrospray coating device, with a total of five layers sprayed.

[0019] Step A3, Mass Spectrometry Imaging Data Acquisition: Mass spectrometry imaging data of the tissue sections were acquired using a timsTOF fleX MALDI-2 mass spectrometer in negative ion mode. The mass-to-charge ratio scanning range was m / z 250-1000, and the spatial resolution was 10 μm.

[0020] Step A4, Data Preprocessing: The raw mass spectrometry signals of each pixel undergo peak detection, peak alignment, peak filtering, peak merging, abnormal hotspot removal, and signal intensity normalization. Abnormal hotspot signals exceeding a preset intensity threshold are truncated, and the signal intensity of each ion channel is normalized to the [0,1] interval to obtain the MSI expression matrix of the tissue section to be analyzed. , where N is the total number of spatial pixels and L is the number of detected m / z ion channels.

[0021] In step two, the specific steps for constructing the semi-synthetic training dataset and determining the zero-value type include:

[0022] Step B1, True Zero Label Extraction: Perform UMAP dimensionality reduction and spectral clustering on the full-spectral features of all tissue pixels in the current MSI expression matrix X to be interpolated to obtain an initial spatial clustering map; calculate the global Moran's I index for each cluster, and filter out spatially discontinuous clusters with Moran's I below the threshold; for the retained clusters, calculate the missing rate of each m / z channel within the clustered region, and mark the zero-value positions with a missing rate ≥80% as true zero labels of biologically real missing values;

[0023] Step B2, False Zero Label Generation: From the non-zero observation positions in the current MSI expression matrix X to be interpolated, a subset equal to the number of true zero labels is randomly selected. The selected non-zero observation positions are masked and marked as false zero labels indicating technical missingness. The masked MSI expression matrix is ​​represented as follows: The labeled true zero labels and false zero labels are used as a semi-synthetic training dataset. , where 1 represents a false zero tag, 0 represents a true zero tag, and -1 represents the rest of the positions;

[0024] Step B3: Train the discriminant network: Construct a three-layer fully connected neural network, inputting the masked MSI representation matrix. The network's hidden layers are 512-dimensional and 256-dimensional respectively. Each layer is followed by a normalization layer, ReLU activation, and dropout. The final layer is activated by a sigmoid function to output probabilities. A binary cross-entropy loss function is used on the semi-synthetic training dataset. Optimize network parameters;

[0025] Step B4, Full-Image Discrimination: Using the trained discriminant network, predict all zero-value locations. Mark locations with a prediction probability greater than 0.5 as technical missing locations requiring imputation, and mark the rest as biologically true missing locations retained as zero. Mark the original non-zero observation locations in the MSI expression matrix X as −1, and output the final label matrix. .

[0026] Step B1 is as follows:

[0027] Step B11: Perform UMAP dimensionality reduction on the full-spectral features of all tissue pixels in the MSI expression matrix X to be interpolated, setting the parameters as follows: n_neighbors=15, min_dist=0.1, n_components=3, metric=cosine. n_neighbors represents the number of neighboring samples used when constructing the local neighborhood map in UMAP; min_dist represents the minimum allowed distance between sample points in the low-dimensional embedding space; n_components represents the low-dimensional embedding dimension output by UMAP; metric represents the metric used to calculate the distance between pixel mass spectrometry features, and cosine represents the use of cosine distance, finally obtaining the three-dimensional embedding features;

[0028] Step B12: Perform spectral clustering on the features to obtain an initial spatial clustering map, and set the number of spatial clusters k divided by spectral clustering to 18;

[0029] Step B13: Calculate the global Moran's I index for each cluster and filter out spatially discontinuous clusters with Moran's I index < 0.25;

[0030] Step B14: For the retained clusters, calculate the missing rate of all cluster regions in each m / z channel ion image. If the missing rate of a certain channel ion image in a certain cluster region is ≥ 80%, then mark the zero value position of that channel in that cluster as a true zero label of biologically true missing value.

[0031] In step B3, the original MSI representation matrix X is used as input. After completing the training process, the masked MSI representation matrix is ​​obtained. and the corresponding semi-synthetic training label dataset ;

[0032] The discriminant network f(∙|θ) is applied to the masked mass spectrometry imaging data matrix. To distinguish between technical deficiencies and simulated biological deficiencies; during training, a semi-synthetic training dataset... It is only used to construct the supervised loss mask; only entries with labels not equal to -1 in the semi-synthetic training dataset M̂ participate in the loss calculation, and unlabeled entries do not participate in the parameter update.

[0033] The discriminant network adopts a three-layer fully connected network structure. In use, the input data passes through a network module containing a linear layer, a normalization layer, a ReLU activation function, and a Dropout layer in sequence, and is mapped to a 512-dimensional and a 256-dimensional latent feature space, respectively. Subsequently, the obtained latent features are processed by a linear layer and a Sigmoid activation function to obtain the predicted probability corresponding to each feature.

[0034] For the masked MSI representation matrix The feature of the i-th pixel in the j-th m / z channel. The corresponding prediction probability for missing cases is defined as:

[0035]

[0036] in, Discriminating network Trainable parameters; This indicates that the feature of the i-th pixel in the j-th m / z channel is missing. This indicates the probability that the missing location is a technical deletion rather than a biological deletion;

[0037] Then, numerical stability is achieved through binary cross-entropy loss;

[0038] The binary cross-entropy loss formula is expressed as follows:

[0039]

[0040] Where Ω represents the set of indices for simulated technical missing locations and biological missing locations used during training, and |Ω| represents the number of elements in this set of indices; Represents a semi-synthetic training dataset The corresponding position of the i-th pixel in the j-th m / z channel;

[0041] The training strategy adopted is as follows: the discriminator's discrimination network is trained and validated only on the organized pixels; in order to avoid information leakage caused by different ion channels of the same pixel appearing in both the training set and the validation set at the same time, the data is partitioned at the pixel level rather than at the level of a single matrix entry.

[0042] Specifically, all tissue pixels are randomly divided into a training set and a validation set in an 8:2 ratio:

[0043] 80% of the organization's pixels are used for model training;

[0044] 20% of the tissue pixels are used for independent verification;

[0045] During training, the loss is applied only to the semi-synthetic training dataset. The calculation is performed on entries whose labels are not equal to -1.

[0046] In step B4, the trained discriminant network is used to predict all zero-value locations to construct the final label matrix M; the elements in matrix M are based on the corresponding position observations of the representation matrix X. and the prediction probability of the discriminant network Determined through assignment mapping, expressed by the formula:

[0047] .

[0048] Step three specifically involves treating each independent spatial pixel in the representation matrix X as a node in a graph. The spatial graph topology is directly constructed from the parameterized MSI pixel grid of mass spectrometry imaging. Based on the spatial coordinates of the pixel, for each node, the node's neighborhood set is defined by the node's 8 neighboring pixels and nodes introduced by self-loops. During training, all available nodes in the neighborhood set are used for neighborhood feature aggregation.

[0049] Step four is as follows:

[0050] Step C1: Construct the graph attention network layer architecture: Three graph attention layers (GAT) are stacked sequentially, with each layer using a multi-head attention mechanism; linear residual transformation branches and identity jump connections are introduced between each layer, and the node features of the next layer are obtained based on the graph attention transformation results, linear residual transformation results, and identity mapping results; the initial node features are directly provided by the MSI representation matrix X to be interpolated, and the node feature matrix is ​​output after transformation by the three-layer GAT.

[0051] Graph Attention Network The core processing backbone consists of a three-layer GAT configuration operating on this spatial graph topology. Linear residual transformation branches and identity jump connections are introduced during layer-by-layer propagation to avoid the vanishing gradient problem and to preserve low-frequency structural topological information between different organizational microenvironments. These are defined as follows:

[0052]

[0053] Where the initial potential representation It is obtained by direct parameterization of the original MSI expression matrix X;

[0054] Step C2, Calculation of attention mechanism for each layer: For each layer of GAT, the feature vectors of all nodes in the current layer are used as input, and the original attention coefficients between the target node and its neighboring nodes are calculated through trainable shared parameters; then, the attention coefficients in the neighborhood are normalized by the softmax function to obtain normalized attention coefficients; the features of the neighboring nodes are weighted and summed using these coefficients, and the outputs of each attention head are concatenated as the output features of all nodes in the current layer;

[0055] Step C3: Construct a parallel dual-branch output structure: The node features output from the third-layer GAT are fed into two independent multi-layer fully connected networks, where the first branch outputs the prediction mean matrix Y, and the second branch outputs the uncertainty parameter matrix S; after extracting refined structured features through the last layer graph structure, the resulting hidden layer representation... It is fed into a parallel dual-branch architecture, which consists of two independent multi-layer fully connected networks:

[0056] Step C4: Define the uncertainty loss function: Construct a loss function based on the outputs of the two branches. The loss function depends only on the non-zero observations in the representation matrix X. For each non-zero observation, the loss term consists of the absolute error between the predicted mean and the observed value, and the logarithmic uncertainty, where the weights are determined by the reciprocal of the prediction uncertainty. The model adaptively reduces the weights of unreliable signals during training by optimizing the loss function. Specifically, to prevent noise features in the original MSI data from adversely affecting model training, uncertainty learning is introduced to optimize the spatial reconstruction network. By simultaneously modeling the prediction mean matrix Y and the uncertainty parameter matrix S for each node, the network can dynamically adapt to the data distribution, thereby achieving robust data imputation. All zero-value entries are excluded from model training, and the objective function is expressed as follows:

[0057]

[0058] in The set of indices representing non-zero features. Its base; Corresponding to the original MSI expression matrix X and the uncertainty parameter matrix respectively And the corresponding feature value of the i-th pixel in the j-th m / z channel of the predicted mean matrix Y;

[0059] The network parameters were initialized using the default parameter initialization methods provided by PyTorch and PyTorch Geometric. The model was trained using the AdamW optimizer with a learning rate of 0.001, weight decay of 1e-4, and a batch size of 2048. During training, 10% of the non-zero observations of the input data were randomly masked as self-supervised signals. The early stopping metric was the mean absolute error (MAE) of the masked region. The early stopping duration was 8 epochs, with a maximum training epoch count of 10000. The model was implemented in PyTorch using Python and deployed on an NVIDIA RTX 4090 GPU.

[0060] Step five involves using the trained imputation model to predict all locations marked as technically missing, and then filling the corresponding locations with the predicted mean. Simultaneously, the zero-value locations marked as biologically true missing from step two, along with the original non-zero observations of the MSI expression matrix X, are retained to obtain the final high-fidelity imputation data. Specifically: upon completion After iterative optimization, the final data matrix This is constructed in the following way: identifying the technically deficient locations, i.e. Replace with the corresponding reconstructed value from the interpolation branch. At the same time, the original non-zero observations in the MSI representation matrix X are retained, i.e. Entries that were judged to be biologically missing, i.e. This remains zero in the final matrix; the result obtained is the final high-fidelity output of the DropMSI framework. .

[0061] This invention develops a method for interpolating missing values ​​in mass spectrometry imaging data based on an uncertainty-aware graph attention neural network. It achieves accurate differentiation between technical and biologically real missing values ​​through a two-stage strategy and can adaptively reduce the weight of unreliable signals by utilizing an uncertainty learning mechanism.

[0062] This invention utilizes a fully connected neural network to distinguish zero-value types, avoiding biological artifacts caused by over-interpolation in traditional methods; it uses a graph attention network to adaptively aggregate the spatial and spectral information of neighboring pixels, preserving tissue boundaries and molecular heterogeneity; and it uses an uncertainty loss function to suppress noise and technical artifacts from interpolating the results, achieving high-fidelity signal recovery.

[0063] The framework of this invention has good versatility and scalability. It is not only applicable to various mass spectrometry imaging platforms such as MALDI-MSI, but also has the potential to be extended to other spatial omics modalities such as spatial transcriptomics and spatial proteomics, providing reliable data support for cutting-edge applications such as single-cell metabolomics, biomarker discovery, and metabolic flux analysis.

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

[0065] 1. This invention constructs a semi-synthetic training dataset by interpolating the MSI expression matrix X and trains a fully connected neural network, thereby achieving accurate differentiation between technical missing data and biologically real missing data in the expression matrix X to be interpolated. This avoids the over-interpolation problem caused by the traditional method of interpolating all zero values ​​indiscriminately, and effectively prevents the introduction of false signals in regions where biomolecules are not actually expressed, thus ensuring the biological authenticity of the interpolation results.

[0066] 2. This invention employs an uncertainty-aware graph attention network for interpolation. Through a parallel dual-branch structure, it simultaneously outputs the predicted mean and uncertainty parameters. By utilizing the uncertainty loss function, it adaptively reduces the weight of unreliable observation signals, thereby suppressing the interference of noise and technical artifacts in the original MSI data on the interpolation results and achieving high-fidelity signal recovery.

[0067] 3. This invention utilizes the attention mechanism of graph attention networks, which can adaptively allocate neighborhood aggregation weights according to the spatial neighborhood structure of pixels, and preferentially obtain information from pixels in the same tissue region, effectively preserving the structural boundaries and molecular heterogeneity of tissues, and avoiding the problem of boundary blurring caused by traditional spatial smoothing methods;

[0068] 4. The framework of this invention has good versatility and scalability. It is not only applicable to various mass spectrometry imaging platforms such as MALDI-MSI, but also has the potential to be transferred across platforms to other spatial omics modalities (such as spatial transcriptomics and spatial proteomics), providing a reliable tool for high-quality analysis of large-scale spatial omics data. Attached Figure Description

[0069] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0070] Appendix Figure 1 This is a schematic diagram of the system framework of the present invention;

[0071] Appendix Figure 2 This is a schematic diagram comparing the interpolation results of the mouse kidney MSI dataset under different mass-to-charge ratios (m / z) in an embodiment of the present invention. Detailed Implementation

[0072] As shown in the figure, an uncertainty-aware graph attention neural network-based mass spectrometry imaging data interpolation method is used to interpolate and repair missing data values ​​in the mass spectrometry imaging process. The interpolation method first performs peak detection, peak alignment, peak screening, peak merging, abnormal hotspot removal, and signal intensity normalization on the raw MSI data collected by the mass spectrometer at the sample's two-dimensional dot matrix to obtain the missing MSI expression matrix to be interpolated. A semi-synthetic training dataset is constructed on the MSI expression matrix to be interpolated using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. Then, a fully connected neural network interpolation model is trained to distinguish between technical and biologically real missing values ​​on the MSI expression matrix. For the identified technical missing values, the trained uncertainty-aware graph attention network interpolation model is used for interpolation. The graph topology adaptively aggregates the spectral information of neighboring pixels, and uncertainty learning reduces the weight of unreliable observation signals to achieve high-fidelity signal recovery. This invention avoids biological artifacts caused by over-interpolation by distinguishing zero-value types, and at the same time uses uncertainty mechanisms to suppress noise propagation, which helps to improve the data quality and reliability of MSI data in downstream tasks such as single-cell metabolomics and tumor heterogeneity analysis.

[0073] The interpolation method includes the following steps;

[0074] Step 1: MSI data acquisition and preprocessing: Mass spectrometry data of the tissue slices to be analyzed on a two-dimensional array are acquired using a mass spectrometer. Peak detection, peak alignment, peak screening, peak merging, abnormal hot spot removal, and signal intensity normalization are performed on the acquired raw mass spectrometry data to obtain the MSI expression matrix X of the tissue slices to be analyzed.

[0075] Step 2: Construction of Semi-synthetic Training Dataset and Zero-Value Type Identification: For the MSI expression matrix X to be interpolated obtained in Step 1, a semi-synthetic training dataset is constructed from the expression matrix X using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. A fully connected neural network is trained based on the semi-synthetic training dataset to perform binary classification on all missing positions in the expression matrix X, distinguishing between technical missing and biologically real missing, and outputting a label matrix M, where technical missing is marked as the position to be imputed and biologically real missing is marked as the position to retain zero value.

[0076] Step 3: Spatial graph topology construction: Using each pixel in the MSI image as a node, construct an adjacency graph based on the spatial coordinates of the pixels. The neighborhood of each node consists of its eight neighboring pixels and itself.

[0077] Step 4: Construction and training of the uncertainty-aware interpolation model: Construct an interpolation model based on a graph attention network. The interpolation model includes a three-layer graph attention network as the feature extraction backbone, followed by a parallel dual-branch structure to output the prediction mean matrix Y and the uncertainty parameter matrix S respectively. The non-zero observations in the expression matrix X are used as supervision signals. The parameters of the interpolation model are optimized using an uncertainty loss function. Zero-value positions are excluded during training so that the model adaptively reduces the weight of unreliable signals.

[0078] Step 5: Imputation and Output of Missing Signals: Using the trained imputation model, predict all positions marked as technically missing, fill the corresponding positions with the predicted mean, and retain the zero values ​​marked as biologically true missing values ​​from Step 2, as well as the original non-zero observations of the MSI expression matrix X, to obtain the final high-fidelity imputed data matrix. .

[0079] Step one specifically includes the following steps;

[0080] Step A1, Sample freezing sectioning and fixation: The tissue sample to be analyzed (mouse kidney tissue sample) was rapidly frozen in liquid nitrogen and stored in an environment of −80 ℃. The tissue sample was prepared into tissue sections with a thickness of 10 μm using a cryostat and the tissue sections were placed on an indium tin oxide (ITO) coated conductive glass slide.

[0081] Step A2, Matrix Spraying: A 1,5-diaminonaphthalene (DAN) methanol solution with a concentration of 5 mg / mL is used as the matrix and is uniformly sprayed onto the surface of the tissue section using an electrospray coating device, with a total of five layers sprayed.

[0082] Step A3, Mass Spectrometry Imaging Data Acquisition: Mass spectrometry imaging data of the tissue sections were acquired using a timsTOF fleX MALDI-2 mass spectrometer in negative ion mode. The mass-to-charge ratio scanning range was m / z 250-1000, and the spatial resolution was 10 μm.

[0083] Step A4, Data Preprocessing: The raw mass spectrometry signals of each pixel undergo peak detection, peak alignment, peak filtering, peak merging, abnormal hotspot removal, and signal intensity normalization. Abnormal hotspot signals exceeding a preset intensity threshold are truncated, and the signal intensity of each ion channel is normalized to the [0,1] interval to obtain the MSI expression matrix of the tissue section to be analyzed. , where N is the total number of spatial pixels and L is the number of detected m / z ion channels.

[0084] In step two, the specific steps for constructing the semi-synthetic training dataset and determining the zero-value type include:

[0085] Step B1, True Zero Label Extraction: Perform UMAP dimensionality reduction and spectral clustering on the full-spectral features of all tissue pixels in the current MSI expression matrix X to be interpolated to obtain an initial spatial clustering map; calculate the global Moran's I index for each cluster, and filter out spatially discontinuous clusters with Moran's I below the threshold; for the retained clusters, calculate the missing rate of each m / z channel within the clustered region, and mark the zero-value positions with a missing rate ≥80% as true zero labels of biologically real missing values;

[0086] Step B2, False Zero Label Generation: From the non-zero observation positions in the current MSI expression matrix X to be interpolated, a subset equal to the number of true zero labels is randomly selected. The selected non-zero observation positions are masked and marked as false zero labels indicating technical missingness. The masked MSI expression matrix is ​​represented as follows: The labeled true zero labels and false zero labels are used as a semi-synthetic training dataset. , where 1 represents a false zero tag, 0 represents a true zero tag, and -1 represents the rest of the positions;

[0087] Step B3: Train the discriminant network: Construct a three-layer fully connected neural network, inputting the masked MSI representation matrix. The network's hidden layers are 512-dimensional and 256-dimensional respectively. Each layer is followed by a normalization layer, ReLU activation, and dropout. The final layer is activated by a sigmoid function to output probabilities. A binary cross-entropy loss function is used on the semi-synthetic training dataset. Optimize network parameters;

[0088] Step B4, Full-Image Discrimination: Using the trained discriminant network, predict all zero-value locations. Mark locations with a prediction probability greater than 0.5 as technical missing locations requiring imputation, and mark the rest as biologically true missing locations retained as zero. Mark the original non-zero observation locations in the MSI expression matrix X as −1, and output the final label matrix. .

[0089] Step B1 is as follows:

[0090] Step B11: Perform UMAP dimensionality reduction on the full-spectral features of all tissue pixels in the MSI expression matrix X to be interpolated, setting the parameters as follows: n_neighbors=15, min_dist=0.1, n_components=3, metric=cosine. n_neighbors represents the number of neighboring samples used when constructing the local neighborhood map in UMAP; min_dist represents the minimum allowed distance between sample points in the low-dimensional embedding space; n_components represents the low-dimensional embedding dimension output by UMAP; metric represents the metric used to calculate the distance between pixel mass spectrometry features, and cosine represents the use of cosine distance, finally obtaining the three-dimensional embedding features;

[0091] Step B12: Perform spectral clustering on the features to obtain an initial spatial clustering map, and set the number of spatial clusters k divided by spectral clustering to 18;

[0092] Step B13: Calculate the global Moran's I index for each cluster and filter out spatially discontinuous clusters with Moran's I index < 0.25;

[0093] Step B14: For the retained clusters, calculate the missing rate of all cluster regions in each m / z channel ion image. If the missing rate of a certain channel ion image in a certain cluster region is ≥ 80%, then mark the zero value position of that channel in that cluster as a true zero label of biologically true missing value.

[0094] In step B3, the original MSI representation matrix X is used as input. After completing the training process, the masked MSI representation matrix is ​​obtained. and the corresponding semi-synthetic training label dataset ;

[0095] The discriminant network f(∙|θ) is applied to the masked mass spectrometry imaging data matrix. To distinguish between technical deficiencies and simulated biological deficiencies; during training, a semi-synthetic training dataset... It is only used to construct the supervised loss mask; only entries with labels not equal to -1 in the semi-synthetic training dataset M̂ participate in the loss calculation, and unlabeled entries do not participate in the parameter update.

[0096] The discriminant network adopts a three-layer fully connected network structure. In use, the input data passes through a network module containing a linear layer, a normalization layer, a ReLU activation function, and a Dropout layer in sequence, and is mapped to a 512-dimensional and a 256-dimensional latent feature space, respectively. Subsequently, the obtained latent features are processed by a linear layer and a Sigmoid activation function to obtain the predicted probability corresponding to each feature.

[0097] For the masked MSI representation matrix The feature of the i-th pixel in the j-th m / z channel. The corresponding prediction probability for missing cases is defined as:

[0098]

[0099] in, Discriminating network Trainable parameters; This indicates that the feature of the i-th pixel in the j-th m / z channel is missing. This indicates the probability that the missing location is a technical deletion rather than a biological deletion;

[0100] Then, numerical stability is achieved through binary cross-entropy loss;

[0101] The binary cross-entropy loss formula is expressed as follows:

[0102]

[0103] Where Ω represents the set of indices for simulated technical missing locations and biological missing locations used during training, and |Ω| represents the number of elements in this set of indices; Represents a semi-synthetic training dataset The corresponding position of the i-th pixel in the j-th m / z channel;

[0104] The training strategy adopted is as follows: the discriminator's discrimination network is trained and validated only on the organized pixels; in order to avoid information leakage caused by different ion channels of the same pixel appearing in both the training set and the validation set at the same time, the data is partitioned at the pixel level rather than at the level of a single matrix entry.

[0105] Specifically, all tissue pixels are randomly divided into a training set and a validation set in an 8:2 ratio:

[0106] 80% of the organization's pixels are used for model training;

[0107] 20% of the tissue pixels are used for independent verification;

[0108] During training, the loss is applied only to the semi-synthetic training dataset. The calculation is performed on entries whose labels are not equal to -1.

[0109] In step B4, the trained discriminant network is used to predict all zero-value locations to construct the final label matrix M; the elements in matrix M are based on the corresponding position observations of the representation matrix X. and the prediction probability of the discriminant network Determined through assignment mapping, expressed by the formula:

[0110] .

[0111] Step three specifically involves treating each independent spatial pixel in the representation matrix X as a node in a graph. The spatial graph topology is directly constructed from the parameterized MSI pixel grid of mass spectrometry imaging. Based on the spatial coordinates of the pixel, for each node, the node's neighborhood set is defined by the node's 8 neighboring pixels and nodes introduced by self-loops. During training, all available nodes in the neighborhood set are used for neighborhood feature aggregation.

[0112] Step four is as follows:

[0113] Step C1: Construct the graph attention network layer architecture: Three graph attention layers (GAT) are stacked sequentially, with each layer using a multi-head attention mechanism; linear residual transformation branches and identity jump connections are introduced between each layer, and the node features of the next layer are obtained based on the graph attention transformation results, linear residual transformation results, and identity mapping results; the initial node features are directly provided by the MSI representation matrix X to be interpolated, and the node feature matrix is ​​output after transformation by the three-layer GAT.

[0114] Graph Attention Network The core processing backbone consists of a three-layer GAT configuration operating on this spatial graph topology. Linear residual transformation branches and identity jump connections are introduced during layer-by-layer propagation to avoid the vanishing gradient problem and to preserve low-frequency structural topological information between different organizational microenvironments. These are defined as follows:

[0115]

[0116] Where the initial potential representation It is obtained by direct parameterization of the original MSI expression matrix X;

[0117] Step C2, Calculation of attention mechanism for each layer: For each layer of GAT, the feature vectors of all nodes in the current layer are used as input, and the original attention coefficients between the target node and its neighboring nodes are calculated through trainable shared parameters; then, the attention coefficients in the neighborhood are normalized by the softmax function to obtain normalized attention coefficients; the features of the neighboring nodes are weighted and summed using these coefficients, and the outputs of each attention head are concatenated as the output features of all nodes in the current layer;

[0118] Step C3: Construct a parallel dual-branch output structure: The node features output from the third-layer GAT are fed into two independent multi-layer fully connected networks, where the first branch outputs the prediction mean matrix Y, and the second branch outputs the uncertainty parameter matrix S; after extracting refined structured features through the last layer graph structure, the resulting hidden layer representation... It is fed into a parallel dual-branch architecture, which consists of two independent multi-layer fully connected networks:

[0119] Step C4: Define the uncertainty loss function: Construct a loss function based on the outputs of the two branches. The loss function depends only on the non-zero observations in the representation matrix X. For each non-zero observation, the loss term consists of the absolute error between the predicted mean and the observed value, and the logarithmic uncertainty, where the weights are determined by the reciprocal of the prediction uncertainty. The model adaptively reduces the weights of unreliable signals during training by optimizing the loss function. Specifically, to prevent noise features in the original MSI data from adversely affecting model training, uncertainty learning is introduced to optimize the spatial reconstruction network. By simultaneously modeling the prediction mean matrix Y and the uncertainty parameter matrix S for each node, the network can dynamically adapt to the data distribution, thereby achieving robust data imputation. All zero-value entries are excluded from model training, and the objective function is expressed as follows:

[0120]

[0121] in The set of indices representing non-zero features. Its base; Corresponding to the original MSI expression matrix X and the uncertainty parameter matrix respectively And the corresponding feature value of the i-th pixel in the j-th m / z channel of the predicted mean matrix Y;

[0122] The network parameters were initialized using the default parameter initialization methods provided by PyTorch and PyTorch Geometric. The model was trained using the AdamW optimizer with a learning rate of 0.001, weight decay of 1e-4, and a batch size of 2048. During training, 10% of the non-zero observations of the input data were randomly masked as self-supervised signals. The early stopping metric was the mean absolute error (MAE) of the masked region. The early stopping duration was 8 epochs, with a maximum training epoch count of 10000. The model was implemented in PyTorch using Python and deployed on an NVIDIA RTX 4090 GPU.

[0123] Step five involves using the trained imputation model to predict all locations marked as technically missing, and then filling the corresponding locations with the predicted mean. Simultaneously, the zero-value locations marked as biologically true missing from step two, along with the original non-zero observations of the MSI expression matrix X, are retained to obtain the final high-fidelity imputation data. Specifically: upon completion After iterative optimization, the final data matrix This is constructed in the following way: identifying the technically deficient locations, i.e. Replace with the corresponding reconstructed value from the interpolation branch. At the same time, the original non-zero observations in the MSI representation matrix X are retained, i.e. Entries that were judged to be biologically missing, i.e. This remains zero in the final matrix; the result obtained is the final high-fidelity output of the DropMSI framework. .

[0124] Example:

[0125] This example includes the following steps;

[0126] S1: MSI Data Acquisition and Preprocessing. Mass spectrometry data of the tissue sections to be analyzed on a two-dimensional array were acquired using a mass spectrometry imager. The acquired raw mass spectrometry data underwent peak detection, peak alignment, peak filtering, peak merging, abnormal hotspot removal, and signal intensity normalization to obtain the MSI expression matrix. , where N is the total number of spatial pixels and L is the number of detected m / z ion channels.

[0127] S2: Construction of Semi-synthetic Training Dataset and Zero-Value Type Identification. For the MSI expression matrix X to be imputed obtained in S1, a semi-synthetic dataset is constructed from the expression matrix X using UMAP dimensionality reduction, spectral clustering, and Moran's I spatial autocorrelation analysis. A discriminant network consisting of three fully connected layers is trained using BCE loss to perform binary classification on all missing locations in the expression matrix X to be imputed, distinguishing between technical missing data and biologically real missing data, and outputting a label matrix. .

[0128] S3: Spatial Graph Topology Construction. Using each pixel in the spatial dimension of the MSI representation matrix X as a node, construct the neighborhood of each node based on its position. The neighborhood of each node consists of its eight neighboring pixels and itself.

[0129] S4: Construction and Training of the Uncertainty-Aware Imputation Model. An imputation model based on a Graph Attention Network (GAT) is constructed, comprising a three-layer GAT as the feature extraction backbone, followed by a parallel dual-branch structure to output the predicted mean matrix. and uncertainty parameter matrix The model is optimized using non-zero observations as monitoring signals and an uncertainty loss function.

[0130] S5: Missing Signal Imputation and Output. Using the trained model, all locations marked as technically missing are replaced with the predicted mean, while retaining the biologically true missing values ​​as zero and the original non-zero observations in the MSI expression matrix X. The final high-fidelity imputed data is then output. .

[0131] Figure 1 A system framework diagram of the present invention is given. Stage (a) is technical missing data identification. A dataset for training the MLP discriminator is generated using a semi-synthetic simulation and masking framework, and optimized using a binary cross-entropy loss function to distinguish between technical missing data and simulated biological missing data. Stage (b) is targeted signal interpolation. A graph topology is constructed based on the original MSI pixel grid and input into a spatial reconstruction network composed of three layers of GAT. Two prediction heads output the interpolation mean and uncertainty value, respectively, which are then optimized based on the uncertainty loss function. The final interpolation matrix is ​​constructed by replacing only the technical missing data locations identified in stage (a) and their corresponding interpolation values, while retaining the zero values ​​of the biologically true missing data locations and the original non-zero observations.

[0132] According to an embodiment of the present invention, an interpolation experiment was performed on a mouse kidney MSI dataset. Figure 2The results show a comparison between the original ion images and the results interpolated using the DropMSI method of this invention on 12 representative m / z channels (m / z 447.2855, 616.4681, 631.1613, 685.5259, 701.5073, 719.5393, 742.5358, 770.5660, 788.5186, 879.5987, 886.5485, 970.6290). Due to instrument sensitivity limitations, the original ion images exhibit significant signal intensity loss and abnormal signal patterns in key anatomical regions, resulting in blurred tissue structures and discontinuous boundaries. After interpolation using this invention, the technically missing signals are effectively recovered, the image structure is clear and complete, and the tissue boundaries are sharp; at the same time, the true zero value region, representing biologically unexpressed data, is accurately preserved as zero, without introducing spurious molecular signals, thus maintaining the biological authenticity of the MSI data. The anatomical details of the kidneys that were previously blurred due to signal loss, such as the boundary between the medulla and cortex and the glomerular region, all showed clear morphology after insertion.

[0133] In summary, this invention develops a missing value imputation method for mass spectrometry imaging data based on an uncertainty-aware graph attention neural network. It achieves accurate differentiation between technical and biologically real missing values ​​through a two-stage strategy and adaptively reduces the weight of unreliable signals using an uncertainty learning mechanism. This invention utilizes a fully connected neural network to discriminate the type of zero value, avoiding biological artifacts caused by over-imputation in traditional methods; it uses a graph attention network to adaptively aggregate the spatial and spectral information of neighboring pixels, preserving tissue boundaries and molecular heterogeneity; and it uses an uncertainty loss function to suppress the interference of noise and technical artifacts on the imputation results, achieving high-fidelity signal recovery. The framework of this invention has good versatility and scalability, applicable not only to various mass spectrometry imaging platforms such as MALDI-MSI, but also potentially extending to other spatial omics modalities such as spatial transcriptomics and spatial proteomics, providing reliable data support for cutting-edge applications such as single-cell metabolomics, biomarker discovery, and metabolic flux analysis.

Claims

1. A mass spectrometry imaging data interpolation method based on an uncertainty-aware graph attention neural network, used to interpolate and repair missing data values ​​in the mass spectrometry imaging process, characterized in that: The interpolation method first processes the raw MSI data collected by the mass spectrometer at the two-dimensional dot matrix of the sample to obtain the missing MSI expression matrix to be interpolated. A semi-synthetic training dataset was constructed on the MSI expression matrix to be imputed using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. Then, the imputation model was trained to distinguish between technical missing data and biologically real missing data on the MSI expression matrix to be imputed. For the identified technical defects, the trained interpolation model is used for interpolation. The graph topology structure is used to adaptively aggregate the spectral information of neighboring pixels, and uncertainty learning is used to reduce the weight of unreliable observation signals to achieve high-fidelity signal recovery.

2. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 1, characterized in that: The interpolation method includes the following steps; Step 1: MSI data acquisition and preprocessing: Mass spectrometry data of the tissue slices to be analyzed on a two-dimensional array are acquired using a mass spectrometer. The acquired raw mass spectrometry data is subjected to peak detection, peak alignment, peak screening, peak merging, abnormal hot spot removal and signal intensity normalization to obtain the MSI expression matrix X of the tissue slices to be analyzed. Step 2: Construction of Semi-synthetic Training Dataset and Zero-Value Type Identification: For the MSI expression matrix X to be interpolated obtained in Step 1, a semi-synthetic training dataset is constructed from the expression matrix X using UMAP dimensionality reduction, spectral clustering, and spatial autocorrelation analysis. A fully connected neural network is trained based on the semi-synthetic training dataset to perform binary classification on all missing positions in the expression matrix X, distinguishing between technical missing and biologically real missing, and outputting a label matrix M, where technical missing is marked as the position to be imputed and biologically real missing is marked as the position to retain zero value. Step 3: Spatial graph topology construction: Using each pixel in the MSI image as a node, construct an adjacency graph based on the spatial coordinates of the pixels. The neighborhood of each node consists of its eight neighboring pixels and itself. Step 4: Construction and training of the uncertainty-aware interpolation model: Construct an interpolation model based on a graph attention network. The interpolation model includes a three-layer graph attention network as the feature extraction backbone, followed by a parallel dual-branch structure to output the prediction mean matrix Y and the uncertainty parameter matrix S respectively. The non-zero observations in the expression matrix X are used as supervision signals. The parameters of the interpolation model are optimized using an uncertainty loss function. Zero-value positions are excluded during training so that the model adaptively reduces the weight of unreliable signals. Step 5: Imputation and Output of Missing Signals: Using the trained imputation model, predict all positions marked as technically missing, fill the corresponding positions with the predicted mean, and retain the zero values ​​marked as biologically true missing values ​​from Step 2, as well as the original non-zero observations of the MSI expression matrix X, to obtain the final high-fidelity imputed data matrix. .

3. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 2, characterized in that: Step 1 in detail Includes the following steps; Step A1, Sample freezing, sectioning and fixation: The tissue sample to be analyzed is rapidly frozen, the tissue sample is prepared into tissue sections, and the tissue sections are placed on a glass slide; Step A2, Matrix Spraying: Spray the matrix evenly onto the surface of the tissue section; Step A3, Mass Spectrometry Imaging Data Acquisition: Use a mass spectrometer to acquire mass spectrometry imaging data of the tissue sections; Step A4, Data Preprocessing: The raw mass spectrometry signals of each pixel undergo peak detection, peak alignment, peak filtering, peak merging, abnormal hotspot removal, and signal intensity normalization. Abnormal hotspot signals exceeding a preset intensity threshold are truncated, and the signal intensity of each ion channel is normalized to obtain the MSI expression matrix of the tissue section to be analyzed. , where N is the total number of spatial pixels and L is the number of detected m / z ion channels.

4. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 2, characterized in that: In step two, the specific steps for constructing the semi-synthetic training dataset and determining the zero-value type include: Step B1, True Zero Label Extraction: Perform UMAP dimensionality reduction and spectral clustering on the full-spectral features of all tissue pixels in the current MSI expression matrix X to be interpolated to obtain an initial spatial clustering map; calculate the global Moran's I index for each cluster, and filter out spatially discontinuous clusters with Moran's I below the threshold; for the retained clusters, calculate the missing rate of each m / z channel within the clustered region, and mark the zero-value positions with a missing rate ≥80% as true zero labels of biologically real missing values; Step B2, False Zero Label Generation: From the non-zero observation positions in the current MSI expression matrix X to be interpolated, a subset equal to the number of true zero labels is randomly selected. The selected non-zero observation positions are masked and marked as false zero labels indicating technical missingness. The masked MSI expression matrix is ​​represented as follows: The labeled true zero labels and false zero labels are used as a semi-synthetic training dataset. , where 1 represents a false zero tag, 0 represents a true zero tag, and -1 represents the rest of the positions; Step B3: Training the discriminant network: Construct a three-layer fully connected neural network, inputting the masked MSI representation matrix. The network's hidden layers are 512-dimensional and 256-dimensional respectively. Each layer is followed by a normalization layer, ReLU activation, and dropout. The final layer is activated by a sigmoid function to output probabilities. A binary cross-entropy loss function is used on the semi-synthetic training dataset. Optimize network parameters; Step B4, Full-Image Discrimination: Using the trained discriminant network, predict all zero-value locations. Mark locations with a prediction probability greater than 0.5 as technical missing locations requiring imputation, and mark the rest as biologically true missing locations retained as zero. Mark the original non-zero observation locations in the MSI expression matrix X as −1, and output the final label matrix. .

5. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 4, characterized in that: Step B1 is as follows: Step B11: Perform UMAP dimensionality reduction on the full-spectral features of all tissue pixels in the MSI expression matrix X to be interpolated. Set the parameters as follows: n_neighbors represents the number of neighboring samples used when constructing the local neighborhood map in UMAP; min_dist represents the minimum allowed distance between sample points in the low-dimensional embedding space; n_components represents the low-dimensional embedding dimension output by UMAP; metric represents the metric used to calculate the distance between pixel mass spectrometry features; cosine represents the use of cosine distance. Finally, the three-dimensional embedding features are obtained. Step B12: Perform spectral clustering on the features to obtain an initial spatial clustering map, and set the number of spatial clusters k to be divided by spectral clustering; Step B13: Calculate the global Moran's I index for each cluster and filter out spatially discontinuous clusters with Moran's I index < 0.25; Step B14: For the retained clusters, calculate the missing rate of all cluster regions in each m / z channel ion image. If the missing rate of a certain channel ion image in a certain cluster region is ≥ 80%, then mark the zero value position of that channel in that cluster as a true zero label of biologically true missing value.

6. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 4, characterized in that: In step B3, the original MSI representation matrix X is used as input. After completing the training process, the masked MSI representation matrix is ​​obtained. and the corresponding semi-synthetic training label dataset ; The discriminant network f(∙|θ) is applied to the masked mass spectrometry imaging data matrix. To distinguish between technical deficiencies and simulated biological deficiencies; during training, a semi-synthetic training dataset... Used to construct a supervised loss mask; in the semi-synthetic training dataset M̂, entries with labels not equal to -1 participate in the loss calculation, while unlabeled entries do not participate in parameter updates; The discriminant network adopts a three-layer fully connected network structure. When in use, the input data passes through a network module containing a linear layer, a normalization layer, a ReLU activation function, and a Dropout layer in sequence, and is mapped to a 512-dimensional and a 256-dimensional latent feature space, respectively. Subsequently, the obtained latent features are processed through a linear layer and a Sigmoid activation function to obtain the predicted probability corresponding to each feature; For the masked MSI representation matrix The feature of the i-th pixel in the j-th m / z channel. The corresponding prediction probability for missing cases is defined as: in, Discriminating network Trainable parameters; This indicates that the feature of the i-th pixel in the j-th m / z channel is missing. This indicates the probability that the missing location is a technical deletion rather than a biological deletion; Then, numerical stability is achieved through binary cross-entropy loss; The binary cross-entropy loss formula is expressed as follows: Where Ω represents the set of indices for simulated technical missing locations and biological missing locations used during training, and |Ω| represents the number of elements in this set of indices; Represents a semi-synthetic training dataset The corresponding position of the i-th pixel in the j-th m / z channel; The training strategy employed is as follows: the discriminator's discriminant network is trained and validated on an organized pixel basis; data partitioning is performed at the pixel level rather than at the level of individual matrix entries. During training, the loss is applied to the semi-synthetic training dataset. The calculation is performed on entries whose labels are not equal to -1.

7. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 6, characterized in that: In step B4, the trained discriminant network is used to predict all zero-value locations to construct the final label matrix M; the elements in matrix M are based on the corresponding position observations of the representation matrix X. and the prediction probability of the discriminant network Determined through assignment mapping, expressed by the formula: 。 8. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 2, characterized in that: Step 3 specifically involves treating each independent spatial pixel in the representation matrix X as a node in a graph, with the spatial graph topology directly constructed from the mass spectrometry imaging (MSI) pixel grid parameterization. Based on the spatial coordinates of the pixel, for each node, the node's neighborhood set is defined by the node's 8 neighboring pixels and nodes introduced by self-loops. During training, all available nodes in the neighborhood set are used for neighborhood feature aggregation.

9. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 2, characterized in that: Step four is as follows: Step C1: Construct the graph attention network layer architecture: Three graph attention layers (GAT) are stacked sequentially, with each layer using a multi-head attention mechanism; linear residual transformation branches and identity jump connections are introduced between each layer, and the node features of the next layer are obtained based on the graph attention transformation results, linear residual transformation results, and identity mapping results; the initial node features are directly provided by the MSI representation matrix X to be interpolated, and the node feature matrix is ​​output after transformation by the three-layer GAT. Graph Attention Network The core processing backbone is defined as follows: Where the initial potential representation It is obtained by direct parameterization of the original MSI expression matrix X; Step C2, Calculation of attention mechanism for each layer: For each layer of GAT, the feature vectors of all nodes in the current layer are used as input, and the original attention coefficients between the target node and its neighboring nodes are calculated through trainable shared parameters; then, the attention coefficients in the neighborhood are normalized by the softmax function to obtain normalized attention coefficients; the features of the neighboring nodes are weighted and summed using these coefficients, and the outputs of each attention head are concatenated as the output features of all nodes in the current layer; Step C3: Construct a parallel dual-branch output structure: The node features output from the third-layer GAT are fed into two independent multi-layer fully connected networks, where the first branch outputs the prediction mean matrix Y, and the second branch outputs the uncertainty parameter matrix S; after extracting refined structured features through the last layer graph structure, the resulting hidden layer representation... It is fed into a parallel dual-branch architecture, which consists of two independent multi-layer fully connected networks: Step C4: Define the uncertainty loss function: Construct a loss function based on the outputs of the two branches. The loss function depends on the non-zero observations in the expression matrix X. For each non-zero observation, the loss term consists of the absolute error between the predicted mean and the observed value, and the logarithmic uncertainty, where the weights are determined by the reciprocal of the prediction uncertainty. The model adaptively reduces the weights of unreliable signals during training by optimizing the loss function; specifically, uncertainty learning is introduced to optimize the spatial reconstruction network. By simultaneously modeling the prediction mean matrix Y and the uncertainty parameter matrix S for each node, the network can dynamically adapt to the data distribution, thereby achieving robust data imputation. All zero-value entries are excluded from model training, and the objective function is expressed as follows: in The set of indices representing non-zero features. Its base; These correspond to the original MSI expression matrix X and the uncertainty parameter matrix, respectively. And the corresponding feature value of the i-th pixel in the j-th m / z channel of the predicted mean matrix Y.

10. The mass spectrometry imaging data interpolation method using an uncertainty-aware graph attention neural network according to claim 2, characterized in that: Step five involves using the trained imputation model to predict all locations marked as technically missing, and then filling the corresponding locations with the predicted mean. Simultaneously, the zero-value locations marked as biologically true missing from step two, along with the original non-zero observations of the MSI expression matrix X, are retained to obtain the final high-fidelity imputation data. .