## 2 The Proposed Method
\(MAX_{I}\) is 1, and \(MSE\) is the mean square error between the grayscale of input image \(I\) and the convolution feature \(F_{k}\). \[MSE=\frac{1}{HW}\sum_{i=1}^{H}\sum_{j=1}^{w}\left\|I(i,j)-F_{k}(i,j)\right\|^{2} \tag{3}\]  
where \(H\) and \(W\) are the height and width of the image, respectively; and \(k=1\), \(2\),..., \(64\) denotes the number of the convolution image. Figure 2: CNN features of the input image extracted by conv1_1 of the VGG16. The two feature images with the maximum values of PSNR are shown in Figure 3. The indices are the 32 nd and 26 th in Figure 2, respectively. In the same scene, the feature distributions extracted by the convolution layer for different video frames are the same. The ranking of the PSNR values which are obtained from one input frame are used as the indices of the convolution feature of the subsequent frames. Therefore, the indices of the two features with maximal PSNR only need to be computed once. Two convolution feature images of the maximum PSNR value are merged into a new image and the formula is as follows:  
\[\hat{I}=\frac{\hat{F}-min(\hat{F})}{max(\hat{F})-min(\hat{F})} \tag{4}\]  
where \(\hat{F}=F_{max}+F_{sec}\), and \(F_{max}\) and \(F_{sec}\) are the two feature images with the maximum values of PSNR. Obviously, \(\hat{I}\) is normalized to a range 0-1. Once the synthetic image is obtained, the foreground binary image (\(FG\)) is finally obtained by the traditional background subtraction method. \[FG(i,j)=\left\{ \begin{array}{ll}1,&if\;\;BGS\Big{(}\hat{I}(i,j)\Big{)}\;is\; foreground\\ 0,&if\;\;BGS\Big{(}\hat{I}(i,j)\Big{)}\;is\;background\end{array} \right. \tag{5}\]  
where \(i\) and \(j\) are the position coordinates of the pixels; \(i=1,\;2,\dots,\;H;\;j=1,\;2,\dots,\;W\); and \(BGS\) is a background subtraction method. Algorithm 1 depicts the overall procedure of the proposed method. ``` Input: \(l_{l}\): input image of video, t = 1, 2,..., L, L is the frame number of the video; Output: \(FG\): the foreground of the input image. \(F\leftarrow conv(I_{1})\). Calculate the \(PSNR\) values between \(F\) and the grayscale image of \(I_{1}\). Find the numbers \(ind_{max}\) of \(F_{max}\) and \(ind_{sec}\) of \(F_{sec}\). \(t\gets 2\) While\(t\leq L\) Do \(F\leftarrow conv(I_{l})\) \(F_{max}=F(ind_{max})\) and \(F_{sec}=F(ind_{sec})\)  Calculate \(\hat{I}\) using (4)  Obtain the foreground image \(FG\) using Equation (5) \[t\gets t+1\] End While

Figure 3: Two CNN features with the maximal PSNR. ## 3 Experiments

To verify the performance of the proposed method, the dynamic background videos from CDnet [20] were used to test the method. The CDnet is an expanded change detection benchmark dataset, which provides a realistic, diverse set of videos and covers a wide range of detection challenges. The main advantage of this dataset is that it provides the ground truths for all video frames. Therefore, the dataset can be used to quantitatively evaluate the performance of various background subtraction methods and rank them. The category of dynamic background contains six videos depicting outdoor scenes with strong background motion. The details of this category are presented in Table 3.

The performance of the background modeling methods was evaluated at the pixel level. The background modeling methods classified pixels into foreground or background. The following six metrics were used to evaluate the performance of the background modeling methods:

\[Recall=\frac{TP}{TP+FN}\]

\[Precision=\frac{TP}{TP+FP}\]

\[FPR=\frac{FP}{FP+TN}\]

\[FNR=\frac{FN}{TP+FN}\]

\[PWC=100\times\frac{FN+FP}{TP+FN+FP+TN}\]

\[F-measure=2\times\frac{Precision\times Recall}{Precision+Recall}\]

where \(TP\) is the number of correctly detected foreground pixels, \(TN\) is the number of correctly detected background pixels, \(FP\) is the number of background pixels that are incorrectly marked as the foreground pixel, and \(FN\) is the number of foreground pixels that are incorrectly marked as the background pixels.