Method and device for estimating age of passenger in vehicle cabin, electronic equipment and storage medium
By constructing a face image dataset containing different age groups and combining face detection and key point detection algorithms, the problems of insufficient data and insufficient model generalization capabilities in the age estimate of occupants in the cabin of the vehicle are solved, and under different conditions, the problem of insufficient data and insufficient model generalization capabilities is achieved. high accuracy and high efficiency age estimates.
Patent Information
- Application Number
- CN202411228364.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, in the age estimation of occupants in the vehicle cockpit, it is difficult to obtain facial image data with age tags, and the generalization ability of the model is greatly affected by factors such as light, angle and occlusion, resulting in low estimation accuracy and efficiency.
By obtaining the face images of occupants in the cabin of the vehicle, marking the age tags, a data set of face images containing different age groups is constructed, and a facial image of faces of at least three sizes is cropped using face detection and key point detection algorithms. Box, build an age estimation prediction model, combine regression and divergence loss functions for training, and improve the generalization ability of the model.
The accuracy and efficiency of occupants in the cabin in the vehicle cockpit is improved under different lighting conditions and perspectives, and the adaptability and accuracy of the model is enhanced, which is suitable for the field of smart vehicles.
Smart Images

Figure CN119206818A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the fields of computer vision and artificial intelligence technology, and in particular to a method, device, electronic device and storage medium for estimating the age of occupants in a vehicle cabin. Background Art
[0002] The demand for vehicle safety systems and personalized driving experience is growing, and accurately identifying the age of vehicle occupants is one of the important requirements. At present, the development of technology in this field mainly relies on deep learning models, especially convolutional neural networks. These models can learn the complex relationship between facial features and age through a large amount of training data, thereby achieving more accurate age estimation.
[0003] In the prior art, the age estimation method of the occupants in the vehicle cabin based on computer vision mainly uses the camera in the vehicle to capture the facial image of the occupants, and then uses computer vision and deep learning technology to analyze and process the image to estimate the age of the occupants. However, in the specific scenario of estimating the age of the occupants in the vehicle cabin, it is a challenge to obtain a large amount of facial image data with age labels; secondly, due to the large differences in facial features of different people, and the influence of factors such as lighting, angle and occlusion, the generalization ability of the model is subject to certain limitations.
[0004] Therefore, how to improve the accuracy and efficiency of estimating the age of vehicle cabin occupants is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, electronic device and storage medium for estimating the age of occupants in a vehicle cabin, so as to improve the generalization ability of the age estimation prediction model, improve the accuracy and efficiency of estimating the age of occupants in the vehicle cabin, and provide new technical support for the development of the field of intelligent vehicles.
[0006] In a first aspect, an embodiment of the present invention provides a method for estimating the age of an occupant in a vehicle cabin, comprising:
[0007] Acquire a facial image of a person in a vehicle cabin, and annotate the facial image with a corresponding age label;
[0008] Based on the annotated facial images, a facial image dataset containing faces of different age groups is constructed, and corresponding divergence features are constructed for age labels;
[0009] Cropping the face image to determine at least three sizes of face image frames according to a face detection algorithm and a face key point detection algorithm, and constructing an age estimation prediction model according to the at least three sizes of face image frames;
[0010] The age estimation prediction model is trained according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges; wherein the total loss function includes a regression loss function and a divergence loss function, and the divergence loss function is used to evaluate the degree of divergence between the predicted age label and the true age label;
[0011] The age of the occupants in the vehicle cabin is estimated based on the trained target age estimation prediction model.
[0012] In a second aspect, an embodiment of the present invention further provides a device for estimating the age of an occupant in a vehicle cabin, comprising:
[0013] An age labeling module is used to obtain a facial image of a passenger in a vehicle cabin and label the facial image with a corresponding age label;
[0014] A data set construction module is used to construct a data set of facial images of people of different age groups based on the annotated facial images, and to construct corresponding divergence features for age labels;
[0015] An age estimation prediction model building module is used to crop a face image to determine at least three sizes of face image frames according to a face detection algorithm and a face key point detection algorithm, and to build an age estimation prediction model according to the at least three sizes of face image frames;
[0016] An age estimation prediction model training module is used to train the age estimation prediction model according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges; wherein the total loss function includes a regression loss function and a divergence loss function, and the divergence loss function is used to evaluate the degree of divergence between the predicted age label and the true age label;
[0017] The vehicle cabin occupant age estimation module is used to estimate the age of the vehicle cabin occupants based on the trained target age estimation prediction model.
[0018] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0019] one or more processors;
[0020] A storage device for storing one or more programs;
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for estimating the age of an occupant in a vehicle cabin as described in any embodiment of the present invention.
[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for estimating the age of an occupant in a vehicle cabin as described in any embodiment of the present invention.
[0023] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the method for estimating the age of an occupant in a vehicle cabin as described in any embodiment of the present invention.
[0024] The embodiment of the present invention provides a method, device, electronic device and storage medium for estimating the age of passengers in a vehicle cabin, by annotating corresponding age labels on facial images of passengers in the vehicle cabin; constructing a facial image dataset containing facial images of passengers of different age groups, and constructing corresponding divergence features for age labels; cropping facial images according to a face detection algorithm and a facial key point detection algorithm to determine facial image frames of at least three sizes, and constructing an age estimation prediction model according to the facial image frames of at least three sizes; training the age estimation prediction model until the total loss function of the age estimation prediction model converges; and estimating the age of passengers in the vehicle cabin according to the target age estimation prediction model obtained by training. The technical solution of the embodiment of the present invention is adopted to obtain facial images of passengers in the vehicle cabin under different lighting conditions and viewing angles, and construct an age estimation prediction model through facial image frames of at least three sizes to meet actual needs, improve the generalization ability of the age estimation prediction model, improve the accuracy and efficiency of age estimation of passengers in the vehicle cabin, and provide new technical support for the development of the field of intelligent vehicles. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts. In the drawings:
[0026] Figure 1 is a flow chart of a method for estimating the age of an occupant in a vehicle cabin provided by a first embodiment of the present invention;
[0027] Figure 2 is a flow chart of a method for estimating the age of an occupant in a vehicle cabin provided by a second embodiment of the present invention;
[0028] Figure 3 This is a basic framework diagram for estimating the age of an occupant in a vehicle cabin provided in an embodiment of the present invention;
[0029] Figure 4is a schematic diagram of age dispersion characteristics of passengers in a vehicle cabin provided in an embodiment of the present invention;
[0030] Figure 5 This is a flowchart of key steps in constructing an age estimation prediction model provided in an embodiment of the present invention;
[0031] Figure 6 It is a structural schematic diagram of an age estimation prediction model provided in an embodiment of the present invention;
[0032] Figure 7 This is a flow chart of a method for testing a target age estimation prediction model provided by Embodiment 3 of the present invention;
[0033] Figure 8 is a schematic diagram of the results of a performance evaluation of a target age estimation prediction model provided in an embodiment of the present invention;
[0034] Fig. 9 is a flow chart of a method for estimating the age of an occupant in a vehicle cabin provided by a fourth embodiment of the present invention;
[0035] Fig.10 It is a schematic diagram of a model deployment process provided in an embodiment of the present invention;
[0036] Fig.11 is a schematic diagram of an age estimation result of an occupant in a vehicle cabin provided in an embodiment of the present invention;
[0037] Fig.12 is a schematic structural diagram of a device for estimating the age of an occupant in a vehicle cabin provided in an embodiment of the present invention;
[0038] Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0040] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0041] Among them, the acquisition, storage, use and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components or models may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0043] Embodiment 1
[0044] Figure 1 This is a flow chart of a method for estimating the age of a passenger in a vehicle cabin provided in an embodiment of the present invention. This embodiment is applicable to the case of estimating the age of a passenger in a vehicle cabin. The method of this embodiment can be executed by a device for estimating the age of a passenger in a vehicle cabin, and the device can be implemented in hardware and / or software. The device can be configured in a server for estimating the age of a passenger in a vehicle cabin. The method specifically includes the following steps:
[0045] S110, obtaining a facial image of an occupant in a vehicle cabin, and marking the facial image with a corresponding age label.
[0046] Among them, deep learning models require a large amount of training data to achieve good performance. However, in the specific scenario of estimating the age of occupants in the vehicle cabin, it is a challenge to obtain a large amount of facial image data with age labels. This may lead to insufficient data when training the model, affecting the final estimation effect. Therefore, the embodiment of the present invention takes into account factors such as different lighting conditions and changes in viewing angles that may occur in the vehicle cabin to obtain facial images of occupants in the vehicle cabin. The method of the present invention has strong adaptability to environmental changes, which ensures that a large amount of facial image data can be obtained under different conditions, so that the final age estimation maintains a high estimation accuracy.
[0047] Optionally, the face images include face images of people of different age groups, different races and different genders. The acquired face images are labeled with corresponding age labels to ensure that the data set is labeled accurately, and the age label ranges from 0 to 100.
[0048] S120, constructing a facial image dataset of faces of different age groups based on the labeled facial images, and constructing corresponding divergence features for the age labels.
[0049] The face image dataset includes a training set, a test set, and a validation set, ensuring that the training set, the validation set, and the test set all contain face images of people of all ages to maintain the representativeness of the dataset. The face images annotated with age labels are subjected to data enhancement processing to construct a face image dataset of people of different age groups.
[0050] The divergence feature may refer to a feature that describes the degree of discreteness between the real age and the predicted age. The present invention develops a model based on the age classification method. In order to enhance the convergence of the model, it is necessary to constrain the label divergence during training, that is, the divergence between the real age and the predicted age. In order to meet the divergence training of the model, it is necessary to generate divergence features for the age label.
[0051] S130, cropping the face image according to the face detection algorithm and the face key point detection algorithm to determine at least three sizes of face image frames, and constructing an age estimation prediction model according to the at least three sizes of face image frames.
[0052] Among them, face detection is a key step in the face recognition system, which involves locating and identifying the face area from an image or video. In the embodiment of the present invention, a face detection algorithm is used to locate and crop the face.
[0053] The key point detection of a human face may refer to judging the head posture from a human face image and determining the key areas of the face, the key areas including but not limited to eyebrows, eyes, nose, mouth and facial contour. In the embodiment of the present invention, the left and right eyes, nose and both ends of the mouth in the human face image are mainly detected.
[0054] The face image frame is obtained by cropping, and the embodiment of the present invention obtains at least three face image frames of different sizes after cropping, so that age recognition can be performed from images of different sizes when estimating the age of the face image. For example, when the size of the face image to be estimated is small or the face is not in the center of the face image to be estimated, the age estimation prediction model constructed by using at least three face image frames of different sizes can better estimate the age of the face in the face image to be estimated.
[0055] S140, training the age estimation prediction model according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges.
[0056] The total loss function includes a regression loss function and a divergence loss function. The divergence loss function is used to evaluate the divergence between the predicted age label and the real age label; the regression loss function is used to evaluate the deviation between the predicted age and the real age. The total loss function refers to the sum of the regression loss function and the divergence loss function.
[0057] In the embodiment of the present invention, the age estimation prediction model is trained based on the face image dataset and the age label until the total loss function of the age estimation prediction model converges to obtain a target age estimation prediction model.
[0058] S150, estimating the age of the face image to be estimated based on the trained target age estimation prediction model.
[0059] Wherein, a facial image of a person to be estimated is obtained, the facial image of the person to be estimated is pre-processed and then input into a target age estimation prediction model, and the age of the person to be estimated is estimated.
[0060] An embodiment of the present invention provides a method for estimating the age of an occupant in a vehicle cabin, comprising acquiring a face image of the occupant in the vehicle cabin, and labeling the face image with a corresponding age label; constructing a face image dataset containing different age groups based on the labeled face image, and constructing a corresponding divergence feature for the age label; cropping the face image based on a face detection algorithm and a face key point detection algorithm to determine a face image frame of at least three sizes, and constructing an age estimation prediction model based on the face image frame of at least three sizes; training the age estimation prediction model based on the face image dataset and the age label until the total loss function of the age estimation prediction model converges; wherein the total loss function includes a regression loss function and a divergence loss function, and the divergence loss function is used to evaluate the degree of divergence between the predicted age label and the true age label; and estimating the age of the occupant in the vehicle cabin based on the trained target age estimation prediction model. By adopting the technical solution of the embodiment of the present invention, facial images of occupants in a vehicle cabin are obtained under different lighting conditions and viewing angles, and an age estimation prediction model is constructed through facial image frames of at least three sizes to adapt to actual needs, improve the generalization ability of the age estimation prediction model, improve the accuracy and efficiency of age estimation of occupants in a vehicle cabin, and provide new technical support for the development of the field of intelligent vehicles.
[0061] Embodiment 2
[0062] Figure 2 The flowchart of a method for estimating the age of a passenger in a vehicle cabin provided in an embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 2 As shown, the method for estimating the age of an occupant in a vehicle cabin provided in an embodiment of the present invention may include the following steps:
[0063] S210, acquiring facial images of passengers of different age groups in a vehicle cabin under different collection lights and at different angles.
[0064] Among them, due to the large differences in facial features of different people, and the influence of factors such as lighting, angle, and occlusion, the generalization ability of the model is subject to certain limitations. This means that in some special cases, the model may give incorrect age estimation results. Therefore, in the embodiment of the present invention, facial images of occupants in the vehicle cabin of different age groups are obtained under different collection lights and different angles. Among them, the occupants in the vehicle cabin include drivers and passengers.
[0065] Among them, see Figure 3The facial images of the passengers in the vehicle cabin obtained include facial images of people of various age groups (infants, children, teenagers, adults, the elderly, etc.), covering as many races, genders and types as possible. The facial images of the passengers in the vehicle cabin are obtained with a gender ratio close to 1:1. The age distribution ratio of the driver is shown in Table 1, and the age distribution ratio of the passengers is shown in Table 2.
[0066] Table 1 Drivers' age distribution ratio
[0067] 18~20 2% 21~25 10% 26~30 18% 31~35 18% 36~40 14% 41~45 12% 46~50 12% 50~55 6% 56~60 5% >60 3%
[0068] Table 2 Passenger age distribution ratio
[0069]
[0070]
[0071] When acquiring facial images of passengers in the vehicle cabin, the collection personnel need to face the camera and collect images from different angles, and the collection quantity interval can be divided according to the normal distribution. The different angles include 0°-45° upward and downward, and 0°-90° sideways.
[0072] Optionally, in order to improve the model's resistance to environmental sensitivity, data collection needs to define different light conditions for data collection, as shown in Table 3.
[0073] Table 3 Different collection light labels
[0074]
[0075] In the embodiment of the present invention, facial images of occupants in a vehicle cabin of different age groups are acquired from different collected lights and at different angles to overcome the problem that the facial features of different occupants vary greatly and that facial images are affected by factors such as lighting, angle and occlusion, thereby affecting the generalization ability of the model.
[0076] S220, pre-processing the acquired human face image and marking the human face image with a corresponding age label, and saving the marked human face image in a preset format.
[0077] The preprocessing includes but is not limited to data cleaning, cropping and sample equalization. The collected face images are cleaned to ensure the quality and authenticity of the face images and to remove blurred, tilted or blocked images. The face images are cropped to retain the image of a single person, and the position of the face in the face image is detected according to the face detection algorithm. The face images are subjected to sample equalization, mainly using upsampling or downsampling methods for equalization for different age groups.
[0078] Optionally, annotate each face image with a corresponding age label to ensure that the data set is accurately labeled. The age label is [0-100] and the gender label is [0:female,1:male]. Save the face image data after preprocessing and age labeling. The save format can be: [image_path, age, gender, xmin, ymin, xmax, ymax]; where image_path represents the face image storage path, age represents age, gender represents gender, and [xmin, ymin, xmax, ymax] represents the face coordinates.
[0079] S230: construct a facial image dataset of human faces of different age groups based on the labeled facial images, and construct corresponding divergence features for the age labels.
[0080] Among them, the embodiment of the present invention constructs a facial image dataset containing faces of people of different age groups for training and testing an age estimation prediction model.
[0081] As an optional but non-limiting implementation, constructing a dataset of facial images of people of different age groups based on the labeled facial images, and constructing corresponding divergence features for age labels, includes but is not limited to steps A1-A2:
[0082] Step A1: construct a face image dataset based on the labeled face images, and divide the face image dataset into datasets; wherein the divided datasets include a training set, a test set, and a validation set, and the divided datasets all contain face images of different age groups.
[0083] Step A2: Perform data enhancement processing on the divided data set, and construct corresponding divergence features for the age labels corresponding to the facial images after the data enhancement processing.
[0084] The data set division may refer to dividing the facial image data set into a training set, a validation set, and a test set; the division is usually carried out in a ratio of 70%-15%-15%. It is ensured that the training set, the validation set, and the test set all contain facial images of people of all ages to maintain the representativeness of the data set. The divided data set is subjected to data enhancement processing, and the data enhancement processing includes but is not limited to flipping, rotation, brightness, contrast, saturation, and random cropping.
[0085] In an optional scheme of an embodiment of the present invention, the present invention develops a model based on an age classification method. In order to enhance the convergence of the model, it is necessary to constrain the label divergence during training, that is, the divergence between the real age and the predicted age. In order to meet the divergence training of the model, it is necessary to generate divergence features for the age label.
[0086] Correspondingly, the divergence feature formula corresponding to the age label is expressed as:
[0087]
[0088] Among them, V represents the divergence feature corresponding to the current age label; k represents the current age label; i represents age, i∈[0,100]; λ is a hyperparameter.
[0089] For example, when age k=20, feature generation is performed based on the divergence feature formula, and the distribution diagram is as follows: Figure 4 As shown in the figure, the horizontal axis is age and the vertical axis is the divergence feature. Figure 4 It can be seen that when the age is 20, the divergence characteristic is 0.8.
[0090] S240, cropping the face image to determine face image frames of at least three sizes according to a face detection algorithm and a face key point detection algorithm, and constructing an age estimation prediction model according to the face image frames of at least three sizes.
[0091] Among them, the embodiment of the present invention first uses a face detection algorithm (Face Detection) to locate and crop the face, and then uses face key point detection (Face-KeyPoints) to determine the head posture to obtain face image frames of at least three sizes, and construct an age estimation prediction model based on the face image frames of at least three sizes.
[0092] As an optional but non-limiting implementation, the face image is cropped according to the face detection algorithm and the face key point detection algorithm to determine at least three sizes of face image frames, and the age estimation prediction model is constructed according to the at least three sizes of face image frames, including but not limited to steps B1-B3:
[0093] Step B1: cropping the face image to determine at least three sizes of face image frames according to the face detection algorithm and the face key point detection algorithm; wherein the face detection algorithm locates the face area, and the face key point detection algorithm determines the face key points and head posture.
[0094] Step B2: respectively inputting the facial image frames of the at least three sizes of faces into the backbone network model to extract facial features of the faces, and splicing the obtained at least three facial features of the faces to obtain the facial features of the target faces.
[0095] Step B3: constructing an age estimation prediction model based on the facial features of the target face.
[0096] Among them, see Figure 5 First, a general face detection algorithm is used to locate the face area and crop the face; a face key point detection algorithm is used to detect and determine the head posture. The key points include the left and right eyes, the nose, and the two ends of the mouth, a total of five key points.
[0097] Among them, see Figure 6 , taking the acquisition of three-size face image frames as an example, after the face image is subjected to the face detection algorithm and the face key point detection algorithm, the cropped face image frames of three sizes are obtained, which are 100%, 110%, and 120% face image frames respectively. After each face image frame is adjusted, three face input images of [128×128] are obtained; the features of the three face input images are respectively input into the backbone network model to extract the face features. The three face features are spliced or weighted to construct an age estimation prediction model. Due to the different sizes of the face image frames, the acquired face features are also different. If the face image frames of different sizes or incomplete faces are input into the age estimation prediction model, the age of the face in the face image can be estimated.
[0098] In the embodiment of the present invention, the face image is cropped to obtain face image frames of at least three sizes, and face features of different scales are obtained by using face image frames of different sizes, so that the constructed age estimation prediction model is more accurate; at the same time, when the face images to be estimated of different sizes are input into the age estimation prediction model, the accuracy of the age prediction of the face in the image can be improved.
[0099] S250, training the age estimation prediction model according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges.
[0100] Among them, the model loss function is used to measure the difference between the model prediction result and the true label, and is usually used to evaluate the performance of the model, and to design a suitable loss function for model training and optimization. The age estimation prediction model in the embodiment of the present invention uses the age classification method and combines the label distribution scheme for model training, so the loss function adopts the weighted result of the classification loss and the label distribution.
[0101] The total loss function includes a regression loss function and a divergence loss function. The regression loss function is used to characterize the classification loss, and the divergence loss function is used to characterize the label distribution. The divergence loss function is used to evaluate the degree of divergence between the predicted age label and the real age label, and the regression loss function is used to evaluate the degree of deviation between the predicted age and the real age.
[0102] As an optional but non-limiting implementation, the age estimation prediction model is trained according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges, including but not limited to steps C1-C5:
[0103] Step C1: training the age estimation prediction model based on the face image dataset and the age label to determine the predicted age and true age of the occupants in the vehicle cabin.
[0104] Step C2: Determine the regression loss function of the age estimation prediction model based on the sum of the absolute values of the differences between the predicted age and the true age of the occupants in the vehicle cabin.
[0105] Step C3: Determine the divergence loss function of the age estimation prediction model based on the degree of divergence between the predicted age value and the true age value of the occupant in the vehicle cabin.
[0106] Step C4: superimpose the regression loss function and the divergence loss function to obtain the total loss function of the age estimation prediction model.
[0107] Step C5: training the age estimation prediction model until the total loss function of the age estimation prediction model converges to obtain a target age estimation prediction model.
[0108] Among them, the present invention extracts facial age feature information based on a deep learning network, performs an age estimation prediction model through an age classification network, and then obtains the final age prediction result based on weighted calculation. According to the needs, the present invention requires two loss functions for model training, one of which needs to evaluate the degree of deviation between the predicted age and the real age based on a regression loss function, and the other needs to evaluate the degree of divergence between the predicted age label and the real label based on a divergence loss function.
[0109] Optionally, the degree of deviation between the predicted age and the actual age is evaluated based on a regression loss function, where the regression loss function can be characterized as the sum of the absolute values of the differences between the predicted age value and the actual age value, which can be expressed as:
[0110]
[0111] Among them, L1 represents the regression loss function, Characterize the age prediction value, Represents the true value of age.
[0112] The divergence between the predicted age label and the true label is evaluated based on the divergence loss function. The divergence loss function can measure the distance between the two continuous distributions of the predicted age value and the true value, which can be expressed as:
[0113]
[0114] Among them, L2 represents the divergence loss function.
[0115] The regression loss function and the divergence loss function are superimposed to obtain the total loss function of the age estimation prediction model, which is:
[0116] Loss = L1 + L2
[0117] Among them, Loss represents the total loss function of the age estimation prediction model.
[0118] In an optional solution of the embodiment of the present invention, a deep learning model such as a convolutional neural network (CNN) is used to extract feature representations of facial images of occupants in the vehicle cabin, and an age estimation prediction model is trained using a data set, and model parameters are adjusted to optimize performance. The main steps of model training include:
[0119] 1. Data loading: The processed facial images need to be loaded into the age estimation prediction model.
[0120] 2. Training model: The age estimation prediction model needs to be trained with the loaded facial images until the total loss function of the age estimation prediction model converges to obtain the target age estimation prediction model.
[0121] 3. Model evaluation: The trained age estimation prediction model needs to be evaluated in order to determine the performance of the model.
[0122] 4. Adjust model parameters: The model parameters need to be adjusted according to the results of the age estimation prediction model evaluation to improve the performance of the model.
[0123] 5. Optimize the trained model: Re-train the age estimation prediction model with better parameters in order to optimize the model.
[0124] 6. Model testing: The trained target age estimation prediction model needs to be tested using a reserved test dataset to evaluate its generalization performance.
[0125] 7. Model saving: The trained target age estimation prediction model needs to be saved for easy application in the inference stage.
[0126] S260, estimating the age of the face image to be estimated based on the trained target age estimation prediction model.
[0127] In an optional solution of the embodiment of the present invention, the age of the face image to be estimated is estimated according to the trained target age estimation prediction model, and the confidence of the estimated age is determined after the estimated age is obtained. The estimated age and the confidence are weighted to determine the target estimated age. Specifically, the age classification is obtained through the age estimation network. The present invention classifies the age into 101 categories [0-100], and each age category is estimated by the trained target age estimation prediction model to obtain each age A. i The confidence level w i , the final estimated age is obtained by weighting the age and its confidence. The specific weighted calculation can be expressed as:
[0128]
[0129] Among them, Age predict represents the final estimated age, A i represents the age estimated by the age estimation prediction model, i∈[0,N]; w i Characterization A i confidence level.
[0130] The embodiment of the present invention provides a method for estimating the age of passengers in a vehicle cabin. The facial images of passengers in different age groups in the vehicle cabin are obtained under different acquisition lights and different angles, so that the collected facial images have strong adaptability to environmental changes, which ensures that the age estimation prediction model can maintain a high estimation accuracy under different conditions. The facial images are cropped to obtain facial image frames of at least three sizes, and facial features of different scales are obtained by using facial image frames of different sizes, so that the constructed age estimation prediction model is more accurate; at the same time, when the facial images of different sizes to be estimated are input into the age estimation prediction model, the accuracy of the age prediction of the face in the image can be improved. The model and model parameters are optimized so that the age can be estimated in real time in the vehicle cabin, and the user needs can be quickly responded to without affecting the vehicle operation efficiency. By using more complex feature extraction and classification techniques, the present invention can effectively reduce the misidentification in the age estimation process, improve the accuracy and efficiency of the age estimation of passengers in the vehicle cabin, and provide new technical support for the development of the intelligent vehicle field.
[0131] Embodiment 3
[0132] Figure 7The flowchart of a method for testing a target age estimation prediction model provided in an embodiment of the present invention is shown in FIG. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 7 As shown, the age estimation method for the occupant in the vehicle cabin provided in the embodiment of the present invention further includes a model test, which may include the following steps:
[0133] S710 , acquiring test data and performing the same preprocessing operation on the test data as that on the training data to obtain target test data.
[0134] S720: Input the target test data into the trained target age estimation prediction model to obtain the predicted age of the occupants in the vehicle cabin.
[0135] S730, determining the accuracy and absolute error between the predicted age value and the true age value of the occupant in the vehicle cabin, so as to detect whether the target age estimation prediction model has an overfitting or underfitting problem.
[0136] S740: If an overfitting or underfitting problem occurs, the target age estimation prediction model is adjusted.
[0137] Among them, model testing generally includes preparing a test data set, data preprocessing, model reasoning, evaluation index calculation, result analysis, and model adjustment. Preparing a test data set may refer to preparing an independent data set that has never been used in the model training process, which is used to evaluate the performance of the target age estimation prediction model on new data. Data preprocessing may refer to performing the same preprocessing steps on the test data as the training data to ensure that the format and characteristics of the test data are consistent with the data during model training. Model reasoning may refer to inputting the test data into the trained target age estimation prediction model to obtain the prediction results of the target age estimation prediction model. Evaluation index calculation may refer to the use of accuracy (Accuracy) and absolute error (MAE) for evaluation according to the task type age performance evaluation of the present invention.
[0138] Optionally, the target age estimation prediction model can be evaluated under the conditions of absolute error CS=3, CS=5 and CS=7, which can be expressed as:
[0139]
[0140] Among them, ACC represents the accuracy, CS represents the absolute error, and N represents the total number of test sets.
[0141] The mean absolute error (MAE) refers to the absolute value between the predicted age and the true age, which can be expressed as:
[0142]
[0143] Among them, the accuracy and absolute error of the target age estimation prediction model are calculated, and the following is obtained: Figure 8 After determining the accuracy and absolute error of the target age estimation prediction model, the evaluation results are analyzed and the model is adjusted. The result analysis may refer to analyzing the performance of the target age estimation prediction model on the test set based on the results of the evaluation indicators, comparing the performance of the target age estimation prediction model on the training set and the test set, and detecting whether problems such as overfitting or underfitting occur. Model adjustment may refer to adjusting the hyperparameters, model structure or other aspects of the target age estimation prediction model based on the test results to further improve the model performance.
[0144] Embodiment 4
[0145] Fig. 9 The flowchart of a method for estimating the age of a passenger in a vehicle cabin provided by the fourth embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Fig. 9 As shown, the method for estimating the age of the occupant in the vehicle cabin provided in the embodiment of the present invention further includes model deployment, which is specifically used for:
[0146] The target age estimation prediction model involved in the present invention is trained based on the Pytorch framework. In the deployment stage, the target age estimation prediction model and parameters can be converted into a torchscript model, and then the target age estimation prediction model can be called up through a python or java interface for reasoning.
[0147] See also Fig.10 The specific steps of deploying the target age estimation prediction model are as follows:
[0148] 1. Develop the model: Use Python to develop the PyTorch model. This usually involves steps such as defining the model structure, compiling the model, and training the model.
[0149] 2. Model conversion: Convert the trained PyTorch model to ONNX format.
[0150] 3. Deploy the model: In the Java program, load the ONNX model and prepare the input data. This usually involves steps such as reading the model file and setting the input data format. Then, create a Java program to load the ONNX model and process the input data.
[0151] 4. Process input data: In the Java program, you need to process the input data and pass it to the ONNX model. This involves steps such as reading files and converting formats.
[0152] 5. Get output results: After the ONNX model is run, the output results will be returned, and these results need to be parsed and converted into a format that Java can handle.
[0153] 6. End-side operation: The packaged model is deployed to the end-side device to ensure that the model can run correctly, which involves installing the necessary libraries and dependencies on the device. After deployment, the Java application communicates with the end-side device to pass input data and receive output results.
[0154] After the target age estimation prediction model training test meets the performance requirements, the target age estimation prediction model is deployed and the target age estimation prediction model is used to predict the age of the occupants in the vehicle cabin. Fig.11 , estimate the age of the occupants in the vehicle cabin, select the occupants' faces, and display the final estimated age value.
[0155] The method of the embodiment of the present invention is designed with practical application requirements in mind, so it is easy to integrate into existing vehicle systems and has a simple deployment process. In order to adapt to the computing resource limitations in the vehicle cabin, the present invention performs lightweight processing on the target age estimation prediction model, so that it can reduce computing resources and energy consumption without sacrificing performance.
[0156] Embodiment 5
[0157] Fig.12 : is a schematic diagram of the structure of a vehicle cabin occupant age estimation device provided in an embodiment of the present invention. The technical solution of this embodiment can be applied to the case of vehicle cabin occupant age estimation. The device can be implemented by software and / or hardware and is generally integrated on any electronic device with network communication function, including but not limited to: servers, computers, personal digital assistants and other devices. Fig.12 As shown, the age estimation device for the occupant in the vehicle cabin provided in this embodiment may include: an age label marking module 1210, a data set construction module 1220, an age estimation prediction model construction module 1230, an age estimation prediction model training module 1240 and a vehicle cabin occupant age estimation module 1250; wherein,
[0158] The age label marking module 1210 is used to obtain a facial image of a passenger in the vehicle cabin and mark the facial image with a corresponding age label;
[0159] The data set construction module 1220 is used to construct a data set of human face images of different age groups based on the labeled human face images, and to construct corresponding divergence features for the age labels;
[0160] The age estimation prediction model construction module 1230 is used to crop the face image to determine at least three sizes of face image frames according to the face detection algorithm and the face key point detection algorithm, and to construct the age estimation prediction model according to the at least three sizes of face image frames;
[0161] The age estimation prediction model training module 1240 is used to train the age estimation prediction model according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges; wherein the total loss function includes a regression loss function and a divergence loss function, and the divergence loss function is used to evaluate the degree of divergence between the predicted age label and the true age label;
[0162] The vehicle cabin occupant age estimation module 1250 is used to estimate the age of the vehicle cabin occupants based on the trained target age estimation prediction model.
[0163] Based on the above embodiment, optionally, the age label marking module is specifically used to:
[0164] Acquire facial images of occupants of different age groups in a vehicle cabin under different collection lights and at different angles; wherein the occupants in the vehicle cabin include a driver and a passenger;
[0165] The acquired face images are preprocessed and the corresponding age labels are annotated on the face images, and the annotated face images are saved in a preset format; wherein the preprocessing includes data cleaning, cropping and sample balancing processing.
[0166] Based on the above embodiment, optionally, the data set construction module is specifically used to:
[0167] Constructing a face image dataset based on the annotated face images, and dividing the face image dataset into datasets; wherein the divided datasets include a training set, a test set, and a validation set, and the divided datasets all contain face images of people of different age groups;
[0168] The divided data set is subjected to data enhancement processing, and the corresponding divergence features are constructed for the age labels corresponding to the facial images after data enhancement processing;
[0169] Correspondingly, the divergence feature formula corresponding to the age label is expressed as:
[0170]
[0171] Among them, V represents the divergence feature corresponding to the current age label; k represents the current age label; i represents age, i∈[0,100]; λ is a hyperparameter.
[0172] Based on the above embodiment, optionally, the age estimation prediction model construction module is specifically used to:
[0173] The face image is cropped according to a face detection algorithm and a face key point detection algorithm to determine a face image frame of at least three sizes; wherein the face detection algorithm locates the face area, and the face key point detection algorithm determines the face key points and the head posture;
[0174] Inputting the facial image frames of the at least three sizes of faces into the backbone network model respectively to extract facial features of faces, and splicing the obtained at least three facial features of faces to obtain facial features of target faces;
[0175] An age estimation prediction model is constructed based on the facial features of the target face.
[0176] Based on the above embodiment, optionally, the age estimation prediction model training module is specifically used to:
[0177] The age estimation prediction model is trained based on the face image dataset and the age label to determine the predicted age and true age of the occupants in the vehicle cabin;
[0178] Determine the regression loss function of the age estimation prediction model according to the sum of the absolute values of the differences between the predicted age and the true age of the occupants in the vehicle cabin;
[0179] According to the degree of divergence between the predicted age value and the true age value of the occupant in the vehicle cabin, the divergence loss function of the age estimation prediction model is determined;
[0180] The regression loss function is superimposed on the divergence loss function to obtain a total loss function of the age estimation prediction model;
[0181] The age estimation prediction model is trained until the total loss function of the age estimation prediction model converges to obtain a target age estimation prediction model.
[0182] Based on the above embodiment, optionally, the device further includes a model testing module, which is specifically used to:
[0183] Acquire test data and perform the same preprocessing operation on the test data as on the training data to obtain target test data;
[0184] Input the target test data into the trained target age estimation prediction model to obtain the age prediction value of the occupants in the vehicle cabin;
[0185] Determine the accuracy and absolute error between the predicted age value and the true age value of the occupant in the vehicle cabin to detect whether the target age estimation prediction model has an overfitting or underfitting problem;
[0186] If overfitting or underfitting problems occur, the target age estimation prediction model is adjusted.
[0187] The device for estimating the age of occupants in a vehicle cabin provided in an embodiment of the present invention can execute the method for estimating the age of occupants in a vehicle cabin provided in any of the above-mentioned embodiments of the present invention, and has the corresponding functions and beneficial effects of executing the method for estimating the age of occupants in the vehicle cabin. For detailed processes, please refer to the relevant operations of the method for estimating the age of occupants in the vehicle cabin in the above-mentioned embodiments.
[0188] Embodiment 6
[0189] Fig.13 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0190] like Fig.13 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0191] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0192] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for estimating the age of an occupant in a vehicle cabin.
[0193] In some embodiments, the method for estimating the age of the occupant in the vehicle cabin may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for estimating the age of the occupant in the vehicle cabin described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for estimating the age of the occupant in the vehicle cabin by any other appropriate means (e.g., by means of firmware).
[0194] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0195] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0196] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0197] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0198] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0199] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0200] Embodiment 7
[0201] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the method for estimating the age of an occupant in a vehicle cabin as provided in any embodiment of the present application.
[0202] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0203] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0204] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for estimating the age of an occupant in a vehicle cabin, characterized in that: The method comprises: Acquire a facial image of a person in a vehicle cabin, and annotate the facial image with a corresponding age label; Based on the annotated facial images, a facial image dataset containing faces of different age groups is constructed, and corresponding divergence features are constructed for age labels; Cropping the face image to determine at least three sizes of face image frames according to a face detection algorithm and a face key point detection algorithm, and constructing an age estimation prediction model according to the at least three sizes of face image frames; The age estimation prediction model is trained according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges; wherein the total loss function includes a regression loss function and a divergence loss function, and the divergence loss function is used to evaluate the degree of divergence between the predicted age label and the true age label; The age of the occupants in the vehicle cabin is estimated based on the trained target age estimation prediction model.
2. The method according to claim 1, characterized in that The step of obtaining a facial image of a passenger in a vehicle cabin and labeling the facial image with a corresponding age label includes: Acquire facial images of occupants of different age groups in a vehicle cabin under different collection lights and at different angles; wherein the occupants in the vehicle cabin include a driver and a passenger; The acquired face images are preprocessed and the corresponding age labels are annotated on the face images, and the annotated face images are saved in a preset format; wherein the preprocessing includes data cleaning, cropping and sample balancing processing.
3. The method according to claim 1, characterized in that The method constructs a dataset of facial images of people of different age groups based on the annotated facial images, and constructs corresponding divergence features for age labels, including: Constructing a face image dataset based on the annotated face images, and dividing the face image dataset into datasets; wherein the divided datasets include a training set, a test set, and a validation set, and the divided datasets all contain face images of people of different age groups; The divided data set is subjected to data enhancement processing, and the corresponding divergence features are constructed for the age labels corresponding to the facial images after data enhancement processing; Correspondingly, the divergence feature formula corresponding to the age label is expressed as: Among them, V represents the divergence feature corresponding to the current age label; k represents the current age label; i represents age, i∈[0,100]; λ is a hyperparameter.
4. The method according to claim 1, characterized in that: The method of cropping the face image according to the face detection algorithm and the face key point detection algorithm to determine at least three sizes of face image frames, and constructing an age estimation prediction model according to the at least three sizes of face image frames, includes: The face image is cropped according to a face detection algorithm and a face key point detection algorithm to determine a face image frame of at least three sizes; wherein the face detection algorithm locates the face area, and the face key point detection algorithm determines the face key points and the head posture; Inputting the facial image frames of the at least three sizes of faces into the backbone network model respectively to extract facial features of faces, and splicing the obtained at least three facial features of faces to obtain facial features of target faces; An age estimation prediction model is constructed based on the facial features of the target face.
5. The method according to claim 1, characterized in that The age estimation prediction model is trained according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges, including: The age estimation prediction model is trained based on the face image dataset and the age label to determine the predicted age and true age of the occupants in the vehicle cabin; Determine the regression loss function of the age estimation prediction model according to the sum of the absolute values of the differences between the predicted age and the true age of the occupants in the vehicle cabin; According to the degree of divergence between the predicted age value and the true age value of the occupant in the vehicle cabin, the divergence loss function of the age estimation prediction model is determined; The regression loss function is superimposed on the divergence loss function to obtain a total loss function of the age estimation prediction model; The age estimation prediction model is trained until the total loss function of the age estimation prediction model converges to obtain a target age estimation prediction model.
6. The method according to claim 1, characterized in that Before estimating the age of the occupants in the vehicle cabin according to the trained target age estimation prediction model, the method further includes model testing, specifically: Acquire test data and perform the same preprocessing operation on the test data as on the training data to obtain target test data; Input the target test data into the trained target age estimation prediction model to obtain the age prediction value of the occupants in the vehicle cabin; Determine the accuracy and absolute error between the predicted age value and the true age value of the occupant in the vehicle cabin to detect whether the target age estimation prediction model has an overfitting or underfitting problem; If overfitting or underfitting problems occur, the target age estimation prediction model is adjusted.
7. A device for estimating the age of an occupant in a vehicle cabin, characterized in that: The device comprises: An age labeling module is used to obtain a facial image of a passenger in a vehicle cabin and label the facial image with a corresponding age label; A data set construction module is used to construct a data set of facial images of people of different age groups based on the annotated facial images, and to construct corresponding divergence features for age labels; An age estimation prediction model building module is used to crop a face image to determine at least three sizes of face image frames according to a face detection algorithm and a face key point detection algorithm, and to build an age estimation prediction model according to the at least three sizes of face image frames; An age estimation prediction model training module is used to train the age estimation prediction model according to the face image dataset and the age label until the total loss function of the age estimation prediction model converges; wherein the total loss function includes a regression loss function and a divergence loss function, and the divergence loss function is used to evaluate the degree of divergence between the predicted age label and the true age label; The vehicle cabin occupant age estimation module is used to estimate the age of the vehicle cabin occupants based on the trained target age estimation prediction model.
8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for estimating the age of an occupant in a vehicle cabin as described in any one of claims 1-6.
9. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, the computer executable instructions are used to perform the method for estimating the age of an occupant in a vehicle cabin as claimed in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method for estimating the age of an occupant in a vehicle cabin according to any one of claims 1 to 6.
Citation Information
Patent Citations
Age estimation model training method, age estimation method and corresponding device
CN110287942A
Age and gender prediction method, system and device based on face image
CN111091109A
Training method of age prediction model, age prediction method and related device
CN113076823A