Slice three-dimensional reconstruction method, apparatus and device, and computer readable storage medium
By using a deep reinforcement learning network model for slice 3D reconstruction, the problems of insufficient alignment accuracy and generalization in existing methods are solved, achieving higher accuracy and wider applicability of slice 3D reconstruction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-27
AI Technical Summary
Existing 3D reconstruction methods for slices have poor alignment accuracy and low generalization ability.
A deep reinforcement learning network model is used to extract local geometric structure regions by acquiring spatial transcriptome data of continuous tissue slices, and to reconstruct the slices in three dimensions using action space, state transition function and reward function.
It improves slice alignment accuracy and enhances the generalizability of the method.
Smart Images

Figure CN121747685A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning technology, and in particular to a method, apparatus, device, and computer-readable storage medium for 3D reconstruction of slices. Background Technology
[0002] 3D reconstruction of the spatial transcriptome from consecutive slices can guide medical and biological scientists in discovering biological mechanisms. In recent years, methods for 3D reconstruction of consecutive slices based on probabilistic models and deep learning have made some progress, but accurately reconstructing consecutive slices of spatial transcriptome data remains challenging. Existing probabilistic methods lack learning capabilities and have poor alignment accuracy, while some deep learning methods are overly dependent on parameters and lack generalization ability.
[0003] In summary, how to effectively solve the problems of poor alignment accuracy and low generalization of current 3D reconstruction methods based on slices is an urgent issue that needs to be addressed by those skilled in the art. Summary of the Invention
[0004] The purpose of this application is to provide a slice 3D reconstruction method that enhances generalization through deep reinforcement learning and improves slice alignment accuracy; another purpose of this application is to provide a slice 3D reconstruction device, apparatus, and computer-readable storage medium.
[0005] To solve the above-mentioned technical problems, this application provides the following technical solution:
[0006] A slice-based 3D reconstruction method, comprising:
[0007] Each consecutive tissue slice was obtained, and spatial transcriptome sequencing was performed on each consecutive tissue slice to obtain spatial transcriptome data corresponding to each consecutive tissue slice; wherein, the spatial transcriptome data includes gene expression matrix and spatial coordinate matrix;
[0008] Extract local geometric structure regions from each consecutive tissue slice;
[0009] Gene expression data and spatial coordinate data corresponding to local geometric structure regions are selected from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and the gene expression data and spatial coordinate data are spliced together to obtain the state matrix corresponding to each continuous tissue slice.
[0010] The state matrices of adjacent consecutive tissue slices are spliced together to obtain pairs of consecutive state matrices;
[0011] Obtain the predefined action space, state transition function, and reward function;
[0012] A deep reinforcement learning network model is used to perform slice-based 3D reconstruction based on the action space, the state transition function, the reward function, and each continuous state matrix.
[0013] In one specific embodiment of this application, a deep reinforcement learning network model is used to perform slice-based 3D reconstruction based on the action space, the state transition function, the reward function, and each continuous state matrix pair, including:
[0014] Obtain the first adjacent consecutive tissue slice pair from one end of each adjacent consecutive tissue slice, and determine the obtained adjacent consecutive tissue slice pair as the current adjacent consecutive tissue slice pair;
[0015] The continuous state matrix pair corresponding to the current adjacent continuous tissue slice pair is determined as the current continuous state matrix pair;
[0016] The current continuous state matrix is input into the deep reinforcement learning network model, and slices of actions to be executed are output.
[0017] The slice action is executed on the next state matrix in the current continuous state matrix pair by the state transition function to obtain the updated state matrix. The updated state matrix is then concatenated with the previous state matrix in the current continuous state matrix pair to obtain the updated continuous state matrix pair.
[0018] The reward function is used to calculate the reward value for the current continuous state matrix pair and the updated continuous state matrix pair, and the updated continuous state matrix pair is determined as the new current continuous state matrix pair.
[0019] Based on the action space, a first preset number of times is determined, and the step of inputting the current continuous state matrix pair into the deep reinforcement learning network model is repeated for the first preset number of times. The calculated reward values, the actions to be executed in each slice, the current continuous state matrix, and the updated continuous state matrix pair are recorded to obtain the current trajectory.
[0020] Repeat the step of inputting the current continuous state matrix pair into the deep reinforcement learning network model for a second preset number of times, estimate the loss based on each obtained trajectory, and perform backpropagation iteration for a third preset number of times based on the estimated loss to obtain the current training weights corresponding to the current adjacent continuous tissue slice pair.
[0021] The next adjacent continuous tissue slice pair of the current adjacent continuous tissue slice pair is determined as the new current adjacent continuous tissue slice pair, and the step of determining the continuous state matrix pair corresponding to the current adjacent continuous tissue slice pair as the current continuous state matrix pair is repeated until all adjacent continuous tissue slice pairs are traversed to complete the 3D reconstruction of the slices.
[0022] In one specific embodiment of this application, extracting local geometric structure regions from consecutive tissue slices includes:
[0023] Spatial domain identification was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structural regions were extracted from each consecutive tissue slice based on the obtained spatial domain information.
[0024] In one specific embodiment of this application, spatial domain identification is performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structure regions are extracted from each consecutive tissue slice based on the obtained spatial domain information, including:
[0025] The spatial coordinate matrix is divided into spatial domains using a clustering algorithm based on spatial adjacency constraints to obtain the local geometric structure region.
[0026] In one specific embodiment of this application, extracting local geometric structure regions from consecutive tissue slices includes:
[0027] Cell type annotation was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric regions were extracted from each consecutive tissue slice based on the obtained cell type annotations.
[0028] In one specific embodiment of this application, cell type annotation is performed on the spatial transcriptome data corresponding to each consecutive tissue slice, including:
[0029] Obtain known single-cell reference data;
[0030] Gene expression features of spatial points in each continuous tissue slice are mapped to the corresponding cell types of known single-cell reference data for cell type annotation.
[0031] In one specific embodiment of this application, splicing the gene expression data and the spatial coordinate data includes:
[0032] The gene expression data and the spatial coordinate data are normalized to standardize the total gene expression level at each spatial point to a uniform size.
[0033] Unexpressed genes are filtered out based on the gene expression levels corresponding to each spatial point to obtain the filtered genes;
[0034] Logarithmic transformation was performed on the gene expression levels corresponding to each filtered gene to obtain the logarithmic transformation results.
[0035] Based on the logarithmic transformation result, the top preset number of genes with the highest expression variability are selected as input features, and the input features are compressed to a preset dimension to obtain the gene expression data;
[0036] The gene expression data and the spatial coordinate data are spliced together.
[0037] A sliced three-dimensional reconstruction device, comprising:
[0038] The spatial transcriptome data acquisition module is used to acquire each continuous tissue slice and perform spatial transcriptome sequencing on each continuous tissue slice to obtain spatial transcriptome data corresponding to each continuous tissue slice; wherein, the spatial transcriptome data includes a gene expression matrix and a spatial coordinate matrix;
[0039] The local geometric structure region extraction module is used to extract local geometric structure regions from each continuous tissue slice;
[0040] The state matrix acquisition module is used to filter gene expression data and spatial coordinate data of corresponding local geometric structure regions from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and to splice the gene expression data and the spatial coordinate data to obtain the state matrix corresponding to each continuous tissue slice.
[0041] The continuous state matrix pair acquisition module is used to splice the state matrices of adjacent continuous tissue slices to obtain continuous state matrix pairs;
[0042] The function acquisition module is used to acquire predefined action space, state transition functions, and reward functions;
[0043] The slice 3D reconstruction module is used to perform slice 3D reconstruction using a deep reinforcement learning network model based on the action space, the state transition function, the reward function, and each continuous state matrix pair.
[0044] A sliced 3D reconstruction device, comprising:
[0045] Memory, used to store computer programs;
[0046] A processor is used to implement the steps of the slice 3D reconstruction method as described above when executing the computer program.
[0047] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the slice 3D reconstruction method as described above.
[0048] The method for three-dimensional reconstruction of tissue slices provided in this application includes: acquiring continuous tissue slices and performing spatial transcriptome sequencing on each continuous tissue slice to obtain spatial transcriptome data corresponding to each continuous tissue slice; wherein, the spatial transcriptome data includes a gene expression matrix and a spatial coordinate matrix; extracting local geometric structure regions from each continuous tissue slice; selecting gene expression data and spatial coordinate data corresponding to the local geometric structure regions from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and splicing the gene expression data and spatial coordinate data to obtain a state matrix corresponding to each continuous tissue slice; splicing the state matrices of adjacent continuous tissue slices to obtain continuous state matrix pairs; acquiring a predefined action space, state transition function, and reward function; and using a deep reinforcement learning network model to perform three-dimensional reconstruction of the slices based on the action space, state transition function, reward function, and continuous state matrix pairs.
[0049] As described in the above technical solution, by performing spatial transcriptome sequencing on each continuous tissue slice, spatial transcriptome data, including gene expression matrices and spatial coordinate matrices, is obtained for each continuous tissue slice. Local geometric structural regions are extracted from each continuous tissue slice. Gene expression data and spatial coordinate data corresponding to the local geometric structural regions are then selected from the gene expression matrices and spatial coordinate matrices corresponding to each continuous tissue slice. The gene expression data and spatial coordinate data are then concatenated to obtain state matrices corresponding to each continuous tissue slice. These state matrix pairs are then concatenated. A deep reinforcement learning network model is used to perform 3D reconstruction of the slices based on the action space, the state transition function, the reward function, and the 3D reconstruction of the slices. This process involves first obtaining the spatial transcriptome data corresponding to each continuous tissue slice, then processing it to obtain 3D state matrix pairs, then performing sequential decision modeling to obtain the action space, state transition function, and reward function, and finally using a deep reinforcement learning network model for 3D reconstruction of the slices. Deep reinforcement learning enhances generalization and improves slice alignment accuracy.
[0050] Accordingly, this application also provides a slice 3D reconstruction apparatus, device, and computer-readable storage medium corresponding to the above-mentioned slice 3D reconstruction method, which have the above-mentioned technical effects, and will not be elaborated here. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a flowchart illustrating one implementation of the slice 3D reconstruction method in this application.
[0053] Figure 2 This is a schematic diagram of the original arrangement of local geometric regions in a continuous tissue slice according to an embodiment of this application;
[0054] Figure 3 This is a schematic diagram illustrating the reconstruction and arrangement of local geometric structures in a continuous tissue slice according to an embodiment of this application.
[0055] Figure 4 This is a structural block diagram of a slice 3D reconstruction device according to an embodiment of this application;
[0056] Figure 5 This is a structural block diagram of a slice 3D reconstruction device according to an embodiment of this application;
[0057] Figure 6 This is a schematic diagram of the specific structure of a slice 3D reconstruction device provided in an embodiment of this application. Detailed Implementation
[0058] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0060] See Figure 1 , Figure 1 This is a flowchart illustrating one implementation of the slice 3D reconstruction method in this application. The method may include the following steps:
[0061] S101: Obtain each continuous tissue slice and perform spatial transcriptome sequencing on each continuous tissue slice to obtain the spatial transcriptome data corresponding to each continuous tissue slice.
[0062] Spatial transcriptome data includes gene expression matrices and spatial coordinate matrices.
[0063] Obtain the tissue sample to be analyzed, for example, from a university or affiliated hospital of a medical school. Prepare serial tissue sections using a slicing device, then fix and embed the sections to maintain the integrity of the tissue structure. Obtain each serial tissue section and perform spatial transcriptome sequencing on each section to obtain spatial transcriptome data corresponding to each section. The spatial transcriptome data includes a gene expression matrix and a spatial coordinate matrix.
[0064] Spatial transcriptome sequencing can be performed by external institutions with spatial transcriptome sequencing capabilities. The gene expression matrix and spatial coordinate matrix of each tissue slice are represented as follows:
[0065] ;
[0066] in, G represents the number of spatial spots in the i-th tissue slice, and G represents the number of genes. This is a gene expression matrix, where each row corresponds to the gene expression information of a single spot. This is a spatial coordinate matrix, where each row corresponds to the two-dimensional coordinates of a spot on a plane, and M represents the number of tissue slices.
[0067] S102: Extract local geometric structure regions from each continuous tissue slice.
[0068] After obtaining each continuous tissue slice, functional regions with geometric structures are extracted from each continuous tissue slice as local geometric structure regions.
[0069] The local geometric structure region data corresponding to each consecutive tissue slice can be represented as:
[0070] ;
[0071] in, This represents the number of spots in the local geometric region within the i-th tissue slice.
[0072] In one specific embodiment of this application, step S102 may include the following steps:
[0073] Spatial domain identification was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structural regions were extracted from each consecutive tissue slice based on the obtained spatial domain information.
[0074] After obtaining each continuous tissue slice, spatial domain identification was performed on the spatial transcriptome data corresponding to each continuous tissue slice, and local geometric structure regions were extracted from each continuous tissue slice based on the obtained spatial domain information.
[0075] In one specific embodiment of this application, spatial domain identification is performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structure regions are extracted from each consecutive tissue slice based on the obtained spatial domain information. This may include the following steps:
[0076] A clustering algorithm based on spatial adjacency constraints is used to partition the spatial coordinate matrix into a spatial domain, thereby obtaining local geometric structure regions.
[0077] After obtaining each continuous tissue slice, a clustering algorithm based on spatial adjacency constraints (such as Louvain or Leiden clustering) was used to partition the spatial coordinate matrix into a spatial domain, obtaining local geometric structure regions. This spatial adjacency constraint-based clustering algorithm enabled the rapid and accurate extraction of local geometric structure regions.
[0078] In one specific embodiment of this application, step S102 may include the following steps:
[0079] Cell type annotation was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric regions were extracted from each consecutive tissue slice based on the obtained cell type annotations.
[0080] After obtaining each consecutive tissue slice, cell type annotation was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structural regions were extracted from each consecutive tissue slice based on the obtained cell type annotations. Rapid and accurate extraction of local geometric structural regions was achieved by using cell type annotations.
[0081] In one specific embodiment of this application, cell type annotation of the spatial transcriptome data corresponding to each consecutive tissue slice may include the following steps:
[0082] Step 1: Obtain known single-cell reference data;
[0083] Step 2: Map the gene expression features of spatial points in each consecutive tissue slice to the corresponding cell types in known single-cell reference data for cell type annotation.
[0084] For ease of description, the two steps above can be combined for explanation.
[0085] After obtaining each continuous tissue section, known single-cell reference data is acquired. The gene expression characteristics of spatial points in each continuous tissue section are mapped to the corresponding cell types in the known single-cell reference data, thus completing cell type annotation. Furthermore, if necessary, cell marker genes or expert manual correction can be combined to improve annotation accuracy.
[0086] S103: Select gene expression data and spatial coordinate data of the corresponding local geometric structure region from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and splice the gene expression data and spatial coordinate data to obtain the state matrix corresponding to each continuous tissue slice.
[0087] After extracting local geometric structure regions from each continuous tissue slice, gene expression data and spatial coordinate data corresponding to the local geometric structure regions are selected from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and the gene expression data and spatial coordinate data are spliced together to obtain the state matrix corresponding to each continuous tissue slice.
[0088] In one specific embodiment of this application, splicing gene expression data and spatial coordinate data may include the following steps:
[0089] Step 1: Normalize the gene expression data and spatial coordinate data to standardize the total gene expression level at each spatial point to a uniform size;
[0090] Step 2: Filter out unexpressed genes based on the gene expression levels corresponding to each spatial point to obtain the filtered genes;
[0091] Step 3: Perform logarithmic transformation on the gene expression levels corresponding to each filtered gene to obtain the logarithmic transformation results;
[0092] Step 4: Select the top preset number of genes with the highest expression variability as input features based on the logarithmic transformation results, and compress the input features to a preset dimension to obtain gene expression data;
[0093] Step 5: Combine the gene expression data and spatial coordinate data.
[0094] For ease of description, the five steps above can be combined for explanation.
[0095] After selecting gene expression data and spatial coordinate data for corresponding local geometric regions from the gene expression matrices and spatial coordinate matrices corresponding to each continuous tissue slice, the gene expression data and spatial coordinate data are normalized to standardize the total gene expression level of each spatial point to a uniform size. Unexpressed genes are filtered based on the gene expression levels corresponding to each spatial point, resulting in filtered genes. The gene expression levels corresponding to each filtered gene are then logarithmically transformed to obtain the logarithmic transformation result. Based on the logarithmic transformation result, a predetermined number of genes with the highest expression variability are selected as input features, and the input features are compressed to a predetermined dimension to obtain gene expression data. The gene expression data and spatial coordinate data are then concatenated. By standardizing the total gene expression level of each spatial point to a uniform size, filtering out unexpressed genes, and compressing feature dimensions, the computational load is reduced, and computational resources are saved.
[0096] Gene expression data and spatial coordinate data can be combined using the following formula:
[0097] ;
[0098] in, This represents the concatenated state matrix.
[0099] S104: Concatenate the state matrices of adjacent consecutive tissue slices to obtain pairs of consecutive state matrices.
[0100] After splicing gene expression data and spatial coordinate data to obtain the state matrix corresponding to each continuous tissue slice, the state matrices of adjacent continuous tissue slices are spliced to obtain continuous state matrix pairs.
[0101] S105: Obtain the predefined action space, state transition function, and reward function.
[0102] Predefine the action space, state transition function, and reward function, and obtain the predefined action space, state transition function, and reward function.
[0103] Defining the state space requires extracting local geometric structure data from all tissue slices. Concatenate and convert into a state set tensor (Can be filled in), represented as:
[0104] ;
[0105] in, , This represents the state matrix of a tissue slice. This represents a continuous pair of state matrices obtained by splicing the state matrices of two adjacent tissue slices.
[0106] Define an action space (x, y, θ), where x and y are translation vectors and θ is the rotation angle. To achieve step-by-step alignment (e.g., divided into P steps, where P is the first preset number of iterations), the action space is scaled to a small adjustment for each step:
[0107] .
[0108] Define a state transition function that describes the change in the spatial position of a slice after performing an action (x, y, θ). This state transition function defines the direct impact of continuous actions on the spatial position of the slice, providing the basis for the next state in the reinforcement learning environment.
[0109] Let the state matrix of the current tissue slice be... The last two columns are spatial coordinates. The state transition function can then be expressed as:
[0110] ;
[0111] Where T is a geometric transformation function that applies the action to the coordinate column of the tissue slice:
[0112] ;
[0113] ;
[0114] The last two columns are spatial coordinates Rotate For the spatial coordinates of the last two columns Perform a translation (x, y) to obtain the updated coordinates. Thus, a new state matrix is obtained. .
[0115] A reward function based on the optimal transport mechanism is defined. To measure the similarity of spatial structure between consecutive tissue slices, a structurally approximate GWOT (Gromov–Wasserstein Optimal Transport) reward function is designed. This reward function can be backpropagated, is suitable for continuous optimization in reinforcement learning frameworks, and remains memory-friendly. By incorporating the optimal transport mechanism, the influence of local optima traps in reinforcement learning, alignment, or matching problems is mitigated or avoided.
[0116] Adjacent slice status Conversely, randomly select the spatial coordinates of two adjacent slices. and :
[0117] ;
[0118] in, , where i represents the i-th slice. The goal is to obtain a subsampled point cloud to reduce computational complexity and ensure memory safety.
[0119] By selecting from each adjacent slice By using spatial points, computational complexity is significantly reduced, and computational resources are saved.
[0120] Calculate the internal distance matrix by calculating the pairwise Euclidean distance matrix for each of the two sampled point clouds (this is not comparing the positions of points in space, but rather comparing the internal geometry of the point clouds, hence the calculation of internal distance):
[0121] ;
[0122] in, Let represent the Euclidean distance matrix between the j-th spatial point and the k-th spatial point in the i-th tissue slice. This represents the spatial coordinates of the j-th point in the i-th tissue slice. This represents the spatial coordinates of the k-th spatial point in the i-th tissue slice.
[0123] And normalize it:
[0124] ;
[0125] in, Let represent the Euclidean distance matrix of the i-th tissue slice.
[0126] To calculate the structural differences, the Frobenius norm is used to measure the difference between the two sets of distance matrices.
[0127] ;
[0128] Reward mapping converts differences into rewards; the more similar two sets of point cloud structures are, the higher the reward. The closer to 1; the greater the difference, The closer to 0:
[0129] .
[0130] S106: Using a deep reinforcement learning network model, slices are reconstructed into three dimensions based on the action space, state transition function, reward function, and each continuous state matrix.
[0131] After obtaining the predefined action space, state transition function, and reward function, a deep reinforcement learning network model is used to perform 3D reconstruction by slicing based on the action space, state transition function, reward function, and each continuous state matrix.
[0132] As described above, the technical solution involves performing spatial transcriptome sequencing on each continuous tissue slice to obtain spatial transcriptome data, including gene expression matrices and spatial coordinate matrices, for each slice. Local geometric regions are extracted from each slice, and gene expression and spatial coordinate data corresponding to these regions are selected from the gene expression and spatial coordinate matrices. These data are then concatenated to obtain state matrices for each slice, resulting in continuous state matrix pairs. A deep reinforcement learning network model is then used to reconstruct the slices in 3D based on the action space, state transition function, reward function, and continuous state matrix pairs. The process involves first obtaining spatial transcriptome data for each continuous tissue slice, then processing it to obtain continuous state matrix pairs, followed by sequential decision modeling to obtain the action space, state transition function, and reward function, and finally using a deep reinforcement learning network model for 3D reconstruction. Deep reinforcement learning enhances generalization and improves slice alignment accuracy.
[0133] It should be noted that, based on the above embodiments, this application also provides corresponding improvement solutions. In subsequent embodiments, steps that are the same as or corresponding to those in the above embodiments can be referred to each other, and the corresponding beneficial effects can also be referred to each other. These improvements will not be elaborated upon in the following improved embodiments.
[0134] In one specific embodiment of this application, step S106 may include the following steps:
[0135] Step 1: Obtain the first adjacent consecutive tissue slice pair from one end of each adjacent consecutive tissue slice, and determine the obtained adjacent consecutive tissue slice pair as the current adjacent consecutive tissue slice pair;
[0136] Step 2: Determine the current consecutive state matrix pair corresponding to the current adjacent consecutive tissue slices as the current consecutive state matrix pair;
[0137] Step 3: Input the current continuous state matrix into the deep reinforcement learning network model and output slices of actions to be executed;
[0138] Step 4: Perform the slice action on the next state matrix in the current continuous state matrix pair through the state transition function to obtain the updated state matrix. Then, concatenate the updated state matrix with the previous state matrix in the current continuous state matrix pair to obtain the updated continuous state matrix pair.
[0139] Step 5: Calculate the reward value for the current continuous state matrix pair and the updated continuous state matrix pair using the reward function, and determine the updated continuous state matrix pair as the new current continuous state matrix pair;
[0140] Step 6: Determine the first preset number of times based on the action space, return to step 3 to execute the first preset number of times, and record the calculated reward values, the actions to be executed in each slice, the current continuous state matrix, and the updated continuous state matrix to obtain the current trajectory;
[0141] Step 7: Return to Step 3 for the second preset number of times, estimate the loss based on the obtained trajectories, and perform backpropagation iteration for the third preset number of times based on the estimated loss to obtain the current training weights corresponding to the current adjacent continuous tissue slice pairs;
[0142] Step 8: Determine the next adjacent consecutive tissue slice pair of the current adjacent consecutive tissue slice pair as the new current adjacent consecutive tissue slice pair, and return to Step 2 until all adjacent consecutive tissue slice pairs have been traversed to complete the 3D reconstruction of the slices.
[0143] For ease of description, the above eight steps can be combined for explanation.
[0144] After obtaining the predefined action space, state transition function, and reward function, the first adjacent continuous tissue slice pair is obtained from one end of each adjacent continuous tissue slice. The obtained adjacent continuous tissue slice pair is determined as the current adjacent continuous tissue slice pair. The continuous state matrix pair corresponding to the current adjacent continuous tissue slice pair is determined as the current continuous state matrix pair. The current continuous state matrix pair is input into the deep reinforcement learning network model, and the slice action to be executed is output. The slice action to be executed is executed on the next state matrix in the current continuous state matrix pair through the state transition function to obtain the updated state matrix. The updated state matrix is then concatenated with the previous state matrix in the current continuous state matrix pair to obtain the updated continuous state matrix pair. The reward function is used to calculate the reward value for the current continuous state matrix pair and the updated continuous state matrix pair. The updated continuous state matrix pair is determined as the new current continuous state matrix pair. Based on the action space, a first preset number of iterations is determined, and the process returns to execute step three for the first preset number of iterations. The calculated reward values, the actions to be executed for each slice, each current continuous state matrix, and each updated continuous state matrix pair are recorded to obtain the current trajectory. The process returns to execute step three for the second preset number of iterations. The loss is estimated based on the obtained trajectories, and backpropagation is performed iteratively for the third preset number of iterations based on the estimated loss to obtain the current training weights corresponding to the current adjacent continuous tissue slice pair. The next adjacent continuous tissue slice pair of the current adjacent continuous tissue slice pair is determined as the new current adjacent continuous tissue slice pair, and the process returns to execute step two. This process continues until all adjacent continuous tissue slice pairs have been traversed, thus completing the 3D reconstruction of the slices.
[0145] Let the current continuous state matrix pair be... ,right The second tissue section Execute the state transition function to obtain .Will splicing back get According to the new status and the old state Calculate the reward.
[0146] It should be noted that the first preset number of times, the second preset number of times, and the third preset number of times can be set and adjusted according to the actual situation. This application embodiment does not limit this. For example, the first preset number of times can be set to 8, the second preset number of times to 10, and the third preset number of times to 100.
[0147] See Figure 2 , Figure 2 This is a schematic diagram of the original arrangement of local geometric regions in a continuous tissue slice according to an embodiment of this application. See also... Figure 3 , Figure 3 This is a schematic diagram illustrating the arrangement of local geometric structure regions for reconstruction of a continuous tissue slice according to an embodiment of this application. Each colored area in the diagram represents a local geometric structure region of a tissue slice. It can be seen that the tissue slice 3D reconstruction method provided in this embodiment achieves accurate 3D reconstruction of continuous tissue slices.
[0148] First, spatial transcriptome data corresponding to each consecutive tissue slice is acquired. This data is then processed to obtain consecutive state matrix pairs. Sequential decision modeling is then performed to obtain the action space, state transition function, and reward function. Finally, a deep reinforcement learning network model is used for 3D reconstruction of the slices. Deep reinforcement learning enhances generalization and improves slice alignment accuracy.
[0149] Corresponding to the above method embodiments, this application also provides a slice three-dimensional reconstruction apparatus, and the slice three-dimensional reconstruction apparatus described below can be referred to in correspondence with the slice three-dimensional reconstruction method described above.
[0150] See Figure 4 , Figure 4 This is a structural block diagram of a slice 3D reconstruction device according to an embodiment of this application. The device may include:
[0151] The spatial transcriptome data acquisition module 41 is used to acquire each continuous tissue slice and perform spatial transcriptome sequencing on each continuous tissue slice to obtain the spatial transcriptome data corresponding to each continuous tissue slice; wherein, the spatial transcriptome data includes a gene expression matrix and a spatial coordinate matrix;
[0152] Local geometric structure region extraction module 42 is used to extract local geometric structure regions from each continuous tissue slice;
[0153] The state matrix acquisition module 43 is used to filter gene expression data and spatial coordinate data of corresponding local geometric structure regions from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and splice the gene expression data and spatial coordinate data to obtain the state matrix corresponding to each continuous tissue slice.
[0154] The continuous state matrix pair acquisition module 44 is used to splice the state matrices of adjacent continuous tissue slices to obtain continuous state matrix pairs;
[0155] Function acquisition module 45 is used to acquire predefined action space, state transition function and reward function;
[0156] The slice 3D reconstruction module 46 is used to perform slice 3D reconstruction using a deep reinforcement learning network model based on the action space, state transition function, reward function, and each continuous state matrix.
[0157] As described above, the technical solution involves performing spatial transcriptome sequencing on each continuous tissue slice to obtain spatial transcriptome data, including gene expression matrices and spatial coordinate matrices, for each slice. Local geometric regions are extracted from each slice, and gene expression and spatial coordinate data corresponding to these regions are selected from the gene expression and spatial coordinate matrices. These data are then concatenated to obtain state matrices for each slice, resulting in continuous state matrix pairs. A deep reinforcement learning network model is then used to reconstruct the slices in 3D based on the action space, state transition function, reward function, and continuous state matrix pairs. The process involves first obtaining spatial transcriptome data for each continuous tissue slice, then processing it to obtain continuous state matrix pairs, followed by sequential decision modeling to obtain the action space, state transition function, and reward function, and finally using a deep reinforcement learning network model for 3D reconstruction. Deep reinforcement learning enhances generalization and improves slice alignment accuracy.
[0158] In one specific embodiment of this application, the slice 3D reconstruction module may include:
[0159] The current adjacent continuous tissue slice pair determination submodule is used to obtain the first adjacent continuous tissue slice pair from one end of each adjacent continuous tissue slice, and determine the obtained adjacent continuous tissue slice pair as the current adjacent continuous tissue slice pair;
[0160] The current continuous state matrix pair determination submodule is used to determine the continuous state matrix pair corresponding to the current adjacent continuous tissue slice pair as the current continuous state matrix pair;
[0161] The slice action output submodule is used to input the current continuous state matrix into the deep reinforcement learning network model and output the slice action to be executed;
[0162] The updated continuous state matrix pair acquisition submodule is used to perform the slice action to be executed on the next state matrix in the current continuous state matrix pair through the state transition function to obtain the updated state matrix. The updated state matrix is then concatenated with the previous state matrix in the current continuous state matrix pair to obtain the updated continuous state matrix pair.
[0163] The new current continuous state matrix pair determination submodule is used to calculate the reward value of the current continuous state matrix pair and the updated continuous state matrix pair using the reward function, and determine the updated continuous state matrix pair as the new current continuous state matrix pair.
[0164] The current trajectory acquisition submodule is used to determine the first preset number of times based on the action space, repeatedly execute the step of inputting the current continuous state matrix pair into the deep reinforcement learning network model for the first preset number of times, and record the calculated reward values, the action to be executed in each slice, the current continuous state matrix and the updated continuous state matrix pair to obtain the current trajectory.
[0165] The current training weights acquisition submodule is used to repeatedly execute the step of inputting the current continuous state matrix pair into the deep reinforcement learning network model for a second preset number of times, estimate the loss based on each obtained trajectory, and perform backpropagation iteration for a third preset number of times based on the estimated loss to obtain the current training weights corresponding to the current adjacent continuous tissue slice pair.
[0166] The slice 3D reconstruction submodule is used to determine the next adjacent consecutive tissue slice pair of the current adjacent consecutive tissue slice pair as the new current adjacent consecutive tissue slice pair, and repeatedly execute the step of determining the consecutive state matrix pair corresponding to the current adjacent consecutive tissue slice pair as the current consecutive state matrix pair, until all adjacent consecutive tissue slice pairs have been traversed to complete the slice 3D reconstruction.
[0167] In one specific embodiment of this application, the local geometric structure region extraction module is specifically a module that performs spatial domain identification on the spatial transcriptome data corresponding to each continuous tissue slice, and extracts the local geometric structure region from each continuous tissue slice based on the obtained spatial domain information.
[0168] In one specific embodiment of this application, the local geometric structure region extraction module is specifically a module that uses a clustering algorithm based on spatial adjacency constraints to divide the spatial coordinate matrix into spatial domains to obtain the local geometric structure region.
[0169] In one specific embodiment of this application, the local geometric structure region extraction module is specifically a module that performs cell type annotation on the spatial transcriptome data corresponding to each consecutive tissue slice, and extracts the local geometric structure region from each consecutive tissue slice according to the obtained cell type annotation.
[0170] In one specific embodiment of this application, the local geometric structure region extraction module may include:
[0171] The reference data acquisition submodule is used to acquire known single-cell reference data;
[0172] The cell type annotation submodule is used to map the gene expression features of spatial points in each consecutive tissue slice to the cell type of the corresponding known single-cell reference data for cell type annotation.
[0173] In one specific embodiment of this application, the state matrix acquisition module may include:
[0174] The total gene expression level normalization submodule is used to normalize gene expression data and spatial coordinate data to standardize the total gene expression level of each spatial point to a uniform size.
[0175] The filtered gene acquisition submodule is used to filter out unexpressed genes based on the gene expression levels corresponding to each spatial point, and obtain the filtered genes.
[0176] The logarithmic transformation result acquisition submodule is used to perform logarithmic transformation on the gene expression levels corresponding to each filtered gene to obtain the logarithmic transformation result;
[0177] The gene expression data acquisition submodule is used to select the top preset number of genes with the highest expression variability as input features based on the logarithmic transformation results, and compress the input features to a preset dimension to obtain gene expression data;
[0178] The data splicing submodule is used to splice gene expression data and spatial coordinate data.
[0179] For the method embodiments described above, see [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of the slice 3D reconstruction device provided in this application, which may include:
[0180] Memory 332 is used to store computer programs;
[0181] The processor 322 is used to implement the steps of the slice three-dimensional reconstruction method of the above method embodiment when executing a computer program.
[0182] For details, please refer to Figure 6 , Figure 6This is a schematic diagram illustrating the specific structure of a slice 3D reconstruction device provided in this embodiment. This slice 3D reconstruction device can vary significantly due to different configurations or performance. It may include a processor (central processing unit, CPU) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. The memory 332 can be temporary or persistent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the slice 3D reconstruction device 301.
[0183] The sliced 3D reconstruction device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0184] The steps in the slice 3D reconstruction method described above can be implemented by the structure of the slice 3D reconstruction device.
[0185] Corresponding to the above method embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the following steps:
[0186] Each continuous tissue slice was acquired, and spatial transcriptome sequencing was performed on each slice to obtain spatial transcriptome data corresponding to each continuous tissue slice. The spatial transcriptome data included gene expression matrices and spatial coordinate matrices. Local geometric structural regions were extracted from each continuous tissue slice. Gene expression data and spatial coordinate data corresponding to the local geometric structural regions were selected from the gene expression matrices and spatial coordinate matrices of each continuous tissue slice, and then concatenated to obtain the state matrix corresponding to each continuous tissue slice. The state matrices of adjacent continuous tissue slices were concatenated to obtain continuous state matrix pairs. A predefined action space, state transition function, and reward function were obtained. A deep reinforcement learning network model was used to reconstruct the slices in three dimensions based on the action space, state transition function, reward function, and continuous state matrix pairs.
[0187] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0188] For a description of the computer-readable storage medium provided in this application, please refer to the above method embodiments; further details will not be repeated here.
[0189] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatuses, devices, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0190] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for 3D reconstruction by slicing, characterized in that, include: Each consecutive tissue slice was obtained, and spatial transcriptome sequencing was performed on each consecutive tissue slice to obtain spatial transcriptome data corresponding to each consecutive tissue slice; wherein, the spatial transcriptome data includes gene expression matrix and spatial coordinate matrix; Extract local geometric structure regions from each consecutive tissue slice; Gene expression data and spatial coordinate data corresponding to local geometric structure regions are selected from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and the gene expression data and spatial coordinate data are spliced together to obtain the state matrix corresponding to each continuous tissue slice. The state matrices of adjacent consecutive tissue slices are spliced together to obtain pairs of consecutive state matrices; Obtain the predefined action space, state transition function, and reward function; A deep reinforcement learning network model is used to perform slice-based 3D reconstruction based on the action space, the state transition function, the reward function, and each continuous state matrix.
2. The slice-based three-dimensional reconstruction method according to claim 1, characterized in that, Using a deep reinforcement learning network model, slice-based 3D reconstruction is performed based on the action space, the state transition function, the reward function, and each continuous state matrix, including: Obtain the first adjacent consecutive tissue slice pair from one end of each adjacent consecutive tissue slice, and determine the obtained adjacent consecutive tissue slice pair as the current adjacent consecutive tissue slice pair; The continuous state matrix pair corresponding to the current adjacent continuous tissue slice pair is determined as the current continuous state matrix pair; The current continuous state matrix is input into the deep reinforcement learning network model, and slices of actions to be executed are output. The slice action is executed on the next state matrix in the current continuous state matrix pair by the state transition function to obtain the updated state matrix. The updated state matrix is then concatenated with the previous state matrix in the current continuous state matrix pair to obtain the updated continuous state matrix pair. The reward function is used to calculate the reward value for the current continuous state matrix pair and the updated continuous state matrix pair, and the updated continuous state matrix pair is determined as the new current continuous state matrix pair. Based on the action space, a first preset number of times is determined, and the step of inputting the current continuous state matrix pair into the deep reinforcement learning network model is repeated for the first preset number of times. The calculated reward values, the actions to be executed in each slice, the current continuous state matrix, and the updated continuous state matrix pair are recorded to obtain the current trajectory. Repeat the step of inputting the current continuous state matrix pair into the deep reinforcement learning network model for a second preset number of times, estimate the loss based on each obtained trajectory, and perform backpropagation iteration for a third preset number of times based on the estimated loss to obtain the current training weights corresponding to the current adjacent continuous tissue slice pair. The next adjacent continuous tissue slice pair of the current adjacent continuous tissue slice pair is determined as the new current adjacent continuous tissue slice pair, and the step of determining the continuous state matrix pair corresponding to the current adjacent continuous tissue slice pair as the current continuous state matrix pair is repeated until all adjacent continuous tissue slice pairs are traversed to complete the 3D reconstruction of the slices.
3. The slice-based three-dimensional reconstruction method according to claim 1, characterized in that, Local geometric regions were extracted from each consecutive tissue slice, including: Spatial domain identification was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structural regions were extracted from each consecutive tissue slice based on the obtained spatial domain information.
4. The sliced three-dimensional reconstruction method according to claim 3, characterized in that, Spatial domain identification was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric structural regions were extracted from each consecutive tissue slice based on the obtained spatial domain information, including: The spatial coordinate matrix is divided into spatial domains using a clustering algorithm based on spatial adjacency constraints to obtain the local geometric structure region.
5. The slice-based three-dimensional reconstruction method according to claim 1, characterized in that, Local geometric regions were extracted from each consecutive tissue slice, including: Cell type annotation was performed on the spatial transcriptome data corresponding to each consecutive tissue slice, and local geometric regions were extracted from each consecutive tissue slice based on the obtained cell type annotations.
6. The slice three-dimensional reconstruction method according to claim 5, characterized in that, Cell type annotation was performed on the spatial transcriptome data corresponding to each consecutive tissue section, including: Obtain known single-cell reference data; Gene expression features of spatial points in each continuous tissue slice are mapped to the corresponding cell types of known single-cell reference data for cell type annotation.
7. The slice three-dimensional reconstruction method according to any one of claims 1 to 6, characterized in that, The process of splicing the gene expression data and the spatial coordinate data includes: The gene expression data and the spatial coordinate data are normalized to standardize the total gene expression level at each spatial point to a uniform size. Unexpressed genes are filtered out based on the gene expression levels corresponding to each spatial point to obtain the filtered genes; Logarithmic transformation was performed on the gene expression levels corresponding to each filtered gene to obtain the logarithmic transformation results. Based on the logarithmic transformation result, the top preset number of genes with the highest expression variability are selected as input features, and the input features are compressed to a preset dimension to obtain the gene expression data; The gene expression data and the spatial coordinate data are spliced together.
8. A slicing three-dimensional reconstruction device, characterized in that, include: The spatial transcriptome data acquisition module is used to acquire each continuous tissue slice and perform spatial transcriptome sequencing on each continuous tissue slice to obtain spatial transcriptome data corresponding to each continuous tissue slice; wherein, the spatial transcriptome data includes a gene expression matrix and a spatial coordinate matrix; The local geometric structure region extraction module is used to extract local geometric structure regions from each continuous tissue slice; The state matrix acquisition module is used to filter gene expression data and spatial coordinate data of corresponding local geometric structure regions from the gene expression matrix and spatial coordinate matrix corresponding to each continuous tissue slice, and to splice the gene expression data and the spatial coordinate data to obtain the state matrix corresponding to each continuous tissue slice. The continuous state matrix pair acquisition module is used to splice the state matrices of adjacent continuous tissue slices to obtain continuous state matrix pairs; The function acquisition module is used to acquire predefined action space, state transition functions, and reward functions; The slice 3D reconstruction module is used to perform slice 3D reconstruction using a deep reinforcement learning network model based on the action space, the state transition function, the reward function, and each continuous state matrix pair.
9. A slicing three-dimensional reconstruction device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the slice three-dimensional reconstruction method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the slice three-dimensional reconstruction method as described in any one of claims 1 to 7.