Abstract
Analyzing functional magnetic resonance imaging (fMRI) time courses with dynamic approaches has generated a great deal of interest because of the additional temporal features that can be extracted. In this work, to systemically model spatiotemporal patterns of the brain, a Gaussian hidden Markov model (GHMM) was adopted to model the brain state switching process. We assumed that the brain switches among a number of different brain states as a Markov process and used multivariate Gaussian distributions to represent the spontaneous activity patterns of brain states. This model was applied to resting-state fMRI data from 100 subjects in the Human Connectome Project and detected nine highly reproducible brain states and their temporal and transition characteristics. Our results indicate that the GHMM can unveil brain dynamics that may provide additional insights regarding the brain at resting state.
Introduction
Understanding the human brain as a dynamical system is gaining traction in the literature (Fox et al., 2005; Rabinovich and Muezzinoglu, 2010), where the human brain is assumed to frequently switch among different metastable states instead of lingering in a single state. Moreover, dynamic approaches, such as sliding window correlation, have shown advantages over stationary ones in detecting neurological diseases, such as schizophrenia (Sakoğlu et al., 2010). These advantages arise from additional features gained by analyzing the brain signals dynamically. Therefore, modeling brain state switching as a dynamic system can unveil additional characteristics about the underlying processes of human brains.
Existing dynamic analysis approaches have limitations. For example, some techniques, such as coactivation patterns (CAPs) (Liu et al., 2013; Liu and Duyn, 2013;), spatial independent component analysis (ICA) (Beckmann et al., 2005), and temporal ICA (Smith et al., 2012) cannot fully exploit information contained in the temporal order of functional magnetic resonance imaging (fMRI) time frames. When the temporal order of fMRI time frames is ignored, each time frame is treated as an independent sample of the brain, and thus shuffling fMRI time frames does not affect the spatial patterns derived by these approaches. In addition, ICA-based approaches assume independence of components and rely on this assumption to derive spatial patterns. Other dynamic methods take the sequential order of fMRI time frames into consideration. For example, the sliding window approach, which has been applied to estimate fluctuations in functional connectivity (Allen et al., 2014), retains sequential information in the data. However, because the length of the sliding window is fixed (Keilholz, 2014), signals from multiple states may be mixed in each window, resulting in contamination between states and maybe even cancellation of signals. While these methods present simple statistics, such as the occurrence rate of CAPs or functional connectivity states, quantification of the sequential transitions between CAPs or states is not embedded in these models.
In contrast, we focus on quantifying the sequential transitions between different brain states using transition probabilities, and model the brain with a Gaussian hidden Markov model (GHMM) (Bilmes, 1998; Eddy, 1996). Assuming the brain transits among different states over time, our GHMM models the state switching process as a Markov chain, and the spontaneous activity pattern of each brain state as a multivariate Gaussian distribution. Unlike ICA, which assumes the components to be independent with each other, our model makes no hypothesis on the relationship between brain states.
The HMM has been previously employed as a sequential modeling tool in studying the brain (Baker et al., 2014; Eavani et al., 2013; Jones et al., 2007; Ou et al., 2014). The HMM was applied to electrophysiological data and detected 4 brain states of neuronal firing patterns in rodents subjected to different types of stimuli (Jones et al., 2007). Applied to human data, the HMM revealed temporal variability of functional connectivity in magnetoencephalography (Baker et al., 2014) and fMRI (Eavani et al., 2013; Ou et al., 2014). A generalized HMM, the hidden Markov random field, was applied in fMRI to detect binary state (on/off) switching on a voxel level (Lindquist et al., 2007; Liu et al., 2014; Robinson et al., 2010).
Compared to the previous applications of HMM in fMRI, our approach is substantially different. The model in Ou and coworkers (2014) was based on the functional connectivity strength derived by the sliding window method, while our model is directly based on fMRI time courses, which will not encounter the aforementioned blurring by the use of sliding window. Although Eavani and coworkers (2013) also modeled fMRI time courses using a HMM, they studied functional connectivity changes using covariance matrices from each state. In contrast, we investigate temporal dynamics of spontaneous brain activity by analyzing the average activity pattern of each state. The hidden Markov random field in (Lindquist et al., 2007; Liu et al., 2014; Robinson et al., 2010) assumed that each voxel had only two states (on/off), whereas our GHMM does not have assumption on the number of states. Furthermore, the criteria for determining the number of states in the previous work was relatively ambiguous with the number of states determined by the elbow point (Eavani et al., 2013) or local optimum (Ou et al., 2014) of the model's log-likelihood. In this study, we introduce a more quantitative and robust method of using stability as a criterion for determining the number of states.
To the best of our knowledge, GHMM has not hitherto been applied to model the sequential state switching process of spontaneous brain activities. The GHMM quantifies the sequential transition of brain states and is not restricted by the aforementioned limitations of CAPs, ICA, and sliding window. In this article, we describe this approach and its application in a comprehensive analysis of brain spontaneous activities based on the publicly available Human Connectome Project (HCP) dataset.
Materials and Methods
Dataset and preprocessing
One hundred subjects from HCP (Van Essen et al., 2013) S500 release were used in the present work (age: 22–36+, gender: 46 male/54 female, TR = 0.72 sec, scan duration: 14.4 min, one scan for each subject). Preprocessing was performed according to the minimal preprocessing pipelines of HCP (Glasser et al., 2013). In particular, we considered the data that had been processed with ICA-FIX (Griffanti, Salimi-Khorshidi et al., 2014; Salimi-Khorshidi et al., 2014), registered onto 32k Cento69 surface mesh (Van Essen et al., 2012), and slightly smoothed with 2 mm half width at half maximum kernel. All time courses were further filtered with a 0.01–0.1 Hz band-pass filter.
To reduce computational complexity, signals from 236 regions of interest (ROIs) (Power et al., 2011) were extracted by averaging time courses of voxels within a 5 mm radius. This distance was calculated based on surface distance by Dijkstra's algorithm (Hanke et al., 2009). The mean value of each time course was subtracted and the standard deviations were normalized to 1 before these time courses were fed into the GHMM.
Brain state switching model
To model resting-state fMRI time courses in a nonstationary manner, we applied a sequential modeling tool, GHMM, to analyze the data. It has been shown that the brain is constantly switching from one metastable state to another (Rabinovich and Muezzinoglu, 2010). In this work, the sequential switching process of brain states was modeled as a Markov chain, while an observation of a brain state (i.e., an fMRI time acquisition) was modeled by a multivariate Gaussian distribution. A toy example illustrating the use of a GHMM with two states is shown in Figure 1. In this example, the brain is switching between two different brain states (introspection state and external processing state), and the observation from fMRI are activations in default mode network (DMN) and dorsal attention network, respectively.

A two-state toy example of the brain's Gaussian hidden Markov model (GHMM). In this case, the brain is only switching between two states, introspection and external processing. The numbers on the arrows represent the probabilities of state switching. During the introspection state, the default mode network is activated, whereas in the external processing state, activation is assumed to be in the dorsal attention network. Color images available online at
To derive the GHMM that best fits the fMRI observations, its parameter set
where λ is the parameter set for the GHMM;
the parameters in the above equation are as follows.
The observations from fMRI time courses,
Stability and reproducibility
Different initializations of the Baum–Welch algorithm may lead to convergence into different local optima. To address this issue, we repeated the algorithm eight times with eight different initializations on 50 subjects and selected the model parameter, λ, which provided the best objective
The stability of brain states is assessed by summing up all the correlation coefficients between every pair of brain states in the same group (total number of pairs is 10(10 − 1)/2 = 45). In our case, the stability for each brain state was the summation of at most 45 correlation coefficients, and the sum was therefore normalized by dividing it by 45. Finally, brain states were sorted in the order of descending stability. The matching and sorting procedure is illustrated schematically in Figure 2A.

The schematic of state matching and sorting
To test the reproducibility of our model on different datasets, we split the data of 100 subjects into two nonoverlapping groups of subjects (50 subjects each), and each half of the dataset was analyzed with the GHMM. The brain states extracted from both halves were compared to see whether the brain states were reproducible in different groups of subjects. Based on our results, we were able to find nine stable and highly reproducible brain states. Therefore, we subsequently set the total number of states to 9 when applying GHMM to resting-state fMRI data.
Brain state sequence decoding
The Viterbi algorithm (Viterbi, 1967) was used to decode the optimal brain state sequence,
Spontaneous brain activity pattern of each state
We decoded the hidden brain state sequence for all the subjects and realizations with the Viterbi algorithm. After matching and grouping the brain states of different realizations, a time frame was labeled with a state only when it was assigned to the same state in all the realizations. Then the Z-scores of all the time frames that have been under the same state were computed as a representation of the spontaneous brain activity pattern of the brain state.
Results
After grouping the brain states from all 10 realizations, the stability of brain states was calculated. The states were subsequently sorted in the order of descending stability (S1 is defined to be the most stable state). Figure 2B and C show the stability of the resultant brain states when the total number of states, M, was set to 9 and 10, respectively. When M = 9, each of the nine states was able to match to a corresponding state in all 10 realizations, and thus only nine groups emerged (Fig. 2B). However, when M = 10, some states in some realizations failed to find a match in other realizations, so there were 11 possible groups for this case (Fig. 2C). Figure 2B and C illustrate that the stabilities of brain states are close to 1 when the total number of states is 9, whereas some states start to exhibit low stabilities when the total number of states is set to 10. In fact, with varying number of states (M = 5, 8, 9, 10, 11, 12, 20), it was found that the stabilities are almost 1 when M is set to 9 or less, but substantially less than 1 when M is greater than 9. Therefore, for the subsequent analysis, the number of states was set to 9.
The brain states detected from the nonoverlapping split-half samples of subjects are presented in Figure 3. The nine brain states extracted from the entire group of 100 subjects and two nonoverlapping samples of 50 subjects are almost identical (Fig. 3A). As can be seen in Figure 3B, correlation coefficients between the brain states from the two halves of the dataset indicate that the spatial patterns of all brain states are highly reproducible across different groups of subjects (p << 0.001). Although the correlation coefficient of the last state is the lowest, it is still statistically significant (p << 0.001). The last state also has relatively low Z-scores (darker colors in Fig. 3A and no patterns after thresholding in Fig. 4) compared to the other eight states. The spatial patterns of the nine stable and highly reproducible brain states detected from the entire dataset, denoted as S1 to S9, are further demonstrated in Figure 4. For better visualization, Figure 4 only displays Z-scores below −20 or above 20. For each state, a brain region with large positive or negative Z-scores indicates that it is highly activated or deactivated. Note that the absolute Z-scores in S9 are below 20 so no activation is seen in Figure 4 for S9.

The reproducibility of brain states for split-half samples.

The Z-maps of nine reproducible brain states. The color bar is set to only display Z-scores below −20 or above 20. These brain states are different combinations of activated and deactivated brain regions. Color images available online at
All detected brain states consist of combinations of activated and deactivated brain regions. For example, as shown in Figure 4, brain activities in S6 and S7 are concentrated in regions specific to default mode and attention networks. S6 contains activation in the DMN and deactivation in the attention network, whereas S7 is comprised of deactivation in the DMN and activation in the attention network. Brain states S3 and S5 are almost opposite in a sense that S5 is comprised of activation in the sensorimotor and visual networks along with deactivation in the frontoparietal control network, while S3 contains deactivation in the sensorimotor and visual networks plus activation in the frontoparietal control network and DMN. Meanwhile, S1 and S2 are whole brain activation or deactivation with sensorimotor and visual networks being the most activated or deactivated. Also, S8 and S4 show whole brain activation and deactivation, but with lower intensities than those in S1 and S2. The final state, S9, has less apparent activation or deactivation patterns in known networks compared with other states.
We also found that the brain is constantly switching among different states. Figure 5A shows an example of a sequence of brain states and how the posterior probability,

Temporal characteristics of the brain state.
After decoding the state sequence, we counted the number of transitions between states and calculated the average direct transition times between each pair of states. Only transitions that are significantly more frequent than the average are color coded in Figure 6A (p < 0.0007. Since this is a multiple comparison, Bonferroni correction has been applied to the α value). Note that most of the states (except S1 and S2) transit to S9 frequently, and S9 also switches back to other states frequently.

The transition properties of the brain states.
The transition from the DMN activation to the attention network activation has been noted previously (Majeed et al., 2011). Based on our results, S7 shows attention network activation, whereas S6 exhibits DMN activation. Therefore, we investigated the duration of the motif from the beginning of S7 to the end of S6 (direct and indirect transitions have both been accounted for). Figure 6B shows the histogram of the duration, in which the peak of the distribution lies between 10 and 20 seconds.
To illustrate the advantage of exploiting temporal information, the method used in CAPs (Liu et al., 2013; Liu and Duyn, 2013), k-means, was applied on the signal from the 236 ROIs used in the GHMM analysis. For this analysis, the split-half approach described in the Materials and Methods section was repeated and the reproducibility of the states derived with the repeated application of k-means was tested. For comparison, the number of initializations and repetitions used was identical to that for the GHMM analysis. Supplementary Figure S1 (Supplementary Data are available online at
Discussion
In general, the Markov property can be applied on either temporal or spatial axes of data. When it is used to model spatial relationship among voxels, it is called a Markov random field and a binary state switch is typically assumed for each voxel (Lindquist et al., 2007; Liu et al., 2014; Robinson et al., 2010). When the Markov property is assumed on the temporal axis, it is a Markov random process and has been employed to investigate variability in functional connectivity over time (Eavani et al., 2013; Ou et al., 2014). In contrast to the previous application of HMM, we applied the GHMM on temporal axis to model the spontaneous brain activity state switching process. Moreover, we introduced a robust approach for determining the number of states based on the stability. The nonstationary assumption of the GHMM provides the ability to capture the dynamics of the brain activity measured by the resting-state fMRI. Our spatiotemporal model of spontaneous activities across the brain in resting-state fMRI was able to identify nine stable brain states with reproducibility near 1. Furthermore, the detected brain states have analogues to combinations of conventional resting-state networks (RSNs). The implications of these results are discussed in the following paragraphs.
The reproducibility of GHMM on estimating brain states is affected by two factors: (1) algorithmic stability and (2) the dataset that the model is trained on. Since the algorithm is nonconvex, there is no guarantee of a global optimum and different initializations can lead to different local optima. Increasing the repetitions of the algorithm with different initializations will increase the chance for the algorithm to reach the global optimum and, thus, increase the stability of the results. Increasing the total number of states will increase the number of parameters in the model, which may lead to a more complicated model with more local optima and thus a less stable result. This could explain the low stability of some states when the total number of states is larger than 9 (Fig. 2C). Meanwhile, different datasets,
No spatial constraint is imposed in our GHMM, yet the nine states identified exhibit smooth contiguous activated and deactivated regions. We further note that these activated and deactivated brain regions resemble conventional RSNs. For example, the whole brain deactivation states, S2 and S4, have been found by temporal functional modes (Smith et al., 2012). Also, linear combinations of activated/deactivated DMN and deactivated/activated attention network, S6 and S7 (Fig. 4), have also been reported as CAPs (Liu et al., 2013; Liu and Duyn, 2013). The existence of these two brain states explains why DMN and attention network are often anticorrelated in seed-based correlation analysis (Fox et al., 2006). Our results further indicate that these two networks are only anticorrelated when the brain is in S6 and S7, rather than during the entire scan. Moreover, the switch between different states leads to changing correlation and anticorrelation patterns and, thus, can explain why the functional connectivity changes over time (Allen et al., 2014). Comparing Figure 3 and Supplementary Figure S1A, we note that most of the spatial patterns of brain states detected by our GHMM (S1, S2, S3, S5, S6, and S8) are similar to those detected by k-means (Supplementary Fig. S1C), indicating that most of our brain states are consistent with those detected by CAPs.
As shown in Figure 5, the duration of states differs for each state and even differs for each occurrence. Therefore, the use of conventional sliding window-based analysis with fixed window length can lead to signals from multiple brain states being merged together and possibly canceling each other. Based on our results, we recommend decoding the brain state sequence first and then determining the window length according to the duration of states rather than fixing the length and sliding the window.
To the best of our knowledge, a state similar to S9 has not been presented in previous literature. We hypothesize that S9 is the “ground” state of the brain, in which brain activity (or deactivity) is similar for the entire cortex (no apparent activation or deactivation as shown in Fig. 4). Note that different groups of subjects have different spatial patterns for state S9 (Fig. 3A). Therefore, S9 has the lowest reproducible spatial pattern (Fig. 3B). However, its temporal characteristics allowed us to distinguish it consistently from other states. S9 occurs more frequently (37.5 ± 6.4 times per scan. or per 14.4 min) compared to other brain states and has a short duration (3.6 ± 0.6 sec; Fig. 5B). From the transition matrix in Figure 6A, we can see that most states (except S1 and S2) often switch to S9 and then transit back to other states from S9. The spatial and temporal characteristics of S9 indicate that it is an intermediate transient state that appears when the brain is switching between other more reproducible brain states and could represent a “ground” state. Note that the low reproducibility of S9's spatial pattern makes it difficult to detect using methods that only consider spatial information when defining states. This may be the reason why k-means cannot detect this state (Supplementary Fig. S1A). Our ability to detect it could be due to the additional temporal information inherent in our model.
States S7 and S6 have similar spatial activation patterns as the attention network and DMN, respectively, reported in literature (Broyd et al., 2009; Buckner et al., 2008) (Supplementary Fig. S2). Prior work (Majeed et al., 2011) found a reproducible transition from activation in attention network (similar to S7) to activation in DMN (similar to S6) within a 20 sec sliding window. Interestingly, the present method also detected similar transition duration between these states. The histogram of the motif from the beginning of S7 to the end of S6 in Figure 6B shows that there exists a peak between 10 and 20 sec, indicating that the motif is more likely 10 to 20 sec in duration, consistent with what was reported in the literature (Majeed et al., 2011). Note that this transition from S7 to S6 not only accounts for direct transition, but also includes indirect transitions through intermediate states (e.g., S7->S9->S6), which were also shown by Majeed and coworkers (2011).
The intrinsic advantage of GHMM over CAPs is that GHMM quantifies state transitions explicitly using a Markov chain in the model. The quantification of state transition not only provides the ability to capture temporal characteristics (Figs. 5 and 6), but also give rise to additional brain states. Specifically, the 9th state, detected by GHMM, due to a relatively low reproducibility of its spatial pattern, is difficult to capture by methods that only consider spatial similarity, such as k-means used by CAPs. However, since S9 has distinctive temporal properties (high occurrence frequency and short duration), GHMM is able to detect it consistently (Fig. 3). Supplementary Figure S1C further illustrates that there are spatial differences in activation patterns between CAPs and GHMM in other brain states as well, including the whole brain deactivation (C1 for CAPs and S4 for GHMM) and attention networks (C8 for CAPs and S7 for GHMM).
The results in this work must be considered in the context of several limitations. First, we assume a memory-less transition between brain states by using Markov chains, that is, the current brain state only depends on the previous state. Fortunately, the HMM is robust to violations of this assumption and has been successfully applied to speech recognition (Rabiner, 1989) as well as detection of brain states from electrophysiological measurements (Jones et al., 2007), neither of which is a memory-less system. Another methodological limitation is that state duration is not modeled explicitly in the present work, and to stay in the same state, the system needs to conduct a self-transition, which would decrease the probability of staying in the same state exponentially over time. In future work, the HMM with explicit duration can be applied, and the duration probability distribution will be trained with the dataset as well. Due to computational limitations, we only trained our GHMM with 236 time courses from the brain of each subject. A voxel-wise GHMM may be able to capture more detailed spatial characteristics of the states. In the present work, we have applied temporal filtering (0.01–0.1 Hz) to focus on the low frequency spontaneous activity (Fox et al., 2005). However, recent studies have demonstrated that visual and sensorimotor networks are also present in higher frequencies (0.5–0.8 Hz) (Lee et al., 2013). We plan to study the effect of different temporal resolutions by applying GHMM to high temporal resolution data and study brain state switching process at other time scales.
Conclusion
We have applied GHMM to analyze resting-state fMRI. The GHMMs the brain state switching process as a Markov chain and the brain states as multivariate Gaussian distribution. Spatially, nine stable and reproducible brain states were discovered and found to be combinations of activated or deactivated RSNs. Temporally, we were able to derive the brain state sequence for individual subjects with the model, and evaluate the occurrence and duration of each state. One transient state, S9, was identified based on its spatiotemporal characteristics. The motif from activated attention network (S7) to activated DMN (S6) was also found to be consistent with previous literature. Therefore, we conclude that the study of brain state sequential switching process can unveil spatiotemporal pattern of the brain and further improve our understanding of brain dynamics.
Footnotes
Acknowledgments
The authors thank Jaemin Shin for his useful suggestions. This work was supported in part by the Georgia Research Alliance.
Author Disclosure Statement
No competing financial interests exist.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
