Abstract
Background reconstruction from an image sequence is an important topic in image processing. However, most existing background reconstruction algorithms do not produce results as good as expected when applied to complex images. The Gaussian mixture model is frequently utilized to represent image features and used to reconstruct background for complex image. A Gaussian mixture-based model for background restoration algorithm is proposed, which evaluates the temporal confidence as well as spatial confidence value to get multiple most reliable models to assess whether a pixel of the image of a background one or a foreground one. During the process, a Sarsa(λ) is utilized to achieve automatic adaption by interaction with the image during the processing to get maximal-reinforced temporal–spatial confidence. To obtain better reconstruction results, a series of pre-processing methods, such as shadow detection and removing, sunshine change relieving and sudden noise detection and removing, are also used before background reconstructing to wipe off negative interface suffered by noises, e.g. shadow, daylight change, and sudden noise. The testing results show that our proposed algorithms work well in background reconstruction.
Keywords
Introduction
In computer vision, moving object detection and segmentation is a very important issue, widely applied in many aspects such as video surveillance, traffic monitoring and image compression. 1 There are usually three types of methods for motion detection, including optical flow method, the adjacent frame difference method and background subtraction method. 2
Optical flow method 3 is in a position to detect and track moving objects without requiring prior knowledge of the background area; however, the optical flow method is computation costly, sensitive to the noise, and requests advanced hardware as fundament. Adjacent frame difference method 4 is basically a kind of background subtraction except that it takes advantage of the previous frame as background model rather than modeling by some algorithm, the benefit of which is that it is highly efficient and can adapt to the dynamic changes of the environment, thus achieving real-time motion detection. However, the resulting segmentation of moving targets is incomplete. Background subtraction method 5 gets moving target by subtracting the background reference frame of the current frame, and then carrying on binarizing with a threshold. Background subtraction method is one of the most simple and effective ways to detect objects without drawbacks of the adjacent frame difference method. One of the simplest implementations of the background subtraction method is tantamount to select a background image without any moving target in advance, and then subtract the current frame with the pre-defined background image. However, as the environment of background often changes, such as illumination changes caused by sunshine within the different time of a day, changes in different seasons, and offset changes of the camera position, background images are supposed to be able to be adaptively updated. To solve this problem, a classical approach is using time-averaged background image which is an approximation of the background image attained by averaging a sequence of images in a period of time. The method tends to incorrectly mix the moving objects with the background image, leading to a hybrid phenomenon called blending.
In real world, image sequences are suffered by shadow, daylight change, and sudden noise. A novel shadow detection and removing algorithm which identifies shadow by comparing the value of candidate shadow pixel with that of the background pixel in HSV space under the assumption that if the hue part value and the saturation part value are both smaller than predefined thresholds, it can be regarded as a shadow point. The sunshine change is key aspect that will affect the background reconstruction.
In this work, we propose a median filtering algorithm with adaptive filtering window that is able to change median filtering window scale according to real-world circumstance as to fit sunlight change, thus relieving the inference. Sudden noise, despite of its short lasting time, always appears unexpectedly and is very difficult to remove. Sudden noise will heavily disturb background reconstruction monitoring. To wipe off sudden noise, we propose an adaptive sudden noise elimination algorithm, which is based on the premise that the sudden noise usually only lasts in adjacent image frames. We perform a series of subtractions to effectively remove the sudden noise. Particularly we propose a Gaussian mixture model-based background reconstruction with temporal and spatial confidence evaluation. The algorithm sets up multiple Gaussian distribution models for each pixel in the image, and computes the corresponding confidence value for each Gaussian distribution model. Each distribution in the model is corresponding to a confidence level and descending sorted by the value of confidence. Thereby, we can get reliable distribution models. We use the model to assess whether the pixel is a foreground one or a background one. Reinforcement learning is able to optimize policy by interacting with the environment. As a kind of reinforcement learning algorithm, Sarsa(λ) can obtain experience by interacting with the environment with minimal cost experience. Hereby, we use a Sarsa(λ)-based algorithm to achieve automatic adaption by interaction with the image during the processing to get maximal-reinforced temporal–spatial confidence so that the algorithm can automatically adapt during the interaction. The testing results show that our proposed algorithms work well in background reconstruction.
Related work
In recent years, people have paid lots of efforts on studying how to achieve adaptive update the background image in the background subtraction method. These efforts can be divided into two categories: reconstructing the background image by the background model with adaptive parameters adjustment, and constituting the background image by selecting pixels from previous images in accordance with certain assumptions.
Ridder et al. 6 used the Kalman filter for each pixel of the background image so that the system can also work when the light changed. Friedman and Russell 7 regarded the gray value of a pixel as the weighted values of three Gaussian distributions, 8 respectively, corresponding to background, foreground, and shadow, and used the EM algorithm to achieve the model parameters.
As the background is usually sophisticated, using background pixels to represent a Gaussian distribution is not enough. Staufer and Grimson 9 utilized a Gaussian mixture model to represent the distribution of background. KaewTraKulPong and Bowden 10 found that it required a lot of computing time and was not in a position to detect the shadow of the moving objects, and then proposed an improved adaptive hybrid model to reduce the amount of computation to achieve shadow detection.
Elgammal 11 believed that only using a very few of Gaussian mixture model to represent the distribution of the background was still not so much accurate; but the increase will reduce the number of Gaussian distribution of motion detection sensitivity, and increase the amount of computation at the same time. They presented a non-parametric kernel density estimation algorithm to improve the motion detection sensitivity; however, it still needed a great amount of computation.
Magee 12 noted that some previous works only established multiple Gaussian mixture model rather than foreground model. They developed a number of foreground model, achieving more effective motion detection. The model used by Xia et al. 13 was based on a Gaussian distribution for each pixel. Toyama et al. 14 reconstructed the background image from the pixel level, regional level and frame-level features of the image and made use of adaptive Wiener filtering to fulfill background updating. However, there are a few drawbacks. First, the method needed to initialize the model which is generally assumed in the initialization phase when the moving foreground objects are not part of the background image, which is very difficult in practice to meet. Second, the established model is sometimes difficult to fully represent the actual background image, causing moving objects unexpectedly to blend into the background parts. Gloyer et al. 15 proposed a median method which takes the pixel gray value that is in the middle of a sequence of images as the background pixel gray value. However, if the background pixels occur less than 50% of the observed time, then the median method tends to return erroneous results. Kornprobst et al. 16 assuming that the background image is the most frequently observed one, proposed a partial differential equation-based background reconstruction algorithm.
Gaussian-based background reconstruction
The Gaussian model requires a Gaussian probability density function, normal distribution curve, to accurately quantify objects which will be decomposed into a number of models formed by a Gaussian probability density function. Image histogram reflects the image of a gray value of the frequency of appearance. It can be taken into account as estimation of gray probability density. If the target area is larger than the background area of the image, and at the same time the background area is different in gray value with objects, then the image histogram appears in the bimodal-valley shape, where a peak corresponds to the target object and the another peak corresponds to the central gray of background. Complex images are typically multimodal. The multimodal characteristic of histogram can be seen as the superimposing of a plurality of Gaussian distributions.
Foreground is, on the assumption that the background is stationary, any object with meaningful moving. The basic idea of reconstruction modeling is to extract the foreground from the current frame so as to ensure the background approximate closer to the current background, which means using the current frames and the current background frame sequence to update the weighted average of the background. Meanwhile, it is not in a position to deal with influence of the sudden light change and influence from the external environment. The Gaussian mixture model is one of the most efficacious methods for background reconstruction. The Gaussian mixture model uses K Gaussian models to represent the features of each pixel in the image, and update the model with the new frame of image. During the process of background reconstruction, the pixel that matches with the Gaussian mixture model is regarded as the background pixel; otherwise it is foreground one. The process of background reconstruction with the Gaussian mixture model is shown in Algorithm 1.
Reinforcement learning
Reinforcement learning
17
provides a framework to directly learn from the interaction in the process of achieving goals. In reinforcement learning framework, there are five essential elements: agent, environment, state, reward and action. An agent is an entity that has cognitive skills, the ability to solve the problem, and the capability of communication. Through agent, it is possible to set up controlling model which is anthropomorphic. As a result, we can control the behavior of the system and unify other control units, providing a unified description of the method. Therefore, we can say that agent is a de facto learner and decision maker, interacting with the environment. The agent makes the decision of choosing an action; the environment responds to the action, generates new scenes to the agent, and then returns a reward. The reinforcement learning framework
18
is shown as Figure 1.
Reinforcement-learning framework where the agent chooses an action; the environment generates new scenes, as well as a reward, to the agent as response to the action.
The agent interacts with the environment at each step during a discrete-time sequence. At each time step t, the agent gets the environment state st ∈ S, where S is the set of all possible states; the agent chooses an action a t ∈ A(st) under some policy, where a t ∈ A(st) is all available actions. By taking the action, the agent receives a reward rt + 1∈R and reaches to a new state st + 1. The ultimate goal of the agent is to maximize the sum of the rewards within the long term. The mapping from state to action selection is the agent policy πt.
As an important algorithm, the temporal difference (TD) learning is capable of learning directly from raw experience without understanding outside the environment.
18
What is more, the model learned by temporal difference is updated by estimation based on part of learning rather than the ultimate results of the learning. These two characteristics of temporal difference make it particularly efficient and suitable for incremental learning. Given some experience with policy π, temporal difference learning updates estimated V of Vπ,
19
as
Let Qπ(s, a) be the value of taking action a, in S under a policy. Qπ(s, a)
20
can be defined as
Sarsa (State-action-return-state-action) is a class of online TD algorithm and Sarsa(λ) is a class of Sarsa algorithm which uses eligibility trace.
17
The update of Qπ(s, a)
17
is as
Image pre-processing
Shadow elimination
The shadow of the moving object of the foreground will cause incorrect detection of moving object, 20 thus leading to incorrectly reconstructing the background. Therefore, it is very necessary to identify and remove shadow of moving objects.
Background reconstruction with Gaussian mixture model.
In Algorithm 2, the value parameter V in the shadowed area is generally less than that of the background area, and the parameter β is a value to measure the strength of brightness where the brightness of the light is inversely proportional to the value of β.
Sunshine change relieving
The sunshine change, which is unavoidable, will negatively affect the background. Obviously, the fully dark circumstance is very different from the circumstance with sunlight. The basic idea is to use the median filtering. However, as the median filtering window has to be predefined, it is unable to change the window scale according.
We hereby put forward an adaptive algorithm that is able to fit sunlight change so as to relieve the inference.
To solve this problem, we hereby put forward an adaptive median filtering method of which the fundamental idea is to change median filtering window scale automatically according to real world circumstance. The main processing steps are as Algorithm 3.
Sudden noise elimination
Sudden noise, e.g. flying bird and falling leaves, although usually occurring and existing for a short time, will heavily disturb background reconstruction. However, it is very difficult to remove as a sudden noise always appears unexpectedly. To wipe off sudden noise, we propose an adaptive sudden noise elimination algorithm, which is based on the premise that the sudden noise usually only lasts a very short duration and therefore it is unreasonable to be regarded as background.
Shadow detection and removing.
Sunshine change relieving.
Sudden noise detection and removing.
Sarsa(λ)-based background reconstruction.
Reinfoced temporal and spatial confidence
In a sequence of images, the pixels with the steady state value are the most likely to be the background ones, but if the foreground objects move very slowly or temporarily kept in a stationary, the pixels in the steady state are is often the foreground ones.
In this work, the reconstruction algorithm restores background images from past observations, mainly using several algorithms for background updates. In the first kind of cases, the background is updated regularly, that is the time period specified in the last several image sequences extracted utilizing algorithm 3, which is applicable to the situation slowly varying, to reconstruct the background. In the second case, the background is updated with a mutation strategy. If the number of pixels in the current frame, which is distinct from the reference image, exceeds a threshold value, the background should be reconstructed with Algorithm 4. For most other cases, we should use another approach to get the background.
Some research work shows that integration of various of information is more conducive to achieve a reasonable reconstruction effect, that is, it is necessary to consider the optimization of the classification of pixels within the temporal features, as well as consider spatial features, which has been theoretically proven by Milan Sonka and their experimental results showed that comprehensive integrated information can obtain more reasonable results than the method using only a single kind of information.
In this work, we, integrating the temporal and spatial information of the image and combining with the related confidence values, propose a novel background reconstruction algorithm.
The algorithm sets up multiple Gaussian distribution models for each pixel in the image, and computes the corresponding confidence value for each Gaussian distribution model. Each distribution in the model is corresponding to a confidence level and descending sorted by the value of confidence. Thereby, we can get top p reliable distribution models and the last q unreliable distribution models. During the processing, although the reliable distributed models are initially arranged ahead of unreliable distribution ones, unreliable distribution model can be rearranged by cumulating matching the pixels with the distribution model and then turn to be a reliable distribution; on the other hand, a reliable distribution model can also turn to be an unreliable one through mismatching the pixel with the reliable model. When we process a new arrival images, the algorithm will sequentially check the matching of the current pixel value with each related Gaussian distribution, so as to determine whether the type of the current pixel is a background pixel, a foreground one, or a unreliable one. After that, based on the multi-Gaussian models, we choose to create a new distribution or update the current distribution. Meanwhile, the pixel in the current image that is determined as a background pixel value will be utilized to generate the background image. In order to increase the adaptability of the model, the algorithm also removes outdated reliable and timely distribution. We also take advantage of reinforcement learning so as the algorithm can automatically adapt during the interaction.
Actions and corresponding value.
In our work, the agent makes decisions in accordance with different conditions, and returns an action sequence, so as to get maximal confidence. To move further, the model gives out an optimal decision made in a certain state. Here, we use temporal and spacial feature confidence to evaluate whether the pixel is a background one, as
Experiment and results
In order to comprehensively evaluate performance of the model, we set up two different scenarios. In the first scenario, candidate objects are small. In the second scenario, candidate objects are large. We used Algorithms 1–4 to pre-process the images and Algorithm 5 to reconstruct the background image. We also used Sarsa(λ) to learn a controller with learning rate = 0.6, discount rate = 0.95, and λ = 0.5 by 1000 episodes. The weighting values were chosen as ω1 = 0.6 and ω2 = 0.4.
We obtained a sequence of images from a traffic surveillance vedio from which the object is large with blur image. We can see from Figure 2 that, despite of some part of noise, the above procedure can restore the background. There are minor noisy pixels left in the result.
The left image is a snapshot from a traffic-monitoring vedio and the right image is the resconstruceted background.
We obtained another sequence of images from the same surveillance camera where moving objects are cleared. Figure 3 shows that the above procedure is able to restore the background successfully.
The left image is a snapshot from a traffic-monitoring vedio and the right image is the resconstruceted background.
Conclusion
Background reconstructiion is a fundamental and key technology in image processing. It is easily contaminated by noises such as shadow, daylight change, and sudden noise. Many existing background reconstruction algorithms do not perform well. In this work, we derived a Gaussian mixture model based on background restoration algorithms. The algorithm, which takes advantage of Sarsa(λ) to achieve automatic adaption by interaction with the image during the processing, takes the temporal and spatial confidence to set up several most reliable models to determine whether the pixel of the image is of a background one or a foreground one.
To achieve better reconstruction background, a series of algorithms is proposed to clean in the image in the pre-processing stage. The testing results show that the proposed procedure works successfully in recovering the background.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
