<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Computational Modeling | Mahyar's world 🌏</title><link>https://mahyar-osn.github.io/tag/computational-modeling/</link><atom:link href="https://mahyar-osn.github.io/tag/computational-modeling/index.xml" rel="self" type="application/rss+xml"/><description>Computational Modeling</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Sun, 15 Dec 2024 00:00:00 +0000</lastBuildDate><image><url>https://mahyar-osn.github.io/media/icon_hu35e4e9c9135f02752aab27d124db531b_75212_512x512_fill_lanczos_center_3.png</url><title>Computational Modeling</title><link>https://mahyar-osn.github.io/tag/computational-modeling/</link></image><item><title>Temporal Predictive Coding</title><link>https://mahyar-osn.github.io/projects/temporal-predictive-coding/</link><pubDate>Sun, 15 Dec 2024 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/temporal-predictive-coding/</guid><description>&lt;p>&lt;strong>Authors&lt;/strong>: Beren Millidge, Mufeng Tang, Mahyar Osanlouy, Nicol S. Harper, Rafal Bogacz&lt;br>
&lt;strong>Publication&lt;/strong>: PLOS Computational Biology (April 2024)&lt;br>
&lt;strong>Code&lt;/strong>: &lt;a href="https://github.com/C16MItang/temporal-predictive-coding" target="_blank" rel="noopener">GitHub Repository&lt;/a>&lt;br>
&lt;strong>Read the paper&lt;/strong>: &lt;a href="https://doi.org/10.1371/journal.pcbi.1011183" target="_blank" rel="noopener">PLOS Computational Biology&lt;/a>&lt;/p>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>How does the brain process dynamic sensory inputs; like tracking a moving object or predicting the next note in a melody?
In this work, we propose &lt;strong>temporal predictive coding (tPC)&lt;/strong>, a biologically plausible neural framework that extends
classical predictive coding to handle time-varying stimuli. By unifying Bayesian inference, neural dynamics,
and synaptic plasticity, tPC explains how cortical circuits might learn to predict and adapt to continuously
changing environments.&lt;/p>
&lt;hr>
&lt;h2 id="key-contributions">Key Contributions&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>A unified model for temporal prediction&lt;/strong>:
tPC bridges predictive coding (for static inputs) and Kalman filtering (for dynamic systems), enabling online inference and learning without complex matrix operations.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Biologically plausible implementation&lt;/strong>:
The model uses only &lt;strong>local computations&lt;/strong> and &lt;strong>Hebbian plasticity&lt;/strong>, aligning with known cortical microcircuit architecture.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Motion-sensitive receptive fields&lt;/strong>:
When trained on natural movies, tPC neurons develop Gabor-like, direction-selective receptive fields—matching properties of early visual cortex neurons.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Nonlinear generalization&lt;/strong>:
The framework extends to nonlinear systems (e.g., pendulum dynamics), outperforming linear models in complex tasks.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="methodology">Methodology&lt;/h2>
&lt;h3 id="core-principles">Core Principles&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Generative model&lt;/strong>: Hidden states evolve via a Markov process, with observations generated from hidden states.&lt;/li>
&lt;/ul>
&lt;p>$$
x_k = A f(x_{k-1}) + B u_k + \omega_x
$$&lt;/p>
&lt;p>$$
y_k = C f(x_k) + \omega_y
$$&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Free energy minimization&lt;/strong>:
Neurons minimize prediction errors at two levels:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Sensory errors&lt;/strong>: Mismatch between predicted and actual observations.&lt;/li>
&lt;li>&lt;strong>Temporal errors&lt;/strong>: Mismatch between predicted and inferred hidden states.&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Neural implementation&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Explicit prediction error neurons or dendritic computations.&lt;/li>
&lt;li>Synaptic updates follow local Hebbian rules (e.g., ΔA ∝ prediction error × presynaptic activity).&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h3 id="comparison-to-kalman-filtering">Comparison to Kalman Filtering&lt;/h3>
&lt;ul>
&lt;li>tPC approximates Kalman filtering but avoids tracking posterior uncertainty.&lt;/li>
&lt;li>Achieves similar accuracy in linear tracking tasks with simpler computations.&lt;/li>
&lt;/ul>
&lt;p>$$
\hat{x}_k^- = A \hat{x}_{k-1} + B u_k
$$&lt;/p>
&lt;p>$$
\hat{x}_k = \hat{x}_k^- + K(y_k - C\hat{x}_k^-)
$$&lt;/p>
&lt;p>$$
K = \Sigma_x C^T \left[C \Sigma_x C^T + \Sigma_y \right]^{-1}
$$&lt;/p>
&lt;hr>
&lt;h2 id="results">Results&lt;/h2>
&lt;h3 id="1-robust-tracking-of-dynamic-states">1. Robust Tracking of Dynamic States&lt;/h3>
&lt;ul>
&lt;li>tPC accurately infers position, velocity, and acceleration from noisy observations, even with scrambled sensory inputs.&lt;/li>
&lt;li>Matches Kalman filter performance with 5 inference steps (MSE difference &amp;lt; 1%).&lt;/li>
&lt;/ul>
&lt;h3 id="2-learning-synaptic-weights">2. Learning Synaptic Weights&lt;/h3>
&lt;ul>
&lt;li>Hebbian plasticity enables online learning of dynamics (&lt;strong>A&lt;/strong>, &lt;strong>B&lt;/strong>) and observation (&lt;strong>C&lt;/strong>) matrices.&lt;/li>
&lt;li>Learns to predict observations even with random initial weights.&lt;/li>
&lt;/ul>
&lt;h3 id="3-biological-receptive-fields">3. Biological Receptive Fields&lt;/h3>
&lt;ul>
&lt;li>Trained on natural movies, tPC develops:
&lt;ul>
&lt;li>&lt;strong>Spatiotemporal receptive fields&lt;/strong> with motion direction selectivity.&lt;/li>
&lt;li>Gabor-like filters resembling V1 simple cells.
&lt;img src="journal.pcbi.1011183.g006.PNG" alt="Receptive fields" width="600">
&lt;em>Representations developed by the model when trained with patches from movies of dynamic natural scenes.
A: First 10 frames of 2 example training movies used in our experiments. Patches extracted from movies obtained
at websites pexels.com, pixabay.com and commons.wikimedia.org (for wikimedia attributions
see &lt;a href="https://github.com/C16Mftang/temporal-predictive-coding%29" target="_blank" rel="noopener">https://github.com/C16Mftang/temporal-predictive-coding)&lt;/a>. B: The projective fields C developed Gabor-like
filters after training. C: Space-time receptive fields developed by hidden neurons of the tPC model.
&lt;a href="https://doi.org/10.1371/journal.pcbi.1011183.g006" target="_blank" rel="noopener">https://doi.org/10.1371/journal.pcbi.1011183.g006&lt;/a>&lt;/em>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h3 id="4-nonlinear-dynamics">4. Nonlinear Dynamics&lt;/h3>
&lt;ul>
&lt;li>Outperforms linear models in predicting pendulum motion (20% lower MSE).&lt;/li>
&lt;li>Captures nonlinearities where linear approximations fail (e.g., large-angle oscillations).
&lt;img src="journal.pcbi.1011183.g007.PNG" alt="Receptive fields" width="800">
&lt;em>&lt;strong>Simulations of the pendulum&lt;/strong>. &lt;strong>A:&lt;/strong> A free-body diagram of a simple pendulum that has a mass m attached to a string
with length $L$. Also shown are the forces applied to the mass. The restoring force $-mg sin \theta$ is a net force toward
the equilibrium position. &lt;strong>B:&lt;/strong> A phase portrait of the pendulum simulation showing the result of our linear versus
nonlinear models prediction for the ground-truth data. The vector field (i.e. set of small arrows) was
created by computing the derivatives of $\frac{d\theta_1}{dt}$ and $\frac{d\theta_2}{dt}$ at $t = 0$ a grid of 30
points over the range of $-\pi$ to $\pi$ and -4 to +4 for $\theta_1$ and $\theta_2$ respectively. &lt;strong>C:&lt;/strong> The barplot
shows the difference between the mean prediction errors of the linear model versus the nonlinear model from 100
simulations with varying noise profiles. The mean errors are significantly different $(p \ll 0.001)$
&lt;a href="https://doi.org/10.1371/journal.pcbi.1011183.g007" target="_blank" rel="noopener">https://doi.org/10.1371/journal.pcbi.1011183.g007&lt;/a>&lt;/em>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="implications">Implications&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Theoretical&lt;/strong>: Provides a unified account of static and dynamic sensory processing under predictive coding.&lt;/li>
&lt;li>&lt;strong>Experimental&lt;/strong>: Predicts neural responses to time-varying stimuli and receptive field properties.&lt;/li>
&lt;li>&lt;strong>Translational&lt;/strong>: Framework for neuromorphic hardware and efficient machine learning models.&lt;/li>
&lt;/ul>
&lt;hr></description></item><item><title>Temporal Predictive Coding: A New Framework for Neural Processing of Dynamic Stimuli</title><link>https://mahyar-osn.github.io/post/temporal-predictive-coding/</link><pubDate>Fri, 15 Nov 2024 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/post/temporal-predictive-coding/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>One of the most fascinating aspects of the brain is its ability to process and predict dynamic sensory inputs that
continuously change over time. From tracking a moving object to predicting the next note in a melody, our brains are
remarkably adept at temporal prediction. In a recent paper published in PLOS Computational Biology titled
&amp;ldquo;Predictive coding networks for temporal prediction,&amp;rdquo; my colleagues and I proposed a new computational framework that
may help explain how the brain accomplishes this feat.&lt;/p>
&lt;p>Predictive coding has emerged as an influential theoretical model for understanding cortical function. The core idea
is deceptively simple: the brain constantly generates predictions of incoming sensory inputs and compares these
predictions with actual sensory data. Any mismatch results in prediction errors that drive learning and perceptual
processing. This framework has successfully explained many neural phenomena and receptive field properties in visual cortex.&lt;/p>
&lt;p>However, most previous predictive coding models have focused on static inputs, neglecting the temporal dimension that
is crucial for real-world perception. Our work addresses this gap by extending predictive coding to the temporal domain
while maintaining its elegant biological implementation.&lt;/p>
&lt;h2 id="the-temporal-predictive-coding-model">The Temporal Predictive Coding Model&lt;/h2>
&lt;h3 id="generative-model-and-free-energy">Generative Model and Free Energy&lt;/h3>
&lt;p>At the foundation of our temporal predictive coding (tPC) model is a Hidden Markov Model (HMM) structure,
which assumes that observations are generated by hidden states that evolve according to a Markov process.
Mathematically, we can express this generative model as:&lt;/p>
&lt;p>$$
x_k = A f(x_{k-1}) + B u_k + \omega_x
$$&lt;/p>
&lt;p>$$
y_k = C f(x_k) + \omega_y
$$&lt;/p>
&lt;p>Where:&lt;/p>
&lt;ul>
&lt;li>$x_{k}$ is the hidden state at time $k$.&lt;/li>
&lt;li>$y_{k}$ is the observed sensory input at time $k$.&lt;/li>
&lt;li>$u_{k}$ is the control input at time $k$.&lt;/li>
&lt;li>$A$ is the dynamics matrix governing state transitions.&lt;/li>
&lt;li>$B$ is the control matrix.&lt;/li>
&lt;li>$C$ is the observation matrix.&lt;/li>
&lt;li>$f$ is a potentially nonlinear function.&lt;/li>
&lt;li>$\omega_x$ and $\omega_y$ are Gaussian process and observation noise.&lt;/li>
&lt;/ul>
&lt;p>The goal is to infer the current hidden state $x_{k}$ given the current observation $y_{k}$ and previous state estimate
$y_{1:k-1}$. To achieve this, we formulate a variational free energy objective:&lt;/p>
&lt;p>$$
\mathcal{F}_k = \frac{1}{2}(y_k - C f(x_k))^T \Sigma_y^{-1} (y_k - C f(x_k)) + \frac{1}{2}(x_k - A f(\hat{x}_{k-1}) - B u_k)^T \Sigma_x^{-1} (x_k - A f(\hat{x}_{k-1}) - B u_k)
$$&lt;/p>
&lt;p>This free energy can be understood as the sum of two weighted prediction errors:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Sensory prediction errors&lt;/strong>: The difference between observed and predicted sensory inputs $y_k - Cf(x_k)$.&lt;/li>
&lt;li>&lt;strong>Temporal prediction errors&lt;/strong>: The difference between the current state and the prediction from the previous state
$x_k - Af(\hat{x}_{k-1}) - Bu_k$.&lt;/li>
&lt;/ol>
&lt;p>Each prediction error is weighted by the precision (inverse variance) of the corresponding noise distribution,
ensuring that more reliable predictions carry more weight.&lt;/p>
&lt;h2 id="neural-implementation">Neural Implementation&lt;/h2>
&lt;p>A crucial contribution of our work is showing how temporal predictive coding can be implemented in neural circuits
using biologically plausible mechanisms. The neural dynamics for inferring the hidden state follow gradient descent
on the free energy:&lt;/p>
&lt;p>$$
\tau \frac{d x_k}{d t} = -\epsilon_x + f'(x_k) \odot C^T \epsilon_y
$$&lt;/p>
&lt;p>Where $\epsilon_x$ and $\epsilon_y$ are precision-weighted prediction errors:&lt;/p>
&lt;p>$$
\epsilon_y = \Sigma_y^{-1} \left( y_k - C f(x_k) \right)
$$&lt;/p>
&lt;p>$$
\epsilon_x = \Sigma_x^{-1} \left( x_k - A f(\hat{x}_{k-1}) - B u_k \right)
$$&lt;/p>
&lt;h3 id="we-proposed-multiple-neural-circuit-implementations-of-this-model">We proposed multiple neural circuit implementations of this model:&lt;/h3>
&lt;ol>
&lt;li>Network with explicit prediction error neurons: Where dedicated neurons represent prediction errors at each level of processing&lt;/li>
&lt;li>Dendritic computing implementation: Where prediction errors are computed as differences between somatic and dendritic potentials&lt;/li>
&lt;li>Single-iteration implementation: A simplified version that performs single updates per time step&lt;/li>
&lt;/ol>
&lt;h3 id="neural-circuit-implementation">Neural circuit implementation&lt;/h3>
&lt;p>Importantly, all of these implementations rely on local information and Hebbian plasticity.
The synaptic weights are updated according to:&lt;/p>
&lt;p>$$
\Delta A = \eta \epsilon_x f(\hat{x}_{k-1})^T
$$&lt;/p>
&lt;p>$$
\Delta B = \eta \epsilon_x u_k^T
$$&lt;/p>
&lt;p>$$
\Delta C = \eta \epsilon_y f(x_k)^T
$$&lt;/p>
&lt;p>These update rules are Hebbian in nature because they depend only on the activities of pre- and post-synaptic neurons,
making them biologically plausible.&lt;/p>
&lt;h2 id="relationship-to-kalman-filtering">Relationship to Kalman Filtering&lt;/h2>
&lt;p>An intriguing property of our model is its relationship to the Kalman filter, which is the optimal solution for
linear Gaussian filtering problems. We demonstrated that both Kalman filtering and temporal predictive coding can be
derived as special cases of Bayesian filtering, with the key difference being how they handle uncertainty.&lt;/p>
&lt;p>The Kalman filter propagates uncertainty estimates through time, tracking the full posterior covariance at each step.
In contrast, tPC approximates this by assuming a point estimate (Dirac distribution) for the previous state. Despite
this simplification, our tPC model achieves comparable performance to the Kalman filter in tracking tasks while being
computationally simpler and more biologically plausible.&lt;/p>
&lt;p>For linear systems, the tPC dynamics at equilibrium yield:&lt;/p>
&lt;p>$$
\hat{x}_k^- = A\hat{x}_{k-1} + Bu_k
$$&lt;/p>
&lt;p>$$
\hat{x}_k = \hat{x}_k^- + K(y_k - C\hat{x}_k^-)
$$&lt;/p>
&lt;p>$$
K = \Sigma_x C^T \left[C \Sigma_x C^T + \Sigma_y \right]^{-1}
$$&lt;/p>
&lt;p>This resembles the Kalman filter update equations but with a fixed gain matrix $K$ rather than a dynamically updated one
based on posterior uncertainty.&lt;/p>
&lt;h2 id="experimental-results">Experimental Results&lt;/h2>
&lt;h3 id="performance-in-linear-filtering-tasks">Performance in Linear Filtering Tasks&lt;/h3>
&lt;p>We tested our model on classic tracking problems, where the goal is to infer the hidden state
(position, velocity, acceleration) of an object undergoing unknown acceleration based on noisy observations.
Even with just a few inference steps between observations, tPC achieved performance approaching that of the
optimal Kalman filter.&lt;/p>
&lt;p>A key advantage of our model is its ability to learn the parameters of the generative model (matrices $A$, $B$, and $C$)
using Hebbian plasticity. Even when starting with random matrices, tPC could learn to accurately predict observations.
Interestingly, the model also implicitly encoded noise covariance information in its recurrent connections, without
needing explicit representation of precision matrices.&lt;/p>
&lt;h3 id="motion-sensitive-receptive-fields">Motion-Sensitive Receptive Fields&lt;/h3>
&lt;p>Perhaps most excitingly, when trained on natural movies, our tPC model developed spatiotemporal receptive fields
resembling those observed in the visual cortex. These fields exhibited Gabor-like patterns and direction selectivity,
a hallmark of motion-sensitive neurons in early visual areas.&lt;/p>
&lt;h3 id="nonlinear-extensions">Nonlinear Extensions&lt;/h3>
&lt;p>We extended the model to handle nonlinear dynamics by incorporating nonlinear activation functions. When tested on a
simulated pendulum task, the nonlinear tPC significantly outperformed the linear model, accurately predicting the
pendulum&amp;rsquo;s motion even at extreme angles where nonlinear effects are strongest.&lt;/p>
&lt;h2 id="implications-and-future-directions">Implications and Future Directions&lt;/h2>
&lt;p>Our temporal predictive coding framework has several important implications:&lt;/p>
&lt;ol>
&lt;li>It provides a biologically plausible explanation for how the brain processes dynamic stimuli and performs temporal predictions.&lt;/li>
&lt;li>It demonstrates that complex temporal filtering operations can be implemented in neural circuits using simple, local computations.&lt;/li>
&lt;li>It offers a unified framework that connects normative theories of perception (Bayesian inference) with mechanistic models of neural circuits.&lt;/li>
&lt;li>It suggests that the same computational principles might underlie both static and dynamic sensory processing in the brain.&lt;/li>
&lt;/ol>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>The temporal predictive coding model we&amp;rsquo;ve developed bridges an important gap in our understanding of how the brain
processes dynamic sensory inputs. By extending predictive coding to the temporal domain while maintaining its biological
plausibility, our model provides a compelling computational mechanism for temporal prediction in neural circuits.&lt;/p>
&lt;p>The fact that our model develops receptive fields resembling those in the visual cortex and approximates optimal
filtering solutions suggests that temporal predictive coding may indeed capture fundamental principles of neural
computation in the brain. As we continue to refine these models and test them against empirical data, we hope to
gain deeper insights into the remarkable predictive capabilities of the brain.&lt;/p>
&lt;p>&lt;em>This blog is based on the paper
&amp;ldquo;Predictive coding networks for temporal prediction&amp;rdquo; by Beren Millidge, Mufeng Tang, Mahyar Osanlouy, Nicol S. Harper,
and Rafal Bogacz, published in PLOS Computational Biology, April 2024.&lt;/em> &lt;a href="https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011183" target="_blank" rel="noopener">Link to the paper&lt;/a>&lt;/p></description></item><item><title>3D Reconstruction of Human Olfactory Projection</title><link>https://mahyar-osn.github.io/projects/olfactory/</link><pubDate>Fri, 10 Nov 2023 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/olfactory/</guid><description>&lt;p>&lt;strong>Authors&lt;/strong>: Victoria F Low, Chinchien Lin, Shan Su, Mahyar Osanlouy, Mona Khan, Soroush Safaei, Gonzalo Maso Talou, Maurice A Curtis, Peter Mombaerts&lt;br>
&lt;strong>Publication&lt;/strong>: &lt;em>Communications Biology&lt;/em> (November 2024)&lt;br>
&lt;strong>Code&lt;/strong>: &lt;a href="https://zenodo.org/records/7865523" target="_blank" rel="noopener">Zenodo Repository&lt;/a>&lt;br>
&lt;strong>Interactive 3D Model&lt;/strong>: &lt;a href="https://mip.datavisualiser.cloud.edu.au/neuroglancer/A1147/it13" target="_blank" rel="noopener">Neuroglancer Platform&lt;/a>&lt;/p>
&lt;hr>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>This study presents a computational pipeline to reconstruct the 3D microanatomy of the human olfactory system, from the
nasal cavity to the olfactory bulb—using fluorescence histology, deep learning, and high-performance computing (HPC).
The workflow addresses challenges in processing terabyte-scale datasets and provides new insights into olfactory sensory
neuron (OSN) distribution and axon trajectories.&lt;/p>
&lt;hr>
&lt;h2 id="key-computational-contributions">Key Computational Contributions&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>First end-to-end pipeline&lt;/strong> for large-scale 3D reconstruction of human olfactory tissues (~7.45 cm³ specimen, 1234
sections).&lt;/li>
&lt;li>&lt;strong>CNN-based segmentation&lt;/strong> achieving Dice scores &amp;gt;0.85 for critical structures (OSNs, glomeruli, vasculature).&lt;/li>
&lt;li>&lt;strong>HPC-optimized registration&lt;/strong> reducing banana-effect artifacts via multi-resolution deformable alignment.&lt;/li>
&lt;li>&lt;strong>Public 3D dataset&lt;/strong> enabling interactive exploration of olfactory projection via Neuroglancer.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="methodology">Methodology&lt;/h2>
&lt;h3 id="computational-pipeline">Computational Pipeline&lt;/h3>
&lt;img src="2025-04-13_22-28.png" alt="Receptive fields" width="400">
&lt;p>&lt;em>From fluorescence histology to 3D visualization – click to expand&lt;/em>&lt;/p>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Fluorescence Histology&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Quadruple staining: Hoechst (nuclei), UEA1 (OSNs), OMP (mature OSNs), VGLUT2 (axon terminals).&lt;/li>
&lt;li>Whole-slide scanning: 1.097 µm/pixel resolution, ~2.9 TB raw data.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>CNN Segmentation&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Architecture: Modified 2D U-Net with 4 input channels (Hoechst + 3 markers).&lt;/li>
&lt;li>Training: Bootstrap approach with iterative ground truth expansion (20-45 sections/structure).&lt;/li>
&lt;li>Key layers:
&lt;pre tabindex="0">&lt;code># Simplified U-Net structure
encoder = [Conv2D(8→16→32), MaxPooling2D]
bottleneck = Conv2D(64) + Upsampling2D
decoder = [Conv2D(32→16→8), Concatenate(skip connections)]
&lt;/code>&lt;/pre>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>HPC Registration&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Intra-block&lt;/strong>: Parallel registration of 247 blocks (5 sections each) using SimpleElastix.&lt;/li>
&lt;li>&lt;strong>Inter-block&lt;/strong>: Banana-effect correction via affine + B-spline transformations between blocks.&lt;/li>
&lt;li>Metrics: Mutual information for intensity alignment, DSC for structural consistency.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="results">Results&lt;/h2>
&lt;h3 id="segmentation-performance">Segmentation Performance&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Structure&lt;/th>
&lt;th>Dice Score&lt;/th>
&lt;th>Binary Cross-Entropy&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Vasculature&lt;/td>
&lt;td>0.808&lt;/td>
&lt;td>0.0148&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>OSNs&lt;/td>
&lt;td>0.760&lt;/td>
&lt;td>0.0173&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Glomeruli&lt;/td>
&lt;td>0.779&lt;/td>
&lt;td>0.0017&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;em>OSN segmentation achieved single-cell resolution in sparse regions but grouped cells in dense zones.&lt;/em>&lt;/p>
&lt;h3 id="registration-efficiency">Registration Efficiency&lt;/h3>
&lt;ul>
&lt;li>1082 CPU hours on 96 Intel Xeon Gold 6136 cores&lt;/li>
&lt;li>16% error reduction vs. sequential registration&lt;/li>
&lt;li>Tolerance: ±80 µm axial drift corrected&lt;/li>
&lt;/ul>
&lt;h3 id="key-findings">Key Findings&lt;/h3>
&lt;ol>
&lt;li>&lt;strong>OSN Count&lt;/strong>: ~2.7 million OSNs calculated via morphometric extrapolation (90% CI: 2.4–2.9M).&lt;/li>
&lt;li>&lt;strong>Fila Olfactoria&lt;/strong>: 34 foramina identified in cribriform plate (17/side).&lt;/li>
&lt;li>&lt;strong>Non-uniform Distribution&lt;/strong>: Olfactory epithelium showed serrated borders and posterior-anterior density gradient.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="implications">Implications&lt;/h2>
&lt;h3 id="technical-advancements">Technical Advancements&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Scalable ML&lt;/strong>: Method enables processing of whole-brain datasets (~100x mouse brain volume).&lt;/li>
&lt;li>&lt;strong>Clinical Potential&lt;/strong>: Pipeline adaptable for Parkinson’s/Alzheimer’s studies via α-synuclein/tau staining.&lt;/li>
&lt;li>&lt;strong>Open Science&lt;/strong>: First public 3D olfactory dataset with ~5.8 GB/channel resolution.&lt;/li>
&lt;/ul>
&lt;h3 id="biological-insights">Biological Insights&lt;/h3>
&lt;ul>
&lt;li>Challenges mouse-to-human extrapolation: ~10x fewer OSNs/glomerulus vs. mice.&lt;/li>
&lt;li>Provides baseline for studying SARS-CoV-2 olfactory dysfunction.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="computational-tools-used">Computational Tools Used&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Segmentation&lt;/strong>: TensorFlow U-Net, Fiji for ground truth&lt;/li>
&lt;li>&lt;strong>Registration&lt;/strong>: SimpleElastix, ITK&lt;/li>
&lt;li>&lt;strong>Visualization&lt;/strong>: ParaView, Neuroglancer&lt;/li>
&lt;li>&lt;strong>HPC&lt;/strong>: New Zealand eScience Infrastructure (NeSI)&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Neuroglancer screenshot placeholder" srcset="
/projects/olfactory/2025-04-13_22-30_hu0a3d9e68d0bcba58dbfed67f020b6e7c_1016129_378c0bcc687f8925b56e8df10b0a25fa.webp 400w,
/projects/olfactory/2025-04-13_22-30_hu0a3d9e68d0bcba58dbfed67f020b6e7c_1016129_c29f28f27c7b3ae1fc51e30bdf455294.webp 760w,
/projects/olfactory/2025-04-13_22-30_hu0a3d9e68d0bcba58dbfed67f020b6e7c_1016129_1200x1200_fit_q75_h2_lanczos_3.webp 1200w"
src="https://mahyar-osn.github.io/projects/olfactory/2025-04-13_22-30_hu0a3d9e68d0bcba58dbfed67f020b6e7c_1016129_378c0bcc687f8925b56e8df10b0a25fa.webp"
width="760"
height="564"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Interactive 3D exploration&lt;/em>&lt;/p>
&lt;hr></description></item><item><title>Spatiotemporal patterns in the embryonic heart</title><link>https://mahyar-osn.github.io/projects/embryo/</link><pubDate>Mon, 25 Sep 2023 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/embryo/</guid><description>&lt;p>&lt;strong>Authors&lt;/strong>: Nazanin Ebrahimi, Mahyar Osanlouy, Chris Bradley, Fabiana Kubke, Dane Gerneke, Peter Hunter &lt;br>
&lt;strong>Publication&lt;/strong>: &lt;em>iScience.&lt;/em> (July 2022)&lt;br>
&lt;strong>Dataset&lt;/strong>: &lt;a href="https://doi.org/10.17632/jwj6m5yxct.1" target="_blank" rel="noopener">Mendeley Data&lt;/a>&lt;/p>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>This study presents an innovative hybrid experimental-computational pipeline to investigate the &lt;strong>spatiotemporal growth patterns&lt;/strong> underlying cardiac C-looping in embryonic chick hearts. C-looping is a critical phase in heart development where the straight heart tube transforms into a C-shaped structure, setting the stage for proper chamber formation. Abnormalities during this process are linked to congenital heart defects. The work combines &lt;strong>multi-scale imaging&lt;/strong>, &lt;strong>deep learning-based cell segmentation&lt;/strong>, and &lt;strong>biomechanical modeling&lt;/strong> to bridge cellular dynamics with tissue-level deformations, offering new insights into the mechanisms driving heart morphogenesis.&lt;/p>
&lt;hr>
&lt;h2 id="key-contributions">Key Contributions&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>First 3D multi-scale dataset&lt;/strong> of C-looping hearts, integrating cell-to-organism level data from confocal microscopy and micro-CT.&lt;/li>
&lt;li>&lt;strong>Fully automated 3D myocardial cell segmentation&lt;/strong> using a custom convolutional neural network (CNN), achieving a Dice coefficient of 0.91 ± 0.1.&lt;/li>
&lt;li>&lt;strong>Finite Element (FE) biomechanical models&lt;/strong> capturing spatiotemporal heart geometry changes across four developmental timepoints.&lt;/li>
&lt;li>&lt;strong>Variance-driven analysis&lt;/strong> revealing how inter-cellular space (ICS) and cellular heterogeneity contribute to tissue growth.&lt;/li>
&lt;li>&lt;strong>Open-source pipeline&lt;/strong> for integrating cellular features with tissue-level kinematics, enabling future studies on cardiac morphogenesis.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="methodology">Methodology&lt;/h2>
&lt;h3 id="experimental-workflow">Experimental Workflow&lt;/h3>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Multi-modal imaging&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Confocal microscopy&lt;/strong>: Whole-mount staining (WGA, NCAM-1, DAPI) provided 3D cell-resolution images of myocardial cells.&lt;/li>
&lt;li>&lt;strong>Micro-CT scanning&lt;/strong>: Sub-micron resolution imaging contextualized heart geometry within the entire embryo.&lt;/li>
&lt;li>&lt;strong>Optical clearing&lt;/strong>: Enabled high-resolution imaging while preserving 3D architecture.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Temporal staging&lt;/strong>: Embryos were ordered developmentally using anatomical landmarks and dorsal detachment metrics.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;img src="workflow.jpg" alt="drc-worfklow" width="800">
&lt;h3 id="computational-workflow">Computational Workflow&lt;/h3>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>3D Deep Learning for Cell Segmentation&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>A &lt;strong>3D U-Net architecture&lt;/strong> was trained to segment individual myocardial cells from confocal stacks.&lt;/li>
&lt;li>Achieved 91% Dice similarity compared to manual segmentation, reducing processing time from &lt;strong>8 hours to seconds&lt;/strong> per 100 cells.&lt;/li>
&lt;li>Addressed memory constraints via a traceable slicing-merging algorithm for large-scale image processing.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Finite Element Modeling&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Anatomically accurate FE meshes were fitted to heart geometries using OpenCMISS.&lt;/li>
&lt;li>RMS fitting error &amp;lt; 3 μm enabled precise representation of tissue deformation.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Spatiotemporal Analysis&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Cellular features (volume, anisotropy, orientation) were mapped onto FE meshes.&lt;/li>
&lt;li>&lt;strong>General Linear Model (GLM)&lt;/strong> linked tissue growth to cellular dynamics (cell number, ICS volume, anisotropy).&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;img src="segmentation.png" alt="drc-worfklow" width="800">
&lt;hr>
&lt;h2 id="results">Results&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Differential Growth Patterns&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Ventral regions showed ~2x higher tissue growth than dorsal regions, driven by increased cell proliferation and ICS expansion.&lt;/li>
&lt;li>Outer curvature cells exhibited circumferential alignment, while inner curvature cells remained isotropic.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Role of Inter-Cellular Space (ICS)&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>ICS accounted for 30–45% of tissue volume changes, highlighting its role in accommodating growth.&lt;/li>
&lt;li>Ventral ICS volume increased by 62% during bending phases.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Variance as a Developmental Signal&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Ring-shaped variance patterns&lt;/strong> in cell volume/anisotropy emerged around the outer curvature, suggesting mechanical feedback loops.&lt;/li>
&lt;li>High-variance regions correlated with zones of rapid tissue remodeling.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Tissue-Cell Dynamics&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>GLM analysis explained 70% of tissue growth variance, with cell number (β = 0.48, p &amp;lt; 0.001) and ICS (β = 0.32, p &amp;lt; 0.01) as key predictors.&lt;/li>
&lt;li>Cell orientation aligned with tissue deformation vectors during rotation (r &amp;gt; 0.8) but not bending phases.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="implications">Implications&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Mechanistic Insights&lt;/strong>: Challenges the &amp;ldquo;differential growth hypothesis&amp;rdquo; by showing ICS and cellular heterogeneity are equally critical to looping.&lt;/li>
&lt;li>&lt;strong>Toolkit for Developmental Biology&lt;/strong>: The pipeline is extensible to other organs/species, enabling studies on how cellular noise shapes tissue patterning.&lt;/li>
&lt;li>&lt;strong>Clinical Relevance&lt;/strong>: Provides a framework to explore how genetic mutations disrupt growth coordination, informing congenital heart defect research.&lt;/li>
&lt;li>&lt;strong>AI/ML Impact&lt;/strong>: Demonstrates the power of deep learning in automating large-scale 3D biological image analysis.&lt;/li>
&lt;/ul>
&lt;img src="deformation.jpg" alt="drc-worfklow" width="800"></description></item><item><title>SFEAL</title><link>https://mahyar-osn.github.io/projects/sfeal/</link><pubDate>Fri, 22 Sep 2023 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/sfeal/</guid><description>&lt;p>&lt;strong>Authors&lt;/strong>: Mahyar Osanlouy, Alys R. Clark, Haribalan Kumar, Clair King, Margaret L. Wilsher, David G. Milne, Ken Whyte, Eric A. Hoffman &amp;amp; Merryn H. Tawhai
&lt;strong>Publication&lt;/strong>: &lt;em>Nature Scientific Reports.&lt;/em> (September 2020)&lt;br>
&lt;strong>Code&lt;/strong>: &lt;a href="https://github.com/mahyar-osn/SFEAL" target="_blank" rel="noopener">Mendeley Data&lt;/a>&lt;/p>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>This project presents a quantitative investigation into age‐related variations in lung and fissure shape among healthy adults (aged 20–90 years). By integrating advanced finite element mesh fitting techniques with statistical shape modeling and principal component analysis (PCA), the study establishes a robust framework for capturing and quantifying subtle geometric changes in lung morphology. Such a mathematical framework provides a normative baseline against which pathological alterations may be compared.&lt;/p>
&lt;h2 id="key-contributions">Key Contributions&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Integration of Finite Element Modeling and PCA:&lt;/strong>&lt;br>
• Developed a high-order finite element (FE) mesh fitted to segmented lung surfaces, incorporating curvature and smoothness constraints.&lt;br>
• Applied PCA to reduce dimensionality, isolating principal modes of shape variation.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Mathematical Modeling of Shape Deformations:&lt;/strong>&lt;br>
• Formulated an energy minimization problem that couples data fidelity with smoothness constraints.&lt;br>
• Expressed lung shape variations as weighted perturbations from a mean model in a high-dimensional space.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Clinical Insights:&lt;/strong>&lt;br>
• Revealed strong associations between lung geometry, age, and BMI.&lt;br>
• Enabled detection of subtle fissure shifts and volumetric changes, likely reflecting underlying tissue elasticity.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="methodology">Methodology&lt;/h2>
&lt;h3 id="finite-element-mesh-construction">Finite Element Mesh Construction&lt;/h3>
&lt;p>Each lung is represented by a finite element mesh with a fixed topology (225 nodes in this study). To ensure an accurate and smooth representation, the mesh is fitted to imaging data by minimizing an energy functional that balances data fidelity against surface smoothness.&lt;/p>
&lt;h4 id="energy-model-formulation">Energy Model Formulation&lt;/h4>
&lt;p>The energy function is defined as:&lt;/p>
&lt;p>$$
T(u) = \sum_{i=1}^{N} \gamma_i \left| z(\xi_i) - z_d \right|^2 + \int_{\Omega} g(u(\xi)), d\xi,
$$&lt;/p>
&lt;p>where:&lt;/p>
&lt;ul>
&lt;li>$u$ is the vector of shape (or nodal displacement) parameters.&lt;/li>
&lt;li>$z(\xi_i)$ represents the geometric position of a node in local parametric coordinates $\xi_i$.&lt;/li>
&lt;li>$z_d$ is the target data point from the segmented lung surface.&lt;/li>
&lt;li>$\gamma_i$ is a weight factor controlling data matching for each node.&lt;/li>
&lt;li>$g(u(\xi))$ is the smoothness (regularization) term that penalizes rapid or non-physical deformations.&lt;/li>
&lt;li>$\Omega$ denotes the domain over which the mesh is defined.&lt;/li>
&lt;/ul>
&lt;p>This formulation ensures that the FE mesh adapts to the lung&amp;rsquo;s surface while preserving a biologically plausible smooth geometry.&lt;/p>
&lt;h4 id="pseudo-code-for-mesh-fitting">Pseudo-code for Mesh Fitting&lt;/h4>
&lt;pre>&lt;code>for each subject:
// Step 1: Initialize template mesh
Initialize template_mesh with 225 nodes
// Step 2: Define anatomical landmarks
Define landmarks:
- Apices
- Diaphragm
- Lung base edges
- Anterior segments
// Step 3: Optimize node positions using energy minimization
Optimize node positions by minimizing the energy function T(u):
T(u) = Σγ ||z(ξ₁, ξ₂) - z_d||² + ∫ g(u(ξ)) dξ
// where:
// z = nodal coordinates (x, y, z)
// g = smoothness constraint (curvature regularization)
// γ = data matching weight factor
&lt;/code>&lt;/pre>
&lt;p>&lt;em>Mean fitting error: 5.2 ± 2.3 mm&lt;/em>&lt;/p>
&lt;h3 id="data-alignment-and-statistical-shape-modeling">Data Alignment and Statistical Shape Modeling&lt;/h3>
&lt;p>Prior to PCA, lung shapes are aligned using General Procrustes Analysis (GPA) to eradicate variations due to
translation, rotation, and, in the case of the size-exclusive model, scaling.&lt;/p>
&lt;h4 id="alignment-equation">Alignment Equation&lt;/h4>
&lt;p>The alignment is expressed as:&lt;/p>
&lt;p>$$
\bar{S} = \alpha R S + T,
$$&lt;/p>
&lt;p>where:&lt;/p>
&lt;ul>
&lt;li>$S$ is the original shape vector,&lt;/li>
&lt;li>$R$ is the rotation matrix,&lt;/li>
&lt;li>$T$ is the translation vector,&lt;/li>
&lt;li>$\alpha$ is the scaling factor (applied only in size-inclusive models).&lt;/li>
&lt;/ul>
&lt;h3 id="principal-component-analysis-pca">Principal Component Analysis (PCA)&lt;/h3>
&lt;p>PCA is employed to reduce the high-dimensional shape vector into principal modes that capture the primary sources of variance.&lt;/p>
&lt;h4 id="pca-decomposition-via-svd">PCA Decomposition via SVD&lt;/h4>
&lt;p>The shape matrix $\mathbf{S}$ is decomposed using singular value decomposition (SVD):&lt;/p>
&lt;p>$$
\mathbf{S} = \mathbf{U} {\Sigma} \mathbf{V}^{T},
$$&lt;/p>
&lt;p>where:&lt;/p>
&lt;ul>
&lt;li>$\mathbf{U}$ contains the eigenvectors of $\mathbf{S} \mathbf{S}^{T}$,&lt;/li>
&lt;li>${\Sigma}$ is the diagonal matrix of singular values $\sigma_i$ (with $\lambda_i = \sigma_i^2$ being
the eigenvalues),&lt;/li>
&lt;li>$\mathbf{V}^{T}$ holds the principal directions in the data space.&lt;/li>
&lt;/ul>
&lt;p>Each lung shape is reconstructed as:&lt;/p>
&lt;p>$$
M_{l}(w) = \bar{S}_0 + w, u_{l},
$$&lt;/p>
&lt;p>with:&lt;/p>
&lt;ul>
&lt;li>$\bar{S}_0$ being the mean shape,&lt;/li>
&lt;li>$u_l$ the $l$th principal component,&lt;/li>
&lt;li>$w$ the corresponding weight factor.&lt;/li>
&lt;/ul>
&lt;p>The variance explained by each mode is:&lt;/p>
&lt;p>$$
\text{Variance Explained} = \frac{\sigma_l^2}{\sum_{i} \sigma_i^2} \times 100%.
$$&lt;/p>
&lt;h2 id="results">Results&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Correlation with Age:&lt;/strong>&lt;br>
Specific principal shape modes display strong correlations with age (e.g., $R = -0.75, ; p &amp;lt; 0.001$),&lt;/p>
&lt;/li>
&lt;li>
&lt;p>indicating that lung geometries become more “pyramidal” as age increases.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Sex and BMI Associations:&lt;/strong>&lt;br>
Differences in shape related to lung size manifest in the size-inclusive model, highlighting sex-related volumetric differences. In contrast, the size-exclusive model emphasizes purely geometric deformations, with moderate correlations observed for BMI.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;img src="pca-lung.png" alt="drc-worfklow" width="800">
&lt;img src="pca-plot.png" alt="drc-worfklow" width="800">
&lt;h2 id="implications">Implications&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Clinical Applications:&lt;/strong>&lt;br>
The detailed mathematical framework enables lung shape to be employed as a biomarker for aging and disease. Deviations from the normative PCA model may assist in early detection or staging of conditions like COPD and IPF.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Technical Advancements:&lt;/strong>&lt;br>
The fusion of finite element modeling with PCA offers a versatile and robust method for analyzing complex organ shapes. This approach can be adapted to other anatomical structures requiring similar quantitative assessments.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Future Directions:&lt;/strong>&lt;br>
Enhancing the energy model and incorporating dynamic imaging (e.g., covering breathing cycles) could further refine shape analysis. Additionally, exploring non-linear dimensionality reduction techniques may uncover further subtleties in lung morphology.&lt;/p>
&lt;/li>
&lt;/ul></description></item><item><title>The SPARC DRC</title><link>https://mahyar-osn.github.io/projects/drc/</link><pubDate>Wed, 20 Sep 2023 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/drc/</guid><description>&lt;p>&lt;strong>Authors&lt;/strong>: Mahyar Osanlouy, Anita Bandrowski, Bernard de Bono, David Brooks, Antonino M. Cassarà, Richard Christie, Nazanin Ebrahimi, Tom Gillespie, Jeffrey S. Grethe, Leonardo A. Guercio, Maci Heal, Mabelle Lin, Niels Kuster, Maryann E. Martone, Esra Neufeld, David P. Nickerson, Elias G. Soltani, Susan Tappan, Joost B. Wagenaar, Katie Zhuang, Peter J. Hunter&lt;br>
&lt;strong>Publication&lt;/strong>: &lt;em>Front. Physiol.&lt;/em> (June 2021)&lt;br>
&lt;strong>Website&lt;/strong>: &lt;a href="https://sparc.science/" target="_blank" rel="noopener">SPARC Science&lt;/a>&lt;br>
&lt;strong>Interactive 3D Models &amp;amp; Data&lt;/strong>: &lt;a href="https://sparc.science/apps/maps?type=ac" target="_blank" rel="noopener">MAP Web App&lt;/a>&lt;/p>
&lt;hr>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>The NIH Common Fund&amp;rsquo;s Stimulating Peripheral Activity to Relieve Conditions (SPARC) program is an ambitious initiative
aimed at revolutionizing our understanding of the autonomic nervous system (ANS) and its role in organ function.
As the lead developer for the Mapping Core (MAP-Core) of the SPARC Data and Resource Center (DRC), I collaborated
with an interdisciplinary team to create a comprehensive framework for curating, visualizing, and analyzing ANS data
across different species.&lt;/p>
&lt;p>The SPARC DRC serves as the technological foundation for the SPARC program, providing researchers worldwide with access
to standardized experimental data, computational models, and visualization tools through a unified web portal
(&lt;a href="https://sparc.science" target="_blank" rel="noopener">https://sparc.science&lt;/a>). Our work addresses a critical gap in biomedical research: the need for standardized,
reproducible, and interoperable data and computational resources to advance our understanding of neural control of
organ function and develop effective neuromodulation therapies.&lt;/p>
&lt;img src="drc-workflow.jpg" alt="drc-worfklow" width="800">
&lt;hr>
&lt;h2 id="key-contributions">Key Contributions&lt;/h2>
&lt;p>Our team developed several groundbreaking innovations that form the technological foundation of the SPARC program:&lt;/p>
&lt;h3 id="1-fair-compliant-data-management-platform">1. FAIR-Compliant Data Management Platform&lt;/h3>
&lt;p>We implemented comprehensive data standards and workflows to ensure all SPARC data adheres to FAIR principles
(Findable, Accessible, Interoperable, and Reusable). This includes standardized metadata schemas, dataset organization
structures, and persistent identifiers for long-term data discoverability.&lt;/p>
&lt;h3 id="2-knowledge-management-system">2. Knowledge Management System&lt;/h3>
&lt;p>We created a sophisticated knowledge graph integrating anatomical relationships, neural connectivity, and semantic
annotations from multiple species. This system enables powerful cross-species comparisons and semantic searches that
were previously impossible with traditional database approaches.&lt;/p>
&lt;h3 id="3-multi-scale-anatomical-mapping-framework">3. Multi-Scale Anatomical Mapping Framework&lt;/h3>
&lt;p>One of our most significant innovations is the development of 3D material coordinate systems (&amp;ldquo;scaffolds&amp;rdquo;) for organs
and bodies. These scaffolds provide a revolutionary solution to a complex problem: how to map and compare data from
organs that undergo substantial deformation (e.g., beating hearts, inflating lungs) across different experimental
conditions and species.&lt;/p>
&lt;h3 id="4-computational-modeling-platform">4. Computational Modeling Platform&lt;/h3>
&lt;p>We developed o²S²PARC (&amp;ldquo;open, online simulations for SPARC&amp;rdquo;), an online computational environment that enables
researchers to analyze data, develop models, and simulate neuromodulation scenarios using cloud computing resources.&lt;/p>
&lt;img src="flatmaps.jpg" alt="faltmaps" width="500">
&lt;hr>
&lt;h2 id="methodology">Methodology&lt;/h2>
&lt;h3 id="developing-standardized-data-workflows">Developing Standardized Data Workflows&lt;/h3>
&lt;p>We established comprehensive curation and data standards to ensure consistency across all SPARC datasets.
Key aspects include:&lt;/p>
&lt;ul>
&lt;li>Implementation of the SPARC Dataset Structure (SDS) for consistent file organization&lt;/li>
&lt;li>Development of the Minimal Information Standard (MIS) for semantic metadata&lt;/li>
&lt;li>Integration with community ontologies and specialized annotation tools&lt;/li>
&lt;li>Creation of SODA (Software for Organizing Data Automatically) to assist researchers in preparing data submissions&lt;/li>
&lt;/ul>
&lt;h3 id="creating-neural-connectivity-maps">Creating Neural Connectivity Maps&lt;/h3>
&lt;p>To represent the complex connectivity of the ANS across different species, we:&lt;/p>
&lt;ul>
&lt;li>Utilized the ApiNATOMY toolkit to create topological and semantic models of neural pathways&lt;/li>
&lt;li>Generated interactive flatmap diagrams that visualize neural connectivity in 2D for multiple species&lt;/li>
&lt;li>Linked these maps to the SPARC Knowledge Graph for data integration&lt;/li>
&lt;/ul>
&lt;h3 id="3d-scaffold-framework-for-anatomical-mapping">3D Scaffold Framework for Anatomical Mapping&lt;/h3>
&lt;p>A cornerstone of our innovation is the development of the 3D scaffold system. This methodology addresses the
fundamental challenge of mapping data from organs that undergo significant deformation. Our approach includes:&lt;/p>
&lt;h4 id="1-material-coordinate-system-development">1. Material Coordinate System Development&lt;/h4>
&lt;p>We developed Scaffold-Maker, specialized CAD software that creates 3D material coordinate systems for body organs.
These scaffolds use finite element meshes with smooth interpolation to represent complex anatomical geometries.&lt;/p>
&lt;h4 id="2-cross-species-anatomical-representation">2. Cross-Species Anatomical Representation&lt;/h4>
&lt;p>We designed the scaffolds to accommodate topological differences between species, allowing for meaningful cross-species
comparisons despite anatomical variations. For example, we created heart scaffolds that accommodate different numbers
of pulmonary veins in humans (4), pigs (2), and rats (3).&lt;/p>
&lt;h4 id="3-deformation-invariant-mapping">3. Deformation-Invariant Mapping&lt;/h4>
&lt;p>Our material coordinate system maintains consistent references to tissue locations regardless of organ deformation.
This allows data to be mapped and compared across different physiological states (e.g., cardiac contraction phases).&lt;/p>
&lt;h4 id="4-integration-with-whole-body-models">4. Integration with Whole-Body Models&lt;/h4>
&lt;p>We developed methods to embed organ scaffolds within whole-body coordinate systems, facilitating multi-scale data
integration from cellular to organism levels.&lt;/p>
&lt;img src="scaffold.jpg" alt="scaffold" width="850">
&lt;hr>
&lt;h2 id="results">Results&lt;/h2>
&lt;p>Our work has produced several tangible outcomes that demonstrate the power of the SPARC DRC infrastructure:&lt;/p>
&lt;h3 id="comprehensive-ans-data-resource">Comprehensive ANS Data Resource&lt;/h3>
&lt;p>The SPARC Portal now serves as the world&amp;rsquo;s most comprehensive resource for standardized ANS data, with:&lt;/p>
&lt;ul>
&lt;li>Curated datasets from multiple species and organ systems&lt;/li>
&lt;li>Rich semantic annotations linking experimental data to anatomical locations&lt;/li>
&lt;li>Standardized protocols and metadata ensuring reproducibility&lt;/li>
&lt;/ul>
&lt;h3 id="species-specific-anatomical-scaffolds">Species-Specific Anatomical Scaffolds&lt;/h3>
&lt;p>We have successfully created detailed 3D scaffolds for key organs across multiple species:&lt;/p>
&lt;ul>
&lt;li>Heart scaffolds for human, pig, and rat with species-specific topologies&lt;/li>
&lt;li>Colon scaffolds capturing species variations in haustra and taeniae coli structures&lt;/li>
&lt;li>Whole-body scaffolds with embedded organ systems&lt;/li>
&lt;li>Bladder, stomach, and lung scaffolds for integrating diverse experimental data&lt;/li>
&lt;/ul>
&lt;h3 id="neural-mapping-demonstrations">Neural Mapping Demonstrations&lt;/h3>
&lt;p>We have demonstrated successful registration of neural data to our scaffold systems:&lt;/p>
&lt;ul>
&lt;li>Mapping of intrinsic cardiac neurons (ICNs) from rat hearts to a standardized cardiac scaffold&lt;/li>
&lt;li>Integration of data from multiple specimens into &amp;ldquo;integrative&amp;rdquo; scaffolds&lt;/li>
&lt;li>Preservation of spatial relationships across deformed organ states&lt;/li>
&lt;/ul>
&lt;h3 id="computational-modeling-environment">Computational Modeling Environment&lt;/h3>
&lt;p>The o²S²PARC platform now provides:&lt;/p>
&lt;ul>
&lt;li>Online access to sophisticated computational models&lt;/li>
&lt;li>Tools for simulating neuromodulation effects&lt;/li>
&lt;li>Reproducible workflows for data analysis&lt;/li>
&lt;li>Collaborative environments for model development&lt;/li>
&lt;/ul>
&lt;img src="heart.png" alt="scaffold" width="850">
&lt;hr>
&lt;h2 id="implications">Implications&lt;/h2>
&lt;p>The SPARC DRC infrastructure we&amp;rsquo;ve developed has significant implications for both basic science and clinical
applications:&lt;/p>
&lt;h3 id="advancing-basic-science">Advancing Basic Science&lt;/h3>
&lt;p>Our work enables new approaches to understanding the ANS by:&lt;/p>
&lt;ul>
&lt;li>Facilitating cross-species comparisons of neural circuitry&lt;/li>
&lt;li>Providing standardized reference systems for integrating multi-scale data&lt;/li>
&lt;li>Creating a foundation for quantitative, data-driven neural mapping&lt;/li>
&lt;li>Enabling reproducible computational analyses&lt;/li>
&lt;/ul>
&lt;h3 id="clinical-applications">Clinical Applications&lt;/h3>
&lt;p>The infrastructure directly supports the development of bioelectronic medicine by:&lt;/p>
&lt;ul>
&lt;li>Providing detailed anatomical maps for targeting neuromodulation&lt;/li>
&lt;li>Enabling simulation of device effects on neural activity&lt;/li>
&lt;li>Supporting the optimization of stimulation parameters&lt;/li>
&lt;li>Facilitating translation between animal models and human applications&lt;/li>
&lt;/ul>
&lt;h3 id="beyond-sparc">Beyond SPARC&lt;/h3>
&lt;p>The methodologies and tools we&amp;rsquo;ve developed have applications beyond the ANS:&lt;/p>
&lt;ul>
&lt;li>The scaffold concept can be applied to any deformable biological system&lt;/li>
&lt;li>Our FAIR data management approaches set standards for other large-scale initiatives&lt;/li>
&lt;li>The o²S²PARC computational platform can support diverse modeling applications&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>The SPARC DRC represents a paradigm shift in how we approach the study of the autonomic nervous system. By creating
standardized frameworks for data organization, anatomical mapping, and computational modeling, we&amp;rsquo;ve laid the groundwork
for a new era of quantitative, integrative neuroscience research that can directly inform the development of
bioelectronic therapies. Our 3D scaffold methodology, in particular, solves the fundamental challenge of mapping
biological data in deformable systems, enabling unprecedented integration of experimental data across scales, species,
and physiological states.&lt;/p></description></item><item><title>AI-Driven Radiomics for Precision Prostate Cancer Therapy</title><link>https://mahyar-osn.github.io/projects/prostate/</link><pubDate>Sun, 20 Aug 2023 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/prostate/</guid><description>&lt;h1 id="ai-driven-radiomics-for-precision-prostate-cancer-therapy">AI-Driven Radiomics for Precision Prostate Cancer Therapy&lt;/h1>
&lt;p>&lt;strong>Authors&lt;/strong>: Tsz Him Chan, Annette Haworth, Alan Wang, Mahyar Osanlouy et al.&lt;br>
&lt;strong>Publication&lt;/strong>: &lt;em>EJNMMI Research&lt;/em> (2023)&lt;br>
&lt;strong>Code&lt;/strong>: &lt;a href="mailto:Hayley.Reynolds@auckland.ac.nz">Available on Request&lt;/a>&lt;/p>
&lt;hr>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>This pioneering study developed an AI-powered radiomics pipeline to optimize biologically targeted radiation therapy
(BiRT) for prostate cancer. By integrating PSMA PET/CT with multiparametric MRI (mpMRI),
we created voxel-level predictions of tumor location and grade through advanced image registration and machine learning
techniques.&lt;/p>
&lt;hr>
&lt;h2 id="key-innovations">Key Innovations&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>Multi-modal fusion&lt;/strong>: First study combining PSMA PET radiomics with DCE MRI perfusion parameters&lt;/li>
&lt;li>&lt;strong>Voxel-wise prediction&lt;/strong>: Achieved 0.89 AUC for tumor detection using 3D radiomic features&lt;/li>
&lt;li>&lt;strong>Grade differentiation&lt;/strong>: Developed two-stage RFC model separating high/low-grade disease (Accuracy: 0.67-0.99)&lt;/li>
&lt;li>&lt;strong>HPC-optimized registration&lt;/strong>: Reduced spatial uncertainty to 3.3mm using deformable histology alignment&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="computational-pipeline">Computational Pipeline&lt;/h2>
&lt;h3 id="1-multi-modal-image-registration">1. Multi-modal Image Registration&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Data Integration&lt;/strong>: Co-registered PSMA PET/CT (5 scanners), mpMRI (2x Siemens 3T), and whole-mount histology&lt;/li>
&lt;li>&lt;strong>Key Steps&lt;/strong>:&lt;/li>
&lt;/ul>
&lt;pre tabindex="0">&lt;code class="language-Pseudo-code" data-lang="Pseudo-code">align_pet_ct() → rigid_registration(mpMRI) →
deformable_registration(ex_vivo_MRI) →
histology_annotation_propagation()
&lt;/code>&lt;/pre>&lt;ul>
&lt;li>&lt;strong>Challenges Solved&lt;/strong>:&lt;/li>
&lt;li>Bladder filling artifacts in PET&lt;/li>
&lt;li>Partial volume effects in 3.27mm PET slices&lt;/li>
&lt;li>Non-linear prostate deformation post-resection&lt;/li>
&lt;/ul>
&lt;h3 id="2-radiomic-feature-engineering">2. Radiomic Feature Engineering&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Modality&lt;/th>
&lt;th>Features Extracted&lt;/th>
&lt;th>Key Parameters&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>PSMA PET&lt;/td>
&lt;td>3D LoG, LBP, GLCM textures&lt;/td>
&lt;td>SUVmax, metabolic tumor volume&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>DCE MRI&lt;/td>
&lt;td>Ktrans, iAUGC60, TTP perfusion maps&lt;/td>
&lt;td>Pharmacokinetic modeling&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ADC Maps&lt;/td>
&lt;td>NGTDM coarseness, percentile values&lt;/td>
&lt;td>b=1200 s/mm² diffusion restriction&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Feature Selection&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>ANOVA filtering → Gini impurity ranking&lt;/li>
&lt;li>Final feature set: 50 most discriminative parameters&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="machine-learning-architecture">Machine Learning Architecture&lt;/h2>
&lt;h3 id="tumor-detection-model">Tumor Detection Model&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Two-stage RFC Framework&lt;/strong>:&lt;/li>
&lt;/ul>
&lt;ol>
&lt;li>&lt;strong>Location Detection&lt;/strong>: 842 sensitivity/804 specificity&lt;/li>
&lt;li>&lt;strong>Grade Classification&lt;/strong>: Low vs High Grade (ISUP ≥3)&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>&lt;strong>Performance Comparison&lt;/strong>:&lt;/li>
&lt;/ul>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Model&lt;/th>
&lt;th>AUC&lt;/th>
&lt;th>Sensitivity&lt;/th>
&lt;th>Specificity&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>PET Alone&lt;/td>
&lt;td>0.865&lt;/td>
&lt;td>0.781&lt;/td>
&lt;td>0.799&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>mpMRI Alone&lt;/td>
&lt;td>0.882&lt;/td>
&lt;td>0.802&lt;/td>
&lt;td>0.801&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Combined&lt;/strong>&lt;/td>
&lt;td>&lt;strong>0.890&lt;/strong>&lt;/td>
&lt;td>&lt;strong>0.842&lt;/strong>&lt;/td>
&lt;td>&lt;strong>0.804&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;img src="roc.png" alt="Receptive fields" width="400">
&lt;p>&lt;em>Receiver operating characteristics for different models&lt;/em>&lt;/p>
&lt;h3 id="key-radiomic-predictors">Key Radiomic Predictors&lt;/h3>
&lt;ol>
&lt;li>&lt;strong>PET&lt;/strong>: 3D LoG(σ=3mm) minimum&lt;/li>
&lt;li>&lt;strong>ADC&lt;/strong>: NGTDM Coarseness&lt;/li>
&lt;li>&lt;strong>DCE MRI&lt;/strong>: Ktrans 90th percentile&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="clinical-implications">Clinical Implications&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Personalized Radiotherapy&lt;/strong>: Enables voxel-level dose painting based on metabolic/perfusion features&lt;/li>
&lt;li>&lt;strong>Early Recurrence Prediction&lt;/strong>: High-grade lesions showed 2.8× higher PSMA uptake (p&amp;lt;0.01)&lt;/li>
&lt;li>&lt;strong>Technical Impact&lt;/strong>:&lt;/li>
&lt;li>Solved partial volume effects in PET-guided planning&lt;/li>
&lt;li>Demonstrated perfusion &amp;gt; diffusion for grade prediction&lt;/li>
&lt;li>Open-source registration framework [3D Slicer Plugin]&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="future-directions">Future Directions&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Multi-institutional validation&lt;/strong> across PET/MRI scanners&lt;/li>
&lt;li>&lt;strong>DL Enhancement&lt;/strong>: Replace handcrafted features with 3D CNNs&lt;/li>
&lt;li>&lt;strong>Real-time Adaptation&lt;/strong>: Integrate with MR-Linac systems&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>&lt;em>This project received funding from Prostate Cancer Foundation of Australia and Health Research Council of New Zealand.&lt;/em>&lt;/p></description></item><item><title>Generalization of predictive coding model to dynamic stimuli</title><link>https://mahyar-osn.github.io/post/tpc/</link><pubDate>Mon, 26 Apr 2021 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/post/tpc/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>Predictive coding is an established model of perceptual inference and learning in hierarchical networks of the brain.
It describes a network of neuron-like nodes, which can infer stimulus properties from noisy input using only
&lt;em>local computation&lt;/em>, i.e. the changes of activity of each neuron in the model is determined only by its inputs and its
current activity levels. Furthermore, the network encodes the estimated parameters of a probabilistic model from which
the stimuli are generated in its synaptic connections, and learn these parameters employing only
&lt;em>local plasticity&lt;/em>, where the changes in synaptic weights only depend of activities of pre and post-synaptic neurons.
In its original form the predictive coding model assumes static input stimuli. However, most of
the stimuli experienced by animals and humans change in time, and it is critical for survival to efficiently interpret
such stimuli.&lt;/p>
&lt;p>Very soon after developing the predictive coding model, it was pointed that it could be generalized to dynamic stimuli,
and the Kalman filter could be employed to infer the states of hidden variables represented by the model. However that work has not described how such computation could be implemented in a biologically
plausible network of neuron-like nodes. More recently, a generalization of predictive coding to dynamic stimuli has been
proposed, in which different neurons represent not only the hidden variables, but also their temporal derivatives.
Although it is possible to implement this model in a network only employing local computation and local plasticity,
this network requires a very intricate and specific pattern of connectivity between various neurons, and there is no evidence that such connectivity exists in cortical circuits.&lt;/p>
&lt;p>This report outlines a simple generalization of predictive coding model to dynamic stimuli, which does not require more
intricate network than the original predictive coding model. A simulation of the proposed generalizations is shown for
a toy problem, and directions are suggested in which the work on the model needs to be conducted.&lt;/p>
&lt;h2 id="model">Model&lt;/h2>
&lt;h3 id="process-generating-stimuli">Process generating stimuli&lt;/h3>
&lt;p>In this report we assume that stimuli are generated from a very simple linear model, which parallels the assumptions
about signal made by the Kalman filter. Let us denote an observed stimulus at time
$t$ by a vector with elements $y_i(t)$. Let us assume that the stimulus depends on values of hidden variables
denoted by $x_j(t)$ according to:&lt;/p>
&lt;p>$$
y_i(t) = \sum_j w_{i,j} x_j(t) + \epsilon_{y,i}(t) \quad (1)
$$&lt;/p>
&lt;p>In the above equation, $w_{i,j}$ form a matrix of parameters, and $\epsilon_{y,i}(t)$ is a noise process (with zero mean).
Furthermore, let us assume that the hidden variables evolve according to:&lt;/p>
&lt;p>$$
\dot{x}_j = \sum_k v_{j,k} x_k(t) + \epsilon_{x,j}(t) \quad (2)
$$&lt;/p>
&lt;p>Analogously as above, $v_{j,k}$ form a matrix of parameters, and $\epsilon_{x,j}(t)$ is a noise process.
A natural way for estimating $x_j$ from $y_i$ is to employ the Kalman filter, but it involves complex equations,
and it is not clear how such computation could be implemented in a network of neurons. Therefore, this report describes
a simpler method for estimating $x_j$ that has a more natural neural implementation.&lt;/p>
&lt;h3 id="computations-in-the-model">Computations in the model&lt;/h3>
&lt;p>Given a observed stimuli $y_i$, we will seek to infer the hidden variables $x_j$ and estimate the parameters $w_{i,j}$
and $v_{j,k}$. In the reminder of Section 2, we will use $x_j$, $w_{i,j}$ and $v_{j,k}$ to denote the estimates of
corresponding terms in Equations (1) and (2) above. We wish to find $x_j$ such that the stimulus $y_i$ is
close to the predicted value $\sum_j w_{i,j} x_j$. Thus we define error in prediction
of $y_i$ as:&lt;/p>
&lt;p>$$
e_i = y_i - \sum_j w_{i,j} x_j \quad (3)
$$&lt;/p>
&lt;p>We wish to minimize a squared sum of these errors which we denote by $E_y = \frac{1}{2} \sum_i \varepsilon_{y,i}^2$.
Hence we change $x_j$ in the direction opposite to the gradient of $E_y$, but we additionally append this dynamics
towards our goal with the natural evolution of $x_j$:&lt;/p>
&lt;p>$$
\dot{x}_j = - \frac{\partial E_y}{\partial x_j} + \sum_k v_{j,k} x_k
$$&lt;/p>
&lt;p>Evaluating the gradient, we obtain the equation describing the dynamics of our estimate of hidden variables:&lt;/p>
&lt;p>$$
\dot{x}_j = \sum_i w_{i,j} \varepsilon_{y,i} + \sum_k v_{j,k} x_k
$$&lt;/p>
&lt;p>In order to learn parameters $w_{i,j}$, which describe how $y_i$ depends on $x_j$, we modify them to minimize $E_y$:&lt;/p>
&lt;p>$$
\dot{w}_{i,j} = - \alpha \frac{\partial E_y}{\partial w_{i,j}} = \alpha \varepsilon_{y,i} x_j
$$&lt;/p>
&lt;p>In the above equation $\alpha$ denotes a learning rate. In order to learn parameters $v_{j,k}$ describing the natural
dynamics of hidden variables, we need to define an error in prediction of this dynamics:&lt;/p>
&lt;p>$$
\varepsilon_{x,j} = \dot{x}_j - \sum_k v_{j,k} x_k
$$&lt;/p>
&lt;p>We wish to minimize squared sum of these errors $E_x = \frac{1}{2} \sum_j \varepsilon_{x,j}^2$,
and hence we modify the weights in the direction opposite to the gradient of $E_x$ over $v_{j,k}$:&lt;/p>
&lt;p>$$
\dot{v}_{j,k} = \alpha \varepsilon_{x,j} x_k
$$&lt;/p>
&lt;p>In summary, this generalized predictive coding model continuously updates hidden variables and parameters according and
recomputes prediction errors.&lt;/p>
&lt;h3 id="possible-neural-implementations">Possible neural implementations&lt;/h3>
&lt;p>Inference of hidden variables $x_j$ from sensory input $y_i$ can be easily performed in a network shown in Figure 1A.
The bottom layer consists of sensory neurons representing the stimulus. They project to neurons computing prediction
error. These errors are then send to the neurons encoding hidden variables which
change their activity according to the dynamics equation above. The weights of connections between neurons encoding errors
and hidden variables are symmetric, i.e. equal in both direction. This network has an architecture very similar to
a standard predictive coding model , but additionally includes recurrent connections between the
neurons encoding hidden variables with weights $v_{j,k}$.&lt;/p>
&lt;img src="featured.png" alt="Receptive fields" width="800">
&lt;p>Learning parameters $w_{i,j}$ corresponds to local Hebbian plasticity in the network
of Figure 1, analogously as in the standard predictive coding networks. However,
learning parameters $v_{j,k}$ is less straightforward because the
prediction error $\varepsilon_{x,j}$ is not explicitly represented in activity of any neurons in the network.
Nevertheless, it is possible to construct models in which $\varepsilon_{x,j}$ would be represented in internal
signals (e.g. concentrations of particular ions or proteins) within neurons encoding $x_j$,
and let us consider two such possible models.&lt;/p>
&lt;p>The first model is illustrated in Figure 1B.
In this network, the recurrent inputs from neurons representing hidden variables converge on a separate dendritic
branch, which sums them and thus can compute $\sum_k v_{j,k} x_k$. To compute the error $\varepsilon_{x,j}$,
the neuron would need to compute the difference between change in its activity and the membrane potential in the dendrite.
Since both of these quantities are encoded within the same neuron, it is plausible that such a computation may be performed,
and an error encoded in an internal signal. Such signal could then drive local synaptic plasticity.&lt;/p>
&lt;p>An alternative way of computing prediction errors $\varepsilon_{x,j}$ relies on an observation that by combining
equations describing the dynamics of $\dot{x}_j$ adn error $\varepsilon_{x,j}$, we see that these errors are equal to:&lt;/p>
&lt;p>$$
\varepsilon_{x,j} = \sum_i w_{i,j} \varepsilon_{y,i}
$$&lt;/p>
&lt;p>Such input from the previous layer of prediction error neurons could be computed in dendrites shown in
Figure 1C. The membrane potential of such dendrite would need to set level of an internal signal that would govern the
plasticity within the entire neuron. This mechanism could be considered biologically plausible as it is analogous to
observations that high membrane potential of apical dendrites of pyramidal neurons triggers plateau potentials via
calcium influx, leading to a burst of spikes by the neuron. Such bursts of spikes may subsequently
induce synaptic plasticity.&lt;/p>
&lt;h2 id="results">Results&lt;/h2>
&lt;p>I tested the model on a simple problem in which hidden variables and stimuli were 2-dimensional.
The hidden variables were generated according to $\dot{x}_j = \sum_k v_{j,k} x_k(t) + \epsilon_{x,j}(t)$ with parameters
$v_{j,k}$ set to a rotation matrix visualized in Figure 2C. The stimuli were generated according
to $y_i(t) = \sum_j w_{i,j} x_j(t) + \epsilon_{y,i}(t)$ with parameters $w_{i,j}$ set to the identity matrix,
so that the stimuli were simply noisy versions of the hidden variables. The stimuli are shown in Figure 2A, and they are
noisy periodic signal because parameters $v_{j,k}$ were set to a rotation matrix. The variables and stimuli were generated
with a sampling frequency 10, by solving our equations using Euler method with integration step $0.1$. During each step,
noise with variance of $0.01$ was added.&lt;/p>
&lt;img src="results.png" alt="Receptive fields" width="700">
&lt;p>At the start of the learning process, weights $w_{i,j}$ were initialized to an identity matrix,
while the weights between hidden units were all set to $v_{j,k}=0$. The hidden units were also initialized to $x_j=0$.
The hidden variables and parameters were updated according to our equations above using the Euler method with integration
step of $0.1$, and learning rate set to $\alpha=0.01$.&lt;/p>
&lt;p>Figure 2B shows that as the learning progressed, the error in prediction of stimuli decreased, so the network was able
to better predict the stimuli. Figure 2D visualizes learned values of parameters $v_{j,k}$, which are very close to the
original parameters used to generate the training data (cf. Figure 2C).
Thus the network was able to discover the underlying process generating the stimuli.&lt;/p>
&lt;h2 id="discussion">Discussion&lt;/h2>
&lt;p>This report outlines generalization of predictive coding to dynamic stimuli for linear and shallow generative models,
so more work would be required to extend this to more complex models and relate it with experimental data.
In particular the work can be extended in the following directions:&lt;/p>
&lt;ul>
&lt;li>Introduce the non-linear activation functions to hidden units, and test if the model can learn dynamics of non-linear systems.&lt;/li>
&lt;li>Introduce multiple levels of hierarchy and investigate if the model can extract dynamics of stimuli generated by hierarchical dynamical systems.&lt;/li>
&lt;li>Test the model performance on real world machine learning problems, e.g. prediction of EEG signal from past history.&lt;/li>
&lt;li>Investigate if after training with natural stimuli the receptive fields of neurons in the model have similar properties
to the receptive fields in the visual system, analogously as in neural networks trained with the back-propagation algorithm.&lt;/li>
&lt;/ul></description></item><item><title>COVID-19 Modelling Effort</title><link>https://mahyar-osn.github.io/projects/covid-19-modelling/</link><pubDate>Tue, 21 Jul 2020 00:00:00 +0000</pubDate><guid>https://mahyar-osn.github.io/projects/covid-19-modelling/</guid><description>&lt;p>&lt;strong>Authors&lt;/strong>: Mahyar Osanlouy, Gonzalo D. Maso Talou, David Brooks, Soroush Safaei, Alan Garny, and Peter J. Hunter&lt;/p>
&lt;hr>
&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>Amid COVID-19 pandemic, a group of computational scientists and engineers in the ABI decide to set up models of COVID- 19 transmission and infection in New Zealand.
The taskforce developed technologies to model/analyze epidemic outbreaks, and a pipeline from data to model to visualization that offers a sandbox environment to test policies and track the infection process with an unprecedented level of details.&lt;/p>
&lt;h2 id="modelling-infection-in-buildings-cities-and-countries-a-multiscale-integrative-model">Modelling infection in buildings, cities and countries: A multiscale integrative model&lt;/h2>
&lt;p>Modelling the spread of COVID-19 is of paramount importance to strategize
effective policies to reduce the impact of the disease in our health and economic
system. By means of this model, we can identify social interactions, places and
activities that favour the spread of the virus in order to propose appropriate
countermeasures. The model is also a sandbox environment where we can test
policies and observe the consequences in the complex environment of a city, to
understand the pros and cons of each action.&lt;/p>
&lt;p>The model is composed of three scales: i) place/building scale; ii) transport/city
scale; iii) cluster/country scale. Each scale is implemented with a different type of
model (see Figure 1), and data between these models is communicated by a
homogenization process. In this process, data of the smaller scale computes the
parameters of the larger scale such that it represents the same phenomenology,
e.g., if the number of infections grew by 10 times during 10 hours in a transport
scale, then rate of infection for the country scale can be computed as one infection
per hour assuming a base 10 exponential growth model.&lt;/p>
&lt;img src="fig1.png" alt="drc-worfklow" width="800">
&lt;p>Finally, the model evolution and statistical analysis of the simulation is visualized
on top of a dynamic web interface that allows the users to easily navigate through
the results in time and space using cartographic and 3D views powered by Unity.
In the current development, simulations can be executed real-time, online
(visualizing results as the simulation is taking place) or offline. The offline modality
allows the user to navigate forward and backwards on time, turning the model
into an ideal tool for contact tracing and understanding the causality of a particular
scenario.&lt;/p>
&lt;h2 id="person-to-person-transmission-place-model">Person-to-person transmission: Place model&lt;/h2>
&lt;p>The place model is implemented by means of agent-based models (ABMs) where
the actions and status of each person can be modelled, predicted and, if needed,
controlled. These models offer high-resolution inferences of infection
transmissions at the level of individuals giving us a clear understanding of the
impact of different infection mechanisms (sneeze, direct or via surface
transmission, social distancing efficiency, among others).&lt;/p>
&lt;p>ABMs capture the interactions of individuals in time and space using real data and
detailed transmission pathways, providing insight into settings where transmission
is occurring and how clusters emerge. Various hypotheses can be tested by
modelling and evaluating social behaviour within different scenarios giving insights
about which elements are key to draw effective policies. In modelling disease
transmission, these scenarios may include different pandemic intervention
strategies deployed by government and/or policymakers such as containment,
mitigation, and suppression. Every individual (agent) also has specific attributes
which may contribute to the behaviour of the model and, as a result, to the result
of the disease transmission. Therefore, ABMs simulate the dynamics of a system
where individual-level characteristics, environmental factors, and the interaction
of the two are of importance.&lt;/p>
&lt;p>As an example, we have developed an ABM to simulate the transmission of COVID-
19 across shoppers in a supermarket (see Figure 2). Here, shoppers are the agents
of the model which have particular attributes including basic demographics (as
accurate as possible), health states and characteristics (e.g. susceptible, immunity
to the disease, etc.), probability of practising social distancing and basic hygiene,
etc. These are what we call the specifics of the local transmission dynamics.
Additionally, a natural disease history model for COVID-19, i.e., the infectivity
profile from the onset of infection, over an incubation period, to the peak of
infectivity, to recovery, for a single symptomatic or asymptomatic individual
becomes extremely important in longitudinal simulations. The supermarket is the
spatial environment where the simulation is confined. It is precisely this
environment where the rules and policies are defined and the mutual interaction
with the shoppers occurs. The environment and its rules have direct and indirect
implications on the shoppers and, ultimately, on the probability of the disease
transmission. The same is also true for the effects of the shoppers and their
behaviour on the environment.&lt;/p>
&lt;img src="fig2.png" alt="drc-worfklow" width="800">
&lt;h2 id="circulation-and-infection-through-the-city-arteries-transport-model">Circulation and infection through the city arteries: Transport model&lt;/h2>
&lt;p>Cities are a complex aggregate of place models, where people navigate between
them at specific times of day using specific means of transportation, among which
infection is also occurring. The proposed transportation model communicates
numerous place models and computes infections while agents commute between
places.&lt;/p>
&lt;p>This model deals with three complexities: (i) How to transport an agent from place
A to B for a given type of transportation; (ii) Which models of infection are
appropriate for each type of transportation mechanism (bus, private service,personal transport, walking, cycling, running, aeroplane and ferry); (iii) How an
agent decides the next action to perform after visiting a place.&lt;/p>
&lt;p>To properly address (i), we need to consider the available path when the agent is
using a specific transport type. The route for commuting to work will be quite
different for bus, cycling and walking, as some spaces can be traversed for one
mode but not for the remaining ones. Then, specific transportation graphs are
derived for each type of transportation. Once the route is known, the agent will
have to compute a trip plan, which involves a set of intermediate action to reach
the final destination. For example, if the agent decides to take the bus to go to
the supermarket, he will perform the following actions: 1) walk to the bus stop, 2) wait until the bus arrives,3) commute
from the bus stop of departure to the
bus stop of arrival, 4) walk from the arrival bus stop to the supermarket. To ensure
that the transport model delivers precise estimates of commuting time, it
considers the time of day, day of the week with the timetables when an agent is
using public transport. Also, the agents can define certain constraints as the
maximum walking distance, waiting time and number of bus connexions.&lt;/p>
&lt;img src="fig3.png" alt="drc-worfklow" width="800">
&lt;p>Regarding (ii), commuting by bus or walking through the street may clearly
present two different scenarios of exposure where a given set of policies will have
a different impact. Models for each transportation type can be modelled by specific
place models (as seen in the previous section), or by partial differential equations
(PDEs) considering the number of susceptible, exposed and infected subjects and
the total area of circulation. Each approach presents its advantages depending on
the policies to be tested, tracing detail required and available resources for the
simulation.&lt;/p>
&lt;p>Lastly, (iii) is addressed by modelling the agent’s behaviour with a stochastic
planner. Each time an agent is idle the planner is executed, evaluating theprobability for this agent to take different actions (such as go to work, go to sleep,
return home, visit a friend, go shopping) based on his personal attributes (age,
occupation, family), history of previous actions and time and day of the week.
After all the probabilities have been computed, the agent performs the most
probable action. Once the action is finished the agent is idle and the planning
starts again.&lt;/p>
&lt;p>Note that all the probabilities distributions needed to characterize the agent’s
behaviour and the number of agents across the country can be extracted from
national census data.&lt;/p>
&lt;h2 id="modelling-nation-wide-infection-cluster-models">Modelling nation-wide infection: Cluster models&lt;/h2>
&lt;p>The cluster model is based on the standard SEIR (susceptible-exposed-infected-removed) approach, gathering all transport model data for each city or region and
reducing it to a set of ordinary differential equations. The rates and coefficients of
this model can be computed by fitting each cluster model with the observations of
the corresponding transport model and, at the same time, the cluster model
informs the transport among cities serving as a boundary condition of the
transport model.&lt;/p>
&lt;img src="fig4.png" alt="drc-worfklow" width="800">
&lt;p>This macro-scale serves as a dashboard of the infection process in large
communities. Its simplicity renders tractable and easy to analyze variables, and
their variation over time - e.g. infection, mortality and recovery rates - which is
extremely useful for specialists and policymakers.&lt;/p></description></item></channel></rss>