{'fraction_non_alphanumeric': 0.022174840085287847, 'fraction_numerical': 0.008208955223880597, 'mean_word_length': 4.922348484848484, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Using a Supervised Method without supervision for foreground segmentation

Neural networks are a powerful framework for foreground segmentation in video acquired by static cameras, segmenting moving objects from the background in a robust way in various challenging scenarios. The premier methods are those based on supervision requiring a final training stage on a database of tens to hundreds of manually segmented images from the specific static camera. In this work, we propose a method to automatically create an"artificial"database that is sufficient for training the supervised methods so that it performs better than current unsupervised methods. It is based on combining a weak foreground segmenter, compared to the supervised method, to extract suitable objects from the training images and randomly inserting these objects back into a background image. Test results are shown on the test sequences in CDnet.


Introduction
Foreground segmentation/background subtraction is one of the central tasks in the field of computer vision due to its numerous applications including surveillance of human activities in public spaces, traffic monitoring, and industrial machine vision.
Deep learning has become the principal methodology in foreground segmentation where each pixel in an image is classified as foreground or background.
One of the great difficulties with supervised learning, especially in the field of foreground segmentation, is the labeling of data that usually requires extensive human hands-on work.
One of the known methods designed to eliminate the need to create data manually is to use synthetic data. The problem with synthetic data in computer vision is the ability to create data that is similar enough to the real data so that the learned system can be generalized to the original task with the real data. This paper proposes substituting the hand-labeled data needed for the premier (supervised) method with an automatically created "artificial" database. It is based on an unsupervised weak foreground segmenter that extracts "good" objects from the training images and then to create the fine tuning data we randomly chose from these objects and insert them in their original position into a background image. It is especially pertinent to static cameras as the objects found are automatically in the "right" location, being of the "right" size, color and shape, and in the "right" lighting conditions. In this way, we create an "scene specific" system in a unsupervised way. This is applicable to a gigantic number of cameras, as cited in CNBC 2 , "One billion surveillance cameras will be watching around the world in 2021".

Related work
Deep learning methods are currently the premier methods in video foreground segmentation.
Many foreground segmentation methods work with one image at a time without taking into consideration temporal aspects between the frames. For example Lin et al. [10] use the Fully Convolutional Semantic Networks (FCSN) [6] for foreground segmentation. The authors concatenate the current frame with the background image channel-wise and feed the 6-channel image to a FCN. Although their model achieves good results in simple videos, it fails in "noisy" environments and in detecting small objects.
In 2019, Lim and Keles presented FgSegNetv2 [5], a modified VGG 16 network is used as an encoder for the network, obtaining high-resolution feature maps, which are input for the Feature Pooling Module (FPM) and consequently as input for the decoder, working with two Global Average Pooling (GAP) modules. This method used up to 200 annotated training frames of each scene and achieves state of the art performance on the CDnet 2014 dataset [14]. Note that the performance of FgSegNet v2 drops dramati- cally when applied to unseen videos as shown by Tezcan et al. [13].
Tezcan et al. [11] presented the BSUV-Net 2.0 that mainly focused on data augmentation to enhance jitter, pantilt and intermittently-static objects especially trying to account for temporal variations that naturally occur in video achieving state of the art results in the unsupervised case for various scenarios.
Synthetic data has been employed for data augmentation. For example, Richter et al. [9] and Ros et al. [3] develop a virtual reality tool from the world of computer games for this purpose. A big advantage of this method is that you can produce endless samples of tagged data and you can create situations as you wish.
Dwibedi et al. [4] used the power of synthetic data for instance detection. They used a 'cut paste and learn' paradigm to cut objects and paste them on various background images to create a dataset for instance detection. They used Poisson blending and Gaussian smoothing on the pasted image to avoid boundary artifacts.
In order to benefit from using synthetic data it is necessary to use foreground elements of the right categories; humans, vehicles, etc., with the the correct style of the elements of the foreground in a specific video. And of course, the synthetic objects should be placed in the correct parts of the image with the right size and projection parameters. This entails a serious intervention for every scene and still there is a big difference between the appearance of synthetic data and reality.
These decisions and interventions are bypassed in our method because the foreground elements are automatically extracted from the real images in the video sequence. Therefore, our method is much more specific and appropriate to the environment in which the videos are shot.

Building the "supervised" training dataset
The supervised foreground segmentation methods require a "supervised" labelled set of images. Here we describe how we automatically generate a video sequence dependent, training set which is sufficient for the training of supervised based background subtraction architectures.
We use the foreground segmentation results of an unsupervised method to extract objects from the video. Subsets of these extracted objects are randomly chosen and inserted into a background image to produce a training set. As these objects are spatially positioned exactly where they were found, cars are on the right roads, pedestrians on the traversed paths, and everything is where it really should be and with the correct projection and lighting, without having to analyze the scenario.

Choosing the objects
As we mentioned before, the foreground objects are extracted with unsupervised methods in a 'cut & paste' fashion such that a foreground object and its mask are extracted to create a foreground database, see Fig 1. In this work we use the state of the art unsupervised method on the CDnet dataset [14], BSUV-Net v2 [12].

Building the dataset
The construction of the database is as follows: Given the objects O, from the previous step and a background image I, randomly choose objects from O and paste them in their original spatial locations onto I, see

Experiments
We tested our method with FgSegNet V2 by Lim et al. [5], which is currently the top-ranked method in the Change Detection 2014 Challenge [14], SBI2015 [7], and UCSD Background Subtraction[1]. FgSegNet V2 requires a final training stage using 25-200 labeled images from the video being evaluated and is thus a supervised method. Our contribution is to use automatic object detection on the images used for fine-tuning converting the method to being completely unsupervised but still scenario dependant.
Our method is especially relevant for static cameras so we tested three of the datasets from CDnet: baseline, shadow, and dynamic background. The background images are pixel-wise medians of a sequence of 50 frames. The frames used to extract objects were the same 200 used by FgSegNet V2 [5].
The average F-measure dependence on the number of augmented frames of the training set is shown in Table 1. Surprisingly more images is not always better, maybe due to inserting too many false positives.
To understand the power of our copy and correct location paste method in a static camera environment, we carried out two more experiments. In one we used the objects that were taken from the same scene but placed in random positions and thus do not take into account the natural location where they should be and in the other we pasted objects from other scenes, see Fig 3 for an illustration. In both cases there was a decrease in the quality of the results, see Table 2.
To see that our method works with different unsupervised methods we carried out the same test based on the semanticBGS [2] algorithm and saw similar improvements, see Table 3.  Table 3. F-measure as a function of the number of images in augmented training set constructed from SemanticBGS objects

Summary
We showed how a supervised foreground segmentation algorithm can be made unsupervised by replacing the supervision with augmented frames based on objects extracted with an unsupervised algorithm. This leads to a state of the art unsupervised foreground segmentation.  Table 2. Different object selection and placement strategies, The BSUV results are followed by using FgSegNet V2 trained using four different options, the annotated frames from BSUV, pasting objects from other scenes in random locations, pasting objects from BSUV on the same video in random locations, and pasting objects from BSUV on the same video in their correct locations