A HOG Facial Fatigue Feature Extraction Method Based on Prior Information Weighting

By introducing dual-threshold adaptive gamma correction and KL divergence weighting processing in the HOG algorithm, the problem of facial fatigue feature loss in the smart cockpit is solved, and stable and reliable feature extraction is achieved in complex environments.

CN116563921BActive Publication Date: 2025-07-11HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310505318.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2025-07-11
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

Traditional HOG feature extraction methods are lost in complex scenes in smart cockpits, which are poorly robust and difficult to cope with lighting changes and environmental complexity.

Method used

Using the HOG face fatigue feature extraction method based on prior information weighting, the traditional HOG algorithm is improved to enhance the robustness and stability of feature extraction through dual-threshold adaptive gamma correction, gradient direction expansion and KL divergence weighting processing.

Benefits of technology

Effectively extract facial fatigue characteristics in complex environments in smart cockpits, improving the reliability and stability of feature extraction and enhancing the ability to adapt to light changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563921B_ABST
    Figure CN116563921B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for extracting HOG face fatigue features weighted by prior information, comprising the following steps: S1. Input a color image, convert it to the HSV color space, and perform double-threshold adaptive gamma correction on the V channel in the HSV color space; S2. Calculate the gradient magnitude and direction of the corrected image, and divide the image into several cell regions; S3. Calculate the weighted projection gradient histogram of the cell regions, perform Laplacian smoothing and normalization; S4. Calculate the corresponding KL divergence value for the normalized cells, and divide all the cells into several block blocks; S5. Perform weighted processing on the cells within the block blocks based on the prior information and the KL divergence value, and integrate all the processed blocks to obtain the final feature vector. This method solves the problem of feature loss in the extraction of traditional algorithms in complex environments in intelligent cockpits, and the face fatigue features extracted by the improved algorithm are reliable and stable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and specifically refers to a method for extracting HOG face fatigue features weighted by prior information in an intelligent cockpit. Background Art

[0002] In recent years, with the rapid development of technologies such as the Internet of Things and artificial intelligence, traditional mechanical and electrical vehicle cockpits have gradually evolved into digital, intelligent, and interconnected intelligent cockpits. The traditional methods for detecting the fatigue state of drivers in vehicle cockpits are not well-suited to the complex environmental scenarios in intelligent cockpits, which poses higher requirements for the algorithms for extracting the fatigue state features of drivers. In the complex scenarios of intelligent cockpits, accurately identifying and extracting the fatigue state of drivers and giving early warnings can effectively reduce the occurrence of traffic accidents and ensure the safety of people's lives and property.

[0003] Histogram of Oriented Gradient (HOG) is a very effective method for extracting face features, with characteristics such as illumination invariance, translation invariance, and rotation invariance. The directional density distribution of its edges or gradients can well represent the local feature regions of face images, and can provide reliable and stable support for the subsequent accurate recognition and determination of face fatigue.

[0004] For traditional HOG feature extraction methods, due to the fixed gamma correction threshold in the algorithm, the brightness and contrast of images are adjusted through a single threshold, resulting in poor robustness and making it difficult to cope with the complex environmental impacts of various real scenarios in intelligent cockpits. When extracting features in the face of situations such as local overbrightness or overdarkness, some important local information is often lost. The gradient calculation in the algorithm only considers the horizontal and vertical directions, and cannot well extract the fatigue features of faces in some complex environments. Moreover, the image processing process of the algorithm is fixed and single, and cannot well extract the fatigue features of different regions. Therefore, finding a method for extracting face fatigue features in complex scenarios of intelligent cockpits is of great significance and value. Summary of the Invention

[0005] The purpose of the present invention is to solve the problem of loss of face fatigue features in complex scenarios in intelligent cockpits in the prior art, and propose a method for extracting HOG face fatigue features weighted by prior information, thereby effectively improving the reliability and stability of face fatigue feature extraction.

[0006] To solve the above technical problems, the technical solution of the present invention is as follows:

[0007] A method for extracting HOG face fatigue features weighted by prior information, comprising the following steps:

[0008] S1. Input a color image, convert it to the HSV color space, and perform double-threshold adaptive gamma correction on the V channel in the HSV color space;

[0009] S2. Calculate the magnitude and direction of the corrected gradient, and divide the image into several cell regions, where the magnitude and direction of the gradient are the calculated gradient amplitude and direction angle;

[0010] S3. Calculate the weighted projection gradient histogram of the cell region, perform Laplacian smoothing and normalization;

[0011] S4. Calculate the corresponding KL divergence value for the normalized cell, and divide all cells into several block blocks;

[0012] S5. Based on the prior information and the KL divergence value, perform weighted processing on the cells within the block, and integrate all processed blocks to obtain the final feature vector.

[0013] Preferably, in the step S1, the double-threshold adaptive gamma correction expression is as follows:

[0014]

[0015]

[0016] F(V) = μF1(V) + (1 - μ)F2(V)

[0017] Among them, F1(V) is a convex function for enhancing the dark light area; F2(V) is a concave function for suppressing the strong light area; μ and γ in the formula are adaptively adjusted according to the brightness value V of the HSV color space.

[0018] Preferably, in the step S1, the expressions of μ and γ are as follows:

[0019]

[0020]

[0021] Preferably, the step S3 includes the following sub-steps:

[0022] S3-1. Divide the cell region into several bins in units to obtain the angular interval ranges of several bins;

[0023] S3-2. After weighting the pixel points within the cell region by the gradient amplitude, project them onto the bin corresponding to the gradient angle of the pixel points, and accumulate to obtain the gradient histogram of this cell. The projection formula is specifically:

[0024]

[0025] In the formula, C represents the A of all pixels in a cell. n The sum of the projection values ​​of the interval, V x represents the gradient value of the x pixel point, θ x Indicates the gradient direction of the x pixel point, by judging θ x Which A n interval, and then calculate its projection weight by the above formula, and finally sum it up to get the total projection value, and finally concatenate all the projection values ​​to get the gradient histogram of the cell;

[0026] S3-3, Laplace smoothing is performed on the gradient histogram obtained in the above steps, and the smoothed gradient histogram is normalized using the L2-Norm function to obtain a smoothed normalized gradient histogram, whose function expression is specifically:

[0027]

[0028] In the formula, B n is the amplitude corresponding to the nth angle interval, and the expression of ||C|| is:

[0029]

[0030] Preferably, in step S3-1, the method of dividing cells and pre-acquiring bins is:

[0031] Divide 0 to 360° into 12 bins in units of 30°, and get 12 angle intervals, whose set is: A = {A1, A2…, A 12}.

[0032] Preferably, in step S4, the specific calculation formula of the KL divergence value is:

[0033]

[0034] In the formula, Table 1 is a known probability distribution, where Corresponding to the values ​​of the 12 bins of the gradient histogram of the prior information cell area; q i =A i is the true probability distribution of the observation, where A i The corresponding values ​​are the 12 bins of the gradient histogram of the observation information cell area. The smaller the calculated KL(p||q) value, the higher the similarity between the two, and the larger the value, the lower the similarity.

[0035] Preferably, the prior information refers to the gradient histogram obtained by processing the color image in the intelligent cockpit without a driver through S1 - S4.

[0036] Preferably, in the step S5, the weighting processing method is as follows:

[0037] H k = ∑ω n C n

[0038] In the formula, H k is the feature vector of the k - th block, which is composed of m×m cells, C n is the gradient histogram feature vector of the cells within the block, ω n is the weight value corresponding to this cell, and its weight calculation formula is as follows:

[0039]

[0040] In the formula, KL n is the KL divergence value corresponding to this cell, and KL sum is the sum of the KL divergence values of all cells within the block where this cell is located.

[0041] The present invention has the following characteristics and beneficial effects:

[0042] The improved HOG face fatigue feature extraction method based on prior information weighting of the present invention solves the problem of feature loss in the extraction of traditional algorithms in the complex environment of the intelligent cockpit. The face fatigue features extracted by the improved algorithm are reliable and stable. Due to the fixed and single gamma correction threshold in the traditional algorithm, feature extraction loss will occur in the complex environment of the intelligent cockpit. The improved gamma correction introduces a double - threshold, which can effectively enhance the dark - light area, suppress the strong - light area, improve the situation of feature loss, and enhance the robustness of feature extraction. At the same time, two diagonal - direction gradient calculations are added to the improved HOG algorithm, which can extract more abundant face information. And because different regions contribute differently to the detection of fatigue features, based on the prior feature vector information, the present invention calculates the similarity between the gradient histograms after Laplace smoothing using KL divergence, and performs weighting processing on the extracted feature map based on this similarity, which can effectively enhance the feature information of face fatigue in the complex scenarios of the intelligent cockpit. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0044] Figure 1 It is a flowchart of a method for extracting HOG face fatigue features based on prior information weighting in an embodiment of the present invention. Detailed implementation manners

[0045] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0046] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "plurality" is two or more.

[0047] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected, or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood through specific situations.

[0048] The present invention provides an improved method for extracting HOG face fatigue features based on prior information weighting in an intelligent cockpit in an embodiment of the present invention, as Figure 1 shown, including the following steps:

[0049] S1. Input a color image, convert it to the HSV color space, and perform double-threshold adaptive gamma correction on the V channel;

[0050] It should be noted that converting an image to the HSV color space is a common technique. Therefore, in this embodiment, the conversion process will not be specifically explained and described.

[0051] S2. Calculate the magnitude and direction of the corrected gradient, and divide the image into several cell regions;

[0052] S3. Calculate the weighted projection gradient histogram of the cells, perform Laplacian smoothing and normalization;

[0053] S4. Calculate the corresponding KL divergence value for the normalized cells, and divide all the cells into several block blocks;

[0054] S5. Based on the prior information and the KL divergence value, perform weighted processing on the cells within the block, and integrate all the processed blocks to obtain the final feature vector.

[0055] In a further setting of the present invention, the dual-threshold adaptive gamma correction is specifically as follows: When performing gamma correction on an image, since the correction threshold is fixed and the correction effect is relatively single, an improved adaptive dual-threshold gamma function is used for correction, and its functional formula is as follows:

[0056]

[0057]

[0058] F(V) = μF1(V) + (1 - μ)F2(V)

[0059] Among them, F1(V) is a convex function for enhancing the dark light area; F2(V) is a concave function for suppressing the strong light area; μ and γ in the formula are adaptively adjusted according to the brightness value V of the HSV color space, and the formulas are as follows:

[0060]

[0061]

[0062] Specifically, the specific calculation formula for the gradient is:

[0063] G x (V) = V(x + 1, y) - V(x - 1, y)

[0064] G y (V) = V(x, y + 1) - V(x, y - 1)

[0065] G i (V) = V(x + 1, y + 1) - V(x - 1, y - 1)

[0066] G j (V) = V (x + 1, y - 1) - V (x - 1, y + 1)

[0067] Where V(x,y) represents the brightness value at the V channel (x,y) of the image HSV color space, G x (V) represents the horizontal gradient, G y (V) represents the vertical gradient, G i (V) represents the gradient at 45° from horizontal, G j (V) represents the gradient at a horizontal angle of 135°. The gradient amplitude and direction angle are calculated based on the obtained gradient. The specific expressions are as follows:

[0068]

[0069]

[0070] Among them, G(x,y) is the gradient amplitude and θ(x,y) is the gradient direction angle.

[0071] Furthermore, the step S3 includes the following sub-steps:

[0072] S3-1, 0 to 360° is divided into 12 bins with 30° as the unit, and 12 angle intervals are obtained, the set of which is: A={A1,A2…,A 12};

[0073] S3-2, after weighting the pixel points in the cell area according to the gradient amplitude, project them to the bin corresponding to their gradient angle, and accumulate them to obtain the gradient histogram of this cell. The specific projection formula is:

[0074]

[0075] In the formula, C represents the A of all pixels in a cell. n The sum of the projection values ​​of the interval, V x represents the gradient value of the x pixel point, θ x Indicates the gradient direction of the x pixel point, by judging θ x Which A n interval, and then calculate its projection weight through the above formula, and finally sum it up to get the total projection value, and finally concatenate all the projection values ​​to get the gradient histogram of the cell.

[0076] S3-3, Laplace smoothing is performed on the gradient histogram obtained in the above steps, and the smoothed gradient histogram is normalized using the L2-Norm function to obtain a smoothed normalized gradient histogram, whose function expression is specifically:

[0077]

[0078] In the formula, B n is the amplitude corresponding to the nth angular interval, and the expression of ||C|| is:

[0079]

[0080] Specifically, calculating the KL divergence value corresponding to the normalized cell, the specific process is as follows:

[0081] Calculate the divergence value KL:

[0082]

[0083] In the formula, represents the known probability distribution, where corresponds to the values corresponding to the 12 bins of the gradient histogram of the prior information cell region; q i = A i is the observed true probability distribution, where A i corresponds to the values corresponding to the 12 bins of the gradient histogram of the observed information cell region. The smaller the calculated KL(p||q) value, the higher the similarity between the two, and the larger the value, the lower the similarity.

[0084] A further setting of the present invention is to perform weighted processing on the cells in the block based on the prior information and the KL divergence value. The specific process is as follows:

[0085] The weighted processing formula is:

[0086] H k = ∑ω n C n

[0087] In the formula, H k is the kth block feature vector, which is composed of m×m cells, C n is the gradient histogram feature vector of the cells in the block, and ω n is the weight corresponding to this cell. The weight calculation formula is as follows:

[0088]

[0089] In the formula, KL n is the KL divergence value corresponding to this cell, and KL sum is the sum of the KL divergence values of all cells in the block where this cell is located.

[0090] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, without departing from the principle and spirit of the present invention, various changes, modifications, substitutions, and variations to these embodiments including components still fall within the protection scope of the present invention.

Claims

1. A method for extracting HOG face fatigue features weighted by prior information, characterized in that It includes the following steps: S1. Input a color image, convert it to the HSV color space, and perform double-threshold adaptive gamma correction on the V channel in the HSV color space; The expression of double-threshold adaptive gamma correction is as follows: F(V) = μF1(V) + (1 - μ)F2(V) where F1(V) is a convex function used to enhance the dark light area; F2(V) is a concave function used to suppress the strong light area; μ and γ in the formula are adaptively adjusted according to the brightness value V of the HSV color space; S2. Calculate the magnitude and direction of the corrected gradient, and divide the image into several cell regions. Among them, the gradient direction includes the horizontal direction of the gradient, the vertical direction of the gradient, the horizontal oblique 45° direction of the gradient, and the horizontal oblique 135° direction of the gradient; S3. Calculate the weighted projection gradient histogram of the cell region, perform Laplacian smoothing and normalization, including the following sub-steps: S3-1. Divide the cell region into several bins in units to obtain the angular interval range of several bins; S3-2. After weighting the pixel points in the cell region according to the gradient amplitude, project them onto the bin corresponding to the gradient angle of the pixel points, and accumulate to obtain the gradient histogram of this cell. The projection formula is specifically: Wherein, C represents the sum of the projection values of all pixel points in a cell within the A n interval, V x represents the gradient value at the x pixel position, θ x represents the gradient direction at the x pixel position; S3-3. Perform Laplacian smoothing on the gradient histogram obtained in the above steps, and normalize the smoothed gradient histogram with the L2-Norm function to obtain the smoothed and normalized gradient histogram. Its function expression is specifically: where B n is the amplitude corresponding to the nth angular interval, and the expression of ||C|| is: S4. Calculate the corresponding KL divergence value for the normalized cell, and divide all cells into several block blocks; S5. Based on the prior information and the KL divergence value, perform weighted processing on the cells in the block block, and integrate all processed blocks to obtain the final feature vector.

2. The method for extracting HOG face fatigue features weighted based on prior information according to claim 1, wherein In the step S1, the expressions of μ and γ are as follows:

3. The method for extracting HOG face fatigue features weighted by prior information according to claim 2, characterized in that In the step S2, the corrected gradient is calculated, and the gradient magnitude and direction angle are calculated through the corrected gradient.

4. The HOG face fatigue feature extraction method based on priori information weighting according to claim 2, characterized in that In the step S3-1, the method for dividing the cell to pre-obtain the bin is: Divide 0 to 360° into 12 bins at 30° intervals to obtain 12 angular range intervals, and their set is: A = {A1, A2…, A 12}.

5. The method for extracting HOG face fatigue features weighted by prior information according to claim 2, wherein In the step S4, the specific calculation formula of the KL divergence value is: In the formula, represents a known probability distribution, where corresponds to the values corresponding to the 12 bins of the gradient histogram of the prior information cell region; q i = A i is the true probability distribution of the observation, where A i corresponds to the values corresponding to the 12 bins of the gradient histogram of the observation information cell region.

6. The method for extracting HOG face fatigue features weighted by prior information according to claim 5, wherein The prior information refers to the gradient histogram obtained after processing the color image without a driver in the intelligent cockpit through S1-S4.

7. The method for extracting HOG face fatigue features weighted based on prior information according to claim 6, wherein In the step S5, the weighted processing method is: H k = ∑ω n C n where H k is the feature vector of the k-th block, which consists of m×m cells, and C n is the gradient histogram feature vector of the cells within the block, ω n is the weight corresponding to this cell, and its weight calculation formula is as follows: where KL n is the KL divergence value corresponding to this cell, and KL sum is the sum of the KL divergence values of all cells within the block where this cell is located.

Citation Information

Patent Citations

  • Road warning mark detection and recognition method based on block recognition

    CN105809138A

  • Image preprocessing method, system and device and medium

    CN111860529A