## 2 Detection Model
### Foreground Motion Blocks Extraction
#### 2.1.1 Sampling Areas Determination
To begin ROC analysis, we define set \(Te\) as the set of test examples (detection outputs); \(Te^{+}\) and \(Te^{-}\)

Figure 11: Visual effect comparisons through different methods on HEVC/AVC test sequences. (**a**) Original frames. (**b**) Ground truth. (**c**) Motion vector mask. (**d**) The proposed method. (**e**) SSGodec [29]. (**f**) Sigma-Delta [68]. are the positive (foreground) and negative (background) subsets, respectively, of \(Te\). Meanwhile, a score function, \(\hat{s}(x)\), denotes the score function of the sample pixel \(x\). Then, the ranking accuracy is defined as:

\[rank-acc=\frac{\sum\limits_{x\in Te^{+},x^{\prime}\in Te^{+}}\delta(\hat{s}(x)> \hat{s}(x^{\prime}))+\frac{1}{2}\delta(\hat{s}(x)=\hat{s}(x^{\prime}))}{Pos \cdot Neg}, \tag{25}\]

where \(\delta(\cdot)\) is the indicator function, and \(Pos\) and \(Neg\) are the number of positive and negative samples, respectively, in \(Te\). For convenience, the output image data of each detection method are normalized between 0 and 1 and binarized via a threshold \(\xi\), and the score function \(\hat{s}(x)\) is defined as:

\[\hat{s}(x)= \begin{cases}&(I_{g}(x)-\xi)^{2},\;\;I_{g}(x)>\xi\\ &-(I_{g}(x)-\xi)^{2},\;\;I_{g}(x)<\xi.\end{cases}  \tag{26}\]

Figure 12a,b provide the ROC curve for AVC/HEVC dataset sequences with three detecting methods, and Figure 12a,b stand for CDNet dataset sequences with six detecting methods. One can see that the proposed method has a larger AUC value. In other words, the demand of detection precision for foreground/background classification is reached. For computation time analysis, we test the performance of each detection method both on CDNet and on AVC/HEVC Sequences. As for CDNet dataset, three sequences (_Canoe_, _Office_, _Highway_) are selected, and each sequence has separated in batches by 20 frames. Figure 13 shows the average

Figure 12: ROC curves for different test sequences based on several detection methods. (**a**) _BQSquare_; (**b**) _Stefan_; (**c**) _PeopleShade_; (**d**) _Highway_. batch-running time for these detection methods tested on CDNet dataset. For AVC/HEVC dataset, four different resolutions of sequences are chosen, which are: _Container_ (QCIF), _Ice_ (CIF), _Racchorse_ (416 \(\times\) 240), _KristenAndSara_ (1280 \(\times\) 720). Figure 13 displays the time consumption data for different sequences while Figure 13 provides the time consumption data for sequences differ from data resolutions. We can find that the proposed method achieves a lower computation time and better performance on detection precision compared with other approaches. Also, the proposed method intends to find a balance between time costs and detection accuracy. #### 3.1.5 Performance Comparisons with Motion Vector Extraction Methods

In this subsection, we add some extra experiments that evaluate the performance compared with some other motion vector extraction methods. Based on the authors' acknowledgements, previous works have introduced the idea of extracting motion vectors of moving objects as ROI detection methods. For example, in [69; 70], the authors proposed a two-stage method to identificate moving objects. At the first stage, moving objects are detected based on the analysis of motion vectors in predicted MBs and DCT coefficients in intra-coded MBs. Then, the authors proposed motion vector informations such as spatial correlation, temporal correlation to identify moving objects. Also, they considered the solutions for objects with intra-coded MBs. [PERSON] et al. [71] presented a novel segmentation approach to extract moving objects in the H.264 compressed domain, in which motion vectors are first refined by the motion relativity in both space and time, then clustered based on their differences with the reference of global motion vector. Similarly, work [72] used Global Motion Compensation (GMC) to effectively extract moving objects based on motion vectors. The authors proposed a search-matching algorithm to compute the background motion vectors for global motion extraction.