Deep Markov Factor Analysis: Towards Concurrent Temporal and Spatial Analysis of fMRI Data
Year: 2021

Abstract:
Factor analysis methods have been widely used in neuroimaging to transfer high dimensional imaging data into low dimensional, ideally interpretable representations. However, most of these methods overlook the highly nonlinear and complex temporal dynamics of neural processes when factorizing their imaging data. In this paper, we present deep Markov factor analysis (DMFA), a generative model that employs Markov property in a chain of low dimensional temporal embeddings together with spatial inductive assumptions, all related through neural networks, to capture temporal dynamics in functional magnetic resonance imaging (fMRI) data, and tackle their high spatial dimensionality, respectively. Augmented with a discrete latent, DMFA is able to cluster fMRI data in its low dimensional temporal embedding with regard to subject and cognitive state variability, therefore, enables validation of a variety of fMRI-driven neuroscientific hypotheses. Experimental results on both synthetic and real fMRI data demonstrate the capacity of DMFA in revealing interpretable clusters and capturing nonlinear temporal dependencies in these high dimensional imaging data.

heading: 1 Introduction
text: Functional magnetic resonance imaging (fMRI) has been extensively used in cognitive neuroscience to study brain structures and their interactions at rest or during a cognitive task [Glover, 2011]. fMRI also provides insights into how brain’s functional connectivity changes during different experimental conditions [Preti et al., 2017, Azari et al., 2020]. However, due to high dimensional nature of fMRI data (tens of thousands of voxels in few seconds-long sessions), analyzing functional connectivity of brain could get very challenging [Turk-Browne, 2013]. Most classical methods employ region of interest (ROI)-based approaches to reduce size of data for processing [Poldrack, 2007, Etzel et al., 2009, Farnoosh and Soltanian-Zadeh, 2017, Gadgil et al., 2020]. However, averaging across many voxels within each region could wash out signals from small number of task-relevant voxels with noise from non-activated voxels, therefore results in a loss of information [Poldrack, 2007].
35th Conference on Neural Information Processing Systems (NeurIPS 2021)
Recently, few approaches have been proposed, based on probabilistic generative models, for topographic factorization of fMRI data into a weighted summation of few localized activation sources (i.e., temporal weights and topographic spatial factors), among which topographic factor analysis (TFA) [Manning et al., 2014b] and its multi-subject extension, hierarchical TFA (HTFA) [Manning et al., 2018], and neural TFA (NTFA) [Sennesh et al., 2020] are the most noted ones. This factorization serves as a necessary preparation step for subsequent statistical analysis that can effectively characterize subject- and stimulus-level variations and reveal task- or cognitive state-related networks in brain. However, TFA approaches assume a prior in which temporal weights are conditionally independent as a function of time, which means they do not encode temporal dynamics. Given the non-linearity and complex time-dependencies inherent in fMRI, a model is required that can capture and represent these dependencies.
In this paper, we propose deep Markov factor analysis (DMFA)1, a Bayesian model for factorization of fMRI data that learns a deep generative Markovian prior to reason about nonlinear temporal dynamics. This is realized by a chain of low dimensional temporal embeddings related through neural networks. This prior is further augmented by a discrete latent for multimodal dynamical estimation, and clustering subject- and task-level variations directly in its low dimensional temporal embedding. To accommodating high spatial dimensionality, DMFA generatively parameterize spatial factors from a low dimensional spatial latent through neural networks.
We evaluate the performance of DMFA on a synthetic and two real large-scale fMRI datasets. Our experiments demonstrate that DMFA uncovers meaningful clusters in these data and achieves better predictive performance for unseen data relative to the state-of-the-art.

heading: 2 Related Work
text: Factor Analysis in fMRI: Factor analysis in neuroimaging includes a wide range of approaches for reducing data dimensionality to facilitate their interpretability and computational tractability. Principal component analysis (PCA) [Pearson, 1901] and independent component analysis (ICA) [Comon et al., 1991] are among the most well-known classical factor analysis methods. To accommodate tensor data and mitigate scalability issues, multilinear versions of PCA and ICA have been proposed in Vasilescu and Terzopoulos [2005], Beckmann and Smith [2005], Cichocki [2011], Richard and Montanari [2014], Hopkins et al. [2015]. Specifically, for multi-subject fMRI study, Lee et al. [2008] proposed independent vector analysis (IVA) and Richard et al. [2020] developed MultiView ICA to model shared responses. Likewise, Chen et al. [2015] developed a shared response model (SRM) for aggregating multi-subject fMRI data and highlighting group differences, and Van Kesteren and Kievit [2021] incorporated structured residuals into the exploratory factor analysis (EFA) framework. Karahanoğlu and Van De Ville [2015] deconvolved hemodynamic response from rest fMRI time series and then performed temporal clustering on the resulting whole-brain innovation signals to recover the corresponding spatial patterns. However, spatial factors obtained by these methods are unstructured, often have the same size as the images in the original dataset, and may include many small and large voxel clusters across the brain, therefore are not directly interpretable [Manning et al., 2014b]. More important, these methods are permutation invariant along temporal dimension (i.e., do not assume any relationships between temporal dimensions), therefore do not model temporal dynamics [Yu et al., 2016].
To enhance spatial interpretability, Manning et al. [2014b] introduced topographic factor analysis (TFA), a probabilistic technique that casts each brain image as a weighted sum of Gaussian spatial factors. In this way, each Gaussian blob (a.k.a topographic factor) can be thought of as a brain region for which activation levels are estimated over time, and is easily interpreted through its set of parameters. Later on, authors proposed a hierarchical version of TFA (HTFA) [Manning et al., 2018] to incorporate data from multiple subjects and enable hypothesis testing across subjects by applying hierarchical Gaussian priors for global and subject-specific parameters of temporal and topographic factors. These linearly-dependent hierarchical Gaussian priors, though, favor estimation of unimodal distributions and limit the model’s expressivity. Recently, Sennesh et al. [2020] proposed neural TFA (NTFA) for task fMRI, which extends TFA by incorporating neural networks onto its framework. NTFA assumes separate latent embeddings for participants and stimuli and map them into the temporal and spatial latents with neural networks. However, methods in this line of work
1The source code is available at https://github.com/ostadabbas/DMFA
essentially assume a prior in which temporal weights are conditionally independent as a function of time, which means that they do not encode temporal dynamics.
Dynamical Factorization: A number of matrix/tensor factorization approaches have been proposed for modeling temporal dynamics in sequential data. These methods employ linear-Gaussian statespace models [Sun et al., 2014], autoregressive temporal regularizer [Bahadori et al., 2014, Yu et al., 2016, Takeuchi et al., 2017], and multilinear dynamical systems [Rogers et al., 2013, Cai et al., 2015, Jing et al., 2018]. In contrast to these methods which provide point estimates, Bayesian dynamical factorization has been proposed in Xiong et al. [2010], Charlin et al. [2015], Sun and Chen [2019], in which linear temporal dynamics are applied to factor latents. While some of these methods have been successful in dynamical modeling of sequential data, they are less effective for high dimensional spatial data like fMRI as they do not explicitly adopt any structural constraints for spatial factors. Moreover, their linear dynamical assumptions lack the capacity to characterize nonlinear dependencies.
Motivated by recent advances in deep learning, several studies have implemented neural networks into Gaussian state space models for nonlinear dynamical modelling [Krishnan et al., 2015, Watter et al., 2015, Chung et al., 2015, Karl et al., 2017, Krishnan et al., 2017, Fraccaro et al., 2017, Becker et al., 2019, Farnoosh et al., 2021]. A common practice is to learn a temporal latent model followed by a mapping to data space, a.k.a. a decoder, and an encoder for amortized variational inference. However, this encoding/decoding framework is not tractable in very high dimensional spatial data like fMRI. To be more specific, it is computationally intensive to feed high dimensional data for amortized estimation, or map to them directly from a latent space (see Section 4.1 for a detailed discussion). Also, several studies have employed recurrent neural networks (RNNs) for temporal analysis of fMRI data [Hjelm et al., 2018, Dvornek et al., 2018, Yan et al., 2019, Wang et al., 2019]. RNN-based methods are not probabilistic and can only process reduced dimensional ROI data. Although convolutional RNN models can capture both temporal and spatial correlations, by construction they do not provide the familiar spatial correlation maps that we expect in neuroimaging analysis and that are necessary for neuroscientific interpretability. In addition, RNN model are harder to train on long sequences due to the vanishing/exploding gradient problem as they feed parameters sequentially. While this problem is much alleviated in LSTM, GRU, and Transformer models, these architectures still result in a huge computational graph and intense GPU memory consumption on long sequences, which leads to very long training times. In contrast, DMFA, as will be explained below, samples from a distinct posterior distribution at each time point and can fit arbitrarily long sequences without any issues (by allowing parallel computations over time), and at the same time infers smooth spatial factors automatically.

heading: 3 Deep Markov Factor Analysis (DMFA)
text: Let’s assume a corpus of N fMRI data {Yn |n ∈ [1:N ]} for Yn ∈ RT×V , where T and V are the number of time points and voxels, respectively. DMFA defines a hierarchical dynamical deep generative model over this corpus in a factorization framework:
Yn ∼ Norm(W>n Fn, σYI), Wn ∼ Norm(µWθ (ZWn ), σWθ (ZWn )),
Fn = [ fk,v := RBFk(v; ρk, γk) ] ,
ρ, γ ∼ Norm(µFθ(zFn), σFθ(zFn)), zFn ∼ Norm(0, I), ZWn ∼ pθ(ZWn |Cn), Cn ∼ Cat(π).
where Fn ∈ RK×V are K V spatial factors and Wn ∈ RK×T are their associated temporal weights, consistent with a factorization framework. pθ(ZWn |Cn) is a deep generative Markovian prior over a set of low dimensional temporal latents ZWn = {zWn,t | t ∈ [0:T ]}
conditioned on a discrete latent Cn for clustering. The temporal weights Wn are sampled from a Gaussian distribution whose mean and covariance are a function of ZWn and are parameterized by neural networks µWθ and σ W θ , respectively. The spatial factors Fn are determined by a set of K radial basis functions (RBFs) whose parameters {ρ, γ} are sampled from a Gaussian distribution parameterized by neural networks µFθ and σ F θ from a low dimensional spatial latent z F n. All networks have parameters, which are collectively denoted by θ. Finally, σY denotes observation noise. The graphical model for DMFA is depicted in Fig. 1.
Clustering Latent: We assume that each fMRI data Yn belongs to a specific cluster s ∈ [1:S] which is declared by its associated discrete latent Cn ∼ Cat(π) sampled from a categorical prior with assignment probability vector π. This discrete latent conditions the first temporal latent zWn,0 resulting in a Gaussian mixture distribution over this temporal latent:
pθ(z W n,0|Cn = s) = Norm(µs,Σs),
where µs and Σs are determined by cluster assignment.
Deep Generative Markovian prior: We assume that the temporal latents ZWn are related through a Markov chain, for which the transition probability pθ(zWn,t|zWn,t−1) = Norm(µZθ(zWn,t−1), σZθ(zWn,t−1)) is a Gaussian distribution whose mean and covariance are parameterized by neural networks from zWn,t−1. We further blend the estimated mean from neural network with a linear transformation of zWn,t−1 to support both nonlinear and linear transitions (we dropped n for brevity):
µZθ(z W t−1) = (1− g) µ Z,L θ (z W t−1) + g µ Z,NL θ (z W t−1)
where µZ,Lθ (·) represents a linear mapping, µ Z,NL θ (·) is the nonlinear mapping of neural network, and g ∈ [0, 1] is a weighting vector estimated from zWt−1 with another neural network. Temporal Weights & Spatial Factors: As with the transition model, we assumed Gaussian distributions for temporal weights, such that their means and covariances are a function of their associated temporal latents:
wn,t ∼ Norm(µWθ (zWn,t), σWθ (zWn,t)), where µWθ and σ W θ are neural network functions. The high spatial dimensionality in fMRI data encourages the need for a hierarchical analysis that summarizes spatial factors with fewer parameters. Therefore, consistent with Manning et al. [2014b,a, 2018], we represent each spatial factor as a radial basis function (i.e., a Gaussian blob):
fkv := RBFk(v; ρk, γk) = exp ( − ‖pv − ρk‖ 2
exp (γk)
) ,
where pv ∈ R3 denotes the position of voxel with index v, and ρk, γk ∈ R3 denote the center and extent of the Gaussian blob, respectively. The set of all RBF parameters {ρk, γk | k ∈ [1:K]} ∼ Norm(µFθ(z F n), σ F θ(z F n)) are sampled from a Gaussian distribution whose mean and covariance are a function of the shared spatial latent zFn. Introducing z F n as a low dimensional spatial embedding encourages estimation of a multi-modal distribution among spatial factors.

heading: 3.1 Learning DMFA with Variational Inference
text: We train DMFA with stochastic variational methods [Hoffman et al., 2013, Ranganath et al., 2013]. These methods approximate the posterior pθ(W,ZW, zF,C, ρ, γ|Y ) using a variational distribution qφ(W,Z
W, zF,C, ρ, γ), where φ denotes parameters of the variational model, by maximizing a lower bound on the log-likelihood of the data:
L(θ, φ) = log pθ(Y )− KL ( qφ(W,Z W, zF,C, ρ, γ) || pθ(W,ZW, zF,C, ρ, γ|Y ) ) .
By maximizing this bound with respect to the parameters θ and φ, we learn a deep generative model and perform Bayesian inference, respectively.
Parameterizing Variational Distribution: We assume a fully factorized variational distribution and introduce trainable variational parameters for each data as mean and covariance of a diagonal Gaussian:
qφ(W,Z W, zF,C, ρ, γ) = N∏ n=1 q(Cn)q(zWn,0)q(z F n) K∏ k=1 q(ρn,k, γn,k) T∏ t=1 q(zWn,t)q(wn,t),
where q(·) for continuous latents are parametric Gaussian distributions. Note that due to the high dimensionality of fMRI data (V N , i.e., number of voxels are much larger than number of data), we do not utilize an amortized inference (where a single parametric function maps each data to a set of variational parameters) as it could be computationally very expensive and result in over-fitting (see Section 4.1). Although we can define variational parameters for categorical distributions q(Cn), we approximate it with posterior p(Cn|zWn,0) to compensate information loss induced by the mean-field approximation:
q(Cn = s) ' p(Cn = s|zWn,0) = p(Cn = s)p(zWn,0|Cn = s)∑S s=1 p(Cn = s)p(z W n,0|Cn = s)
This approximation has a two-fold advantage: spares the model additional trainable parameters for variational distribution, and further links variational parameters of qφ(zWn,0) to generative parameters of pθ(zWn,0) and pθ(c), hence results in a more robust learning and inference algorithm.
Derivation of Evidence Lower Bound (ELBO): Once the generative model and variational distribution are determined, we can derive the ELBO which contains a reconstruction term and regularization terms for each latent to bring their variational posterior as close as possible to their generative prior: Ln(θ, φ) = Eqφ(Wn)qφ(ρn,γn) [ log pθ(Yn|Wn, Fn) ] (Likelihood)
− ∑ Cn qφ(Cn) KL ( qφ(z W n,0)||pθ(zWn,0|Cn) ) − KL ( qφ(Cn)||p(C) ) (Clusters)
− ∑ t Eqφ(zWn,t−1) [ KL ( qφ(z W n,t)||pθ(zWn,t|zWn,t−1) )] (Markov Transitions)
− ∑ t Eqφ(zWn,t) [ KL ( qφ(wn,t)||pθ(wn,t|zWn,t) )] (Weights)
− ∑ k Eqφ(zFn) [ KL ( qφ(µn,k, γn,k)||pθ(µn,k, γn,k|zFn) )] − KL ( qφ(z F n)||p(zF) ) . (Factors)
We compute Monte Carlo estimate of gradient of the ELBO using a reparameterized sample from the variational distribution of continuous latents. For the discrete latent, Cn, we compute the expectations over qφ(Cn) by summing over all the possibilities, hence no sampling is performed. We analytically calculate the KL terms of ELBO for both multivariate Gaussian and categorical distributions, which leads to lower variance gradient estimates and faster training as compared to e.g., noisy Monte Carlo estimates often used in the literature.

heading: 4 Training Details
text: We described the network architectures of DMFA in Table 1, where Dt and De are the dimensions of hidden layers for (µZθ, σ Z θ) and (µ W θ , σ W θ ), respectively. We did all the programming in PyTorch v1.3 and used Adam optimizer with learning rate of 0.01. We initialized all the parameters randomly except for locations of Gaussian blobs for which we set initial values to local extrema in their averaged fMRI data. We clipped Gaussian blob parameters to the confines of brain if needed. We used a linear KL annealing schedule, [Bowman et al., 2016], which increased from 0.01 to 1 over 100 epochs. We learned/tested all models on an Intel Core i7 CPU @3.7 GHz with 8 Gigabytes of RAM, which proves tractability of the learning process. Per-epoch training time varied from 0.1 minutes in small datasets to 6.0 minutes in larger experiments and 200 epochs sufficed for most experiments.

heading: 4.1 Discussion of Parameter Count for DMFA
text: The number of learnable parameters for variational distribution in DMFA is O(NTK). DMFA has O(KDe+Dt) parameters for its temporal generative model and O(K) parameters for its spatial generative model. Note that the clustering latent, C, does not impose additional parameters to the variational distribution, while only adds O(S) parameters to the temporal generative model.
While DMFA introduces extra features and more complex modeling assumptions for fMRI experiments compared to TFA methods of Manning et al. [2014b,a, 2018], (i.e., infers nonlinear temporal dynamics and performs clustering), we emphasize that it has the same order of parameters as these methods. TFA methods similarly have O(NTK) parameters as they employ a fully factorized variational distribution. We also want to highlight that DMFA is tractable in very high dimensional spatial data like fMRI in contrast to nonlinear state-space models of Watter et al. [2015], Krishnan et al. [2017], Fraccaro et al. [2017], Karl et al. [2017], Becker et al. [2019]. The encoder/decoder structure in these works, i.e., qφ(Wn|Yn)/pθ(Yn|Wn), immediately scales both generative and variational parameters to at least O(KV), where V ∼ 105 NT in fMRI data, hence causes extensive computational burden and more importantly overfitting. Furthermore, these methods do not learn a generative model for spatial factors, i.e., pθ(ρ, γ), and as a result are not able to reason about subject-level variabilities in this respect. We overcome these challenges in DMFA by carefully designing our non-amortized variational inference and imposing functional form assumptions on spatial factors in a factorization framework. The proposed learning and inference algorithm keep generative parameters in O (KDe + Dt) O(KV), and variational parameters in O(NTK), where NT ∼ 102 − 105, yield an observation to parameter ratio of O( NTVNTK ) = O( V K ) for all the experiments, therefore permit an efficient learning process.

heading: 5 Experimental Results
text: We analysed the performance of DMFA on a synthetic and two large-scale fMRI datasets. In the first experiment, we verified DMFA’s capability in recovering the true clusters and capturing the underlying temporal dynamic in a synthesized fMRI dataset (visualized in Fig. 2). Next, we evaluated the performance of DMFA on a large scale resting-state fMRI data, Autism dataset [Craddock et al., 2013], and a task fMRI data, Depression dataset [Lepping et al., 2016]. We assessed the clustering feature of DMFA on both datasets in terms of disease and cognitive state separation tasks, visualized in Fig. 3 and Fig. 4. We further provided a quantitative comparison with two state-of-the-art Bayesian generative models for fMRI data, HTFA [Manning et al., 2018] and NTFA [Sennesh et al., 2020], and a deep state-space model, RKN [Becker et al., 2019], in terms of synthesis quality of the generative models on both datasets by computing held-out log-likelihood and prediction accuracy, respectively, in Table 2.

heading: 5.1 Synthetic fMRI
text: We generated synthetic fMRI data using a MATLAB package provided by Manning et al. [2014b], which is known to be useful for analysing fMRI models. The synthesized brain image for each trial (time point) is a weighted summation of a number of radial basis functions (spatial factors) randomly located in brain. This synthesized fMRI data is then convolved with a hemodynamic response function (HRF) and zero-mean Gaussian noise with a medium-level signal-to-noise ratio is added. Here, we considered 30 activation sources (spatial factors) randomly located in a standard MNI-152-3mm brain template with roughly V = 270, 000 voxels and 150 trials. We randomly split these 30 activation sources into 3 groups, each having 10 of the Gaussian blobs. These three groups of sources are periodically activated according to some random weights, one after another, for 5 trials. We generated non-overlapping sequences of T = 5 time points from this synthetic fMRI data. This resulted in 10 data points for each activation group (i.e., N = 30). To train DMFA, we set T = 5, K = 30, Dt = 2, De = 8, S = 3, and σY = 0.01. As depicted in Fig. 2 (a), DMFA was able to successfully recover the 3 clusters of activation that were present in this dataset totally unsupervised. The dynamical trajectory of each cluster mean in the temporal latent (i.e., µzWt |µzWt−1 ,C) is predicted sequentially from the learned generative model and is visualized in the bottom-right of Fig. 2 (a), and appears to be partitioned into three consecutive rotational dynamics. This is consistent with the periodic activations of sources in data clusters (which come in tandem). Predictions of the learned generative model for a selected activation source are visualized in Fig. 2 (d) for the next 50 time points, estimated as follows: wt ∼ p(wt|zt), where zt ∼ p(zt|zt−1) for t = {151, . . . , 200}. These predicted samples perfectly follow hemodynamic response function, confirming DMFA’s capacity in capturing the underlying nonlinear HRF by using neural networks in its deep temporal generative model.

heading: 5.2 Autism Dataset
text: We used the publicly available preprocessed resting state fMRI (rs-fMRI) data from the Autism Brain Imaging Data Exchange (ABIDE) collected at 16 international imaging sites [Craddock et al., 2013]. This dataset includes rs-fMRI imaging from 408 individuals suffering from Autism Spectrum
Disorder (ASD), and 476 typical controls. Each scan has T = 145 ∼ 315 time points at TR = 2, and V = 271, 633 voxels. We split the signals into sequences of 75 time points. We take two approaches to evaluate the performance of DMFA in separating ASD from control: (i) Cluster data directly in the low dimensional latent, ZW, using the clustering feature of DMFA (called DMFA), (ii) Extract functional connectivity matrices, [Hull et al., 2017], from learned temporal weights, W , followed by a 10-fold SVM for classification (called DMFA+SVM). As baselines, we performed a 10-fold SVM classification on extracted connectivity matrices from (i) averaged signals of 116 ROIs in automatic anatomical labeling (AAL) atlas [Kazeminejad and Sotero, 2019] (called ROI+SVM) and (ii) a hundred time courses obtained with nonlinear spatial ICA of Hyvarinen and Morioka [2017] (called ICA+SVM). Several studies have been done on this dataset to differentiate ASD group from control [Abraham et al., 2017, Parisot et al., 2017, Singh et al., 2017, Kazeminejad and Sotero, 2019, Wang et al., 2021, Sun et al., 2021], all of which using supervised methods, and could achieve accuracies up to 72% using the signals extracted from anatomically labeled regions in the brain by carefully splitting data to be as homogeneous as possible and reducing site-related variability.
We set T = 75, K = 100, De = 15, Dt = 5, S = 2, σY = 0.01, and trained DMFA for 200 epochs on the entire dataset (Full), and also datasets from 9 imaging sites (with more balanced datasets) separately: Caltech, Leuven, MaxMun, NYU, SBL, Stanford, UM, USM, Yale. As shown in Fig. 3 (Right), DMFA and DMFA+SVM outperformed baselines in Caltech, SBL, Stanford, and Yale (at p-value < 0.005, corrected for multiple comparisons), while ROI+SVM and ICA+SVM only performed better in NYU dataset. DMFA+SVM performed slightly better than baselines on the entire dataset (Please note that DMFA is a clustering approach, hence, no error bars are provided for it in Fig. 3). Clustering results for Caltech, Maxmun, SBL, and Stanford are shown in Fig. 3 (Left) in which ASD and control seems to be partially separable (see Fig. S1 in supplementary for more visualization results).

heading: 5.3 Depression Dataset
text: In this dataset [Lepping et al., 2016], 19 individuals with major depressive disorder (MDD) and 20 never-depressed control participants listened to standardized positive and negative emotional musical and nonmusical stimuli during fMRI scanning. Each participant underwent 3 musical, and 2 nonmusical runs each for 105 time points at TR=3 with V = 353, 600 voxels. During each run, each stimulus type (positive, and negative) was presented for 33 seconds (∼ 11 time points) interleaved with instances of neutral tone of the same length. We discarded instances of neutral tone, and split each run into non-overlapping sequences of T = 6 time points in agreement with stimuli design (each stimuli block is split into two sequences). In other words, each run has 4 sequences associated with “positive stimuli”, and 4 with “negative stimuli” resulting in a total of 8 data points for each run.
In the first experiment, we trained DMFA on the entire musical runs (N = 39 × 3 × 8 = 936) by setting T = 6, K = 100, De = 15, Dt = 5, σY = 0.001 for 200 epochs. The results are shown in Fig. 4 (a, Left). We observed that DMFA fully separated the data points associated with each subject into distinct clusters across the low dimensional temporal latent space. In other words, DMFA was able to re-unite pieces of signals associated with each subject without any supervision. More importantly, DMFA was able to partially separate the data points associated with MDD group from control. As seen in Fig. 4 (a, Left), the MDD group data points are fairly populated in the center of temporal latent while control group are dispersed across the latent space. However, DMFA was not able to meaningfully separate “negative” and “positive” music pieces in its low-dimensional latent space from a subject-level perspective, since the variation between runs of a subject dominates the stimulus-level variation. For this reason, in a second experiment, we focused on 5 subjects, and their first musical run from both MDD and control group and trained DMFA respectively. Again, as expected, data points from each subject were distinctly clustered in the latent space (see middle and right columns in Fig. 4 (a)). Additionally, DMFA was able to fit two partially separating Gaussians to “positive”, and “negative” stimuli per subject. However, since the number of data points for each subject and run is limited, the significance of these clusters are not conclusive. A dataset with longer runs could possibly answer that.

heading: 5.4 Comparison with State-of-the-Art
text: We further evaluated DMFA against HTFA [Manning et al., 2018], an established probabilistic generative model for multi-subject fMRI analysis, which uses unimodal Gaussian priors for both temporal weights and spatial factor parameters, and its neural network-based extension NTFA [Sennesh et al., 2020] in terms of held-out log-likelihood, and a state-of-the-art deep state-space model, recurrent Kalman networks (RKN) [Becker et al., 2019], in terms of next-time-point prediction accuracy of test set (see Table 2). Held-out likelihood is an established metric for evaluating generative models (in lack of a ground-truth) and measures how probable an unseen data is under the generative model. For next-time-point prediction, we adopt a rolling prediction scheme as in Chen et al. [2019], and predict next time point on the test set sequentially from historical data using the generative model and spatial factors learned on the train set.
We split our data to train and test as follows. We used the Caltech site subset from autism dataset and split each subject’s fMRI time series into two half (each with T = 70). We trained the models on the first half, and tested on the second half. For the depression dataset, we considered 4 sequences from each subject’s run for training and tested on the remaining 4 sequences. We set K = 100 spatial factors for all the models and trained each with their default hyperparameters. For the RKN model, we fit AAL atlas ROI signals as it is intractable to feed raw high-dimensional data. We reported average normalized prediction error (NRMSE%) for both RKN and DMFA on AAL atlas regions to make a fair comparison. For the synthetic fMRI, we set K = 30 and picked half of the data for test, and used the 30 Gaussian blob activations as ROI signals for reporting prediction accuracy in RKN and DMFA. The results are shown in Table 2, which proves that DMFA resulted in models with higher likelihood on the test sets, hence it is a better fit when compared to NTFA and HTFA models. DMFA also resulted in better predictions on the test sets of autism, depression, and synthetic datasets when compared with RKN.

heading: 5.5 Ablation Study
text: We performed two ablation studies to further evaluate (and quantify) the impact of deep neural networks and Markov temporal apriori. First, we trained a version of DMFA in which we removed nonlinear activation functions (i.e., PReLU), denoted as DMFA. As reported in Table 2, in our datasets, this resulted in a decrease in held-out likelihood. Also, the inferred temporal latents lacked the interpretable patterns seen in Fig. 3 and Fig. 4 in terms of clinical/cognitive separability as latents collapsed into the conditional Gaussian priors. Second, we trained a version of DMFA in which we removed the temporal connections (i.e., temporal transition model), denoted as DMFA. Again, this resulted in a drop in held-out likelihood as reported in Table 2, however, the temporal latents preserved their interpretable patterns.

heading: 6 Conclusion
text: We presented deep Markov factor analysis, DMFA, a new probabilistic model for robust factor analysis of high dimensional fMRI data. We employed a chain of low dimensional Markovian latents connected by deep neural networks and conditioned on a discrete latent as a state-space embedding for temporal weights to account for nonlinear dynamics, enable data clustering in a low dimensional space, and provide informative visualizations about data. To tackle high spatial dimensionality in fMRI, we employed a low dimensional spatial embedding to generatively parameterize spatial factors. DMFA proves fast and capable on large-scale fMRI data.

heading: Acknowledgment
text: This work was supported by award numbers 1944964 and 1835309 from the national science foundation (NSF). The authors would also like to thank the anonymous reviewers for their insightful feedback.

Review summaries:
The paper presents a deep Markov factor analysis (DMFA), which is a generative model that employs Markov property in a chain of low dimensional temporal embeddings as well as spatial inductive assumptions in order to capture temporal dynamics in functional magnetic resonance imaging (fMRI). The paper shows that DMFA has capability to cluster fMRI data in its low temporal embedding in regards to subject and cognitive state variability. The advantages of DMFA are demonstrated both through synthetic and application data.

The paper Deep Markov Factor Analysis (DMFA): Towards Concurrent Temporal and Spatial Analysis of fMRI Data proposes a scalable approach to factorize the data of each subject into a product of a small number of spatial and temporal components. Following on the work of (Manning et al., Topographic Factor Analysis, Plos ONE 2014) on topographical factor analysis, each spatial component is given by a radial basis function. The temporal components are modeled from a set of latent satisfying the Markov property. The first latent is conditioned on the data class giving to the model clustering capabilities. Variational inference is used to derive a lower bound of the log-likelihood which is then optimized via stochastic gradient descent. In a first experiment on resting state data (Autism dataset), DMFA is used to obtain subject specific atlases that allow to seggregate ASD and control subjects with an accutacy of 60 % (it is definitely hard to read). On a second experiment (Depression dataset), MDD and controls are exposed to different musical stimuli and DMFA is able to seggregate well the data of different subjects without supervision. In some extend it gives some hint about the kind of stimuli and the conditions of the subjects but results are not so convincing (the authors are honest about this).  In a third experiment they show that DMFA gives better results than other methods in terms of held-out log-likelihood and prediction of the next time point given the history. The code for DMFA is available. Pre-trained model are given and the code to generate the figures from pre-trained model works. 

This paper introduces Deep Markov Factor Analysis (DMFA). DMFA can model spatiotemporal BOLD fMRI time series by using time-varying latent factors that govern time-varying spatial maps consisting of spatial mixtures of RBFs. Latent time series are associated to a categorical clustering variable in order to enable grouping. Certain links in the Bayesian diagram are modeled using deep neural networks. Optimization is done by a variational approach. Experiments are performed on a simulated data set with known ground truth, the ABIDE autism data set, and a Depression study data set. Some clustering of relevant clinical outcomes is observed.   

The authors present deep Markov factor analysis (DMFA) to capture temporal dynamics in functional magnetic resonance imaging data. The method chosen by the authors is relevant since existing methods overlook the highly nonlinear and complex temporal dynamics of neural processes when factorizing their imaging data. The authors claim that their method (DMFA) is able to cluster fMRI data in its low dimensional temporal embedding, which enables validation of fMRI related hypotheses.

The paper proposes deep Markov factor analysis (DMFA) that uses the Markov process to capture the temporal dynamics in the fMRI dataset and maps the high spatial dimensions to a low-dimensional feature space. DMFA can cluster fMRI responses into “low dimensional temporal embedding” based on subject or cognitive state. The empirical studies on synthetic and real fMRI datasets illustrate that DMFA generates better performance in comparison with state-of-the-art techniques --- such as NTFA and HTFA.