Spatial transcriptome data recognition method and system based on kan distance perception space graph

CN122619128BActive Publication Date: 2026-09-29HUNAN NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611100835.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-09-29
Estimated Expiration
2046-07-23

AI Technical Summary

Technical Problem

这种静态的距离偏置无法自适应地学习不同组织器官中特异性的空间作用范围,导致局部微结构边界模糊,或是产生过度平滑现象

Benefits of technology

[0067]现有的空间转录组图谱分析方法,在处理空间距离时,要么将其作为固定的截断阈值,要么采用人工预设的静态衰减函数。真实的生物组织是高度异质的。在密集的细胞区和稀疏的间质区,细胞间信号传递的“有效物理距离”是完全不同的。固定的距离函数“一刀切”,会导致局部微细结构被“过度平滑”掉,造成边界模糊。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122619128B_ABST
    Figure CN122619128B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on KAN distance perception space graph's spatial transcriptome data identification method and system, the method includes: obtaining gene expression matrix and spatial coordinates, normalization and high-variable gene screening are carried out;Random mask enhancement is carried out to input feature;Distance perception space graph KAN encoder is constructed, nonlinear query, key, value vector is generated by the KAN projection layer of radial basis function expansion, and the adaptive nonlinear mapping of attention bias is learned to spatial distance by independent KAN projection layer, and the output latent low-dimensional representation is aggregated after graph attention;Structure loss and expression reconstruction loss are calculated respectively by structure decoding branch and omics decoding branch, and network parameters are optimized jointly;The latent representation is clustered, and obtains the organization spatial domain division result.The application breaks through the limitation of traditional fixed distance attenuation function, enhances the nonlinear expression ability of feature projection, and significantly improves the precision and spatial continuity of spatial domain identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of bioinformatics and artificial intelligence, and specifically relates to a method and system for spatial transcriptome data identification based on KAN distance-aware spatial graphs. Background Technology

[0002] Spatial transcriptomics technology can measure whole-genome expression profiles in high throughput while preserving tissue spatial location information, providing a strong data foundation for analyzing tissue microenvironment heterogeneity, developmental and differentiation trajectories, and spatial evolution of diseases. One of the core tasks in spatial transcriptomics data analysis is accurately identifying spatial domains with similar gene expression and spatial continuity.

[0003] In the early stages of the development of spatial transcriptomics technology, researchers generally directly adopted the analysis approach of single-cell transcriptomics (such as K-means and Louvain), treating each sequencing point as an independent sample, completely stripping away the two-dimensional coordinate information carried by the sequencing point, making it difficult to present the regional coherence that should exist in real biological structures.

[0004] Subsequently, researchers began to incorporate spatial proximity as a constraint into the clustering process. In recent years, graph neural networks have gradually become the mainstream modeling method for spatial domain recognition. SpaGCN was one of the first to attempt to unify gene expression, spatial location, and tissue image information within a graph convolution framework, while GraphST enriched this technical approach from the perspective of self-supervised contrastive learning.

[0005] However, existing analytical methods still have the following limitations: when measuring the influence of spatial proximity on molecular similarity, they generally rely on traditional linear transformation layers, which are difficult to flexibly adapt to the diverse nonlinear relationships between distance and correlation strength in different tissue microenvironments. When fusing spatial location information, they often rely on artificially preset graph structures (or use static Euclidean distance decay functions). This static distance bias cannot adaptively learn the specific spatial range of action in different tissues and organs, leading to blurred local microstructural boundaries or over-smoothing phenomena. Summary of the Invention

[0006] To overcome the problems of blurred local microstructure boundaries or excessive smoothing in the prior art, the present invention proposes a spatial transcriptome data identification method and system based on KAN distance-aware spatial maps.

[0007] A spatial transcriptome data identification method based on KAN distance-aware spatial maps includes the following steps:

[0008] Step 1: Obtain the gene expression matrix and the two-dimensional spatial coordinates of the corresponding sequencing points of the tissue slice sample to be analyzed; preprocess the gene expression matrix to obtain the preprocessed gene expression feature matrix; calculate the Euclidean distance matrix between sequencing points based on the two-dimensional spatial coordinates, and construct a spatial adjacency graph and the corresponding attention mask Boolean matrix.

[0009] Step 2: Perform a random masking operation on the preprocessed gene expression feature matrix according to a preset ratio to obtain a masked gene expression feature matrix;

[0010] Step 3: Based on the Euclidean distance matrix and the attention mask Boolean matrix, the masked gene expression feature matrix is ​​encoded using a distance-aware spatial graph KAN encoder to obtain a latent low-dimensional representation;

[0011] Step 4: Decoding and Encoder Update;

[0012] The potential low-dimensional representation is decoded using a decoder to obtain the structural loss and representation reconstruction loss of the encoding. Based on the total loss formed by the structural loss and representation reconstruction loss, the parameters of the distance-aware spatial graph KAN encoder are synchronously updated through backpropagation.

[0013] Step 5: Spatial domain identification and result output;

[0014] After processing the tissue slices to be analyzed according to step 1, they are then encoded using the updated distance-aware spatial map KAN encoder to obtain the final potential low-dimensional representation Z. The Z is then clustered using a clustering algorithm, and the clustering results are smoothed to output the tissue spatial domain partitioning results.

[0015] Furthermore, the process of obtaining the latent low-dimensional representation by encoding using the distance-aware spatial graph KAN encoder is as follows:

[0016] 1) Nonlinear QKV projection: The masked gene expression feature matrix is ​​input into three independent KAN projection layers to generate a query matrix Q, a key matrix K, and a value matrix V;

[0017] 2) Adaptive distance bias generation: Input each element of the Euclidean distance matrix between sequencing points into an independent KAN projection layer, adaptively learn the nonlinear mapping between distance and attention bias, and obtain the distance bias tensor B corresponding to the number of attention heads;

[0018] 3) Attention fusion and neighborhood aggregation: The inner product of the query matrix Q and the key matrix K, the distance bias tensor B, and the attention mask Boolean matrix obtained in step 1 are linearly superimposed and normalized using the Softmax function to obtain the attention weight matrix; the attention weight matrix is ​​then weighted and aggregated with the value matrix V to obtain the aggregated feature matrix H.

[0019] 4) After normalizing the aggregated feature matrix H, perform a residual connection with the masked gene expression matrix to obtain the potential representation of the masked gene expression matrix.

[0020] The weight parameters of each individual KAN projection layer are different;

[0021] Furthermore, nonlinear QKV projection based on radial basis functions is adopted, and the processing procedure for each KAN projection layer is as follows;

[0022] First, a set of learnable grid points is preset. Initialize it as a vector uniformly distributed in the interval [-2, 2], where num_grids represents the number of grid points. Represents the real number field;

[0023] Secondly, calculate the Gaussian radial basis function response of each dimension and grid point in the masked gene expression feature matrix:

[0024] ;

[0025] in, This represents the relationship between element x and the j-th grid point in the masked gene expression feature matrix. The Gaussian radial basis function response values ​​between; exp represents the natural exponential function;

[0026] Next, x is expanded into radial basis function eigenvectors. This is then flattened into a one-dimensional vector; this vector is coupled with a learnable spline weight matrix. Multiply to obtain the spline output. ;

[0027] Response values ​​of all grid points constitute ;

[0028] Then, x is processed by the SiLU activation function and passed through a standard linear basis weight layer. Obtain the base output part ;

[0029] Ultimately, the output of the KAN projection layer is the sum of the two:

[0030] ;

[0031] in, This represents the output of the KAN projection layer. This represents the transpose of the linear basis weight matrix; This represents the feature value of x after processing by the SiLU activation function; This represents the transpose of the learnable spline weight matrix; This represents a one-dimensional vector obtained after flattening the eigenvectors of the radial basis functions.

[0032] The masked gene expression feature matrix is ​​input into three KAN projection layers with independent learnable weight parameters. The same radial basis function expansion formula is used to calculate the query matrix, key matrix and value matrix after nonlinear projection.

[0033] When generating query (Q), key (K), and value (V) vectors for graph attention mechanisms, traditional graph attention networks (GAT) or well-known models generally employ standard linear transformations (nn.Linear). This approach replaces this with a KAN projection layer based on Gaussian radial basis function (RBF) expansion. This setting forcibly maps sparse gene features onto a high-dimensional nonlinear surface, enhancing the semantic expressive power of the feature projection.

[0034] Furthermore, a dual-branch decoder is used to decode the latent low-dimensional representation to obtain the encoding structural loss and representation reconstruction loss. The dual-branch decoder includes a structural decoding branch and an omics decoding branch. The specific decoding process is as follows:

[0035] Structural decoding branch: After performing Dropout and L2 norm normalization on the latent low-dimensional representation Z, the matrix product of Z and its transpose is calculated to obtain the reconstructed cosine similarity matrix. ;

[0036] in, This represents the result after applying Dropout and L2 norm normalization to the latent low-dimensional representation Z;

[0037] Based on the adjacency matrix A corresponding to the spatial adjacency graph obtained in step 1, the positive sample weights of the cross-entropy structural loss are adaptively calculated. :

[0038] ;

[0039] Where N is the total number of sequencing points on the tissue slice to be analyzed, and sum(A) represents the sum of non-zero elements in the original adjacency matrix A, i.e. the number of positive sample edges;

[0040] To alleviate the class imbalance problem caused by extremely sparse spatial nearest neighbor edges, the positive sample weights of the cross-entropy structural loss are calculated.

[0041] Calculate the reconstructed cosine similarity matrix using the positive sample weights. The weighted binary cross-entropy loss between the adjacency matrix A and the structural loss is used as the structural loss. :

[0042] ;

[0043] The omics decoding branch takes the latent low-dimensional representation as input and uses a decoding network consisting of fully connected layers and graph convolutional layers. It uses the sigmoid function, softplus function and exponential function as activation functions to predict the parameters of the zero-inflated negative binomial distribution: dropout rate π, dispersion θ and mean μ.

[0044] The activation function is used to ensure that the output values ​​of each parameter satisfy their mathematical domain constraints.

[0045] Under the constraint of the zero-inflated negative binomial (ZINB) distribution, a preprocessed gene expression feature matrix X is introduced, and the negative log-likelihood of the reconstructed expression level is calculated as the expression reconstruction loss. The calculation formula is:

[0046] ;

[0047] in, This represents the standard zero-inflated negative binomial probability density function.

[0048] This omics decoding branch, acting as a low-level biostatistical filter, effectively avoids the risk of overfitting the front-end KAN encoder to high-noise missing values ​​during backpropagation gradient flow.

[0049] Furthermore, the structural loss and the representation reconstruction loss are weighted and summed to obtain the total loss function, and the KAN projection layer parameters, decoder parameters and learnable mask embedding vector are updated synchronously through backpropagation;

[0050] ;

[0051] in, Represents the total loss function. and These are parameters representing the reconstruction loss and the structural loss, respectively.

[0052] The default value is preset based on experience. =0.1, =0.4;

[0053] Furthermore, Z is clustered using a clustering algorithm based on Gaussian mixture model.

[0054] Furthermore, an iterative smoothing correction based on spatial nearest neighbor majority voting is performed on the clustering results to output the organizational spatial domain partitioning results.

[0055] Secondly, a spatial transcriptome data identification system based on KAN distance-aware spatial maps includes the following steps:

[0056] Preprocessing and Spatial Adjacency Graph Construction Module: Obtain the gene expression matrix and corresponding two-dimensional spatial coordinates of the sequencing points of the tissue slice to be analyzed; preprocess the gene expression matrix to obtain the preprocessed gene expression feature matrix; calculate the Euclidean distance matrix between sequencing points based on the two-dimensional spatial coordinates; and construct the spatial adjacency graph and the corresponding attention mask Boolean matrix.

[0057] Masking module: Performs a random masking operation on the preprocessed gene expression feature matrix according to a preset ratio to obtain a masked gene expression feature matrix;

[0058] Encoding module: The Euclidean distance matrix and the attention mask Boolean matrix are used to encode the masked gene expression feature matrix using a distance-aware spatial graph KAN encoder to obtain a latent low-dimensional representation;

[0059] Decoding and encoder update module: The decoder is used to decode the latent low-dimensional representation to obtain the structural loss and representation reconstruction loss of the encoding. Based on the total loss formed by the structural loss and representation reconstruction loss, the parameters of the distance-aware spatial graph KAN encoder are updated synchronously through backpropagation.

[0060] Spatial domain identification and result output module: After the tissue slices to be analyzed are processed by the preprocessing and spatial adjacency graph construction module, they are then encoded using the updated distance-aware spatial graph KAN encoder to obtain the final potential low-dimensional representation Z; Z is clustered using a clustering algorithm, and the clustering results are smoothed and corrected to output the tissue spatial domain partitioning results.

[0061] Thirdly, a computer device comprising:

[0062] One or more processors;

[0063] A memory that stores one or more computer programs;

[0064] The processor invokes a computer program to implement the steps of the above-mentioned spatial transcriptome data identification method based on KAN distance-aware spatial maps.

[0065] Fourthly, a computer-readable storage medium storing a computer program that is invoked by a processor to implement the steps of the above-described method for spatial transcriptome data identification based on a KAN distance-aware spatial map.

[0066] Compared with the prior art, the technical solution of this invention has the following advantages:

[0067] Existing spatial transcriptome mapping methods either use spatial distance as a fixed cutoff threshold or employ artificially preset static attenuation functions. Real biological tissues are highly heterogeneous. The "effective physical distance" for intercellular signal transduction differs significantly between densely packed cellular regions and sparsely populated mesenchymal regions. A fixed distance function, applied indiscriminately, can lead to the "over-smoothing" of local microstructures, resulting in blurred boundaries.

[0068] This invention directly inputs the calculated Euclidean distance matrix between sequencing points into an independent KAN projection layer. Utilizing the powerful nonlinear fitting capability of the KAN network, continuous physical spatial distances are explicitly mapped to dynamic spatial attention biases. It cleverly leverages the strong fitting ability of the KAN spline function to fit the distance decay law in biophysical space, deeply binding the underlying mathematical operators with the spatial topological biases in the spatial transcriptome. Subsequently, when calculating node attention scores, this spatial attention bias is linearly superimposed and fused with the query-key inner product of gene features and the attention mask Boolean matrix within the same architecture. Through the synergy of these features, this scheme does not rely on any manually preset static functions. During model training, it can automatically learn and dynamically adjust spatial distance decay curves that better fit the current biological characteristics for different tissue microenvironments. This effectively overcomes the over-smoothing limitations easily caused by traditional fixed distance functions, enabling precise characterization of fine tissue boundaries during final clustering, significantly alleviating boundary ambiguity problems, and maintaining good spatial continuity. Attached Figure Description

[0069] Figure 1 This is a flowchart illustrating the method described in the technical solution of the present invention. Detailed Implementation

[0070] The technical solution of the present invention will be further described below with reference to the accompanying drawings and examples.

[0071] Example 1.

[0072] like Figure 1 As shown, a spatial transcriptome data identification method based on KAN distance-aware spatial maps includes the following steps:

[0073] Step 1: Obtain the gene expression matrix and the two-dimensional spatial coordinates of the corresponding sequencing points of the tissue slice sample to be analyzed; preprocess the gene expression matrix to obtain the preprocessed gene expression feature matrix; calculate the Euclidean distance matrix between sequencing points based on the two-dimensional spatial coordinates, and construct a spatial adjacency graph and the corresponding attention mask Boolean matrix.

[0074] Step 2: Perform a random masking operation on the preprocessed gene expression feature matrix according to a preset ratio to obtain a masked gene expression feature matrix;

[0075] Step 3: Based on the Euclidean distance matrix and the attention mask Boolean matrix, the masked gene expression feature matrix is ​​encoded using a distance-aware spatial graph KAN encoder to obtain a latent low-dimensional representation;

[0076] The process of obtaining the latent low-dimensional representation by encoding using the distance-aware spatial graph KAN encoder is as follows:

[0077] 1) Nonlinear QKV projection: The masked gene expression feature matrix is ​​input into three independent KAN projection layers to generate a query matrix Q, a key matrix K, and a value matrix V;

[0078] The nonlinear QKV projection based on radial basis functions is adopted, and the processing procedure for each KAN layer is as follows;

[0079] First, a set of learnable grid points is preset. Initialize it as a vector uniformly distributed in the interval [-2, 2], where num_grids represents the number of grid points. Represents the real number field;

[0080] Secondly, calculate the Gaussian radial basis function response of each dimension and grid point in the masked gene expression feature matrix:

[0081] ;

[0082] in, This represents the relationship between element x and the j-th grid point in the masked gene expression feature matrix. The Gaussian radial basis function response values ​​between; exp represents the natural exponential function;

[0083] Next, x is expanded into radial basis function eigenvectors. This is then flattened into a one-dimensional vector; this vector is coupled with a learnable spline weight matrix. Multiply to obtain the spline output. ;

[0084] Response values ​​of all grid points constitute ;

[0085] Then, x is processed by the SiLU activation function and passed through a standard linear basis weight layer. Obtain the base output part ;

[0086] Ultimately, the output of the KAN projection layer is the sum of the two:

[0087] ;

[0088] in, This represents the output of the KAN projection layer. This represents the transpose of the linear basis weight matrix; This represents the feature value of x after processing by the SiLU activation function; This represents the transpose of the learnable spline weight matrix; This represents a one-dimensional vector obtained after flattening the eigenvectors of the radial basis functions.

[0089] The masked gene expression feature matrix is ​​input into three KAN projection layers with independent learnable weight parameters. The same radial basis function expansion formula is used to calculate the query matrix, key matrix and value matrix after nonlinear projection.

[0090] When generating query (Q), key (K), and value (V) vectors for graph attention mechanisms, traditional graph attention networks (GAT) or well-known models generally employ standard linear transformations (nn.Linear). This approach replaces this with a KAN projection layer based on Gaussian radial basis function (RBF) expansion. This setting forcibly maps sparse gene features onto a high-dimensional nonlinear surface, enhancing the semantic expressive power of the feature projection.

[0091] 2) Adaptive distance bias generation: Input each element of the Euclidean distance matrix between sequencing points into an independent KAN projection layer, adaptively learn the nonlinear mapping between distance and attention bias, and obtain the distance bias tensor B corresponding to the number of attention heads;

[0092] 3) Attention fusion and neighborhood aggregation: The inner product of the query matrix Q and the key matrix K, the distance bias tensor B, and the attention mask Boolean matrix obtained in step 1 are linearly superimposed and normalized using the Softmax function to obtain the attention weight matrix; the attention weight matrix is ​​then weighted and aggregated with the value matrix V to obtain the aggregated feature matrix H.

[0093] 4) After normalizing the aggregated feature matrix H, perform a residual connection with the masked gene expression matrix to obtain the potential representation of the masked gene expression matrix.

[0094] The weight parameters of each individual KAN projection layer are different;

[0095] Step 4: Decoding and Encoder Update;

[0096] The potential low-dimensional representation is decoded using a decoder to obtain the structural loss and representation reconstruction loss of the encoding. Based on the total loss formed by the structural loss and representation reconstruction loss, the parameters of the distance-aware spatial graph KAN encoder are synchronously updated through backpropagation.

[0097] A dual-branch decoder is used to decode the latent low-dimensional representation to obtain the encoding structural loss and representation reconstruction loss. The dual-branch decoder includes a structural decoding branch and an omics decoding branch. The specific decoding process is as follows:

[0098] Structural decoding branch: After performing Dropout and L2 norm normalization on the latent low-dimensional representation Z, the matrix product of Z and its transpose is calculated to obtain the reconstructed cosine similarity matrix. ;

[0099] in, This represents the result after applying Dropout and L2 norm normalization to the latent low-dimensional representation Z;

[0100] Based on the adjacency matrix A corresponding to the spatial adjacency graph obtained in step 1, the positive sample weights of the cross-entropy structural loss are adaptively calculated. :

[0101] ;

[0102] Where N is the total number of sequencing points on the tissue slice to be analyzed, and sum(A) represents the sum of non-zero elements in the original adjacency matrix A, i.e. the number of positive sample edges;

[0103] To alleviate the class imbalance problem caused by extremely sparse spatial nearest neighbor edges, the positive sample weights of the cross-entropy structural loss are calculated.

[0104] Calculate the reconstructed cosine similarity matrix using the positive sample weights. The weighted binary cross-entropy loss between the adjacency matrix A and the structural loss is used as the structural loss. :

[0105] ;

[0106] The omics decoding branch takes the latent low-dimensional representation as input and uses a decoding network consisting of fully connected layers and graph convolutional layers. It uses the sigmoid function, softplus function and exponential function as activation functions to predict the parameters of the zero-inflated negative binomial distribution: dropout rate π, dispersion θ and mean μ.

[0107] The activation function is used to ensure that the output values ​​of each parameter satisfy their mathematical domain constraints.

[0108] Under the constraint of the zero-inflated negative binomial (ZINB) distribution, a preprocessed gene expression feature matrix X is introduced, and the negative log-likelihood of the reconstructed expression level is calculated as the expression reconstruction loss. The calculation formula is:

[0109] ;

[0110] in, This represents the standard zero-inflated negative binomial probability density function.

[0111] This omics decoding branch, acting as a low-level biostatistical filter, effectively avoids the risk of overfitting the front-end KAN encoder to high-noise missing values ​​during backpropagation gradient flow.

[0112] The total loss function is obtained by weighted summing of structural loss and representation reconstruction loss, and KAN projection layer parameters, decoder parameters and learnable mask embedding vector are updated synchronously through backpropagation.

[0113] ;

[0114] in, Represents the total loss function. and These are parameters representing the reconstruction loss and the structural loss, respectively.

[0115] The default value is preset based on experience. =0.1, =0.4;

[0116] Backpropagation is used to update all parameters, including the KAN layer spline weights and basis weights, decoder parameters, and mask vector p, using the Adam optimizer (learning rate 0.001).

[0117] Step 5: Spatial domain identification and result output;

[0118] After processing the tissue slices to be analyzed according to step 1, they are then encoded using the updated distance-aware spatial map KAN encoder to obtain the final latent low-dimensional representation Z. Z is then clustered using a clustering algorithm based on a Gaussian mixture model, and the clustering results are subjected to iterative smoothing correction based on spatial nearest neighbor majority voting to output the tissue spatial domain partitioning results.

[0119] To verify the effectiveness of the method of the present invention, experiments were conducted on two publicly available transcriptome datasets: the human breast cancer (HBC) dataset and the E9.5 mouse embryo transcriptome dataset.

[0120] On the HBC dataset, tissue regions annotated by pathologists were used as ground truth labels. Experimental results show that the adjusted Land index (ARI) of the proposed method reaches 0.66, and the normalized mutual information (NMI) reaches 0.72, both significantly better than existing baseline methods. Spatial domain visualization results show that the proposed method can clearly distinguish invasive ductal carcinoma regions, adjacent normal tissue, and immune-infiltrated regions. The boundaries of each region are sharp and spatially continuous, without the region fragmentation phenomenon commonly seen in existing methods.

[0121] On the E9.5 mouse embryo transcriptome dataset, the ARI of the method of this invention reached 0.38, which is still superior to the comparative methods such as SpaGCN, STAGATE and GraphST.

[0122] The above results demonstrate that the present invention achieves excellent domain recognition performance on both tumor samples with discrete boundaries and embryo samples with continuous gradient features, verifying the adaptive modeling capability of the KAN distance-aware spatial graph mechanism for the microenvironment characteristics of different tissues.

[0123] Example 2.

[0124] A spatial transcriptome data identification system based on KAN distance-aware spatial maps includes the following steps:

[0125] Preprocessing and Spatial Adjacency Graph Construction Module: Obtain the gene expression matrix and corresponding two-dimensional spatial coordinates of the sequencing points of the tissue slice to be analyzed; preprocess the gene expression matrix to obtain the preprocessed gene expression feature matrix; calculate the Euclidean distance matrix between sequencing points based on the two-dimensional spatial coordinates; and construct the spatial adjacency graph and the corresponding attention mask Boolean matrix.

[0126] Masking module: Performs a random masking operation on the preprocessed gene expression feature matrix according to a preset ratio to obtain a masked gene expression feature matrix;

[0127] Encoding module: The Euclidean distance matrix and the attention mask Boolean matrix are used to encode the masked gene expression feature matrix using a distance-aware spatial graph KAN encoder to obtain a latent low-dimensional representation;

[0128] Decoding and encoder update module: The decoder is used to decode the latent low-dimensional representation to obtain the structural loss and representation reconstruction loss of the encoding. Based on the total loss formed by the structural loss and representation reconstruction loss, the parameters of the distance-aware spatial graph KAN encoder are updated synchronously through backpropagation.

[0129] Spatial domain identification and result output module: After the tissue slices to be analyzed are processed by the preprocessing and spatial adjacency graph construction module, they are then encoded using the updated distance-aware spatial graph KAN encoder to obtain the final potential low-dimensional representation Z; Z is clustered using a clustering algorithm, and the clustering results are smoothed and corrected to output the tissue spatial domain partitioning results.

[0130] The identification system uses the above-mentioned identification method for identification, and the specific steps will not be described in detail here.

[0131] Example 3.

[0132] A computer device, comprising:

[0133] One or more processors;

[0134] A memory that stores one or more computer programs;

[0135] The processor invokes a computer program to implement the steps of the above-mentioned spatial transcriptome data identification method based on KAN distance-aware spatial maps. The specific steps of the identification method will not be described in detail here.

[0136] Example 4.

[0137] A computer-readable storage medium storing a computer program that is invoked by a processor to implement the steps of the above-described spatial transcriptome data identification method based on a KAN distance-aware spatial map, the specific steps of which will not be elaborated here.

[0138] Those skilled in the art will understand that embodiments of the present invention can be implemented entirely in hardware, entirely in software, or in a combination of hardware and software functions. Typically, the present invention can be deployed using a computer-readable storage medium (including but not limited to disk storage, non-volatile memory, optical memory, etc.) containing usable program code. The flowcharts and block diagrams presented in the specification and drawings illustrate the logical functions and execution timing of the control architecture of the present invention. Each action and combination thereof in these flowcharts or block diagrams can be implemented by a general-purpose computer, a dedicated computing platform, or an embedded data processing device that executes specific machine-readable instructions, thereby completing the functional actions specified in the two-step prediction and disturbance feedforward compensation of the present invention.

[0139] Finally, it should be noted that the above description is merely a preferred embodiment of the technical solution of the present invention, intended to explain the technical logic of the present invention in detail, and not to impose an absolute limitation on the scope of protection. Any equivalent substitutions or engineering evolutions made within the core control concept and technical architecture of the present invention should be covered within the scope of protection of the present invention. For example, in the specific design of the interference observer, the linear sliding surface is extended to a higher-order sliding surface; or the coordinate system parameters of the discrete prediction model are corrected accordingly for permanent magnet motors with different configurations. For those skilled in the art, these local improvements and modifications made without departing from the basic principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A spatial transcriptome data identification method based on KAN distance-aware spatial maps, characterized in that, Includes the following steps: Step 1: Obtain the gene expression matrix and the two-dimensional spatial coordinates of the corresponding sequencing points of the tissue section sample to be analyzed, and preprocess the gene expression matrix to obtain the preprocessed gene expression feature matrix; Calculate the Euclidean distance matrix between sequencing points based on the two-dimensional spatial coordinates, and construct a spatial adjacency graph and the corresponding attention mask Boolean matrix; Step 2: Perform a random masking operation on the preprocessed gene expression feature matrix according to a preset ratio to obtain a masked gene expression feature matrix; Step 3: Based on the Euclidean distance matrix and the attention mask Boolean matrix, the masked gene expression feature matrix is ​​encoded using a distance-aware spatial graph KAN encoder to obtain a latent low-dimensional representation; Step 4: Decoding and Encoder Update; The potential low-dimensional representation is decoded using a decoder to obtain the structural loss and representation reconstruction loss of the encoding. Based on the total loss formed by the structural loss and representation reconstruction loss, the parameters of the distance-aware spatial graph KAN encoder are synchronously updated through backpropagation. Step 5: Spatial domain identification and result output; After processing the tissue slices to be analyzed according to step 1, they are then encoded using the updated distance-aware spatial map KAN encoder to obtain the final latent low-dimensional representation Z; Z is clustered using a clustering algorithm, and the clustering results are smoothed and corrected to output the tissue spatial domain partitioning results. The process of obtaining the latent low-dimensional representation by encoding using the distance-aware spatial graph KAN encoder is as follows: 1) Nonlinear QKV projection: The masked gene expression feature matrix is ​​input into three independent KAN projection layers to generate a query matrix Q, a key matrix K, and a value matrix V; nonlinear QKV projection based on radial basis functions is used. 2) Adaptive distance bias generation: Input each element of the Euclidean distance matrix between sequencing points into an independent KAN projection layer, adaptively learn the nonlinear mapping between distance and attention bias, and obtain the distance bias tensor B corresponding to the number of attention heads; 3) Attention fusion and neighborhood aggregation: The inner product of the query matrix Q and the key matrix K, the distance bias tensor B, and the attention mask Boolean matrix obtained in step 1 are linearly superimposed and normalized using the Softmax function to obtain the attention weight matrix; the attention weight matrix is ​​then weighted and aggregated with the value matrix V to obtain the aggregated feature matrix H. 4) After normalizing the aggregated feature matrix H, perform a residual connection with the masked gene expression feature matrix as a potential representation of the masked gene expression feature matrix.

2. The method according to claim 1, characterized in that, The nonlinear QKV projection based on radial basis functions is adopted, and the processing procedure for each KAN projection layer is as follows; First, a set of learnable grid points is preset. Initialize it as a vector uniformly distributed in the interval [-2, 2], where num_grids represents the number of grid points. Represents the real number field; Secondly, calculate the Gaussian radial basis function response of each dimension and grid point in the masked gene expression feature matrix: ; in, This represents the relationship between element x and the j-th grid point in the masked gene expression feature matrix. The Gaussian radial basis function response values ​​between; exp represents the natural exponential function; Next, x is expanded into radial basis function eigenvectors. This is then flattened into a one-dimensional vector; this vector is coupled with a learnable spline weight matrix. Multiply to obtain the spline output. ; Then, x is processed by the SiLU activation function and passed through a standard linear basis weight layer. Obtain the base output part ; Ultimately, the output of the KAN projection layer is the sum of the two: ; in, This represents the output of the KAN projection layer. This represents the transpose of the linear basis weight matrix; This represents the feature value of x after processing by the SiLU activation function; This represents the transpose of the learnable spline weight matrix; This represents a one-dimensional vector obtained after flattening the eigenvectors of the radial basis functions.

3. The method according to claim 1, characterized in that, A dual-branch decoder is used to decode the latent low-dimensional representation to obtain the encoding structural loss and representation reconstruction loss. The dual-branch decoder includes a structural decoding branch and an omics decoding branch. The specific decoding process is as follows: Structural decoding branch: After performing Dropout and L2 norm normalization on the latent low-dimensional representation Z, the matrix product of Z and its transpose is calculated to obtain the reconstructed cosine similarity matrix. ; in, This represents the result after applying Dropout and L2 norm normalization to the latent low-dimensional representation Z; Based on the adjacency matrix A corresponding to the spatial adjacency graph obtained in step 1, the positive sample weights of the cross-entropy structural loss are adaptively calculated. : ; Where N is the total number of sequencing points on the tissue slice to be analyzed, and sum(A) represents the sum of non-zero elements in the original adjacency matrix A, i.e. the number of positive sample edges; Calculate the reconstructed cosine similarity matrix using the positive sample weights. The weighted binary cross-entropy loss between the adjacency matrix A and the structural loss is used as the structural loss. : ; The omics decoding branch takes the latent low-dimensional representation as input and uses a decoding network consisting of fully connected layers and graph convolutional layers. It uses the sigmoid function, softplus function and exponential function as activation functions to predict the parameters of the zero-inflated negative binomial distribution: dropout rate π, dispersion θ and mean μ. Under the constraint of a zero-inflated negative binomial ZINB distribution, a preprocessed gene expression feature matrix X is introduced, and the negative log-likelihood of the reconstructed expression level is calculated as the expression reconstruction loss. The calculation formula is: ; in, This represents the standard zero-inflated negative binomial probability density function.

4. The method according to claim 3, characterized in that, The total loss function is obtained by weighted summing of structural loss and representation reconstruction loss, and KAN projection layer parameters, decoder parameters and learnable mask embedding vector are updated synchronously through backpropagation. ; in, Represents the total loss function. and These represent the parameters that express the reconstruction loss and the structural loss, respectively.

5. The method according to claim 1, characterized in that, Clustering Z using a clustering algorithm based on Gaussian mixture model.

6. The method according to claim 1, characterized in that, The clustering results are subjected to iterative smoothing correction based on spatial nearest neighbor majority voting, and the organizational spatial domain partitioning results are output.

7. A spatial transcriptome data identification system based on a KAN distance-aware spatial map, employing the method described in any one of claims 1-6, characterized in that, Includes the following steps: Preprocessing and spatial adjacency graph construction module: Obtain the gene expression matrix and the two-dimensional spatial coordinates of the corresponding sequencing points of the tissue slice to be analyzed, and preprocess the gene expression matrix to obtain the preprocessed gene expression feature matrix; Calculate the Euclidean distance matrix between sequencing points based on the two-dimensional spatial coordinates, and construct a spatial adjacency graph and the corresponding attention mask Boolean matrix; Masking module: Performs a random masking operation on the preprocessed gene expression feature matrix according to a preset ratio to obtain a masked gene expression feature matrix; Encoding module: The Euclidean distance matrix and the attention mask Boolean matrix are used to encode the masked gene expression feature matrix using a distance-aware spatial graph KAN encoder to obtain a latent low-dimensional representation; Decoding and encoder update module: The decoder is used to decode the latent low-dimensional representation to obtain the structural loss and representation reconstruction loss of the encoding. Based on the total loss formed by the structural loss and representation reconstruction loss, the parameters of the distance-aware spatial graph KAN encoder are updated synchronously through backpropagation. Spatial domain identification and result output module: After the tissue slices to be analyzed are processed by the preprocessing and spatial adjacency graph construction module, they are then encoded using the updated distance-aware spatial graph KAN encoder to obtain the final potential low-dimensional representation Z; Z is clustered using a clustering algorithm, and the clustering results are smoothed and corrected to output the tissue spatial domain partitioning results.

8. A computer device, characterized in that: include: One or more processors; A memory that stores one or more computer programs; The processor invokes a computer program to achieve the following: The steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer program is stored and is invoked by the processor to implement: The steps of the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Spatial transcriptome data clustering method based on progressive learning and multi-modal fusion

    CN120256988A

  • Spatial multi-omics structural domain identification method and system based on Taylor linear attention graph convolution

    CN121542572A