{"id":1353646,"date":"2026-12-04T12:21:27","date_gmt":"2026-12-04T12:21:27","guid":{"rendered":"https:\/\/www.europesays.com\/uk\/1353646\/"},"modified":"2026-12-04T12:21:27","modified_gmt":"2026-12-04T12:21:27","slug":"tissue-reconstruction-with-generative-ai","status":"publish","type":"post","link":"https:\/\/www.europesays.com\/uk\/1353646\/","title":{"rendered":"Tissue reconstruction with generative AI"},"content":{"rendered":"<p>Overview of LUNA<\/p>\n<p>LUNA is a diffusion-based generative model designed to generate spatial locations of cells from their gene expression. Using an attention-based mechanism, LUNA learns how each individual cell should attend to other cells according to their relevance to a cell\u2019s own location and molecular features. During training, LUNA leverages spatial transcriptomics data with ground-truth cell locations to learn to generate cell locations conditioned on gene expression. During inference, the input to LUNA is the gene expression of dissociated cells, and the model then generates cell locations from pure Gaussian noise conditioned on gene expression, enabling inference of cell locations.<\/p>\n<p>In the training phase, the input to LUNA is spatial transcriptomics data from single or multiple slices. LUNA learns cell embeddings that capture both the local and global tissue structure using a multihead self-attention mechanism<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 22\" title=\"Vaswani, A. et al. Attention is all you need. In Advances in Neural Information Processing Systems Vol. 30 (Curran Associates, 2017).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR22\" id=\"ref-link-section-d36180078e2293\" rel=\"nofollow noopener\" target=\"_blank\">22<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 23\" title=\"Shen, Z., Zhang, M., Zhao, H., Yi, S. &amp; Li, H. Efficient attention: attention with linear complexities. In Proc. IEEE\/CVF Winter Conference on Applications of Computer Vision (IEEE, 2021).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR23\" id=\"ref-link-section-d36180078e2296\" rel=\"nofollow noopener\" target=\"_blank\">23<\/a> that enables cells to learn to attend to other cells. We designed the loss in LUNA as an SE(2)-invariant function<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Segol, N. &amp; Lipman, Y. On universal equivariant set networks. In 8th International Conference on Learning Representations (ICLR, 2020).\" href=\"#ref-CR75\" id=\"ref-link-section-d36180078e2300\">75<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Torres-Mendez, L. A., Ruiz-Suarez, J. C., Sucar, L. E. &amp; G&#xF3;mez, G. Translation, rotation, and scale-invariant object recognition. IEEE Trans. Syst. Man Cybern. 30, 125&#x2013;130 (2000).\" href=\"#ref-CR76\" id=\"ref-link-section-d36180078e2300_1\">76<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Romero, D., Bekkers, E., Tomczak, J. &amp; Hoogendoorn, M. Attentive group equivariant convolutional networks. In Proc. 37th International Conference on Machine Learning Vol. 119, 8188&#x2013;8199 (PMLR, 2020).\" href=\"#ref-CR77\" id=\"ref-link-section-d36180078e2300_2\">77<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 78\" title=\"Wu, Y., L&#xF6;we, H., Carricato, M. &amp; Li, Z. Inversion symmetry of the Euclidean group: theory and application to robot kinematics. IEEE Trans. Robot. 32, 312&#x2013;326 (2016).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR78\" id=\"ref-link-section-d36180078e2303\" rel=\"nofollow noopener\" target=\"_blank\">78<\/a> (it is robust to arbitrary rotations and translations of the predicted locations), only enforcing the preservation of relative distances between cells within each slice.<\/p>\n<p>Training LUNA involves two main steps: (1) a corruption process that iteratively adds noise to the ground-truth cell locations, and (2) a denoising process that generates the ground-truth locations from the noise-corrupted locations. During the denoising process, LUNA learns to reverse the corruption process, gradually transitioning from noisier to less noisy cell locations. LUNA as a generative model is more robust to distribution shifts, compared to a regression model which is prone to overfitting to specific tissue distributions (Supplementary Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">35<\/a>). Another benefit of using generative modeling lies in estimating uncertainty in predictions (Figs. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3c\u2013e<\/a> and <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4h,i<\/a>).<\/p>\n<p>Learning cell representations<\/p>\n<p>LUNA learns cell representations that capture the relationship between the molecular features of individual cells and their spatial context within tissue. These embeddings form the foundation for predicting the locations of cells.<\/p>\n<p>The model is built on the premise that a cell\u2019s location is influenced not only by its own molecular features but also by those of other cells in the tissue. To effectively model these interactions, LUNA employs a multihead self-attention mechanism<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 22\" title=\"Vaswani, A. et al. Attention is all you need. In Advances in Neural Information Processing Systems Vol. 30 (Curran Associates, 2017).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR22\" id=\"ref-link-section-d36180078e2330\" rel=\"nofollow noopener\" target=\"_blank\">22<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 23\" title=\"Shen, Z., Zhang, M., Zhao, H., Yi, S. &amp; Li, H. Efficient attention: attention with linear complexities. In Proc. IEEE\/CVF Winter Conference on Applications of Computer Vision (IEEE, 2021).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR23\" id=\"ref-link-section-d36180078e2333\" rel=\"nofollow noopener\" target=\"_blank\">23<\/a>, which dynamically integrates information from all cells in the slice. This mechanism allows the model to assign attention scores to different cells based on their relevance to the prediction of each cell\u2019s location, capturing both local and global cellular interactions. Once the cell embeddings are learned, LUNA projects each cell\u2019s embedding into a 2D space to predict its location.<\/p>\n<p>Formally, LUNA takes as input (1) molecular features of cells \\({{X}}_{s}\\in {{\\mathbb{R}}}^{m\\times d}\\) in a given slice s, where m denotes the number of cells and d denotes the number of genes; (2) time step \\(t\\in {\\mathbb{N}}\\) uniformly sampled from 0 to the maximum diffusion time T; and (3) corrupted cell locations \\({\\tilde{{R}}}_{s,t}\\in {{\\mathbb{R}}}^{m\\times 2}\\) at time step t. The output of the model is the denoised cell locations \\({\\hat{{R}}}_{s}\\in {{\\mathbb{R}}}^{m\\times 2}\\) for a given slice s. We omit slice index s for the ease of notation.<\/p>\n<p>LUNA is composed of multiple transformer layers, each integrating fully connected layers followed by the self-attention block. At each layer l given a fixed diffusion time t, LUNA learns (1) cell embeddings \\({{F}}^{(l)}\\in {{\\mathbb{R}}}^{m\\times {d}_{x}^{(l)}}\\); (2) a diffusion time embedding \\({\\gamma }_{t}^{(l)}\\in {\\mathbb{R}}\\); and (3) cell location embeddings \\({{R}}^{(l)}\\in {{\\mathbb{R}}}^{m\\times {d}_{r}^{(l)}}\\).<\/p>\n<p>The cell embeddings F(0) in layer 0 are initialized via a fully connected neural network layer that maps the molecular features of cells into the latent embedding space with dimensionality \\({d}_{x}^{(0)}\\):<\/p>\n<p>$${{F}}^{(0)}={\\mathrm{FCN}}({{X}}_{s}),$$<\/p>\n<p>\n                    (1)\n                <\/p>\n<p>where FCN denotes a fully connected neural network layer. The diffusion time embedding \\({\\gamma }_{t}^{(0)}\\) is initialized to the value of the diffusion time itself:<\/p>\n<p>$${\\gamma }_{t}^{(0)}=t.$$<\/p>\n<p>\n                    (2)\n                <\/p>\n<p>Finally, the cell location embeddings are initialized as the corrupted cell locations obtained from the corruption process at time step t:<\/p>\n<p>$${{R}}^{(0)}={\\tilde{{R}}}_{t}.$$<\/p>\n<p>\n                    (3)\n                <\/p>\n<p>Then, at each layer l \u2208 {1, \u2026, L}, LUNA first transforms cell embeddings, a diffusion time embedding and cell location embeddings using fully connected layers:<\/p>\n<p>$${{F}}_{f}^{(l)}={\\mathrm{FCN}}\\left({{F}}^{(l-1)}\\right),$$<\/p>\n<p>\n                    (4)\n                <\/p>\n<p>$${\\gamma }_{t}^{(l)}={\\mathrm{FCN}}\\left({\\gamma }_{t}^{(l-1)}\\right),$$<\/p>\n<p>\n                    (5)\n                <\/p>\n<p>$${{R}}_{r}^{(l)}={\\mathrm{FCN}}\\left({{R}}^{(l-1)}\\right).$$<\/p>\n<p>\n                    (6)\n                <\/p>\n<p>The transformed cell embeddings, diffusion time embedding and cell location embeddings are concatenated to form a unified representation for each cell:<\/p>\n<p>$${{H}}^{(l)}=\\left[{{F}}_{f}^{(l)},{\\gamma }_{t}^{(l)}{{\\bf{1}}}_{m\\times 1},{{R}}_{r}^{(l)}\\right],$$<\/p>\n<p>\n                    (7)\n                <\/p>\n<p>where <b>1<\/b>m\u2009\u00d7\u20091 is a column vector of ones used to replicate the diffusion time embedding \\({\\gamma }_{t}^{(l)}\\) across all m cells. To obtain final cell embeddings F(l) in layer l, the unified representation H(l) is passed through a self-attention block which computes attention weights between all pairs of cells<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 23\" title=\"Shen, Z., Zhang, M., Zhao, H., Yi, S. &amp; Li, H. Efficient attention: attention with linear complexities. In Proc. IEEE\/CVF Winter Conference on Applications of Computer Vision (IEEE, 2021).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR23\" id=\"ref-link-section-d36180078e3493\" rel=\"nofollow noopener\" target=\"_blank\">23<\/a>:<\/p>\n<p>$${{F}}^{(l)}={\\text{SelfAttention}}^{(l)}\\left({{H}}^{(l)}\\right).$$<\/p>\n<p>\n                    (8)\n                <\/p>\n<p>This self-attention operation enables the model to aggregate information from all cells in a slice, capturing how each cell\u2019s location is influenced by others. To ensure scalability, we implemented the efficient attention<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 23\" title=\"Shen, Z., Zhang, M., Zhao, H., Yi, S. &amp; Li, H. Efficient attention: attention with linear complexities. In Proc. IEEE\/CVF Winter Conference on Applications of Computer Vision (IEEE, 2021).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR23\" id=\"ref-link-section-d36180078e3582\" rel=\"nofollow noopener\" target=\"_blank\">23<\/a> (an approximation of attention computation with a linear complexity). This approach reduces memory usage and computational complexity by circumventing the need for explicit pairwise interactions between every query\u2013key pair (Supplementary Note <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">9<\/a>).<\/p>\n<p>Finally, the cell embeddings F(l) are used to predict the locations of each cell. The cell locations are generated from the embeddings using a fully connected layer that projects the location of each cell from the latent embedding space to the 2D physical space:<\/p>\n<p>$${{R}}^{(l)}={\\mathrm{FCN}}\\left({{F}}^{(l)}\\right).$$<\/p>\n<p>\n                    (9)\n                <\/p>\n<p>At each layer, the updated locations are centered by subtracting the mean, ensuring that the cell locations remain stable and consistent relative to the tissue structure. At the final layer, the output cell locations are the predicted clean cell locations \\(\\hat{{R}}={{R}}^{(L)}\\). To better illustrate the scalability of our model components, especially the efficient attention mechanism and the FCN layer, we conducted kernel-level profiling of LUNA (Supplementary Note <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">10<\/a> and Supplementary Table <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a>).<\/p>\n<p>Loss objective<\/p>\n<p>To optimize LUNA, we introduce a specific loss objective that is SE(2)-invariant. This geometric invariance is crucial because the spatial arrangement of cells in the tissue may undergo transformations due to experimental artifacts, while the underlying gene expression profiles remain unchanged.<\/p>\n<p>To ensure SE(2)-invariance, LUNA introduces a pairwise loss function, which focuses on preserving the relative distances between all cells in the slice defined as follows:<\/p>\n<p>$${{\\mathcal{L}}}_{{\\rm{diff}}}=\\dfrac{1}{{m}^{2}}\\parallel \\Delta (\\hat{{R}})-\\Delta ({{R}}_{gt}){\\parallel }_{F}^{2},$$<\/p>\n<p>\n                    (10)\n                <\/p>\n<p>where \\(\\Delta (\\cdot):{{\\mathbb{R}}}^{m\\times 2}\\to {{\\mathbb{R}}}^{m\\times m}\\) computes the pairwise squared Euclidean distances between the locations of all cells and \\({{R}}_{gt}\\in {{\\mathbb{R}}}^{m\\times 2}\\) represents the ground-truth cell locations.<\/p>\n<p>The function \\(\\Delta {(\\hat{{R}})}_{ij}=\\parallel {\\hat{r}}_{i}-{\\hat{r}}_{j}{\\parallel }_{2}^{2}\\) computes the squared distance between the predicted locations of cells i and j, and similarly, \\(\\Delta {({{R}}_{gt})}_{ij}=\\parallel {r}_{i}-{r}_{j}{\\parallel }_{2}^{2}\\) computes the squared distance between the true locations. The pairwise loss then becomes:<\/p>\n<p>$${{\\mathcal{L}}}_{{\\rm{diff}}}=\\dfrac{1}{{m}^{2}}\\mathop{\\sum }\\limits_{i=1}^{m}\\mathop{\\sum }\\limits_{j=1}^{m}{\\left(\\parallel {\\hat{r}}_{i}-{\\hat{r}}_{j}{\\parallel }_{2}^{2}-\\parallel {r}_{i}-{r}_{j}{\\parallel }_{2}^{2}\\right)}^{2},$$<\/p>\n<p>\n                    (11)\n                <\/p>\n<p>which penalizes deviations between the predicted and true pairwise distances, ensuring that the spatial relationships between cells are preserved.<\/p>\n<p>The final loss is computed over all slices s \u2208 {1,\u2009.\u2009.\u2009. S} where S denotes the total number of slices:<\/p>\n<p>$${\\mathcal{L}}=\\dfrac{1}{S}\\mathop{\\sum }\\limits_{s=1}^{S}{{\\mathcal{L}}}_{\\,\\text{diff}\\,}^{(s)}.$$<\/p>\n<p>\n                    (12)\n                <\/p>\n<p>We further conducted a comprehensive ablation study on LUNA\u2019s model components, which confirms that LUNA\u2019s attention-based architecture is crucial for capturing complex spatial dependencies between cells, while the pairwise loss function plays a key role in maintaining relational consistency (Supplementary Note <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">8<\/a> and Supplementary Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">36<\/a>).<\/p>\n<p>Corruption process<\/p>\n<p>The diffusion model training begins with a corruption process, where LUNA progressively introduces noise to the true cell locations in an autoregressive manner. This step gradually transitions the true cell locations into pure noise, with the resulting corrupted locations serving as inputs for the subsequent denoising process.<\/p>\n<p>We denote the initial diffusion time step, where no noise has been introduced to the cell locations, as time step 0, where ground-truth spatial information is fully retained. Conversely, the maximum diffusion time step, denoted as T, represents the state where no ground-truth information is preserved, and the locations are sampled from pure Gaussian noise. The time step t is randomly selected from {0, 1, 2, \u2026, T}. The corrupted cell locations at time step t for the slice s are denoted as \\({\\tilde{{R}}}_{t}\\in {{\\mathbb{R}}}^{m\\times 2}\\), where again we omit the slice index s for the ease of notation. From time step t \u2212 1 to t, Gaussian noise is added to the corrupted cell locations \\({\\tilde{{R}}}_{t-1}\\), yielding noisier locations \\({\\tilde{{R}}}_{t}\\) according to a predefined noise scheduler<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 24\" title=\"Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N. &amp; Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In Proc. 32nd International Conference on Machine Learning (PMLR, 2015).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR24\" id=\"ref-link-section-d36180078e4779\" rel=\"nofollow noopener\" target=\"_blank\">24<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 25\" title=\"Ho, J., Jain, A. &amp; Abbeel, P. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems Vol. 33 (Curran Associates, 2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR25\" id=\"ref-link-section-d36180078e4782\" rel=\"nofollow noopener\" target=\"_blank\">25<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 79\" title=\"Song, J., Meng, C. &amp; Ermon, S. Denoising diffusion implicit models. In 9th Int. Conference on Learning Representations (2021).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR79\" id=\"ref-link-section-d36180078e4785\" rel=\"nofollow noopener\" target=\"_blank\">79<\/a>. This noise scheduler is controlled by the noise schedule exponent, which controls how much noise is injected or removed at each time step of the reverse diffusion process and governs the randomness during sampling<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 80\" title=\"Vignac, C., Osman, N., Toni, L. &amp; Frossard, P. Midi: mixed graph and 3D denoising diffusion for molecule generation. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases (Springer, 2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR80\" id=\"ref-link-section-d36180078e4789\" rel=\"nofollow noopener\" target=\"_blank\">80<\/a>. At time step T, the true cell locations \\({{R}}_{gt}={\\tilde{{R}}}_{0}\\) are transformed into corrupted cell locations \\({\\tilde{{R}}}_{T}\\) that have a standard Gaussian distribution. The conditional distribution is defined as:<\/p>\n<p>$${q}_{\\phi }({\\tilde{{R}}}_{t}| {\\tilde{{R}}}_{t-1})={\\mathcal{N}}\\left({\\tilde{{R}}}_{t}| \\sqrt{{\\alpha }_{t}}{\\tilde{{R}}}_{t-1},(1-{\\alpha }_{t}){I}\\right),$$<\/p>\n<p>\n                    (13)\n                <\/p>\n<p>where q\u03d5(\u2009\u22c5\u2009\u2223\u2009\u22c5\u2009) represents the corruption process with a noise scheduler \u03d5 that conditionally transitions the cell location distribution from less corrupted to more corrupted states. \\({\\mathcal{N}}(\\cdot | \\cdot ,\\cdot)\\) denotes a Gaussian distribution, and I is the identity matrix. The noise scheduler \u03d5, regulated by hyperparameters {\u03b1t}, controls the balance between retaining the original cell locations and adding noise and governs the randomness during sampling.<\/p>\n<p>To mitigate computational complexity, we compute the conditional distribution of corrupted cell locations given the true cell locations Rgt, rather than from the previous diffusion step<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 25\" title=\"Ho, J., Jain, A. &amp; Abbeel, P. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems Vol. 33 (Curran Associates, 2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR25\" id=\"ref-link-section-d36180078e4974\" rel=\"nofollow noopener\" target=\"_blank\">25<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 81\" title=\"Chan, S. H. Tutorial on diffusion models for imaging and vision. Found. Trends Comput. Graph. Vis. 16, 322&#x2013;471 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR81\" id=\"ref-link-section-d36180078e4977\" rel=\"nofollow noopener\" target=\"_blank\">81<\/a>:<\/p>\n<p>$${q}_{\\phi }({\\tilde{{R}}}_{t}| {\\tilde{{R}}}_{0})={\\mathcal{N}}\\left({\\tilde{{R}}}_{t}| \\sqrt{{\\overline{\\alpha }}_{t}}{\\tilde{{R}}}_{0},(1-{\\overline{\\alpha }}_{t}){I}\\right).$$<\/p>\n<p>\n                    (14)\n                <\/p>\n<p>Sampling from this conditional distribution is equivalent to adding Gaussian noise to the true cell locations. As shown in ref. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 81\" title=\"Chan, S. H. Tutorial on diffusion models for imaging and vision. Found. Trends Comput. Graph. Vis. 16, 322&#x2013;471 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR81\" id=\"ref-link-section-d36180078e5200\" rel=\"nofollow noopener\" target=\"_blank\">81<\/a>, the corrupted cell locations are computed as:<\/p>\n<p>$${\\tilde{{R}}}_{t}=\\sqrt{{\\overline{\\alpha }}_{t}}{\\tilde{{R}}}_{0}+\\sqrt{(1-{\\overline{\\alpha }}_{t})}\\epsilon ,$$<\/p>\n<p>\n                    (15)\n                <\/p>\n<p>where \\({\\overline{\\alpha }}_{t}=\\mathop{\\prod }\\nolimits_{i = 1}^{t}{\\alpha }_{i}\\), and \u03f5 is drawn from a Gaussian distribution with mean 0 and variance I (\\(\\epsilon \\sim {\\mathcal{N}}(0,{I})\\)). As t progresses from 0 to T, the cell locations become increasingly corrupted until they are indistinguishable from white noise. At t = T, the corrupted locations \\({\\tilde{{R}}}_{T}\\) are sampled purely from Gaussian noise, with \\({\\overline{\\alpha }}_{T}=0\\). To ensure robustness to translations, we additionally subtract the center of mass from the noise \u03f5 and the data slices \\({\\tilde{{R}}}_{0}\\), thus working with distributions defined in the subspace where the center of mass is fixed to 0 (refs. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 82\" title=\"Xu, M. et al. GeoDiff: a geometric diffusion model for molecular conformation generation. In 10th International Conference on Learning Representations (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR82\" id=\"ref-link-section-d36180078e5570\" rel=\"nofollow noopener\" target=\"_blank\">82<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 83\" title=\"Hoogeboom, E., Satorras, V. G., Vignac, C. &amp; Welling, M. Equivariant diffusion for molecule generation in 3D. In Proc. 39th International Conference on Machine Learning Vol. 162, 8867&#x2013;8887 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR83\" id=\"ref-link-section-d36180078e5573\" rel=\"nofollow noopener\" target=\"_blank\">83<\/a>).<\/p>\n<p>Denoising process<\/p>\n<p>Given the corrupted locations, we train the LUNA model to recover the true cell locations by reversing the corruption process using gene expression profiles. We denote the model as \u03bc\u03b8(\u2009\u22c5\u2009,\u2009\u22c5\u2009,\u2009\u22c5\u2009) where \u03b8 represents all model parameters. LUNA progressively denoises the corrupted cell locations \\({\\tilde{{R}}}_{t}\\) producing less corrupted locations \\({\\tilde{{R}}}_{t-1}\\) given time step t, more corrupted locations \\({\\tilde{{R}}}_{t}\\) at the time step t, and the molecular features X.<\/p>\n<p>Eventually, LUNA learns to generate clean cell locations from pure white noise, transitioning from t = T to t = 0. To achieve this, the model first predicts the clean cell locations \\(\\hat{{R}}\\) using the learned network \u03bc\u03b8(\u2009\u22c5\u2009,\u2009\u22c5\u2009,\u2009\u22c5\u2009). It then interpolates between the corrupted locations \\({\\tilde{{R}}}_{t}\\) and the predicted clean locations \\(\\hat{{R}}\\), producing less corrupted locations for the next diffusion step:<\/p>\n<p>$${\\tilde{{R}}}_{t-1}=\\dfrac{(1-{\\overline{\\alpha }}_{t-1})\\sqrt{{\\alpha }_{t}}}{1-{\\overline{\\alpha }}_{t}}{\\tilde{{R}}}_{t}+\\dfrac{(1-{\\alpha }_{t})\\sqrt{{\\overline{\\alpha }}_{t-1}}}{1-{\\overline{\\alpha }}_{t}}\\hat{{R}}.$$<\/p>\n<p>\n                    (16)\n                <\/p>\n<p>Inference phase<\/p>\n<p>Once the model \u03bc\u03b8(\u2009\u22c5\u2009,\u2009\u22c5\u2009,\u2009\u22c5\u2009) is trained, LUNA generates cell locations based on the molecular features of the cells in the test set \\({{X}}_{ts}\\in {{\\mathbb{R}}}^{{m}_{ts}\\times d}\\). The inference process starts by sampling locations from a normal distribution \\(\\epsilon \\sim {\\mathcal{N}}(0,{I})\\), where \\(\\epsilon \\in {{\\mathbb{R}}}^{{m}_{ts}\\times 2}\\). The noisy locations, Rts,T = \u03f5 are then refined through a sequence of diffusion steps.<\/p>\n<p>At each step t, the model takes the noisy locations Rts,t, the molecular features Xts, and the time step t as inputs to predict the denoised locations for the next time step t \u2212 1:<\/p>\n<p>$${{R}}_{ts,t-1}=\\dfrac{(1-{\\overline{\\alpha }}_{t-1})\\sqrt{{\\alpha }_{t}}}{1-{\\overline{\\alpha }}_{t}}{{R}}_{ts,t}+\\dfrac{(1-{\\alpha }_{t})\\sqrt{{\\overline{\\alpha }}_{t-1}}}{1-{\\overline{\\alpha }}_{t}}{\\mu }_{\\theta }({{R}}_{ts,t},{{X}}_{ts},t).$$<\/p>\n<p>\n                    (17)\n                <\/p>\n<p>This process is repeated for each time step, iterating from t = {T, .\u2009.\u2009., 0} until the model generates the final clean cell locations at t = 0.<\/p>\n<p>Hyperparameters<\/p>\n<p>We use a consistent learning rate of 5 \u00d7 10\u22124 across all experiments, with a maximum diffusion time of 1,000 steps and a cosine noise schedule characterized by \u03bd = 2, which dictates the noise addition rate to the coordinates. A detailed analysis of hyperparameter selection and robustness to different values is provided in Supplementary Note <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">4<\/a> and Supplementary Figs. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">37<\/a> and <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM1\" rel=\"nofollow noopener\" target=\"_blank\">38<\/a>.<\/p>\n<p>Xenium data collection<\/p>\n<p>We generate a new spatial transcriptomics dataset using Xenium. Animal husbandry and experimental procedures adhered to the Swiss Federal Veterinary Office guidelines and were authorized by the Cantonal Veterinary Office (cantonal animal license no. VD3499).<\/p>\n<p>Animal procedures<\/p>\n<p>C57BL\/6J male mice were group-housed, with a maximum of four animals per cage, at 22\u2009\u00b0C and 50\u201360% relative humidity, under a 12-h light\u2013dark cycle. At 8 weeks of age, mice were anesthetized with a ketamine\/xylazine cocktail prepared in sterile saline. Once fully anesthetized, mice were placed in a stereotaxic frame. The head was shaved, Viscotears was applied to protect the eyes, and the scalp was disinfected with liquid Betadine solution. After incision, connective tissue was removed to expose the skull and identify the bregma landmark for unilateral dorsal striatum injections.<\/p>\n<p>Stereotaxic coordinates relative to bregma were anteroposterior +0.6\u2009mm, mediolateral +2.0\u2009mm and dorsoventral \u22122.6\u2009mm. A small hole was drilled into the skull, preserving the dura mater, and 2\u2009\u03bcl of mouse wild-type PFFs at a concentration of 2.5\u2009\u03bcg\u2009\u03bcl\u22121 were injected into the right hemisphere at a flow rate of 0.4\u2009\u03bcl\u2009min\u22121 using a Hamilton syringe. The needle was left in place for 5\u2009min post-injection before slow retraction to minimize backflow and was cleaned from blood to avoid clogging. The incision was sutured, Betadine gel was applied and animals were monitored in a heated recovery cage until fully awake. Postoperative well-being was assessed daily in accordance with animal license scoring sheets.<\/p>\n<p>Tissue preparation for Xenium<\/p>\n<p>Xenium was performed on four C57BL\/6J mice: two wild-type controls and two \u03b1-synuclein PFF-injected animals collected at 3MPI. One 3MPI animal was excluded before any downstream analysis because its coronal sections were not anatomically matched to the control sections, showing a systematic spatial offset in the sampled planes that precluded reliable cross-sample comparison. All analyses in this study, and the dataset deposited on figshare, are based on the remaining three animals (two control and one 3MPI). Control and 3MPI mice were killed via overdose of a ketamine\/xylazine cocktail and brains were rapidly removed. Brains were embedded in Tissue-Tek O.C.T. compound (cat. no. 4583) within 10 \u00d7 10 \u00d7 5-mm cryomolds (Tissue-Tek, cat. no. 4565) and frozen by submersion in dry-ice-chilled (approximately \u221270\u2009\u00b0C) isopentane (Sigma, cat. no. M32631). Frozen embedded brains were maintained on dry ice until transfer to \u221280\u2009\u00b0C storage.<\/p>\n<p>Coronal sections (10\u2009\u03bcm) were cut on a Leica cryostat and mounted onto Xenium capture slides (10x Genomics, cat. no. 10006559). For each brain, one coronal section targeting the amygdala (\u22121.70\u2009mm relative to bregma) and one targeting the striatum (+0.6 to \u22121\u2009mm relative to bregma) were collected. Two sections were placed per capture slide, which were returned to \u221280\u2009\u00b0C until processing. The predesigned 248-gene Xenium Mouse Brain Gene Expression panel was profiled across all sections on the Xenium in situ platform (10x Genomics).<\/p>\n<p>Post-Xenium immunofluorescence<\/p>\n<p>Following completion of the Xenium runs, slides were stored in PBS at 4\u2009\u00b0C. For immunofluorescence staining, tissues were permeabilized with PBS containing 0.5% bovine serum albumin (BSA) and 0.1% Triton X-100, blocked with 2% BSA in PBS and then incubated overnight at 4\u2009\u00b0C with primary antibody against phosphorylated Ser129 \u03b1-synuclein (pSer129 \u03b1-synuclein, clone EP1536Y, Abcam ab51253, RRID:AB_869973) at 1:1,000 dilution, followed by a secondary antibody (Invitrogen A32731, polyclonal, Alexa488) at 1:500 dilution.<\/p>\n<p>Imaging was performed using a Leica DMi8 epifluorescence microscope equipped with a Lumencor SPECTRA X LED light source (nIR, 90-10172), a Leica DFC9000 GTC sCMOS camera (11547007) and a \u00d720 HC PC APO objective (NA 0.8, air), yielding a pixel size of 0.34\u2009\u03bcm. Images were acquired with 10% tile overlap to cover the entire tissue section, collecting between 8 and 12 z-planes with 1-\u03bcm spacing.<\/p>\n<p>Anatomical registration<\/p>\n<p>Anatomical registration was performed using Aligning Big Brains and Atlases (<a href=\"https:\/\/go.epfl.ch\/abba\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/go.epfl.ch\/abba<\/a>)<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 84\" title=\"Chiaruttini, N. et al. ABBA+ BraiAn, an integrated suite for whole-brain mapping, reveals brain-wide differences in immediate-early genes induction upon learning. Cell Rep. &#010;                https:\/\/doi.org\/10.1016\/j.celrep.2025.115876&#010;                &#010;               (2025).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR84\" id=\"ref-link-section-d36180078e6679\" rel=\"nofollow noopener\" target=\"_blank\">84<\/a>, which combines affine transformations and nonlinear warping with anatomical border-guided feature registration. Images were automatically aligned to the Allen Brain Atlas Common Coordinate Framework version 3 (CCFv3), and the alignment was subsequently manually refined to ensure precise anatomical correspondence.<\/p>\n<p>Immunofluorescence data processing<\/p>\n<p>2D images were obtained from the acquired immunofluorescence stacks by performing maximum-intensity projection channelwise on the raw stacks. The immunofluorescence images were then stitched into a mosaic image using ASHLAR<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 85\" title=\"Muhlich, J. L. et al. Stitching and registering highly multiplexed whole-slide images of tissues and tumors using ASHLAR. Bioinformatics 38, 4613&#x2013;4621 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR85\" id=\"ref-link-section-d36180078e6691\" rel=\"nofollow noopener\" target=\"_blank\">85<\/a>. Only the 4\u2032,6-diamidino-2-phenylindole (DAPI) channel was used to compute the corrected stitched coordinates. The immunofluorescence images were then aligned to the Xenium images by running the software wsireg<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 86\" title=\"Patterson, H. Multi-modal whole slide image registration (wsireg), v.0.3.8. GitHub &#010;                https:\/\/github.com\/NHPatterson\/wsireg&#010;                &#010;               (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR86\" id=\"ref-link-section-d36180078e6695\" rel=\"nofollow noopener\" target=\"_blank\">86<\/a>, a Python wrapper of elastix<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 87\" title=\"Klein, S., Staring, M., Murphy, K., Viergever, M. A. &amp; Pluim, J. P. W. elastix: a toolbox for intensity-based medical image registration. IEEE Trans. Med. Imaging 29, 196&#x2013;205 (2010).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR87\" id=\"ref-link-section-d36180078e6699\" rel=\"nofollow noopener\" target=\"_blank\">87<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 88\" title=\"Shamonin, D. et al. Fast parallel image registration on CPU and GPU for diagnostic classification of Alzheimer&#x2019;s disease. Front. Neuroinform. &#010;                https:\/\/doi.org\/10.3389\/fninf.2013.00050&#010;                &#010;               (2014).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR88\" id=\"ref-link-section-d36180078e6702\" rel=\"nofollow noopener\" target=\"_blank\">88<\/a>. Each image transformation was computed using only the DAPI channel of both acquisitions, and the same obtained transformation was applied to the other channels of the immunofluorescence images (no warping was applied to the Xenium data in the process). To calculate the \u03b1-synuclein intensity level per cell, we first normalized the aligned \u03b1-synuclein channel by applying percentile-based normalization, in which we transformed the intensity values of the image so that the first percentile is mapped to 0 and the 99.8th percentile is mapped to 1. The results from the normalization were then clipped to the \\(\\left[0,1\\right]\\) intensity range. The median normalized \u03b1-synuclein intensity per cell was then calculated by sequentially subsetting the normalized \u03b1-synuclein channel using the segmentation masks obtained from Xenium and aggregating accordingly.<\/p>\n<p>Cell annotation<\/p>\n<p>To annotate the Xenium data at the single-cell level, we used the scRNA-seq data published elsewhere<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 89\" title=\"Yao, Z. et al. A high-resolution transcriptomic and spatial atlas of cell types in the whole mouse brain. Nature 624, 317&#x2013;332 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR89\" id=\"ref-link-section-d36180078e6736\" rel=\"nofollow noopener\" target=\"_blank\">89<\/a> as a reference for label transfer. We downloaded all the given single-cell references (v.2 and v.3) and then concatenated them to obtain a single h5ad data file. During the concatenation process, we randomly subsampled the data by a factor of 4 (we kept 25% of the single cells) to alleviate posterior computational workload. We then ran Tangram<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 14\" title=\"Biancalani, T. et al. Deep learning and alignment of spatially resolved single-cell transcriptomes with Tangram. Nat. Methods 18, 1352&#x2013;1362 (2021).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#ref-CR14\" id=\"ref-link-section-d36180078e6740\" rel=\"nofollow noopener\" target=\"_blank\">14<\/a> for each Xenium dataset using the preprocessed single-cell data as reference. We ran Tangram in its default settings except for the run mode, for which we used mode\u2009=\u2009\u2018clusters\u2019. This mode runs the mapping at the cluster level and substantially reduces computational complexity. We annotated the Xenium data using 34 clusters.<\/p>\n<p>Reporting summary<\/p>\n<p>Further information on research design is available in the <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"supplementary material anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03332-2#MOESM2\" rel=\"nofollow noopener\" target=\"_blank\">Nature Portfolio Reporting Summary<\/a> linked to this article.<\/p>\n","protected":false},"excerpt":{"rendered":"Overview of LUNA LUNA is a diffusion-based generative model designed to generate spatial locations of cells from their&hellip;\n","protected":false},"author":2,"featured_media":1353647,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_share_on_mastodon":"0"},"categories":[8],"tags":[7445,114707,114706,20597,3968,12308,3690,25997,70,7154,7448,16,15],"class_list":["post-1353646","post","type-post","status-publish","format-standard","has-post-thumbnail","category-science","tag-bioinformatics","tag-biological-microscopy","tag-biological-techniques","tag-biomedical-engineering-biotechnology","tag-general","tag-life-sciences","tag-machine-learning","tag-proteomics","tag-science","tag-software","tag-transcriptomics","tag-uk","tag-united-kingdom"],"share_on_mastodon":{"url":"https:\/\/pubeurope.com\/@uk\/117728017344147991","error":""},"_links":{"self":[{"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/posts\/1353646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/comments?post=1353646"}],"version-history":[{"count":0,"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/posts\/1353646\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/media\/1353647"}],"wp:attachment":[{"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/media?parent=1353646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/categories?post=1353646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.europesays.com\/uk\/wp-json\/wp\/v2\/tags?post=1353646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}