Mass spectrum imaging ion image multi-task analysis method and device based on contrast learning

Through the multi-task analysis method of mass spectrometry imaging ion image based on contrast learning, a twin network is constructed and a positive and negative correlation ion image is generated using a symmetric cosine loss function, which solves the problem of difficult to identify spatially distributed ions in the prior art, and realizes efficient analysis and biological analysis of mass spectrometry imaging data.

CN120451970APending Publication Date: 2025-08-08XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510512853.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Existing mass spectrometry imaging techniques are difficult to effectively identify negatively correlated ions with different spatial distributions. Existing methods can only identify positively correlated ions with similar spatial distributions, which cannot meet the needs of biological research for ion image analysis.

Method used

A multi-task analysis method for mass spectrometry imaging ion image based on contrast learning is adopted, and a twin network is constructed for comparison learning training is used to generate positive and negative correlation ion images based on data enhancement strategies. The model is optimized using a symmetric cosine loss function, and the advanced features of ion images are extracted and dimensionality reduction and clustering are performed to identify positive and negative correlation ions.

Benefits of technology

It improves the interpretability of mass spectrometry imaging data, can effectively identify positive and negative correlation ions, reveal the interaction relationship between molecules, and improves the accuracy and efficiency of biological analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451970A_ABST
    Figure CN120451970A_ABST
Patent Text Reader

Abstract

The invention discloses a mass spectrum imaging ion image multi-task analysis method and device based on comparative learning, and the method comprises the steps: obtaining and preprocessing mass spectrum imaging data, and obtaining a three-dimensional mass spectrum imaging data matrix; ion image training data is combined with a projection module and a prediction module to carry out comparative learning training on the coding model, and a trained coding model is obtained; inputting each ion image into one sub-network in the trained coding model to obtain advanced features of the ion image; the high-level features of the ion image pass through a dimension reduction module to obtain low-dimensional representation of the ion image; inputting the low-dimensional representation of the ion image into a clustering module for clustering to obtain a clustered ion cluster; and inputting the low-dimensional representation of the ion image into a first positive and negative correlation ion recognition module, recognizing to obtain positive correlation ions and negative correlation ions of each query ion, and performing organ subregion network analysis in combination with an organ subregion mask image, thereby improving the interpretability of mass spectrum imaging data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mass spectrometry imaging data analysis, and in particular to a mass spectrometry imaging ion image multi-task analysis method and device based on contrast learning. Background Art

[0002] Mass spectrometry imaging (MSI) is an emerging molecular imaging technology that combines the biochemical characterization capabilities of mass spectrometry with the spatial information acquisition capabilities of imaging. It enables in situ qualitative and quantitative detection of tens of thousands of endogenous and exogenous compounds in biological tissues in a single experiment. Due to its label-free, highly sensitive, and high-throughput characteristics, MSI offers unique advantages for studying the spatial distribution of biomolecules and has been widely applied in fields such as environmental science, biochemistry, clinical medicine, and drug development. MSI employs a point-by-point scanning strategy in the spatial dimension, acquiring in situ molecular information by acquiring high-resolution mass spectra at each pixel within a virtual rectangular grid on a tissue section. Ion images are reconstructed from the intensity distribution of a single molecular ion (mass-to-charge ratio, m / z) within the sampled spatial region (pixel coordinates x, y). They can intuitively reveal the spatial distribution differences of specific biomolecules within different tissue microregions.

[0003] A core task of MSI data analysis is to explore the causal relationship between the spatial distribution characteristics of molecular ions and biological phenomena. As the main information carrier of MSI data, ion images can not only be used to detect co-localized ions with a similar spatial distribution to the query ion, but also to extract specific distribution patterns associated with pathological features or organ subregions. In recent years, with the rapid development of hardware equipment, the spatial resolution and mass resolution of MSI technology have been significantly improved, and hundreds of thousands of ion images can be obtained with a single sampling. How to quickly and automatically extract high-order features of images from these massive data and use them to identify molecules or ions with similar or different spatial distributions has become a key task in ion image analysis. Currently, researchers often use the following two strategies for ion image analysis:

[0004] (1) Similarity measurement method based on vector distance: After converting the two-dimensional ion image into a one-dimensional vector, similarity measurement methods such as Euclidean distance, cosine distance, Spearman rank correlation coefficient or Pearson correlation coefficient are used to calculate the similarity of the spatial distribution of the ion images, thereby obtaining the co-localized ions of the target ions;

[0005] (2) Methods based on dimensionality reduction and clustering: Linear (e.g., principal component analysis, non-negative matrix factorization) or nonlinear (e.g., t-SNE, UMAP) dimensionality reduction techniques are used to map high-dimensional MSI data into a low-dimensional space, and then clustering algorithms are used to group similar ion images. However, these methods only focus on the intensity differences of molecular ions at different pixel points, ignoring the spatial distribution patterns caused by differences in their biochemical properties.

[0006] With the widespread application of deep learning in computer vision tasks, researchers have attempted to transfer neural network models for natural image feature extraction to the field of ion image analysis, and have achieved initial success. For example, Ovchinnikova et al. created a manually annotated standard ion image colocalization dataset and, based on this, developed an Xception-based supervised learning model for colocalization ranking of target ions. Zhang et al. employed the unsupervised Xception model to extract high-order features (called "neural ion images") from MSI ion images and demonstrated that these features help improve ion image clustering results. Hu et al. used the SimCLR contrastive learning model to generate low-dimensional representations of ion images, demonstrating that this method can achieve superior ion classification performance on manually annotated datasets. Guo Lei et al. proposed the DeepION model, which incorporates MSI domain knowledge into the data augmentation module of contrastive learning, further improving the low-dimensional representation of ion images. However, these methods can only identify positively correlated ions of the target ion, that is, colocalized ions with similar spatial distributions, and remain unable to effectively identify negatively correlated ions with different spatial distributions. Summary of the Invention

[0007] The purpose of this application is to propose a mass spectrometry imaging ion image multi-task analysis method and device based on contrast learning to address the above-mentioned technical problems.

[0008] In a first aspect, the present invention provides a multi-task analysis method for mass spectrometry imaging ion images based on contrastive learning, comprising the following steps:

[0009] Acquire mass spectrometry imaging data and perform preprocessing to obtain a three-dimensional mass spectrometry imaging data matrix, wherein the three-dimensional mass spectrometry imaging data matrix is composed of ion images of a plurality of ions;

[0010] Constructing a coding model and ion image training data, and using the ion image training data in combination with the projection module and the prediction module to perform comparative learning training on the coding model to obtain a trained coding model. The coding model uses a twin network containing two weight-sharing sub-networks;

[0011] A multi-task analysis model is constructed, which includes a dimensionality reduction module, a clustering module and a first positive and negative correlation ion identification module that are set in parallel; each ion image is input into one of the sub-networks in the trained encoding model to obtain high-level features of the ion image; the high-level features of the ion image are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a low-dimensional representation of the ion image; the low-dimensional representation of the ion image is input into the clustering module for clustering to obtain clustered ion clusters; the low-dimensional representation of the ion image is input into the first positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion.

[0012] As an option, it also includes:

[0013] Obtaining organ histopathological images and dividing them into several organ subregions, selecting a corresponding region of interest for each organ subregion and processing it to obtain an organ subregion mask image, which is then superimposed with the three-dimensional mass spectrometry imaging data matrix to obtain an organ subregion-specific expression ion image;

[0014] Constructing organ subregion-specific expression ion image training data, using the organ subregion-specific expression ion images in combination with a projection module and a prediction module to perform comparative learning fine-tuning on the trained encoding model to obtain a fine-tuned encoding model;

[0015] The multi-task analysis model also includes an organ subregion network analysis module set up in parallel with the clustering module and the positive and negative ion identification module. The organ subregion network analysis module includes a second positive and negative correlation ion identification module and a network construction module. The specific expression ion image of the organ subregion is input into one of the sub-networks in the fine-tuned encoding model to obtain specific expression high-level features. The specific expression high-level features are input into the multi-task analysis model, first passed through a dimensionality reduction module to obtain a low-dimensional representation of the specific expression, and the low-dimensional representation of the specific expression is input into the organ subregion network analysis module, first passed through the second positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion in each organ subregion; then passed through the network construction module, for each organ subregion, each query ion is used as a node, and the similarity scores between the query ion and the positive and negative correlated ions are used as edges to construct positive and negative correlation networks.

[0016] Preferably, the encoding model is trained and fine-tuned as follows:

[0017] ion images in ion image training data or organ subregion-specific expression ion images in organ subregion-specific expression ion images training data are subjected to three modes of data enhancement to obtain a first enhanced view, a second enhanced view, and a third enhanced view, wherein the first enhanced view is a negatively correlated ion image that is negatively correlated with the query ion and is generated by a combination of image inversion, intensity loss, color jittering, random loss, and data filtering and is used as a negatively correlated sample, and the second enhanced view and the third enhanced view are positively correlated ion images that are positively correlated with the query ion and are generated by a combination of color jittering and data filtering and are used as positively correlated samples;

[0018] The first enhanced view, the second enhanced view, and the third enhanced view are respectively input into the encoding model or the trained encoding model to obtain the first high-level feature, the second high-level feature, and the third high-level feature, as shown in the following formula:

[0019] r 1 =f(x1|θ f );

[0020] r 2 =f(x2|θ f );

[0021] r 3 =f(x3|θ f );

[0022] Where x1, x2 and x3 represent the first enhanced view, the second enhanced view and the third enhanced view respectively, r 1 、r 2 and r 3 represent the first, second and third high-level features respectively, f(·|θ f ) represents the encoding model or the function corresponding to the trained encoding model, θ f represents a learnable parameter of an encoding model or a trained encoding model;

[0023] The first high-level feature, the second high-level feature, and the third high-level feature are respectively input into the projection module to obtain the first projection feature, the second projection feature, and the third projection feature, as shown in the following formula:

[0024] h 1 =g(r 1 |θ g );

[0025] h 2 =g(r 2 |θ g );

[0026] h 3 =g(r 3|θ g );

[0027] Among them, h 1 、h 2 and h 3 denote the first projection feature, the second projection feature, and the third projection feature, respectively, g(·|θ g ) represents the function corresponding to the projection module, θ g represents the learnable parameters of the projection module;

[0028] The first projection feature, the second projection feature, and the third projection feature are respectively input into the prediction module to obtain the first prediction result, the second prediction result, and the third prediction result, as shown in the following formula:

[0029] p 1 =q(h 1 |θ q );

[0030] p 2 =q(h 2 |θ q );

[0031] p 3 =q(h 3 |θ q );

[0032] Among them, p 1 、p 2 and p 3 Represent the first prediction result, the second prediction result and the third prediction result respectively, q(·|θ q ) represents the function corresponding to the prediction module, θ q Represents the learnable parameters of the prediction module;

[0033] The Adam optimizer is used in the training and fine-tuning process of the encoding model, and the loss function used is the symmetric cosine loss, as shown in the following formula:

[0034]

[0035] in, represents the loss function, D(·) represents the negative cosine similarity calculation, N represents the total number of ion images in the ion image training data or the total number of organ subregion-specific expression ion images in the organ subregion-specific expression ion image training data, n represents the nth ion image in the ion image training data or the nth organ subregion-specific expression ion image in the organ subregion-specific expression ion image training data, and stopgrad(·) represents stopping the gradient descent.

[0036] Preferably, in the first positive and negative correlation ion identification module or the second positive and negative correlation ion identification module, each ion is used as a query ion, and the Euclidean distance between the low-dimensional representation of the ion image corresponding to the query ion and the low-dimensional representation of the ion image corresponding to other ions is calculated, or the Euclidean distance between the low-dimensional representation of the specific expression corresponding to the query ion and the low-dimensional representation of the specific expression corresponding to other ions is calculated to obtain a similarity score; the similarity scores are sorted from small to large, and the other ions ranked in the first M positions are selected as positively correlated ions of the query ion, and the other ions ranked in the last Y positions are selected as negatively correlated ions of the query ion.

[0037] Preferably, the subnetwork includes a pre-trained ResNet18 network, the dimensionality reduction module adopts the UMAP algorithm combined with the minimum maximum scaler, the projection module includes a first multi-layer perceptron, and the prediction module includes a second multi-layer perceptron.

[0038] Preferably, the clustering module adopts an unsupervised clustering method, which includes a K-means algorithm, a DBSCAN clustering algorithm, a Spectral Clustering algorithm or a Gaussian mixture model.

[0039] In a second aspect, the present invention provides a mass spectrometry imaging ion image multi-task analysis device based on contrast learning, comprising:

[0040] a preprocessing module configured to acquire mass spectrometry imaging data and perform preprocessing to obtain a three-dimensional mass spectrometry imaging data matrix, wherein the three-dimensional mass spectrometry imaging data matrix is composed of ion images of a plurality of ions;

[0041] A model construction module is configured to construct a coding model and ion image training data, and use the ion image training data in combination with the projection module and the prediction module to perform comparative learning training on the coding model to obtain a trained coding model, wherein the coding model adopts a twin network including two weight-sharing sub-networks;

[0042] The analysis module is configured to construct a multi-task analysis model, which includes a dimensionality reduction module, a clustering module and a first positive and negative correlation ion identification module set in parallel; each ion image is input into one of the sub-networks in the trained encoding model to obtain high-level features of the ion image; the high-level features of the ion image are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a low-dimensional representation of the ion image; the low-dimensional representation of the ion image is input into the clustering module for clustering to obtain clustered ion clusters; the low-dimensional representation of the ion image is input into the first positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion.

[0043] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0045] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which implements the method described in any implementation manner in the first aspect when the computer program is executed by a processor.

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

[0047] (1) The multi-task analysis method for mass spectrometry imaging ion images based on contrastive learning proposed in the present invention adopts three parallel data enhancement strategies in the ion image data enhancement step, two of which are used to generate positively correlated ion images of the query ion, i.e., positively correlated samples, and the other is used to generate negatively correlated ion images, i.e., negatively correlated samples. At the same time, the encoding model is trained through contrastive learning using positively correlated samples and negatively correlated samples. The high-level features of the ion image are extracted using the trained encoding model, and a low-dimensional representation of the ion image is further generated through a dimensionality reduction module. These low-dimensional representations of the ion image can be effectively used to serve downstream analysis tasks, thereby identifying positively correlated ions and negatively correlated ions of the query ion and improving the interpretability of the mass spectrometry imaging data.

[0048] (2) The multi-task analysis method for mass spectrometry imaging ion images based on contrastive learning proposed in this paper uses a symmetric cosine loss to reduce the distance between positively correlated ion image pairs in the low-dimensional representation space, while increasing the projection distance between positively correlated ion images and negatively correlated ion images in the low-dimensional space. Compared with the common cosine loss, the symmetric cosine loss is more suitable for contrastive learning tasks with clear positive and negative sample labels and provides stronger gradient signals and richer training information.

[0049] (3) The multi-task analysis method of mass spectrometry imaging ion images based on contrastive learning proposed in the present invention designs three universal and representative downstream tasks, corresponding to the clustering module, the first positive and negative correlation ion identification module or the organ subregion network analysis module. In the clustering module, an unsupervised clustering method is used to perform unsupervised clustering on the low-dimensional representation of the ion image, aiming to analyze whether ions with similar spatial distribution represent specific biological functions; in the first positive and negative correlation ion identification module, the Euclidean distance between the low-dimensional representation of the ion image of the query ion and the low-dimensional representation of the ion image of other ions is calculated, and the threshold and interval score are set to identify ions that are positively or negatively correlated with the query ion in spatial distribution. This process helps to analyze the correlation between the biochemical properties of the ion itself and its spatial distribution. For a certain organ subregion, the organ subregion mask image is drawn in combination with the organ tissue pathology image, aiming to analyze the specific expression ion image corresponding to the local anatomical structure. In addition, by calculating the similarity scores between these specific expression ion images, a positive or negative correlation similarity network is further constructed, thereby revealing the interaction relationship between molecules from a network perspective. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 Schematic diagram of the process of the multi-task analysis method of mass spectrometry imaging ion images based on contrast learning according to an embodiment of the present application;

[0052] Figure 2 A flowchart of a multi-task analysis method for mass spectrometry imaging ion images based on contrast learning according to an embodiment of the present application;

[0053] Figure 3 Schematic diagram of ion clusters after clustering in the mass spectrometry imaging ion image multi-task analysis method based on contrast learning according to an embodiment of the present application;

[0054] Figure 4 This is a diagram showing the identification results of positively correlated ions and negatively correlated ions of a query ion in a multi-task analysis method of mass spectrometry imaging ion images based on contrastive learning according to an embodiment of the present application;

[0055] Figure 5 This is a diagram showing the identification results of positively correlated ions and negatively correlated ions of a query ion in a specific organ subregion of the mass spectrometry imaging ion image multi-task analysis method based on contrastive learning in an embodiment of the present application;

[0056] Figure 6 Schematic diagram of a positive correlation network and a negative correlation network constructed for the corpus callosum subregion in the mass spectrometry imaging ion image multi-task analysis method based on contrastive learning according to an embodiment of the present application;

[0057] Figure 7 Schematic diagram of a mass spectrometry imaging ion image multi-task analysis device based on contrast learning according to an embodiment of the present application;

[0058] Figure 8 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] To make the objectives, technical solutions, and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings. It is apparent that the embodiments described are only some, not all, of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort are intended to fall within the scope of protection of the present invention.

[0060] Figure 1 The embodiment of the present application provides a multi-task analysis method for mass spectrometry imaging ion images based on contrast learning, comprising the following steps:

[0061] S1, acquiring mass spectrometry imaging data and performing preprocessing to obtain a three-dimensional mass spectrometry imaging data matrix, wherein the three-dimensional mass spectrometry imaging data matrix is composed of ion images of a plurality of ions.

[0062] Specifically, in the examples of this application, the open-source R package Cardinal 3 was used for data preprocessing, including spectral smoothing, spectral alignment, and total ion current normalization. Mass spectrometry peak extraction was performed using the peakpick function. In one example, the signal-to-noise ratio (SNR) was set to 5; a mass tolerance of 10 ppm was set during peak merging. Subsequently, data reconstruction was performed using Python, deleting ions with missing pixel values exceeding 30% of the total number of pixels to obtain a three-dimensional mass spectrometry imaging data matrix.

[0063] S2, constructing a coding model and ion image training data, using the ion image training data in combination with the projection module and the prediction module to perform comparative learning training on the coding model to obtain a trained coding model. The coding model adopts a twin network containing two weight-sharing sub-networks.

[0064] Specifically, the ion image training data in the embodiments of the present application uses a data set that has been published in a public journal. Taking the mouse brain data set as an example, the following is the basic information of the mouse brain data set: brain slices of three control rats and three rats exposed to PM2.5 environment were used for mass spectrometry imaging analysis. Mass spectrometry imaging images were collected on a RapifleX MALDI Tissuetyper mass spectrometer (Bruker Daltonics, Germany) equipped with a Smartbeam 3D355nm laser. In reflection mode, mass spectrometry imaging images were obtained in the mass range of 80 to 2000 m / z by 200 cumulative laser shots. At a repetition rate of 10,000 Hz, the laser energy was set to 54% in positive ion mode and 47% in negative ion mode. A spatial resolution of 100 μm was achieved by setting a 56 μm laser scanning range and a 100 μm grating width in the X and Y directions in M5 defocus mode. Data preprocessing was performed on the mouse brain data set to obtain the corresponding three-dimensional mass spectrometry imaging data matrix.

[0065] Considering the potential for m / z deviation between sections, the m / z alignment parameters in this example were optimized to minimize mass differences within 50 ppm, ensuring unique correspondence between the normal control and pollutant-exposed rat brain tissue sections during ion matching. After preprocessing, ion images of 337 ions were obtained. The acquisition size of the normal control rat brain sections was 226×93, while that of the pollutant-exposed rat brain sections was 217×117. Combined with histopathological images of rat brain tissue, the rat brain was divided into the following five organ subregions: hippocampus, palisade layer, cerebellar white matter, brainstem, and corpus callosum.

[0066] In a specific embodiment, the subnetwork includes a pre-trained ResNet18 network, the dimensionality reduction module adopts the UMAP algorithm combined with the minimum maximum scaler, the projection module includes a first multi-layer perceptron, and the prediction module includes a second multi-layer perceptron.

[0067] Specifically, the embodiment of the present application constructs a deep neural network based on contrastive learning to learn the high-level representation of ion images. The deep neural network includes an encoding model, a projection module and a prediction module, wherein the goal of the encoding model is to learn a representation function f(·|θ f ) to extract high-level features from ion images for downstream tasks. It consists of a twin network consisting of sub-networks sharing the same weights, and the sub-networks use a pre-trained ResNet18 as the backbone network. The goal of the projection module is to learn a multi-layer perceptron (MLP) function g(·|θ g) to ensure that the encoding model outputs meaningful ion image representations. In one embodiment, the projection module consists of three fully connected (FC) layers. The goal of the prediction module is to learn an MLP function to avoid model collapse. In one embodiment, it consists of two fully connected (FC) layers.

[0068] In a specific embodiment, the training and fine-tuning process of the encoding model is as follows:

[0069] ion images in ion image training data or organ subregion-specific expression ion images in organ subregion-specific expression ion images training data are subjected to three modes of data enhancement to obtain a first enhanced view, a second enhanced view, and a third enhanced view, wherein the first enhanced view is a negatively correlated ion image that is negatively correlated with the query ion and is generated by a combination of image inversion, intensity loss, color jittering, random loss, and data filtering and is used as a negatively correlated sample, and the second enhanced view and the third enhanced view are positively correlated ion images that are positively correlated with the query ion and are generated by a combination of color jittering and data filtering and are used as positively correlated samples;

[0070] The first enhanced view, the second enhanced view, and the third enhanced view are respectively input into the encoding model or the trained encoding model to obtain the first high-level feature, the second high-level feature, and the third high-level feature, as shown in the following formula:

[0071] r 1 =f(x1|θ f );

[0072] r 2 =f(x2|θ f );

[0073] r 3 =f(x3|θ f );

[0074] Where x1, x2 and x3 represent the first enhanced view, the second enhanced view and the third enhanced view respectively, r 1 、r 2 and r 3 represent the first, second and third high-level features respectively, f(·|θ f ) represents the encoding model or the function corresponding to the trained encoding model, θ f represents a learnable parameter of an encoding model or a trained encoding model;

[0075] The first high-level feature, the second high-level feature, and the third high-level feature are respectively input into the projection module to obtain the first projection feature, the second projection feature, and the third projection feature, as shown in the following formula:

[0076] h 1 =g(r 1 |θ g );

[0077] h 2 =g(r 2 |θ g );

[0078] h 3 =g(r 3 |θ g );

[0079] Among them, h 1 、h 2 and h 3 denote the first projection feature, the second projection feature, and the third projection feature, respectively, g(·|θ g ) represents the function corresponding to the projection module, θ g represents the learnable parameters of the projection module;

[0080] The first projection feature, the second projection feature, and the third projection feature are respectively input into the prediction module to obtain the first prediction result, the second prediction result, and the third prediction result, as shown in the following formula:

[0081] p 1 =q(h 1 |θ q );

[0082] p 2 =q(h 2 |θ q );

[0083] p 3 =q(h 3 |θ q );

[0084] Among them, p 1 、p 2 and p 3 Represent the first prediction result, the second prediction result and the third prediction result respectively, q(·|θ q ) represents the function corresponding to the prediction module, θ q Represents the learnable parameters of the prediction module;

[0085] The Adam optimizer is used in the training and fine-tuning process of the encoding model, and the loss function used is the symmetric cosine loss, as shown in the following formula:

[0086]

[0087] in, represents the loss function, D(·) represents the negative cosine similarity calculation, N represents the total number of ion images in the ion image training data or the total number of organ subregion-specific expression ion images in the organ subregion-specific expression ion image training data, n represents the nth ion image in the ion image training data or the nth organ subregion-specific expression ion image in the organ subregion-specific expression ion image training data, and stopgrad(·) represents stopping the gradient descent.

[0088] Specifically, contrastive learning is an unsupervised learning method that aims to learn effective representations of data by comparing similarities and differences between samples. Figure 2 The present embodiment adopts three parallel data augmentation strategies to generate positively and negatively correlated ion image pairs. Furthermore, to enhance the model's ability to learn ion images and ensure that it can extract high-level features from MSI data, the present invention introduces intensity loss processing during the data augmentation process. The specific strategies are as follows:

[0089] Enhancement mode 1 is a combination of image inversion, intensity deletion, color dithering, random deletion, and data filtering, which generates a negative correlation ion image that is negatively correlated with the ion image of the query ion and serves as a negative correlation sample.

[0090] Enhancement mode 2 and enhancement mode 3 are combinations of color dithering and data filtering, which generate positive correlation ion images that are positively correlated with the ion image of the query ion and serve as positive correlation samples.

[0091] Taking the ion image x of one of the ions as an example, the ion image x obtains three enhanced views through enhancement mode 1, enhancement mode 2, and enhancement mode 3, namely the first enhanced view x1, the second enhanced view x2, and the third enhanced view x3 as the input of the encoding model, and obtains three ion representations corresponding to the same ion image, namely the first high-level feature, the second high-level feature, and the third high-level feature; the first high-level feature, the second high-level feature, and the third high-level feature are respectively input into the projection module to obtain the first projection feature, the second projection feature, and the third projection feature; the first projection feature, the second projection feature, and the third projection feature are respectively input into the prediction module to obtain the first prediction result, the second prediction result, and the third prediction result. This embodiment uses the Adam optimizer for model training. In one embodiment, the learning rate is set to 0.0003, and the momentum parameters β1 = 0.5 and β2 = 0.99. To prevent model collapse, a gradient stop operation is introduced during the training process. The gradient stop operation is applied to the projection module connected to one of the sub-networks of the twin network, while the gradient stop operation is not applied to the projection module and prediction module connected to one of the sub-networks of the twin network. The loss function adopts the symmetric cosine loss. The negative cosine similarity calculation used in the symmetric cosine loss takes the third prediction result and the second projection feature corresponding to the ion image of the nth ion as an example. The calculation process is as follows:

[0092]

[0093] In the negative cosine similarity computation, ‖·‖2 represents the L2 norm. The training process was performed on a workstation equipped with an Nvidia GTX 3090 GPU and implemented in PyTorch.

[0094] S3, construct a multi-task analysis model, which includes a dimensionality reduction module, a clustering module set in parallel, and a first positive and negative correlation ion identification module; input each ion image into one of the sub-networks in the trained encoding model to obtain high-level features of the ion image; the high-level features of the ion image are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a low-dimensional representation of the ion image; the low-dimensional representation of the ion image is input into the clustering module for clustering to obtain clustered ion clusters; the low-dimensional representation of the ion image is input into the first positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion.

[0095] In a specific embodiment, the clustering module adopts an unsupervised clustering method, and the unsupervised clustering method includes a K-means algorithm, a DBSCAN clustering algorithm, a Spectral Clustering algorithm, or a Gaussian mixture model.

[0096] Specifically, the purpose of the dimensionality reduction module is to generate a dense vector for similarity measurement, avoiding the adverse effects caused by the high dimensionality of the ion image high-level features r (d = 512). Since the UMAP algorithm has been proven to perform better than other dimensionality reduction methods in many fields, the embodiments of the present application use the UMAP algorithm to obtain a denser ion image representation o(m), where m is the dimension of the set ion image representation after dimensionality reduction, as shown below:

[0097] o(m)=UMAP(f(x|θ f ));

[0098] By balancing space-time complexity and information utilization, as well as different downstream tasks, the final dimension after dimensionality reduction can be selected by the user. Different dimensionality reduction can be achieved according to different tasks or datasets. At the same time, a minimum-maximum scaler is used to adjust the range of the ion image representation to [0,1]. The normalization formula is as follows:

[0099]

[0100] The output represents a low-dimensional representation of the ion image or a low-dimensional representation of the specific expression. The low-dimensional representation of the ion image or the low-dimensional representation of the specific expression is then used as the input of the clustering module, the first positive and negative correlation ion identification module, or the organ subregion network analysis module in the multi-task analysis module.

[0101] In a specific embodiment, it also includes:

[0102] Obtaining organ histopathological images and dividing them into several organ subregions, selecting a corresponding region of interest for each organ subregion and processing it to obtain an organ subregion mask image, which is then superimposed with the three-dimensional mass spectrometry imaging data matrix to obtain an organ subregion-specific expression ion image;

[0103] Constructing organ subregion-specific expression ion image training data, using the organ subregion-specific expression ion images in combination with a projection module and a prediction module to perform comparative learning fine-tuning on the trained encoding model to obtain a fine-tuned encoding model;

[0104] The multi-task analysis model also includes an organ subregion network analysis module set up in parallel with the clustering module and the positive and negative ion identification module. The organ subregion network analysis module includes a second positive and negative correlation ion identification module and a network construction module. The specific expression ion image of the organ subregion is input into one of the sub-networks in the fine-tuned encoding model to obtain specific expression high-level features. The specific expression high-level features are input into the multi-task analysis model, first passed through a dimensionality reduction module to obtain a low-dimensional representation of the specific expression, and the low-dimensional representation of the specific expression is input into the organ subregion network analysis module, first passed through the second positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion in each organ subregion; then passed through the network construction module, for each organ subregion, each query ion is used as a node, and the similarity scores between the query ion and the positive and negative correlated ions are used as edges to construct positive and negative correlation networks.

[0105] In a specific embodiment, in the first positive and negative correlation ion identification module or the second positive and negative correlation ion identification module, each ion is used as a query ion, and the Euclidean distance between the low-dimensional representation of the ion image corresponding to the query ion and the low-dimensional representation of the ion image corresponding to other ions is calculated, or the Euclidean distance between the low-dimensional representation of the specific expression corresponding to the query ion and the low-dimensional representation of the specific expression corresponding to other ions is calculated to obtain a similarity score; the similarity scores are sorted from small to large, and the other ions ranked in the first M positions are selected as positively correlated ions of the query ion, and the other ions ranked in the last Y positions are selected as negatively correlated ions of the query ion.

[0106] Specifically, the multi-task analysis model includes three specific tasks, which are implemented by the clustering module, the first positive and negative correlation ion identification module, or the organ subregion network analysis module, as follows:

[0107] Task one, ion image clustering, the clustering module is used to cluster ion images. The clustering module can use unsupervised clustering methods, such as k-means algorithm, DBSCAN clustering algorithm, Spectral Clustering algorithm or Gaussian mixture model, to perform cluster analysis on the low-dimensional representation of ion images, and the number of categories is specified by the user. The goal of clustering is to identify subsets of ions with similar spatial distribution characteristics, which reflect the molecular characteristics of co-localization or functional correlation in organ tissues. In one embodiment, the clustering module can use the K-means algorithm to perform cluster analysis on the low-dimensional representation of the ion image obtained after dimensionality reduction. K=9 is set on the mouse brain dataset to identify ion clusters with similar spatial distribution to characterize specific molecular functions, such as Figure 3 shown.

[0108] Task two, ion similarity measurement, the first positive and negative correlation ion identification module is used to calculate the similarity score between the low-dimensional representation of the ion image of the query ion and the low-dimensional representation of the ion image of other ions. Specifically, the Euclidean distance can be used to measure the similarity between the low-dimensional representations of the ion image, and the threshold and interval score can be set to identify positively correlated ions and negatively correlated ions, and analyze the correlation between the spatial distribution differences of molecules or ions and their biological functions. Using the low-dimensional representation of the ion image reduced to 20 dimensions, the Euclidean distance between different low-dimensional representations of ion images is calculated to measure their similarity scores. In this application, any ion can be used as a query ion, or each ion can be traversed as a query ion, and the similarity scores calculated for each query ion and other ions are sorted and arranged in order from small to large. In one embodiment, other ions ranked in the top 40 are selected as positively correlated ions of the query ion, and other ions ranked in the bottom 40 are selected as negatively correlated ions of the query ion. Figure 4 The top three positively and negatively correlated ions of two query ions (m / z 794.509 and m / z 856.517) are shown.

[0109] Task three, organ subregion network analysis, using the organ subregion network analysis module to perform organ subregion network analysis, specifically in combination with organ histopathological images, outline the organ subregion mask image, and use the organ subregion mask image and the three-dimensional mass spectrometry imaging data matrix to fine-tune the trained encoding model to obtain the specific expression low-dimensional representation of each organ subregion, and then use the similarity score between the specific expression low-dimensional representations of different ions in each organ subregion to construct the positive correlation network and negative correlation network of the query ion in each organ subregion. In this embodiment, based on the histopathological images of the mouse brain, the entire brain region is divided into 5 organ subregions. First, using the python matplotlib package, outline the region of interest (ROI), that is, the pixels in the ROI are set to 1, and the remaining pixels are all set to 0 to obtain the organ subregion mask image. The organ subregion mask image is superimposed with the three-dimensional mass spectrometry imaging data matrix corresponding to the mouse brain MSI data, retaining the intensity value of the pixel ion image in the organ subregion, and setting the intensity value of the ion image in other areas to 0, to obtain the specific expression ion image of the organ subregion. Then, for the five organ subregions, the trained encoding model is fine-tuned by combining the projection module and the prediction module with contrastive learning to obtain a fine-tuned encoding model. The specific expression ion image of the organ subregion is input into the fine-tuned encoding model to obtain the specific expression high-level features, and the specific expression high-level features are input into the dimensionality reduction module for dimensionality reduction to obtain the specific expression low-dimensional representation. Finally, the second positive and negative correlation ion identification module is used to calculate the similarity score between the specific expression low-dimensional representation of the query ion and the specific expression low-dimensional representation of other ions, and the positive and negative correlated ions for each query ion in each organ subregion are obtained, such as Figure 5 As shown. Further, by taking each ion as a node and the similarity score between the ion and its corresponding positively correlated ion as an edge plot, a positively correlated network can be obtained; by taking each ion as a node and the similarity score between the ion and its corresponding negatively correlated ion as an edge plot, a negatively correlated network can be obtained. In this embodiment, the number of accurately annotated ions is 64, and similarity networks are constructed for 5 organ subregions respectively. The similarity networks include positively correlated networks and negatively correlated networks. Figure 6As shown, for the corpus callosum, the positive correlation network for the control group had 123 edges, while the positive correlation network for the exposed group had 116 edges. In the negative correlation network, both the control and exposed groups had 183 edges. Comparing the positive and negative correlation networks reveals that ions in the positive correlation network are more dispersed, with 8 and 9 clusters in the positive correlation network for the control and exposed groups, respectively. The distribution of ions within these clusters is highly spatially similar across subregions of the organ. The negative correlation network has fewer clusters, with 3 and 2 clusters in the negative correlation network for the control and exposed groups, respectively. Positively correlated ions have similar spatial distributions, while heterogeneously distributed ions show weak correlations. Therefore, positively correlated networks often have multiple isolated clusters. In contrast, in negatively correlated networks, ions may be negatively correlated with other ions with significantly different spatial distributions, which can help identify potential interactions between metabolites.

[0110] The present invention can not only characterize the spatial distribution of metabolic molecules in biological tissues, but also explore the metabolic characteristics of specific organ subregions, providing new tools and ideas for the physiological mechanisms of pathological events.

[0111] Further references Figure 7 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a mass spectrometry imaging ion image multi-task analysis device based on contrast learning, which is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0112] The present application provides a mass spectrometry imaging ion image multi-task analysis device based on contrast learning, comprising:

[0113] A preprocessing module 1 is configured to acquire mass spectrometry imaging data and perform preprocessing to obtain a three-dimensional mass spectrometry imaging data matrix, wherein the three-dimensional mass spectrometry imaging data matrix is composed of ion images of a plurality of ions;

[0114] Model construction module 2 is configured to construct a coding model and ion image training data, and use the ion image training data in combination with the projection module and the prediction module to perform comparative learning training on the coding model to obtain a trained coding model, wherein the coding model adopts a twin network including two weight-sharing sub-networks;

[0115] The analysis module 3 is configured to construct a multi-task analysis model, which includes a dimensionality reduction module, a clustering module and a first positive and negative correlation ion identification module set in parallel; each ion image is input into one of the sub-networks in the trained encoding model to obtain high-level features of the ion image; the high-level features of the ion image are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a low-dimensional representation of the ion image; the low-dimensional representation of the ion image is input into the clustering module for clustering to obtain clustered ion clusters; the low-dimensional representation of the ion image is input into the first positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion.

[0116] Figure 8 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 8 As shown, the electronic device of this embodiment includes: a processor 801 and a memory 802; wherein the memory 802 is used to store computer-executable instructions; and the processor 801 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description of the above method embodiment.

[0117] Optionally, the memory 802 may be independent or integrated with the processor 801 .

[0118] When the memory 802 is independently provided, the electronic device further includes a bus 803 for connecting the memory 802 and the processor 801 .

[0119] An embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When the processor 801 executes the computer execution instructions, the above method is implemented.

[0120] An embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by the processor 801, the above method is implemented.

[0121] In the embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical functional division. In actual implementation, other division methods may be used. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not implemented. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, which may be electrical, mechanical or other forms.

[0122] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of these modules may be selected to implement the solution of this embodiment based on actual needs.

[0123] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each module may exist physically separately, or two or more modules may be integrated into a single unit. The units formed by the above modules may be implemented in the form of hardware or hardware plus software functional units.

[0124] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or processor 801 to perform some steps of the methods of various embodiments of the present application.

[0125] It should be understood that the processor 801 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), or application-specific integrated circuits (ASIC). A general-purpose processor can be a microprocessor, or the processor 801 can be any conventional processor 801. The steps of the method disclosed in the present invention can be directly implemented as being executed by the hardware processor 801, or can be implemented by a combination of hardware and software modules in the processor 801.

[0126] The memory 802 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.

[0127] Bus 803 can be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Bus 803 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the bus 803 in the drawings of this application is not limited to only one bus 803 or only one type of bus 803.

[0128] The storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0129] An exemplary storage medium is coupled to the processor 801, so that the processor 801 can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor 801. The processor 801 and the storage medium can be located in an application-specific integrated circuit (ASIC). Of course, the processor 801 and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0130] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-task analysis method for mass spectrometry imaging ion images based on contrastive learning, characterized in that: The following steps are involved: Acquiring mass spectrometry imaging data and performing preprocessing to obtain a three-dimensional mass spectrometry imaging data matrix, wherein the three-dimensional mass spectrometry imaging data matrix is composed of ion images of a plurality of ions; Constructing a coding model and ion image training data, and using the ion image training data in combination with a projection module and a prediction module to perform comparative learning training on the coding model to obtain a trained coding model, wherein the coding model uses a twin network including two weight-sharing subnetworks; A multi-task analysis model is constructed, which includes a dimensionality reduction module, a clustering module and a first positive and negative correlation ion identification module arranged in parallel; each of the ion images is input into one of the sub-networks in the trained encoding model to obtain high-level features of the ion image; the high-level features of the ion image are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a low-dimensional representation of the ion image; the low-dimensional representation of the ion image is input into the clustering module for clustering to obtain clustered ion clusters; the low-dimensional representation of the ion image is input into the first positive and negative correlation ion identification module to identify the positively correlated ions and negatively correlated ions of each query ion.

2. The multi-task analysis method of mass spectrometry imaging ion images based on contrast learning according to claim 1, characterized in that: Also includes: Acquiring an organ histopathological image and dividing it into several organ subregions, selecting a corresponding region of interest for each organ subregion and processing it to obtain an organ subregion mask image, and superimposing the organ subregion mask image with a three-dimensional mass spectrometry imaging data matrix to obtain an organ subregion-specific expression ion image; Constructing organ subregion-specific expression ion image training data, and using the organ subregion-specific expression ion image in combination with a projection module and a prediction module to perform comparative learning fine-tuning on the trained encoding model to obtain a fine-tuned encoding model; The multi-task analysis model also includes an organ sub-region network analysis module set in parallel with the clustering module and the positive and negative ion identification module. The organ sub-region network analysis module includes a second positive and negative correlation ion identification module and a network construction module. The specific expression ion image of the organ sub-region is input into one of the sub-networks in the fine-tuned encoding model to obtain specific expression high-level features. The specific expression high-level features are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a specific expression low-dimensional representation, and the specific expression low-dimensional representation is input into the organ sub-region network analysis module, first passed through the second positive and negative correlation ion identification module to identify the positive and negative correlated ions of each query ion in each organ sub-region; then passed through the network construction module, for each organ sub-region, each query ion is used as a node, and the similarity scores between the query ion and the positive and negative correlated ions are used as edges to construct positive and negative correlation networks.

3. The multi-task analysis method of mass spectrometry imaging ion images based on contrast learning according to claim 2, characterized in that: The training and fine-tuning process of the encoding model is as follows: ion images in the ion image training data or organ sub-region specific expression ion images in the organ sub-region specific expression ion image training data are subjected to three modes of data enhancement to obtain a first enhanced view, a second enhanced view, and a third enhanced view, wherein the first enhanced view is a negatively correlated ion image that is negatively correlated with the query ion and is generated by a combination of image inversion, intensity loss, color jittering, random loss, and data filtering and serves as a negatively correlated sample, and the second enhanced view and the third enhanced view are positively correlated ion images that are positively correlated with the query ion and are generated by a combination of color jittering and data filtering and serve as positively correlated samples; The first enhanced view, the second enhanced view, and the third enhanced view are respectively input into the encoding model or the trained encoding model to obtain a first high-level feature, a second high-level feature, and a third high-level feature, as shown in the following formula: r 1 =f(x1|θ f ); r 2 =f(x2|θ f ); r 3 =f(x3|θ f ); Where x1, x2 and x3 represent the first enhanced view, the second enhanced view and the third enhanced view respectively, r 1 、r 2 and r 3 represent the first, second and third high-level features respectively, f(·|θ f ) represents the encoding model or the function corresponding to the trained encoding model, θ f represents a learnable parameter of an encoding model or a trained encoding model; The first high-level feature, the second high-level feature, and the third high-level feature are respectively input into the projection module to obtain the first projection feature, the second projection feature, and the third projection feature, as shown in the following formula: h 1 =g(r 1 |θ g ); h 2 =g(r 2 |θ g ); h 3 =g(r 3 |θ g ); Among them, h 1 、h 2 and h 3 denote the first projection feature, the second projection feature, and the third projection feature, respectively, g(·|θ g ) represents the function corresponding to the projection module, θ g represents the learnable parameters of the projection module; The first projection feature, the second projection feature, and the third projection feature are respectively input into the prediction module to obtain the first prediction result, the second prediction result, and the third prediction result, as shown in the following formula: p 1 =q(h 1 |θ q ); p 2 =q(h 2 |θ q ); p 3 =q(h 3 |θ q ); Among them, p 1 、p 2 and p 3 Represent the first prediction result, the second prediction result and the third prediction result respectively, q(·|θ q ) represents the function corresponding to the prediction module, θ q Represents the learnable parameters of the prediction module; The Adam optimizer is used in the training and fine-tuning process of the encoding model, and the loss function used is the symmetric cosine loss, as shown in the following formula: in, represents the loss function, D(·) represents the negative cosine similarity calculation, N represents the total number of ion images in the ion image training data or the total number of organ sub-region specific expression ion images in the organ sub-region specific expression ion image training data, n represents the nth ion image in the ion image training data or the nth organ sub-region specific expression ion image in the organ sub-region specific expression ion image training data, and stopgrad(·) represents stopping gradient descent.

4. The multi-task analysis method of mass spectrometry imaging ion images based on contrast learning according to claim 2, characterized in that: In the first positive and negative correlation ion identification module or the second positive and negative correlation ion identification module, each ion is used as a query ion, and the Euclidean distance between the low-dimensional representation of the ion image corresponding to the query ion and the low-dimensional representation of the ion image corresponding to other ions is calculated, or the Euclidean distance between the low-dimensional representation of the specific expression corresponding to the query ion and the low-dimensional representation of the specific expression corresponding to other ions is calculated to obtain a similarity score; the similarity scores are sorted from small to large, and the other ions ranked in the first M positions are selected as positively correlated ions of the query ion, and the other ions ranked in the last Y positions are selected as negatively correlated ions of the query ion.

5. The multi-task analysis method of mass spectrometry imaging ion images based on contrast learning according to claim 1, characterized in that: The subnetwork includes a pre-trained ResNet18 network, the dimensionality reduction module adopts the UMAP algorithm in combination with a minimum-maximum scaler, the projection module includes a first multi-layer perceptron, and the prediction module includes a second multi-layer perceptron.

6. The multi-task analysis method of mass spectrometry imaging ion images based on contrast learning according to claim 1, characterized in that: The clustering module adopts an unsupervised distance method, which includes a K-means algorithm, a DBSCAN clustering algorithm, a Spectral Clustering algorithm or a Gaussian mixture model.

7. A mass spectrometry imaging ion image multi-task analysis device based on contrast learning, characterized in that: include: a preprocessing module configured to acquire mass spectrometry imaging data and perform preprocessing to obtain a three-dimensional mass spectrometry imaging data matrix, wherein the three-dimensional mass spectrometry imaging data matrix is composed of ion images of a plurality of ions; a model construction module configured to construct a coding model and ion image training data, and perform comparative learning training on the coding model using the ion image training data in combination with a projection module and a prediction module to obtain a trained coding model, wherein the coding model uses a twin network including two weight-sharing sub-networks; The analysis module is configured to construct a multi-task analysis model, which includes a dimensionality reduction module, a clustering module and a first positive and negative correlation ion identification module arranged in parallel; each of the ion images is input into one of the sub-networks in the trained encoding model to obtain high-level features of the ion image; the high-level features of the ion image are input into the multi-task analysis model, first passed through the dimensionality reduction module to obtain a low-dimensional representation of the ion image; the low-dimensional representation of the ion image is input into the clustering module for clustering to obtain clustered ion clusters; the low-dimensional representation of the ion image is input into the first positive and negative correlation ion identification module to identify the positively correlated ions and negatively correlated ions of each query ion.

8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.