## 3 Materials and Methods
### Regional Topic Model and Its Online Inference Algorithm
In our experiment, we divide whole video into 250 clips; each clip is 12 s (360 frames). The top 14.36 min (30 documents) is training dataset, and the last 10 min (50 documents) is test dataset. Each scene of a clip is first divided into a 4 by 4 grid (a total of 16 positions) and five valid regions. After cutting off the part of sky and generating motion code book for model training, RTM-HSVG (RTM is learned and inference by Hybrid Stochastic Variational Gibbs Sampling) and RTM-GS (RTM is learned and inference by Gibbs Sampling) then computes the negative loglikelihood of every region as a score in each test clip and abnormality clips are picked up while its abnormality score exceed 1.5 times of average. The parameter settings are shown in Table 2

### Experimental Results

#### 4.3.1 Simulation Experiment of Visualization Traffic Intersection

Firstly, the motion topics and regions discovered by RTM-GS and RTM-HSVG is shown in Figure 5, where Figure 5a shows the seven random simulated abnormal motions. The number of simulated training documents is same as the number of test set, which is 100. As can be seen from Figure 5, although RTM-GS discovers more latent regions, a refined topic division is obtained by RTM-HSVG. Furthermore, in RTM-HSVG, the two roads with same direction are combined to a latent region, which is capable of moving crossroad. It is more reasonable that motions comply with traffic rules of a same road are the same. To compare the abilities of our model to discover abnormal motion, the NLL and r_NLL comparisons of our model and actual values is shown in Figure 6. \begin{table}
\begin{tabular}{l c} \hline \hline
**RTM-GS** & **RTM-HSVG** \\ \hline Burn-in time \(N=2000\); After Markov chain convergence, sampling at intervals of 100 times; the total number of sampling is \(S=20\); \(T=18\); \(R=20\); The hyper parameter is \(\alpha=0.3\); \(\beta=1.2\); \(\lambda=0.3\) & Burn-in time \(N=400\); After [PERSON] chain convergence, sampling at intervals of 10 times; the total number of sampling is \(S=10\); \(T=36\); \(R=20\); The hyper parameter is \(\alpha=0.3\); \(\beta=1.2\); \(\lambda=0.3\) & Burn-in time \(N=400\); After [PERSON] chain convergence, sampling at intervals of 10 times; the total number of sampling is \(S=20\); \(T=18\); \(R=20\); The hyper parameter is \(S=10\); \(T=36\); \(R=20\); The hyper parameter is \(\alpha=0.3\); \(\beta=1.2\); \(\lambda=0.3\) & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameter settings of RTM-HSVG and RTM-GS. Figure 5: Motion topics and regions discovered by RTM-GS and RTM-HSVG in simulation dataset (**a**) The seven random simulate abnormal motions. (**b**) The four motion topics and five regions discovered by RTM-GS. (**c**) The four motion topics and three regions discovered by RTM-HSVG. As shown in Figure 6, for r_NLL curve, the accuracy of RTM-GS seems to be higher than RTM-HSVG. Nonetheless, for NLL curve, RTM-HSVG obtained a higher accuracy. As HSVG is a kind of stochastic algorithm, it cause a volatile shocks in r_NLL curve. It also suggests that our stochastic online algorithm need to introduce more motion region information to acid early-warning. The difference between RTM-GS and RTM-HSVG is also able to be observed in their ROC and AUC, which is shown in Figure 7.

Figure 6: The NLL and r_NLL comparisons of our model and actual values. (**a**) NLL (left and blue) and r_NLL (right and blue) comparisons of RTM-HSVG. (**b**) NLL (left and blue) and r_NLL (right and blue) comparisons of RTM-GS. Figure 7: Comparative results of ROC. (**a**) Comparative results on NLL. (**b**) Comparative results on r_NLL. As shown in Figure 7, the area under NLL ROC of RTM-HSVG is 0.68, and RTM-GS is 0.56. This result again explains that the comprehensive accuracy of RTM-HSVG is better than RTM-GS. On the other hand, the area under r_NLL ROC of RTM-HSVG is 0.64, and RTM-GS is 0.97, which illustrates that the performance of learning motion region of RTM-GS is better than RTM-HSVG.