BSUV-Net: A Fully-Convolutional Neural Network for Background Subtraction of Unseen Videos
M. Ozan Tezcan Prakash Ishwar Janusz Konrad
cs.CV













 BSUV-Net: A Fully-Convolutional Neural Network for
 Background Subtraction of Unseen Videos
    
  M. Ozan Tezcan, Prakash Ishwar, Janusz Konrad
    This work was supported in part by ARPA-E under agreement DE-AR0000944 and by the donation of Titan GPUs from NVIDIA Corp.


  Department of Electrical and Computer Engineering

  Boston University, Boston, MA 

   


    
==================================================================================================================================================================================================================================================================================










   Background subtraction is a basic task in computer vision and video processing often applied as a pre-processing step for object tracking, people recognition, Recently, a number of successful background-subtraction algorithms have been proposed, however nearly all of the top-performing ones are supervised. Crucially, their success relies upon the availability of some annotated frames of the test video during training. Consequently, their performance on completely “unseen” videos is undocumented in the literature. In this work, we propose a new, supervised, background-subtraction algorithm for unseen videos () based on a fully-convolutional neural network. The input to our network consists of the current frame and two background frames captured at different time scales along with their semantic segmentation maps. In order to reduce the chance of overfitting, we also introduce a new data-augmentation technique which mitigates the impact of illumination difference between the background frames and the current frame. On the CDNet-2014 dataset,  outperforms state-of-the-art algorithms evaluated on unseen videos in terms of several metrics including F-measure, recall and precision.






§ INTRODUCTION


Background subtraction (BGS) is
a foundational, low-level task in computer vision and video processing. The aim of BGS is to segment an input video frame into regions corresponding to either foreground (e.g., motor vehicles) or background (e.g., highway surface).
It is frequently used as a pre-processing step for higher-level tasks such as object tracking, people and motor-vehicle recognition, human activity recognition, etc. Since BGS is often the first pre-processing step, the accuracy of its output has an overwhelming impact on the overall performance of subsequent steps. Therefore, it is critical that BGS produce as accurate a foreground/background segmentation as possible.

Traditional BGS algorithms are unsupervised and rely on a background model to predict foreground regions <cit.>. PAWCS <cit.>, SWCD <cit.> and WisenetMD <cit.> are considered to be state-of-the-art unsupervised BGS algorithms. However, since they rely on the accuracy of the background model, they encounter difficulties when applied to complex scenes. Recently, ensemble methods and a method leveraging semantic segmentation have been proposed which significantly outperform traditional algorithms <cit.>.

The success of deep learning in computer vision did not bypass BGS research <cit.>. A number of supervised deep-learning BGS algorithms have been developed <cit.> with performance easily surpassing that of traditional methods. However, most of these algorithms have been tuned to either one specific video or to a group of similar videos, and their performance on unseen videos has not been evaluated. For example, FgSegNet <cit.> uses 200 frames from a test video for training and the remaining frames from the same video for evaluation. If applied to an unseen video, its performance drops significantly (Section <ref>).

In this paper, we introduce Background Subtraction for Unseen Videos (), a fully-convolutional neural network for predicting foreground of an unseen video. A key feature of our approach is that the training and test sets are composed of frames originating from different videos.
This guarantees that no ground-truth data from the test videos have been shown to the network in the training phase.
By employing two reference backgrounds at different time scales,  addresses two challenges often encountered in BGS: varying scene illumination and intermittently-static objects that tend to get absorbed into the background.
We also propose novel data augmentation which further improves our method's performance under varying illumination.
Furthermore, motivated by recent work on the use of semantic segmentation in BGS <cit.>, we improve our method's accuracy by inputting semantic information along with the reference backgrounds and current frame.
The main contributions of our work are as follows:

 -2pt-2pt-2pt
    
  * Supervised BGS for Unseen Videos: Although supervised algorithms, especially neural networks, have significantly improved BGS performance, they are tuned to a specific video and thus their performance on unseen videos deteriorates dramatically. To the best of our knowledge,  is the first supervised BGS algorithm that is truly generalizable to unseen videos.
    
  * Data Augmentation for Increased Resilience to Varying Illumination: 
    Changes in scene illumination pose a major challenge to BGS algorithms. 
    To mitigate this, we develop a simple, yet effective, data augmentation technique.
    Using a simple additive model we vary the illumination of
    the current frame and the reference background frames that are fed into  during training. This enables us to effectively tackle various illumination change scenarios that may be present in test videos.
    
  * Leveraging Semantic and Multiple Time-Scale Information:  improves foreground-boundary segmentation accuracy by accepting semantic information as one of its inputs. This is unlike in an earlier BGS method <cit.> which used semantic information as a post-processing step. The other network inputs are the current frame (to be segmented) and a two-frame background model with data from different time scales. While one background frame, based on distant history, helps with the discovery of intermittently-static objects, the other frame, based on recent history, is key for handling dynamic factors such as illumination changes.


Based on our extensive experiments on the CDNet-2014 dataset <cit.>,  outperforms state-of-the-art BGS algorithms evaluated on unseen videos







§ RELATED WORK



A wide range of BGS algorithms have been developed in the past,
each having some advantages and disadvantages over others. 

Since this is not a survey paper, we will not cover all BGS variants. Instead, we will focus only on 
recent top-performing methods.

We divide these algorithms into 3 categories: (i) BGS by (unsupervised) background modeling, (ii) supervised BGS tuned to a single video or a group of videos, (iii) Improving BGS algorithms by post-processing.


    


 §.§ BGS by Background Modeling


Nearly all traditional BGS algorithms first compute a background model, and then use it to predict the foreground. While a simple model based on the mean or median of a subset of preceding frames offers only a single background value per pixel, a probabilistic Gaussian Mixture Model (GMM) <cit.> allows a range of background values. This idea was improved by creating an online procedure for the update of GMM parameters in a pixel-wise manner <cit.>. Kernel Density Estimation (KDE) was introduced into BGS <cit.> as a non-parametric alternative to GMMs and was subsequently improved <cit.>. The probabilistic methods achieve better performance compared to single-value models for dynamic scenes and scenes with small background changes.

    
In <cit.>, Barnich and Droogenbroeck introduced a sample-based background model. Instead of implementing a probabilistic model, they modeled the background by a set of sample values per pixel and used a distance-based model to decide whether a pixel should be classified as background or foreground. Since color information alone is not sufficient for complex cases, such as illumination changes, Bilodeau introduced Local Binary Similarity Patterns (LBSP) to compare the current frame and background using spatio-temporal features instead of color <cit.>. St-Charles combined color and texture information, and introduced a word-based approach, PAWCS <cit.>. They considered pixels as background words and updated each word's reliability by its persistence. Similarly, SuBSENSE by St-Charles <cit.> combines LBSP and color features, and employs pixel-level feedback to improve the background model. 
    
Recently, Isik introduced SWCD, a pixel-wise, sliding-window approach leveraging a dynamic control system to update the background model <cit.>, while Lee introduced WisenetMD, a multi-step algorithm to eliminate false positives in dynamic backgrounds <cit.>. 
In <cit.>, Sultana introduced an unsupervised background estimation method based on a generative adversarial network (GAN).
They use optical flow to create a motion mask and then in-paint covered regions with background values estimated by a GAN. The foreground is then computed by subtracting the estimated background from the current frame followed by morphological operations. 
They, however, do not achieve state-of-the-art results.
Zeng introduced RTSS <cit.> which uses deep learning-based semantic segmentation predictions to improve the background model used in SubSENSE <cit.>.




 §.§ Supervised BGS



Although background subtraction has been extensively studied in the past, the definition of a supervised BGS algorithm is still vague. Generally speaking, the aim of a supervised BGS algorithm is to learn the parameters (e.g., neural-network weights) of a complex function in order to minimize a loss function of the labeled training frames. Then, the performance of the algorithm is evaluated on a separate set of test frames. In this section we divide the supervised BGS algorithms into three groups namely, video-optimized, video-group-optimized and video-agnostic depending on which frames and videos they use during training and testing. 

Several algorithms use some frames from a test video for training and all the frames of the same video for evaluating performance on that video. In such algorithms, parameter values are optimized separately for each video. We will refer to this class of algorithms as video-optimized BGS algorithms.  In another family of algorithms, randomly-selected frames from a group of test videos are used for training and all the frames of the same videos are used for testing. Since some frames from all test videos are used for training, we will refer this class of algorithms as video-group-optimized algorithms. Note that, in both of these scenarios the algorithms are neither optimized for nor evaluated on unseen videos and to the best of our knowledge all of the top-performing supervised BGS algorithms to-date are either video-optimized or video-group-optimized. In this paper, we introduce a new category of supervised BGS algorithms, called video-agnostic algorithms, that can be applied to unseen videos with no or little loss of performance. To learn parameters, a video-agnostic algorithm uses frames from a set of training videos but for performance evaluation it uses a completely different set of videos.


In recent years, supervised learning algorithms based on convolutional neural networks (CNNs) have been widely applied to BGS. The first CNN-based BGS algorithm was introduced in <cit.>. This is a video-optimized algorithm which produces a single foreground probability for the center of each 27 × 27 patch of pixels.
A method proposed in <cit.> uses a similar approach, but with a modified CNN which operates on patches of size 31 × 31 pixels.
    
Instead of using a patch-wise algorithm, Zeng and Zhu introduced the Multiscale Fully-Convolutional Neural Network (MFCN) which can predict the foreground of the entire input image frame in one step <cit.>. Lim and Keles proposed a triplet CNN which uses siamese networks to create features at three different scales and combines these features within a transposed CNN <cit.>. In a follow-up work, they removed the triplet networks and used dilated convolutions to capture the multiscale information <cit.>. In <cit.>, Bakkay used generative adversarial networks for BGS. The generator performs the BGS task, whereas the discriminator tries to classify the BGS map as real or fake. Although all these algorithms perform very well on various BGS datasets, it is important to note that they are all video-optimized, thus they will suffer a performance loss when tested on unseen videos. In <cit.>, Babae designed a video-group-optimized CNN for BGS. They randomly selected 5% of CDNet-2014 frames <cit.>  as a training set and developed a single network for all of the videos in this dataset. In <cit.>, Sakkos used a 3D CNN to capture the temporal information in addition to the color information. Similarly to <cit.>, they trained a single algorithm using 70% of frames in CDNet-2014 and then used it to predict the foreground in all videos of the dataset. Note that even these approaches do not  generalize to other videos since some ground truth data from each video exists in the training set. Table <ref> compares and summarizes the landscape of supervised BGS algorithms and the methodology used for training and evaluation.
    
As discussed above, none of the CNN-based BGS algorithms to-date have been designed for or tested on unseen videos with no ground truth at all. 
This limits their practical utility since it is not possible to label some frames in every new video. 
Since the publication of the first version of this paper, we have learned about a recent BGS algorithm named 3DFR <cit.>, which uses 3D spatio-temporal convolution blocks in an encoder-decoder architecture to predict background in an unseen video. However, <cit.> only reports evaluation results on 10 out of the 53 videos of CDNet2014.





 §.§ Improving BGS Algorithms by Post-Processing

    
Over the last few years, many deep-learning-based algorithms were developed for the problem of semantic segmentation and they achieved state-of-the-art performance. In <cit.>, Braham and Droogenbroeck introduced a post-processing step for BGS algorithms based on semantic segmentation predictions. Given an input frame, they predicted a segmentation map using PSPNet <cit.> and obtained pixel-wise probability predictions for semantic labels such as person, car, animal, house etc. Then, they manually grouped these labels into two sets – foreground and background labels,
and used this information to improve any BGS algorithm's output in a post-processing step. They obtained very competitive results 
by using SubSENSE <cit.> as the BGS algorithm. 

Bianco introduced an algorithm called IUTIS which combines the results produced by several BGS algorithms <cit.>. They used genetic programming to determine how to combine several BGS algorithms' outputs using a sequence of basic binary operations, such as logical “and/or”, majority voting and median filtering. Their best result was achieved by using 5 top-performing BGS algorithms on the CDNet-2014 dataset at the time of publication. Zeng followed the same idea, but instead of genetic programming, used a fully-convolutional neural network to fuse several BGS results into a single output <cit.>, and outperformed IUTIS on CDNet-2014.




§ PROPOSED ALGORITHM: 


    


 §.§ Inputs to 


    
Segmenting an unseen video frame into foreground and background regions without using any information about the background would be an ill-defined problem.



In , we use two reference frames to characterize the background. One frame is an “empty” background frame, with no people or other objects of interest, which can typically be extracted from the beginning of a video e.g., via median filtering over a large number of initial frames. This provides an accurate reference that is very helpful for segmenting intermittently-static objects in the foreground. However, due to dynamic factors, such as illumination variations, this reference may not be valid after some time. To counteract this, we use another reference frame that characterizes recent background, for example by computing median of 100 frames preceding the frame being processed. However, this frame might not be as accurate as the first reference frame since we cannot guarantee that there will be no foreground objects in it (if such objects are present for less than 50 frames, the temporal median will suppress them). By using two reference frames captured at different time scales, we aim to leverage benefits of each frame type.
   
Braham <cit.> have shown that leveraging results of  semantic segmentation significantly improves the performance of a BGS algorithm, for example by using semantic segmentation results in a post-processing step. In , we follow a different idea and use semantic information as an additional input channel to our neural network. In this way, we let our network learn how to use this information. To extract semantic segmentation information, we used a state-of-the-art CNN called DeepLabv3 <cit.> trained on ADE20K <cit.>, an extensive semantic-segmentation dataset with 150 different class labels and more than 20,000 images with dense annotations. Let us denote the set of object classes in ADE20K as C = {c_0, c_1, …,  c_149}. Following the same procedure as in <cit.>, we divided these classes into two sets: foreground and background objects. As foreground objects, we used person, car, cushion, box, book, boat, bus, truck, bottle, van, bag and bicycle. 
The rest of the classes are used as background objects. The softmax layer of DeepLabv3 provides pixel-wise class probabilities p_c_j for c_j∈ C. Let 𝐈[m,n] be an input frame at spatial location m,n and let {p_c_j[m, n]}_j=0^149 be the predicted probability distribution of 𝐈[m,n]. We compute a foreground probability map (FPM) 𝐒[m, n] = ∑_c_j∈ F p_c_j[m, n], where F is the set of foreground classes.

We use the current, recent and empty frames in color, each along with its FPM, as the input to BSUV-Net (Figure <ref>). Clearly, the number of channels in 's input layer is 12 for each frame consists of 4 channels (R,G,B,FPM).
   
    


 §.§ Network Architecture and Loss Function

    


We use a UNET-type <cit.> fully-convolutional neural network (FCNN) with residual connections. The architecture of  has two parts: encoder and decoder, and is shown in Figure <ref>. In the encoder network, we use 2 × 2 max-pooling operators to decrease the spatial dimensions. In the decoder network, we use up-convolutional layers (transposed convolution with a stride of 2) to increase the dimensions back to those of the input. In all convolutional and up-convolutional layers, we use 3 × 3 convolutions as in VGG <cit.>. The residual connections from the encoder to the decoder help the network combine low-level visual information gained in the initial layers with high-level visual information gained in the deeper layers. Since our aim is to increase the performance on unseen videos, we use strong batch normalization (BN) <cit.> and spatial dropout (SD) <cit.> layers to increase the generalization capacity. Specifically, we use a BN layer after each convolutional and up-convolutional layer, and an SD layer before each max-pooling layer. Since our task can be viewed as a binary segmentation,
we use a sigmoid layer as the last layer in . The operation of the overall network can be defined as a nonlinear map 𝐆(𝐖): 𝐗→𝐘
where 𝐗∈ℝ^w × h × 12 is a 12-channel input, w and h are its spatial dimensions, 𝐖 represents the parameters of neural network 𝐆, and 𝐘∈ [0,1]^w × h
is a pixel-wise foreground probability prediction. Note that since this is a fully-convolutional neural network, it does not require fixed input size; any frame size can be used, but some padding may be needed to account for max-pooling operations.
    
In most BGS datasets, the number of background pixels is much larger than the number of foreground pixels. This class imbalance creates significant problems for the commonly-used loss functions, such as cross-entropy and mean-squared error. A good alternative for unbalanced binary datasets is the Jaccard index. Since the network output is a probability map, 
we opted for a relaxed form of the Jaccard index as the loss function, defined as follows:

    J_R(𝐘, 𝐘) =T + ∑_m,n(𝐘[m,n] 𝐘[m,n])/T +∑_m,n(𝐘[m,n] +𝐘[m,n] -𝐘[m,n]  𝐘[m,n] )
where 𝐘∈{0, 1}^w × h is the ground truth of 𝐗, T is a smoothing parameter and m, n are the spatial locations.
    


 §.§ Resilience to Illumination Change by Data Augmentation


Since neural networks have millions of parameters, they are very prone to overfitting. A widely-used method for reducing overfitting in computer-vision problems is to enlarge the dataset by applying several data augmentations such as random crops, rotations and noise addition. Since we are dealing with videos in this paper, we can also add augmentation in the temporal domain. 
    
In real-life BGS problems, there might be a significant illumination difference between an empty background frame acquired at an earlier time and the current frame. However, only a small portion of videos in CDnet-2014 capture significant illumination changes which limits 's generalization performance.
Therefore, we introduce a new data-augmentation technique to account for global illumination changes between the empty reference frame and the current frame. Suppose that 𝐑_𝐄∈ℝ^w, h, 3 represents the RGB channels of an empty reference frame. Then, an augmented version of 𝐑_𝐄 can be computed as 𝐑_𝐄[m, n, c] = 𝐑_𝐄[m, n, c] + 𝐝[c] for c = 1,2,3, where 𝐝∈ℝ^3 represents a frame-specific global RGB change in our illumination model.
By choosing 𝐝 randomly for each example during training (see Section <ref> for details), we can make the network resilient to illumination variations.





§ EXPERIMENTAL RESULTS





 §.§ Dataset and Evaluation Metrics


In order to evaluate the performance of BSUV-Net, we used CDNet-2014 <cit.>, the largest BGS dataset with 53 natural videos from 11 categories including challenging scenarios such as shadows, night videos, dynamic background, etc. The spatial resolution of videos varies from 320 × 240 to 720 × 526 pixels. Each video has a region of interest labelled as either 1) foreground, 2) background, 3) hard shadow or 4) unknown motion. When measuring an algorithm's performance, we ignored pixels with unknown motion label and considered hard-shadow pixels as background. Our treatment of hard shadows is consistent with what is done in CDNet-2014 for the change-detection task.  

    
In CDNet-2014 <cit.>, the authors propose seven binary performance metrics to cover a wide range of BGS cases: recall (Re), specificity (Sp), false positive rate (FPR), false negative rate (FNR), percentage of wrong classification (PWC), precision (Pr) and F-measure (F_1).
They also introduced two ranking-based metrics namely “average ranking” (R) and “average ranking accross categories” (R_cat) which combine all 7 metrics into ranking scores. The details of these rankings can be found at “changedetection.net”. 
    
    


 §.§ Training and Evaluation Details

    
As discussed in Section <ref>, we use a video-agnostic evaluation methodology in all experiments. This allows us to measure an algorithm's performance on real-world-like tasks when no ground-truth labels are available. 
To evaluate  performance on all videos in CDNet-2014, we used 18 different combinations of training/test video sets. 
The splits are structured in such a manner that every video appears in the test set of exactly one split, but when it does so, it does not appear in the training set for that split. Detailed information about these sets can be found in the supplementary material.
Let us denote the m-th combination by (V_train^m,  V_test^m). Then, ∪_m=1^18 V_test^m is equal to the set of all 53 videos in CDNet-2014. During training, we used 200 frames suggested in <cit.> for each video in V_train^m. 
    
When training on different sets V_train^m, we used exactly the same hyperparameter values across all sets to make sure that we are not tuning our network to specific videos. In all of our experiments, we used ADAM optimizer with a learning rate of 10^-4, β_1 = 0.9, and β_2=0.99. The minibatch size was 8 and we trained for 50 epochs.
As the empty background frame, we used the median of all foreground-free frames within the first 100 frames. In a few videos containing highway traffic, the first 100 frames did not contain a single foreground-free frame. For these videos, we hand-picked empty frames (e.g., in groups) and used their median as the empty reference. Although this may seem like a limitation, in practice one can randomly sample several hundred frames at the same time of the day across several days (similar illumination) and median filter them to obtain an empty background frame (due to random selection, a moving object is unlikely to occupy the same location in more than 50% of frames). Since there is no single empty background frame in videos from the pan-tilt-zoom (PTZ) category, we slightly changed the inputs. Instead of “empty background + recent background” pair we used “recent background + more recent background” pair, where the recent background is computed as the median of 100 preceding frames and the more recent background is computed as the median of 30 preceding frames.
    
Although  can accept frames of any spatial dimension, we used a fixed size of 224 × 224 pixels (randomly cropped from the input frame) so as to leverage parallel GPU processing in the training process. We applied random data augmentation at the beginning of each epoch. For illumination resilience, we used the data augmentation method of Section <ref> with 𝐝[c] = 𝐈 + 𝐈_c, where 𝐈 is the same for all c and sampled from 𝒩(0, 0.1^2), while 𝐈_c is independently sampled from  𝒩(0, 0.04^2) for each c.
We also added random Gaussian noise from  𝒩(0, 0.01^2) to each pixel in each color channel.
For pixel values, we used double precision numbers that lie between 0 and 1.
    
In the evaluation step, we did not apply any scaling or cropping to the inputs. To obtain binary maps, we applied thresholding with  threshold θ=0.5 to the output of the sigmoid layer of . 

    


 §.§ Quantitative Results


  


    
Table <ref> compares  against state-of-the-art BGS algorithms in terms of the seven  metrics and two rankings discussed in Section <ref>. All quantitative results shown in this paper are computed by “changedetection.net” evaluation servers to reflect the real performance on test data. Since  is video-agnostic, comparing it with video-optimized or video-group-optimized algorithms would not be fair and we omit them. Instead, we compare BSUV-Net with state-of-the-art unsupervised algorithms, namely  SWCD <cit.>, WisenetMD <cit.> and PAWCS <cit.> 
, which, by definition, are video-agnostic. We exclude RTSS <cit.> and 3DFR <cit.> in Table <ref> since their results on the test frames are not available on “changedetection.net”.

We include the results of IUTIS-5 <cit.> and SemanticBGS <cit.>, but we list them separately because these are post-processing algorithms. Note that, both IUTIS-5 and SemanticBGS can be applied to any BGS algorithm from Table <ref>, including , to improve its performance. To show this, we also report the result of  post-processed by SemanticBGS. In the  category, we also list FgSegNet v2 <cit.> since it is currently the best performing algorithm on CDNet-2014.
However, since FGSegNet v2's performance reported on “changedetection.net” has been obtained in a video-optimized manner, we trained it anew in a video-agnostic manner using the same methodology that we used for BSUV-Net.
As expected, this caused a huge performance decrease of FgSegNet v2 compared to it’s video-optimized training. As is clear from Table <ref>,  outperforms its competitors on almost all of the metrics. The F-measure performance demonstrates that  achieves excellent results without compromising either recall or precision. Table <ref> also shows that the performance of  can be improved even further by combining it with SemanticBGS. The combined algorithm outperforms all of the video-agnostic algorithms that are available on “changedetection.net”.
    
Table <ref> compares the per-category F-measure performance of  against state-of-the-art BGS algorithms.For RTSS <cit.>, the values of performance metrics shown in Table <ref> are as reported in their paper.

Columns 2-12 report the F-measure for each of the 11 categories from “changedetection.net”, while the last column reports the mean F-measure across all categories. Similarly to Table <ref>, we divided this table into post-processing and . 
It can be observed that  achieves the best performance in 5 out of 11 categories. It has a striking performance advantage in the “night” category. All videos in this category are traffic-related and many cars have headlights turned on at night which causes significant local illumination variations in time. 's excellent performance in this category demonstrates that the proposed model is indeed largely illumination-invariant.
    
 performs poorer than other algorithms in “camera jitter” and “dynamic background” categories. We believe this is related to the empty and recent background frames we are using as input. The median operation used to compute background frames creates very blurry images for these categories since the background is not static. Thus,  predicts some pixels in the background as foreground and increases the number of false positives.
     



 §.§ Visual Results
 

A visual comparison of  with SWCD <cit.> and WisenetMD <cit.> is shown in Figure <ref>. Each column shows a sample frame from one of the videos in one of the 8 categories.
It can be observed that  produces visually the best results for almost all categories.

In the “night” category, SWCD and WisenetMD produce many false positives because of local illumination changes.  produces better results since it is designed to be illumination-invariant. In the “shadow” category,  performs much better in the shadow regions.
Results in the “intermittent object motion” and “baseline” categories show that  can successfully detect intermittently-static objects. It is safe to say that  is capable of simultaneously handling the discovery of intermittently-static objects and also the dynamic factors such as illumination change.

An inspection of results in the “dynamic background” category shows that  has detected most of the foreground pixels but failed to detect the background pixels around the foreground objects. We believe this is due to the blurring effect of the median operation that we used in the computation of background frames. Using more advanced background models as an input to  might improve the performance in this category.

 




 §.§ Ablation Study


One of the contributions of  is its multi-channel input composed of two background frames from different time scales and a foreground probability map (FPM). Another contribution is temporal data augmentation tailored to handling illumination changes. In Table <ref>, we explore their impact on precision, recall and F-measure. Each column on the left represents one characteristic and each row represents a different combination of these characteristics. RGB channels of the current frame are used in all of the combinations. “Empty BG” and “Recent BG” refer to the use of empty and\or recent background frames, respectively, in addition to the current frame. “Data aug.” refers to temporal data augmentation described in Section <ref> and “FPM” refers to the use of semantic FPM channel in addition to the RGB channels for all input frames. It is clear that all these characteristics have a significant impact on the overall performance. Using only the current frame as input results in very poor metrics. The introduction of empty or/and recent background frames leads to a significant improvement. Adding temporal data augmentation or/and FPM channels further improves the performance and the final network achieves state-of-the-art results.





In this paper, we proposed to add semantic FPM channel as input in order to improve our algorithm's performance. However, if the background and foreground object categories are chosen carefully, FPM can be used as a BGS algorithm by itself. This would require prior information about the video (to compute FPM) and, therefore, would not qualify as a video-agnostic method. In our algorithm, however, we combine FPM information with RGB channels and background frames. When applying DeepLabv3 <cit.> to compute FPM frames, we pre-defined global background and foreground class categories which might be wrong for some of the videos. We did not optimize the selection of these class categories but instead used those suggested in <cit.>. To demonstrate that our algorithm is not replicating FPM but leverages its semantic information to boost performance, we compared  with thresholded FPM used as a BGS result (Table <ref>). It is clear that FPM alone is not a powerful tool for BGS as it is significantly outperformed by .



While in  we assume that the empty background frame is foreground-free, CDNet-2014 does not provide empty background frames. Therefore, in some videos, we manually selected empty background frames from among the initial frames as explained in Section <ref>. In Table <ref>, we show the impact of this manual process by comparing the manual selection strategy with an automatic one, that is using the median of all frames in the test video as a the empty background frame.
Clearly, the manual selection slightly improves precision while significantly decreasing recall. We believe this is due to the increase of false negatives caused by the appearance of some of the foreground objects in the empty background. Since videos in CDNet2014 are rather short (at most 10 minutes), in some cases the median of all frames does not result in an empty background. However, for stationary surveillance cameras in a real-life scenario it is often possible to compute an empty background, for example by taking the median of frames at the same time of the day (when it is expected to be empty) over many days.






§ CONCLUSIONS AND FUTURE WORK


We introduced a novel deep-learning algorithm for background subtraction of unseen videos and proposed a video-agnostic evaluation methodology that treats each video in a dataset as unseen. The input to  consists of the current frame and two reference frames from different time-scales, along with semantic information for all three frames (computed using Deeplabv3 <cit.>). To increase the generalization capacity of , we formulated a simple, yet effective, illumination-change model. 
Experimental results on CDNet-2014 show that  outperforms state-of-the-art video-agnostic BGS algorithms in terms of 7 out of 9 performance metrics. Its performance can be further improved by adding SemanticBGS <cit.> as a post-processing layer. This shows great potential for deep-learning BGS algorithms designed for unseen or unlabeled videos.

In the future, we are planning further work on temporal data-augmentation techniques to improve performance for challenging categories, such as “dynamic background” and “camera jitter”. We will also investigate different background models for the reference frames. In this work, we kept our focus on designing a high-performance, supervised BGS algorithm for unseen videos without considering the computational complexity. To bring  closer to real-time performance, we are also planning to study a shallow-network implementation designed for fast inference. 


plain





empty


[


§ APPENDICES
]





§ SELECTION OF TRAINING TEST SETS FOR 
 EVALUATION ON UNSEEN VIDEOS

In this paper, we introduced a supervised background subtraction (BGS) algorithm for unseen videos. As for all supervised learning algorithms, the size and diversity of the training data are crucially important for the learning process. Generally speaking, for most of the state-of-the-art deep neural networks, the best approach is to use all of the available training data. Unfortunately, CDNet 2014 <cit.> does not provide different videos for training and testing. Instead, it provides some frames from each video as training data and the remaining ones – as test data. However, this type of division is not useful for evaluating the performance on unseen videos. 

For comparing the performance of different models on unseen videos, we split the dataset into 18 different sets of training/testing videos as shown in Tables <ref> and <ref>. When training a supervised algorithm, the main assumption is that the training set is diverse enough to cover a wide range of test scenarios. For example, if there are no examples that include shadow in the training set, then it is impossible for the network to learn how to classify shadow regions. Therefore, we designed the splits so that the training set for each split contains some videos from the same category as the test videos. 




We did not perform a full “leave-k-videos-out” cross-validation due to prohibitive time need to train . 
In all of the tests, we used videos from “baseline”, “bad weather”, “intermittent object motion”, “low frame rate” and “shadow” categories during training since they span most of the common scenarios. 
For videos from more difficult scenarios, we progressively added additional categories into the training set.
In particular, we considered “PTZ”, “thermal” and “turbulence” categories as the most difficult ones since they have substantially different data characteristics from other categories. “PTZ” is the only category with significant camera movement and zoom in/out, while “thermal” and `turbulence” categories capture different scene properties than the remaining categories (far- and near-infrared spectrum instead of RGB, respectively). For these 3 categories, we used more videos in the training set, than in the other categories. 


Please note that a '`leave-k-videos-out” approach would have more videos in the training set compared to our splits and is therefore likely to yield better results.






