## 3 Materials and Methods
### Regional Topic Model and Its Online Inference Algorithm
\begin{split}& p(\mathbf{\rho},\mathbf{\theta},\mathbf{\pi},R,T,X|\mathbf{\alpha}, \beta,\lambda)=p(\mathbf{\rho},R|\beta)p(\mathbf{\pi},T|\mathbf{\alpha})p(\mathbf{\theta},X|R,T, \lambda)\\ &=p(\mathbf{\rho}|\beta)p(R|\mathbf{\rho})\cdot\prod\limits_{r=1}^{R} \prod\limits_{t=1}^{T}p(\theta_{rt}|\lambda)\cdot\prod\limits_{j=1}^{T}p\big{(} \mathbf{\pi}_{j}|\mathbf{\alpha}\big{)}p\big{(}T_{j}\big{|}\mathbf{\pi}_{j}\big{)}p\big{(} X_{j}\big{|}R,T_{j},\mathbf{\theta}\big{)}\\ &=p(\mathbf{\rho}|\beta)p(R|\mathbf{\rho})\cdot\prod\limits_{r=1}^{R} \prod\limits_{t=1}^{T}p(\theta_{rt}|\lambda)\cdot\prod\limits_{j=1}^{T}p\big{(} \mathbf{\pi}_{j}|\mathbf{\alpha}\big{)}\prod\limits_{n=1}^{N_{j}}p\big{(}\mathbf{\mathrm{ t}}_{jn}|\mathbf{\pi}_{j}\big{)}p\Big{(}\mathbf{x}_{jn}\big{|}\mathbf{t}_{jn}, \mathbf{r}_{jn\in i},\mathbf{\theta}_{\mathbf{r}_{jn}\in i},\mathbf{j}_{jn} \Big{)}\end{split}  \tag{7}\]  
According to above construction of RTM, the model learning acts as clustering document sample subsets \(X_{j}=\left\{\mathbf{x}_{jn}\right\}_{n=1}^{N_{j}}\). The word samples not only can be clustered to \(T\) motion topics, but also to \(R\) motion regions. Each latent motion topic is inevitably correlated to a space region. It is worth noting that even though there have been several studies that introduce latent variables for merging various factors to jointly estimate document contents, which have the obvious differentiation with our RTM. For instance, in topic modeling of document, [PERSON] et al. [39] introduced an author latent variable, and [PERSON] et al. [40] introduced an emotion latent variable. Both of them first generated the introduced variables (emotion or author) from a specific distribution, then generated a latent topic from a multinomial distribution conditioned on generated variable, and finally generated document terms from another multinomial distribution based on latent topics. Whereas our RTM generates a introduced variable (region) and a latent topic in two independent steps respectively, and finally generates document terms from a multinomial distribution based on fixed latent region and topic. Therefore, a different generative process leads to different forms of joint distribution as well as inference algorithm. As with traditional topic model, there are generally two kinds of inference methods for our RTM: MCMC sampling and VB inference. For realizing the real-time video mining, we proposed a hybrid stochastic variational Gibbs (HSVG) sampling algorithm for RTM. In comparison with HSVG sampling, the Gibbs sampling algorithm needs to scan the entire samples for at each iteration as a batch algorithm. Therefore, due to the huge memory (risk of overhead), slower running and difficultly determining convergence time, even collapsed Gibbs sampling algorithm is not suitable for huge data sets or data stream. The HSVG algorithm introduces the second source of stochasticity by MCMC sampling, and takes advantage of sparse computation to make complexity sublinearly increased with the number of topics, which fits for large collection with many topics. The inference process of our HSVG algorithm is formulated with more detail as follows. Firstly, the motion region label is considered as a global latent variable. We eliminate the local motion topic weight \(\mathbf{\pi}_{j}\) by marginal computation, and obtain the local collapsed space of latent variable \(Z=\left(\left\{T_{j}\right\}_{j=1}^{J},\ R\right)=\left\{\mathbf{t}_{jn}, \mathbf{r}_{jn\in i}\right\}_{n=1,j=1}^{N_{j},\ J}\). Then the strong correlation between latent variable \(Z\) and local motion topic weight \(\mathbf{\pi}_{j}\) is retained. The joint distribution becomes Equation (8)  
\[ \begin{split}& p(\mathbf{\rho},\mathbf{\theta},R,T,X|\mathbf{\alpha},\beta, \lambda)\\ &=p(\mathbf{\rho}|\beta)p(R|\mathbf{\rho})\cdot\prod\
olimits_{r=1}^{R} \prod\
olimits_{t=1}^{T}p(\theta_{rt}|\lambda)\cdot\prod\
olimits_{j=1}^{J}p \big{(}T_{j}|\mathbf{\alpha}\big{)}p\big{(}X_{j}\big{|}R,T_{j},\mathbf{\theta}\big{)} \end{split}