Human body detection algorithm based on AdaBoost combined with improved Gaussian mixture model
By combining the human detection algorithm of AdaBoost and the improved Gaussian mixture model, the problem of insufficient real-time and accuracy of human detection methods in the existing technology is solved, the adaptability to illumination changes and the improvement of calculation efficiency are achieved, and the recognition accuracy is significantly improved. Spend.
Patent Information
- Application Number
- CN202310241693.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2024-09-20
AI Technical Summary
Human body detection methods in the existing technology are difficult to balance real-time performance and accuracy, and are sensitive to changes in illumination, resulting in large deviations in detection results, large amounts of calculation, and low accuracy.
A human detection algorithm based on AdaBoost combined with an improved Gaussian mixture model is used to improve the background extraction effect through Gaussian mixture background modeling and adaptive threshold method, and AdaBoost's human head and shoulder positioning and shortest distance classifier are used for human body recognition.
It improves the real-time and accuracy of background modeling, reduces the impact of illumination changes on detection results, reduces the amount of calculation, and improves recognition accuracy and robustness.
Smart Images

Figure CN118675196A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision analysis, and in particular relates to a human body detection algorithm based on AdaBoost combined with an improved Gaussian mixture model. Background Art
[0002] Visual analysis of human motion is one of the important research contents in the field of computer vision. The detection and recognition technology of targets in videos is a key technology in the field of intelligent monitoring. Common detection methods include frame difference method, optical flow method and background difference method. The frame difference method has a simple algorithm, but it is difficult to detect moving objects with fast movement speed because there is no repeated area between two adjacent frames; the optical flow method can detect moving objects without knowing the detection scene information, but it is time-consuming and difficult to meet the real-time requirements; the background difference method has a fast detection speed and obtains the foreground image information by subtracting the current frame from the background frame, but it is sensitive to changes in lighting.
[0003] The disadvantage of the human body recognition algorithm in the prior art is that the instability of the color information model causes an imbalance in the weights of the two recognizers in series, resulting in a low recognition rate. At the same time, the small number of samples will cause recognition errors.
[0004] In response to the above problems, this paper optimizes detection and recognition. The background difference method improves background extraction and background difference respectively. First, by combining the running mean method with Gaussian mixture background modeling, the background extraction effect is improved in terms of real-time and accuracy. Secondly, the adaptive threshold method is used to adaptively adjust the segmentation threshold according to the change of regional light intensity, so as to avoid the influence of uneven lighting on the detection results. In order to make full use of the characteristics of human motion invariance and avoid recognition errors caused by small training samples, this paper first adopts a human head and shoulder positioning based on AdaBoost, that is, the human head is preliminarily positioned according to the actual position of the moving object. Then, after positioning the head, the feature quantities of the human head are extracted, such as roundness, shoulder width ratio, etc. Finally, the human body is recognized by combining the shortest distance classifier. Summary of the invention
[0005] The technical problem to be solved by the present invention is that it is difficult to achieve both implementation and accuracy in the target detection method in the prior art, and it is also sensitive to changes in illumination, resulting in large deviations in the detection results. At the same time, the amount of calculation for human body recognition is large and the accuracy is low. In order to improve its shortcomings, the present invention provides a human body detection algorithm based on AdaBoost combined with an improved Gaussian mixture model.
[0006] To achieve the above object, the present invention is achieved through the following technical solutions:
[0007] A human body detection algorithm based on AdaBoost combined with an improved Gaussian mixture model includes target detection and human body recognition. The target detection includes the following steps:
[0008] S1: Gaussian mixture background modeling. This model mainly sets K (3-5) Gaussian distribution models for pixels in the image and counts the brightness values of pixels at the same position in the previous N frames. Thus, the probability distribution of each pixel in the current frame at time t is obtained, as shown in formula (1):
[0009]
[0010] S2: dynamic Gaussian mixture background extraction;
[0011] Step 1: According to B i (x,y)=λf i-1 (x,y)+(1-λ)B i-1 (x, y) calculates the preliminary background image B;
[0012] Step 2: Initialize the Gaussian model based on the preliminary background image B and establish a Gaussian model for each pixel;
[0013] Step 3: Match the newly obtained pixels with the existing Gaussian distributions one by one to determine whether the current number of Gaussian distributions reaches the set maximum value threshold;
[0014] Step 4: remove and merge Gaussian distributions with similarity. After the image is circulated, the updated background B is obtained by equation (2). new ;
[0015]
[0016] Step 5: The subsequent background update is based on the calculated noise point count. If the noise point count reaches the threshold, the running average is used to obtain the background B. Otherwise, the background is dynamically updated according to formula (2) to obtain the background B. new ;
[0017] S3: Adaptively adjust the regional threshold according to the changes in the mean and variance values of regional pixels;
[0018] Step 1: Divide the surveillance video area into several block areas;
[0019] Step 2: The background image B(B new ) is subtracted from the current frame I to obtain a differential image D;
[0020] Step 3, calculate the mean and variance of the difference map of each region n;
[0021] Step 4: Extract the foreground image.
[0022] The human body recognition comprises the following steps:
[0023] S1: Divide the video area into sections, each section corresponds to a weak classifier, and initialize the ratio between the head and body in the edge area of the video to be 1:3, and the ratio between the head and body directly below the video to be 1:2;
[0024] S2: Using the AdaBoost algorithm, H(x) = α1h1(x) + α2h2(x) + … α T h T (x) Connecting weak classifiers in series and hierarchically to obtain a strong classifier;
[0025] S3: Input the detected moving object position features into the strong classifier, calculate the weight α of each weak classifier, and then calculate the strong classifier H(x) to obtain the head candidate region;
[0026] S4: Calculate the head feature in the head candidate region, where the value of a1 is the head-shoulder width ratio, the value of a2 is the roundness, and the value of a3 is the mean-to-variance ratio, and convert these feature quantities into a feature vector x=(a1, a2, a3);
[0027] S5: According to the sample feature vector through the formula j=1,2…M calculates the distance m of the internal mean vector of the head-like pattern;
[0028] S6: Call decision function The distance between class patterns is calculated. If d(x)>T, it is judged to belong to the human body; if d(x)<T, it does not belong to the human body; if d(x)=T, it cannot be judged, and the value of T is obtained based on a large number of sample training tests.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. This method combines the running mean method and Gaussian mixture background modeling based on their respective characteristics, thereby improving the real-time and accuracy of background modeling. In the process of foreground and background subtraction, a regional threshold adaptive method is proposed, which adjusts and updates the segmentation threshold in real time according to the different light intensities in each area, which can better achieve the real-time and accuracy of moving object detection.
[0031] 2. Through the AdaBoost human head detection method, the human head is first preliminarily located according to the actual position of the moving object; then, after locating the head, the characteristic quantities of the human head are extracted: roundness, shoulder width ratio, etc.; finally, the human body is recognized by combining the shortest distance classifier. This method makes full use of the human position information to locate the human head, combines a variety of invariant features, and obtains the average feature through the three-dimensional vector feature. The average vector is used as the center of the ball, and the threshold is used as the radius of the ball, which reduces the amount of calculation to a certain extent and also improves the recognition accuracy. Experiments have shown that the algorithm is highly robust and has a high accuracy rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a comparison diagram of the background extraction of the present invention and the prior art.
[0033] Figure 2 This is a comparison chart of the processing time of the algorithms of the present invention and the prior art.
[0034] Figure 3 This is a comparison diagram of the foreground extraction effect obtained from video sequence A using the adaptive threshold method of the present invention and the effect of the prior art.
[0035] Figure 4 This is a comparison diagram of the foreground extraction effect obtained from video sequence B using the adaptive threshold method of the present invention and the effect of the prior art.
[0036] Figure 5 This is to identify the target feature value deviation in the present invention.
[0037] Figure 6 This is a statistical table of identification parameters of moving objects in the present invention.
[0038] Figure 7 This is the time-consuming statistics of object recognition in the present invention. DETAILED DESCRIPTION
[0039] The technical solution of the present application is further described below in conjunction with the accompanying drawings and embodiments.
[0040] A human body detection algorithm based on AdaBoost combined with an improved Gaussian mixture model includes the following steps:
[0041] S1: Gaussian mixture background modeling. This model mainly sets K (3-5) Gaussian distribution models for pixels in the image and counts the brightness values of pixels at the same position in the previous N frames. Thus, the probability distribution of each pixel in the current frame at time t is obtained, as shown in formula (1):
[0042]
[0043] in is the probability density of the i-th Gaussian distribution at time t, express Become the i-th Gaussian distribution The ratio of n represents the nth pixel in the image. is the expected value and standard deviation, and d is the detection diameter. In general, Gaussian distribution is based on There are two important parameters in this algorithm: α and H: 1 / α represents the training The number of samples; H represents the threshold for determining the background distribution;
[0044]
[0045] For each sample To determine whether it falls within the existing Gaussian distribution η, according to Determine whether it is true, if it is true, then the sample is Match, assuming that it does not match the first m, and matches m+1, let and Then the m+1th Gaussian distribution is updated according to the following formula, including weight, variance and expected value. For other Gaussian distributions, only weights are updated, and variance and expected value remain unchanged:
[0046]
[0047]
[0048]
[0049]
[0050] If it appears does not match any of the K Gaussian distributions. The distribution with the smallest median value is Replace it, set the variance value to a larger value, and the weight value to a relatively smaller value. Finally, according to formula (2), we can know that if Falling on η 1,t ,η 2,t ,…η B,t If the pixel is in the middle, it is a background pixel, otherwise it is a foreground pixel.
[0051] The disadvantages of the above-mentioned Gaussian mixed background are that the amount of calculation is large, the convergence speed is slow, and it is not conducive to real-time operation. To address this problem, the Gaussian mixed background extraction is improved; the background of the video image is updated by combining the running period mean method with the dynamic adjustment of the number of Gaussian distributions, that is, the initial background image is first obtained by the period mean method, and then the background is updated by dynamic Gaussian modeling, that is, S2: dynamic Gaussian mixed background extraction. The specific algorithm steps are as follows:
[0052] Step 1: According to formula (7):
[0053] B i (x,y)=λf i-1 (x,y)+(1-λ)B i-1 (x,y) (7)
[0054] The preliminary background image B is obtained by calculation;
[0055] Step 2: Initialize the Gaussian model based on the preliminary background image B and establish a Gaussian model for each pixel;
[0056] Step 3: Match the newly acquired pixels with the existing Gaussian distributions one by one. If no match is successful, determine whether the current number of Gaussian distributions reaches the set maximum value threshold. If the condition is not met, the standard deviation and weight need to be initialized to σ init and w init , added to the existing distribution; if the maximum threshold has been reached, the Gaussian distribution with a smaller priority is replaced with the latest Gaussian distribution;
[0057] Step 4: Remove duplicates from Gaussian distributions that are similar. The standard for removing duplicates is to compare whether two pixels i and j meet the criteria. If the conditions are met, the two Gaussian distributions are combined and the new expected value and variance after the combination are shown in formula (8):
[0058]
[0059] After the entire image is cycled, the updated background B is obtained through formula (2): new ;
[0060] Step 5: Subsequent background updates are based on the calculated noise points Where (i, j) represents the pixel coordinates, δ is the judgment function, if the number of noise points reaches the threshold, the running average is used to obtain the background B, otherwise the background is dynamically updated according to formula (2) to obtain the background B new .
[0061] According to the brightness of the video, we can know that the brightness values of pixels at different positions in the video or at different times in the same position are different. The traditional background difference is to set a fixed threshold and detect the foreground target by judging the size of the background difference and the threshold. The advantage of this is that the calculation is simple, but it will also cause problems such as increasing interference points or incomplete detection of targets. This paper proposes an adaptive adjustment of the regional threshold according to the changes in the mean and variance values of regional pixels, that is, S3: According to the changes in the mean and variance values of regional pixels, the regional threshold is adaptively adjusted. The specific algorithm is as follows:
[0062] Step 1: Divide the surveillance video area into 9 areas (set according to the complexity of the scene brightness change). If the scene lighting changes greatly, the area can be further subdivided. On the contrary, if the change is relatively small, the number of subdivided areas can be reduced to 3 or 6 areas.
[0063] Step 2: Take the background image B(B new ) is subtracted from the current frame I to obtain the differential image D:
[0064]
[0065] Step 3: Calculate the mean and variance of the difference map of region n:
[0066]
[0067] Step 4: Extract foreground image:
[0068] Where n is the area number of the block, and ω is the weighting factor. The value of ω is generally related to the intensity of the light change on the scene. The greater the change, the larger the value needs to be. If the value of ω is too large, the foreground information will be incompletely extracted, and if the value of ω is too small, noise points will appear. Therefore, the value of ω is generally 0-0.5.
[0069] Through MATLAB simulation experiments, Gaussian mixture modeling, running mean method and this method are compared. The moving object is relatively slow and occupies a large area of the entire video. Figure 1 (a) is the 80th frame of the video sequence; Figure 1 (b) is the background extracted by Gaussian mixture modeling, which converges slowly and has poor results; Figure 1 (c) is the background extracted by the running mean method. At this time, since the moving object is relatively slow, each point is calculated according to the mean, the foreground interference is large, and there are noise points in the background. Figure 1 (d) is the background extracted by the proposed method. By combining it with dynamic Gaussian mixture at runtime, the mean of pixels is no longer calculated alone. Instead, each pixel is modeled by a Gaussian model, which improves the accuracy of background extraction.
[0070] Figure 2 The figure shows the average time comparison of background calculation by Gaussian mixture modeling, running mean method, improved ViBe algorithm and the proposed method when processing the same 500-frame video.
[0071] In view of the problems in the foreground extraction process, the uneven distribution of light intensity is the main difficulty in extracting the foreground by background difference. By selecting a video of the flow of people recorded at the entrance of a store, the method proposed in this paper is compared with the traditional background difference method. The characteristics of the two videos are that the light at the entrance is strong, the light indoors is weak, and the brightness of the entrance often changes due to the sunlight outside. As shown in the video sequence A, the sunlight at the entrance shines on the object, causing the brightness of the object surface to change differently. Figure 3 In (a), the foreground is extracted using a fixed threshold. It can be seen that due to the change in illumination, the changed illumination value reaches the background difference threshold and is extracted as the foreground. Figure 4 In (a), a fixed threshold is set. The closer the moving object is to the door, the stronger the light is and the clearer the detected image is. It can be seen from the figure that the detection effect is inconsistent at different positions and the detected object is incomplete.
[0072] Figure 3 and Figure 4 (b) shows the foreground extraction effect obtained by using the adaptive threshold method, which overcomes the interference caused by changes and uneven illumination, and can adaptively adjust the threshold size of each area, reducing the impact of interference points.
[0073] The main idea of the AdaBoost algorithm is to obtain a strong classifier by connecting several weak classifiers in series and classifying them.
[21] The weak classifier is obtained by training and learning each feature sample. The traditional AdaBoost algorithm theory is as follows:
[0074] In general, when there is no prior knowledge of sample features, the weights of each sample feature are initialized to the same value D1(i) = 1 / n, where n represents the number of sample features. Through each training and learning, it is determined whether the sample classification is correct. When an error occurs, the learning weight of the sample is increased so that the subsequent training and learning can focus on training samples of this type.
[0075] Assume that the i-th training sample (x i ,y i ) After t iterations, the weight is D1(i). Each round of sample training is to obtain a weak classifier through weight and sample distribution. After t iterations of training, t weak classifiers h are obtained. t , that is, h t :X→{+1,-1}, this is the simplest form (binary form), ht The accuracy of t to decide.
[0076]
[0077] where y i For categories, when the misjudgment rate is lower, the weight α obtained by the weak classifier t The higher the value, the higher the value. After T iterations, T classifiers h1, h2…h are obtained. T .
[0078] By combining T classifiers in series and cumulatively, a strong classifier is obtained:
[0079] H(x)=α1h1(x)+α2h2(x)+…α T h T (x) (12)
[0080] Where x is the eigenvector, α t is the weight of the weak classifier, h t is a weak classifier, and H(x) is the final strong classifier.
[0081] The human body recognition comprises the following steps:
[0082] Step 1: Divide the video area into sections, each section corresponds to a weak classifier, and initialize the ratio between the head and body in the edge area of the video to be 1:3, and the ratio between the head and body directly below the video to be 1:2;
[0083] Step 2: Use the AdaBoost algorithm to connect the weak classifiers in series and hierarchically to obtain a strong classifier using formula (12);
[0084] Step 3: Input the detected moving object position features (target centroid) into the strong classifier, calculate the weight α of each weak classifier, and then calculate the strong classifier H(x) to obtain the head candidate area;
[0085] Step 4: Calculate the head feature in the head candidate area: the value of a1 is the head-shoulder width ratio, the value of a2 is the roundness, and the value of a3 is the mean-to-variance ratio. Convert these feature quantities into a feature vector x = (a1, a2, a3);
[0086] Step 5: According to the sample feature vector x = (a1, a2, a3), calculate the distance m of the internal average vector of the head class pattern through formula (14);
[0087]
[0088] Step 6: Call the decision function (15);
[0089]
[0090] The distance between the class patterns is calculated. If d(x)>T, it is judged to belong to the human body; if d(x)<T, it does not belong to the human body; if d(x)=T, it cannot be judged. The value of T is obtained based on a large number of sample training tests.
[0091] This experiment selects a video recorded at the entrance of a shopping mall to verify the accuracy of the proposed method in human body and object recognition. It also compares the proposed method with the neural network classification and recognition method. It compares the proposed method with the proposed method through convolutional neural network, K-means, SVM, and COCO Human Parts. According to the calculated head feature x = (a1, a2, a3), the eigenvalue state is calculated by formula (15). The eigenvalue deviation is compared with the predicted eigenvalue and the true value deviation obtained by the proposed method, K-means, and SVM, as shown in the figure. Figure 5 As shown: the vertical axis value represents the predicted human body deviation value, negative values represent the possibility of being recognized as an object, and positive values represent the possibility of being recognized as a human body. The larger the negative value, the greater the possibility of being an object, and the larger the positive value, the greater the possibility of being a human body.
[0092] From the curve fitting in the figure, we can see that there is a relatively large error between the feature values predicted by K-means and SVM and the feature values of real objects and human bodies, while the method in this paper basically maintains the trend of the real feature values.
[0093] The test was conducted on 100 samples, including people, scenes of people and objects, and the recognition results of K-means, SVM and this paper were statistically compared from the perspectives of accuracy, recall rate, false positives, etc. Figure 6 shown.
[0094] Precision: indicates the percentage of correctly identified objects that meet the requirements to the total number of identified objects; Recall: indicates the percentage of correctly identified objects that meet the requirements to the total number of objects in the test set; FP: false positive, that is, a prediction error (the algorithm predicts an object that does not exist); FN: false negative, that is, no prediction (the algorithm does not predict the object within the specified range of the object); TP: true positive, that is, a correct prediction (the algorithm predicts the object within the specified range of the object); TN: true negative, the algorithm predicts that this is the background, which means that there is no object here. From Figure 6 It can be seen that the overall false positives and accuracy of this method are significantly better than those of the other two algorithms.
[0095] The three algorithms are compared in terms of human recognition rate and mixed scene recognition of people, respectively, from the perspective of algorithm time consumption and algorithm recognition accuracy. Figure 7 shown.
[0096] The above experiments show that the recognition rate of this method is relatively high and the time consumption is low. Compared with the convolutional neural network classification, the neural network needs a large number of samples for training to make the weight converge, resulting in the recognition accuracy relying on the number of samples, thus affecting the actual recognition rate; K-means uses the key frame sequence after secondary optimization to improve the recognition rate and processing time, but it cannot distinguish the object features for the mixed scene of people and objects, resulting in a low recognition rate; the combined feature SVM method uses a combination of multiple features for classification calculation, which increases the computational complexity from the algorithm, resulting in a long time consumption, and the recognition effect in the single-person scene is improved, but there is also a problem that the recognition of mixed scenes does not distinguish the object features, resulting in a low recognition rate for mixed scenes; COCO Human Parts detects the human body parts of each person instance and predicts the subordinate relationship between them, and recognizes human body parts, such as gesture recognition, face / hand key point detection, visual action, human-object interaction and virtual reality, but there is a large error in distinguishing between people and objects, and does not distinguish between the features of objects and human features. In the case of a small number of samples, the proposed method simultaneously calculates the key features: the average feature vector, i.e., the feature center point, and classifies the features according to the shortest distance. This not only reduces the computational complexity, but also improves the recognition accuracy.
[0097] The present invention is not limited to the above-mentioned embodiments. On the basis of the technical solution disclosed in the present invention, technicians in this field can make some substitutions and deformations to some technical features therein according to the disclosed technical content without creative labor, and these substitutions and deformations are all within the protection scope of the present invention.
Claims
1. A human detection algorithm based on AdaBoost combined with improved Gaussian mixture model, It is characterized in that It includes target detection and human body recognition, and the target detection includes the following steps: S1: Gaussian mixture background modeling. This model mainly sets K (3-5) Gaussian distribution models for pixels in the image and counts the brightness values of pixels at the same position in the previous N frames. Thus, the probability distribution of each pixel in the current frame at time t is obtained, as shown in formula (1): S2: dynamic Gaussian mixture background extraction; Step 1: According to B i (x,y)=λf i-1 (x,y)+(1-λ)B i-1 (x, y) calculates the preliminary background image B; Step 2: Initialize the Gaussian model based on the preliminary background image B and establish a Gaussian model for each pixel; Step 3: Match the newly obtained pixels with the existing Gaussian distributions one by one to determine whether the current number of Gaussian distributions reaches the set maximum value threshold; Step 4: remove and merge Gaussian distributions with similarity. After the image is circulated, the updated background B is obtained by equation (2). new ; Step 5: The subsequent background update is based on the calculated noise point count. If the noise point count reaches the threshold, the running average is used to obtain the background B. Otherwise, the background is dynamically updated according to formula (2) to obtain the background B. new ; S3: Adaptively adjust the regional threshold according to the changes in the mean and variance values of regional pixels; Step 1: Divide the surveillance video area into several block areas; Step 2: The background image B(B new ) is subtracted from the current frame I to obtain a differential image D; Step 3, calculate the mean and variance of the difference map of each region n; Step 4: Extract the foreground image. The human body recognition comprises the following steps: S1: Divide the video area into sections, each section corresponds to a weak classifier, and initialize the ratio between the head and body in the edge area of the video to be 1:3, and the ratio between the head and body directly below the video to be 1:2; S2: Using AdaBoost algorithm with H(x) = α 1 h 1 (x)+α 2 h 2 (x)+…α T h T (x) Connecting weak classifiers in series and hierarchically to obtain a strong classifier; S3: Input the detected moving object position features into the strong classifier, calculate the weight α of each weak classifier, and then calculate the strong classifier H(x) to obtain the head candidate region; S4: Calculate the head feature in the head candidate area, a 1 The value of the head-shoulder ratio, a 2 The value of circularity, a 3 The value is the ratio of mean to variance, and these feature quantities are converted into feature vectors x = (a 1 ,a 2 ,a 3 ); S5: According to the sample feature vector through the formula j=1,2…M calculates the distance m of the internal mean vector of the head-like pattern; S6: Call decision function The distance between class patterns is calculated. If d(x)>T, it is judged to belong to the human body; if d(x)<T, it does not belong to the human body; if d(x)=T, it cannot be judged, and the value of T is obtained based on a large number of sample training tests.
2. According to claim 1, a human body detection algorithm based on AdaBoost combined with an improved Gaussian mixture model, Features: The block areas are generated into 3 blocks, 6 blocks, 9 blocks, etc. according to the complexity of the scene brightness change.
