An Improved Moving Object Detection Algorithm Based on Gaussian Mixture Models

Aiming at the problems that the classical Gaussian mixture model is unable to detect the complete moving object, and is sensitive to the light mutation scenes and so on, an improved algorithm is proposed for moving object detection based on Gaussian mixture model and three-frame difference method. In the process of extracting the moving region, the improved three-frame difference method uses the dynamic segmentation threshold and edge detection technology, and it is first used to solve the problems such as the illumination mutation and the discontinuity of the target edge. Then, a new adaptive selection strategy of the number of Gaussian distributions is introduced to reduce the processing time and improve accuracy of detection. Finally, HSV color space is used to remove shadow regions, and the whole moving object is detected. Experimental results show that the proposed algorithm can detect moving objects in various situations effectively.


Introduction
The performance of moving object detection algorithm is very crucial in a sound surveillance system for reliable tracking and behavior recognition.In recent years, many scholars have successively proposed lots of classic moving object detection algorithms [1].They mainly include the optical flow method, the frame difference method and the background subtraction method.The optical flow method uses the vector characteristics of the

Gaussian Mixture Model
GMM algorithm considers the value of a particular pixel ( ) 0 0 , x y over time as a "pixel process", which is a time series of pixel value.It presents the recent history of each pixel { } , , , t X X X ⋅⋅⋅ by mixture of K Gaussian distributions, where t X is the pixel value of ( ) 0 0 , x y at time t.The probability of observing the current pixel value is , where , i t µ is the mean value of the th i Gaussian in the mixture at time t, , i t ω is an estimate of the weight of the th i Gaussian in the mixture at time t, , i t M is the covariance matrix of the th i Gaussian in the mixture at time t, and where η is a Gaussian probability density function where n is dimension of the t X .For computational reasons, the covariance matrix is assumed to be of the form

=
.This assumes that the red, green, and blue pixel values are independent and have the same variances, where I is the unit matrix, 2 , i t σ is the variance of the th i Gaussian in the mixture at time t.Every new pixel value, t X , is checked against the existing K Gaussian distributions, until a match is found.A match is defined as a pixel value within 2.5 standard deviations of a distribution.If none of the K distributions match the current pixel value, the least probable distribution is replaced with the current value as its mean value, an initially high variance, and low prior weight.The prior weight of the K distributions at time t, , i t ω are adjusted as follows ( ) where α is the learning rate, , i t R is 1 for the model which matched and 0 for the remaining models.The µ , σ for unmatched distributions remain the same.Parameters of the distribution which matches the new obser- vation are updated as follows ( ) where β is parameter learning rate, and where T is a measure of the minimum portion of the pixel that should be accounted for by the background.Each pixel which is matched with any of the former B Gaussian distributions will be marked as background pixel.
Otherwise, it will be marked as foreground pixel.

Proposed Algorithm
This paper proposes a moving object detection algorithm which based on Gaussian mixture model and threeframe difference method.Firstly, we achieve the coarse segmentation of motion region which utilize the improved three-frame difference method.We make up the target boundary fracture portions by combining with edge detection technology, and overcome the impact of the sudden illumination change by adjusting the binary threshold value based on changes of the scenes.Secondly, in the process of mixture Gaussian background model, according to the change of model's weight decide to add model or remove unmatched model, the number of components of the mixture is constantly adapted for each pixel, which improves the ability of the algorithm to describe the scene.Finally, we utilize characteristic of HSV color space to eliminate the interference of the shadow region effectively.

Improved Three-Frame Difference Method
The traditional three-frame difference method can quickly detect moving objects.But the algorithm has poor ability to deal with illumination change scenes because of the fixed segmentation threshold it utilized.In addition, holes phenomena will occur in object interior and part of the object contour is not continuous.To solve these problems, this paper proposes the improved of three-frame difference method.It combines three-frame difference method with canny edge detection [9] operator, which solves the problem of target edge discontinuity.What's more, with dynamic binary threshold value, it effectively adapt to the scene of illumination change.
Steps of the improved three-frame difference method are shown as follows 1) Three frames, defined as , , , , , , then we calculate the difference value of image between adjacent two frames respectively, binary image

D x y
+ are obtained by the segmentation threshold.They can be written as follows where T is the fixed binary threshold, are dynamic threshold.They are described as follows ( ) ( ) where M N × is the number of pixels of the image, ξ is inhibition coefficient.We can get binary image ( ) , 2) We get edge image ( ) x y by using canny operator extract edge information of k f frame image.Then we obtain binary image , , , by doing operation between edge image and , others 3) We obtain complete moving object region ( ) ( ) i M x y = , which is foreground pixel, and others are background pixels.

Improved Gaussian Mixture Model
Moving target detection algorithm based on Gaussian mixture model basically set the fixed number of Gaussian distributions for each pixel.In fact, when recently observed pixel values are roughly constant, all of the distributions approximate the same values.In such a case, only one distribution should exist and the other distributions are not necessary at all.On the contrary, if recently observed pixel values change frequently, a constant number of Gaussian is not always enough to estimate the background model, and which is very difficult to determine the appropriate number of Gaussians.Therefore, this paper proposes a new background estimation method, which can increase and decrease the number of distributions to handle the variations of each pixel.The update process of improved Gaussian mixture model is listed as follows: 1) Increment of distribution Every new pixel value t X is checked against the existing K Gaussian distributions, when none of the K dis- tribution matches the current pixel value, if max K K < , we increase a new Gaussian distribution.Setting the Gaussian distribution of mean, variance, and weights are , , , the least probable distribution is replaced with the current value as its mean value, an initially high variance and low prior weight.

2) Decrement of distribution
In the process of Gaussian mixture model update, if a Gaussian distribution of the current pixel can't describe the background accurately, its weight will continue to decay according to ( ) . Therefore, we can set an initial weight init ω , when a Gaussian distribution satisfies the formula (13).Which indicate that the Gaussian distribution can't describe background well.And this distribution will affect the convergence rate of the model, therefore, we should delete it.

HSV Color Space Shadow Removal
Shadow is the dark area in which the light source can't directly irradiate to the surface of the object, and it can be divided into two types: shadows of the object and the cast shadows [10].Shadows cause serious problems while segmenting and extracting moving objects due to the misclassification of shadow points as foreground.
Usually, we are interested only in the objects and the pixels corresponding to the shadow should be detected.This algorithm works in Hue-Saturation-Value (HSV) [11] color space.We analyze pixels in HSV color space, the main reasons that HSV color space corresponds closely to the human perception of color and it has revealed more accuracy in distinguishing shadows.In fact, a shadow cast on a background does not change its hue and saturation significantly.However, whether in color or grayscale image, Value component always reflect the useful information of the image.According to this characteristic, this paper proposes a new method of shadow detection.The resulting decision process is reported in the following equation: ( ) is the value of the Value component of the previous frame.For each pixel belonging to the objects resulting from the segmentation step, we check if it is a shadow according to the formula (17).If ( ) , 1 i SP x y = , the point is shadow point, others are moving object points.Compared with previous algorithm which judges shadow region just by using change of the value of current frame and background frame, this algorithm increases the change of value between current frame and previous frame, which improves the accuracy of the shadow judging.Moreover, we set the fixed ratio threshold of Value component between the input image and the background model, which improve the processing speed of the algorithm.

Experimental Results and Analysis
In this paper, all experiments are performed on windows 7 system with 3.00 GHz Core 4 processor and 4.00 GB of memory.In order to analyze the robustness and effectiveness of the proposed method, four experiments under different conditions are demonstrated in our paper.The results are compared with GMM algorithm and the algorithm [12] in subjective visual and objective parameters statistics.
Figure 1 shows results of the algorithm in situation of single object and multiple objects.GMM algorithm can't extract complete object region, and it isn't sensitivity to low-speed object.Literature [12] and our algorithm can detect the complete moving targets, but literature [12] still exist holes phenomenon.However, our algorithm is preferably made up for this shortcoming, and the detection sensitivity to low-speed moving object has improved a lot in the meanwhile.
Figure 2 shows the detection results in shadow scenes.Due to the interference of noise and shadows, the detection result of GMM algorithm isn't accurate.The algorithm [12] is only able to remove a portion of shadows.But our method can eliminate the influences of noise and shadow, and retain complete edge and internal information of moving targets.
Figure 3 shows detection results under the illumination change scenes.GMM algorithm can hardly recognize the moving objects, and it exist false detection objects in the result.Literature [12] is able to detect moving targets.However, as it is affected by illumination mutation, the information of edges and internal details has been seriously damaged.What's worse, some of small objects can't be detected.Compared with it, our algorithm can  detect the moving objects accurately and completely.Table 1 presents the processing speed of various algorithms.The image sequence is sampled to 320 240 × .As we can see, the proposed method has better real-time performance than the algorithm [12] and GMM algorithm.The improved three-frame difference method is used to quickly detect the motion regions, and it can avoid matching detection of pixels which belong to the background.In addition, we reduce the computational complexity of the algorithm by automatically choosing the number of components for each pixel.
In order to systematically evaluate various algorithms, it is useful to identify the following two important quality measures: Recall (also known as detection rate) and Precision (also known as positive prediction) [13].They are written as follows where p t is the total number of true positives, n f is the total number of false negatives, p f is the total number of false positives.Precision reflects the false detection rate, and Recall reflects the accuracy of detection result.
We calculate Recall and Precision of various algorithms, and results are reported in Table 2.The ground truth for each frame is necessary, and we obtain it by segmenting the images with an accurate manual classification of points in foreground and background regions.From the table data, GMM algorithm is easily affected with the scenes change.The proposed algorithm reduces the interference of environmental impact and removes shadow regions.Compared with the algorithm [12], our algorithm has improved the rates of Precision and Recall.

Conclusion
This paper proposes an improved moving object detection algorithm based on adaptive Gaussian mixture model and three-frame difference method.The proposed algorithm can automatically select the number of components for each pixel.This modification dramatically improves the convergence and the accuracy of background subtraction whilst maintaining the same temporal adaptability.The three-frame difference method uses adaptive segmentation threshold that can adapt to illumination change scene.In addition, we preserve the complete edge information of moving object by using edge detection technology, and effectively remove the shadow by using HSV color space.Comprehensive analysis of experimental results shows that our algorithm can detect moving objects in the complex scenes effectively and has good robustness.

Table 1 .
The running time for single frame.

Table 2 .
A comparison of performance of various algorithms (%).