## 3 Materials and Methods
### Regional Topic Model and Its Online Inference Algorithm  
In our RTM, the goal is to discover a set of motions (topics) from video by learning the probability distributions of visual features over each topic and topics over each clip. These two probability distributions are represented as two co-occurring matrixes in Figure 1. Meanwhile, the location information of motion is discovered. Nonetheless, BOVW based on latent Dirichlet allocation (LDA) model presumes that the words are unordered and interchangeable in document, this hypothesis destroys the spatial information of motions or activities; we are unable to get the motion region from model learning. In order to keep and use the spatial information of motion in video, we introduce RTM, in which each sample in a frame is not only labeled by its motion direction \(\omega\) but also by a motion region label \(r\in\{0,1,\ldots R\}\). It means that the latent motion topics in videos are associated with the regions where they occurred in. Suppose that there are \(J\) documents (video clips), each document \(j\in J\) contains \(N_{j}\) observed samples \(\mathbf{x}_{jn}\). \(\mathbf{t}_{jn}\) is the motion topic of each sample \(\mathbf{x}_{jn}\), and \(\mathbf{r}_{jn\in i}\) is its motion region label of region \(i\). Then, video sequence can be represented as \(X=\left\{X_{j}\right\}_{j=1}^{J}\), \(X_{j}=\left\{\mathbf{x}_{jn}\right\}_{n=1}^{N_{j}}\). The latent variables are motion topic and regional labels sets \(Z=\left\{T,\,R\right\}=\left\{\mathbf{t}_{jn},\,\,\mathbf{r}_{jn\in i}\right\} _{n=1,j=1}^{N_{j},\,J}\). From a global perspective, motion topic weight vector of document \(j\) can be expressed as \(\boldsymbol{\pi}_{j}=\left\{\pi_{jt}\right\}_{t=1}^{T}\). When a symmetric Dirichlet prior distribution is applied on the topic weight vector \(\boldsymbol{\pi}_{j}\), the hyperparameters of Dirichlet prior is \(\alpha,\boldsymbol{\pi}_{j}\sim\text{Dir}(\alpha)\). From a local perspective, motion regional weight vector can be expressed as \(\boldsymbol{\rho}=\left\{\rho_{r}\right\}_{r=1}^{R}\). When a symmetric Dirichlet prior distribution \(\beta\) is applied on the regional weight vector, it means \(\boldsymbol{\rho}\sim\text{Dir}(\beta)\). Document \(j\) shares \(T\) motion topics by local topic weight vector \(\boldsymbol{\pi}_{j}=\left\{\pi_{jt}\right\}_{t=1}^{T}\). In other words, the motion topic label subset \(T_{j}=\left\{\mathbf{t}_{jn}\right\}_{n=1}^{N_{j}}\) obeys a multinomial distribution of \(T\) dimension whose parameter is \(\boldsymbol{\pi}_{j}\), \(T_{j}\sim\text{Mul}\big{(}\boldsymbol{\pi}_{j}\big{)}\)\[\log p\left(T_{j}|\mathbf{\pi}_{j}\right)\ =\sum_{t=1}^{T}N_{jt}\log\pi_{jt}\log p \left(T_{j}|\mathbf{\pi}_{j}\right)\ =\sum_{t=1}^{T}N_{jt}\log\pi_{jt} \tag{1}\]  
Local motion topic weight vector \(\mathbf{\pi}_{j}\) obey a symmetric Dirichlet prior distribution \(\mathbf{\pi}_{j}\sim\text{Dir}(\alpha)\) whose parameter is \(\alpha\)  
\[\log p\left(\mathbf{\pi}_{j}|\alpha\right)\ =\log\Gamma(T\alpha)-T\log\Gamma(\alpha)+ \sum_{t=1}^{T}(\alpha-1)\log\pi_{jt} \tag{2}\]  
The corpus share \(R\) motion regions by global region weight vector \(\mathbf{\rho}=\left\{\rho_{r}\right\}_{r=1}^{R}\).